/**************************************************     Inline Flash Sniffer Version 20040406   ****                                             ****     Modified by MG 10/15/2007               **************************************************///this variable must remain as a global variable outside of any functions for the//script to perform correctly.var plugin = 0;//this part checks for the presence of an override cookie value set as jflashcookievar dc = document.cookie;var dcindex = dc.indexOf("jflashcookie=");if (dcindex >= 0)	{	dcindex = dc.indexOf("=",dcindex) + 1;	var dcend = dc.indexOf(";",dcindex);	dcend = (dcend == -1) ? dc.length : dcend;	plugin = unescape(dc.substring(dcindex,dcend));	if (plugin == null) plugin = 0;	}	//this part looks for a sound preferncevar au_pref = 1;//alert(au_pref);dcindex = dc.indexOf("audioprefs=");if (dcindex >= 0)	{	dcindex = dc.indexOf("=",dcindex) +1;	dcend = dc.indexOf(";",dcindex);	dcend = (dcend == -1) ? dc.length : dcend;	au_pref = unescape(dc.substring(dcindex,dcend));	if (au_pref == null) au_pref = 1;	}//alert(au_pref);au_pref = (au_pref == 1)? 0 : 1;//first the script checks for the shockwave flash mime type and an associated plugin//if it is found it sets the plugin variable to 1, this works with Netscape and MAC IE 5 if (plugin < 1)	{	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) 		{		if (navigator.plugins && navigator.plugins["Shockwave Flash"]) 			{			var versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".");			var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);			plugin = parseInt( versionString );			}		}	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Win")>=0)) 		{		//if it is a windows computer, it writes a client side vb script to try to create		//an instnace of the flash activeX object for each version 3 - 6. If it succeeds then		//it sets the plugin variable to 1 (see why we need the plugin variable to be outside the function?)		document.write('<SCRI' + 'PT LANGUAGE=VBScript\> \n');		document.write('on error resume next \n');		document.write('For i = 9 to 3 step -1\n');		document.write('SFlash = "ShockwaveFlash.ShockwaveFlash." & i \n');		document.write('hasflash = isObject(CreateObject(SFlash)) \n');		document.write('If hasflash Then \n');		document.write('plugin = i \n');		document.write('Exit For \n');		document.write('End If \n');		document.write('Next \n');		document.write('</SCR'+'IPT\> \n');		}	}function gotFlash(arg, expires)	{	if (!arg) arg = 0;	var ndc = "jflashcookie=" + arg + ";";	if (expires)			{		nd = new Date(expires);		ndc += " expires=" + nd.toGMTString() + ";";		}		document.cookie = ndc;	location.reload();	}function printFlash2(arg)		{	//at this point, we are either on a browser with a script detectable version of flash	//or we aren't. Real deep.	//if we are, write the appropriate flash code, if not write an alternate image.		var dc = document.cookie;	var dcindex = dc.indexOf("seenit=");	var beenSeen = 0;	if (dcindex >= 0)		{		dcindex = dc.indexOf("=",dcindex) + 1;		var dcend = dc.indexOf(";",dcindex);		dcend = (dcend == -1) ? dc.length : dcend;		beenSeen = unescape(dc.substring(dcindex,dcend));		if (beenSeen == null) plugin = 0;		}		//****************flash file		fval = (arg)? arg : 1;	if ( plugin >= fval && beenSeen < 20 ) 		{		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="753" height="60" id="cal_counter" align="middle">');		document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name=wmode value=transparent><param name="movie" value="flash/cal_counter.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');		document.write('<embed src="flash/cal_counter.swf" quality="high" bgcolor="#ffffff" width="753" height="60" name="WaterTransitioner" wmode="transparent"  align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>');		document.write('</object>');		} 	else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0))		{		document.write('<img src="/jpgs/ticker_no_flash.jpg" width="753" height="60" alt="Caldera Spas">');		}	}	function seenIt(arg)	{	var si = "seenit=20;"	document.cookie = si;	}	function soundPrefs(arg)	{	var nd = new Date()	nd.setYear(nd.getYear() + 2);	var ap = "audioprefs=" + arg + ";expires=" + nd.toGMTString() + ";";	document.cookie = ap;	//alert(ap);	}
