
    function getParam(p,d) {
      var str = "" + unescape(document.location);
      var i = Math.max( str.indexOf('?'+p+'='), str.indexOf('&'+p+'=') );
      if( i < 0 ) return d;
      i+=2+p.length;
      var i2 = str.indexOf('&',i);
      var returnstr = str.substring(i,(i2<0?str.length:i2));
      return (returnstr.indexOf(',')>0?returnstr.split(','):returnstr);
    };

    var newwin;
    function launchwin(winurl,winname,winfeatures) {
      newwin = window.open(winurl,winname,winfeatures);
      setTimeout('newwin.focus();',250);
    };
    function launchwinfs(winurl,winname) {
	var w = 100;
	var h = 100;
	if( typeof(window.innerWidth) == 'number' ) {
		w = window.innerWidth-1;
		h = window.innerHeight-20;
	} else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ) {
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	} else {
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	var dl="http://www.spryphoto.com/tourviewer/tour.html?tourid=3";
	var sizestr = "&w="+w+"&h="+h;
	launchwin( dl.substr(0,dl.indexOf("?"))+winurl+sizestr,'zoomfs','width='+(screen.width-10)+',height='+(screen.height-30)+',screenX=0,screenY=0,directories=0,fullscreen=1,location=0,menubar=0,scrollbars=0,status=0,toolbar=0');

    }

    function doClose() {
        top.close();
    };

    function saveViewerSize(s) {
    };



function addViewer() {

	var MM_contentVersion = 6;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
			}
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	MM_FlashCanPlay = true;
	if ( MM_FlashCanPlay ) {
		var s = 2;
		var p = 3;
		var ss_obj = 0
		var w = 620;
		var h = 320;
		var sizestr = "";
		if( s == 4 ) {
			if( typeof(window.innerWidth) == 'number' ) {
				w = window.innerWidth-1;
				h = window.innerHeight-20;
			} else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ) {
				w = document.documentElement.clientWidth;
				h = document.documentElement.clientHeight;
			} else {
				w = document.body.clientWidth;
				h = document.body.clientHeight;
			}
	
			sizestr = "&w="+w+"&h="+h;
			var dl = "http://www.spryphoto.com/tourviewer/tour.html?tourid="+p;
			var params = "?s=5&p="+p+"&ss_obj="+ss_obj+"&";
	
			launchwin( dl.substr(0,dl.indexOf("?"))+params,'zoomfs','width='+(screen.width-10)+',height='+(screen.height-30)+',screenX=0,screenY=0,directories=0,fullscreen=1,location=0,menubar=0,scrollbars=0,status=0,toolbar=0');
			document.location = "./?TSImg=/tszoom/window_closer.html";
	
		} else {
			if( s == 5 ) {
				s = 4;
				if( typeof(window.innerWidth) == 'number' ) {
					w = window.innerWidth-1;
					h = window.innerHeight-20;
				} else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ) {
					w = document.documentElement.clientWidth;
					h = document.documentElement.clientHeight;
				} else {
					w = document.body.clientWidth;
					h = document.body.clientHeight;
				}
				sizestr = "&w="+w+"&h="+h;
			} else {
			}
	
			document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
			document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
			document.write(' ID="tourviewer" WIDTH="'+w+'" HEIGHT="'+h+'" ALIGN="">');
			document.write(' <PARAM NAME=movie VALUE="tourviewer/tourviewer20070813.swf?tourid='+p+'&s='+s+'&ss_obj='+ss_obj+sizestr+'&s2=2&"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noscale> <PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
			document.write(' <EMBED src="tourviewer/tourviewer20070813.swf?tourid='+p+'&s='+s+'&ss_obj='+ss_obj+sizestr+'&s2=2&" menu=false quality=high scale=noscale salign=LT bgcolor=#FFFFFF  ');
			document.write(' swLiveConnect=FALSE WIDTH="'+w+'" HEIGHT="'+h+'" NAME="tourviewer" ALIGN=""');
			document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
			document.write(' </EMBED>');
			document.write(' </OBJECT>');
		}
	
	} else{
		   document.write(' <table width=300 height=300 border=1><tr><td bgcolor=#eeeeee align=center valign=center><font color=#000000 face=Arial size=2>This application requires<br><br> <b>Macromedia Flash Player 6</b><br><br><a href=http://www.macromedia.com/go/getflashplayer target=_blank>Click here to get the latest<br>Macromedia Flash Player.</a></font></td></tr></table>' );
	}

}