
function util_setCookie2(NameOfCookie, value, expirehours)
{
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expirehours * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expirehours == null) ? "" : "; expires=" + ExpireDate.toGMTString()) +  "; path=/;" ;
}

function util_getCookie(name)
{
	var cookie = document.cookie + ";";
	var loc = cookie.indexOf(name + "=");
	if (loc == -1) return "";
	loc = cookie.indexOf("=",loc);
	return unescape(cookie.substring(loc+1,cookie.indexOf(";",loc)));
}

function util_setCookie(name,value,permanent)
{
	var cookie = name + "=" + escape(value) + "; PATH=/; DOMAIN=.shockwave.com; "
	if (permanent)
	{
		var exp_date = new Date("2020", "12", "25", "12", "59", "59");
		exp_date = exp_date.toGMTString();
		cookie += '; EXPIRES=' + exp_date;
	}

	document.cookie = cookie;
}

// Set cookie function that takes a site parameter used for setting the cookie domain 
function util_setCookie(name,value,site,permanent)
{
	var cookie = name + "=" + escape(value) + "; PATH=/; ";

	if(site=="af") {
	    cookie = cookie + "DOMAIN=.atomfilms.com; "

	} else {
	    cookie = cookie + "DOMAIN=.shockwave.com; "
	}

	if (permanent) {

		var exp_date = new Date("2020", "12", "25", "12", "59", "59");
		exp_date = exp_date.toGMTString();
		cookie += '; EXPIRES=' + exp_date;
	}

	document.cookie = cookie;
}

function util_deleteCookie(name)
{
	var cookie = name + "=; PATH=/; DOMAIN=.shockwave.com; "
	var exp_date = new Date("1999", "1", "1", "12", "59", "59");
	cookie += '; EXPIRES=' + exp_date;

	document.cookie = cookie;
}

function util_deleteCookieAF(name)
{
	var cookie = name + "=; PATH=/; DOMAIN=.atomfilms.com; "
	var exp_date = new Date("1999", "1", "1", "12", "59", "59");
	cookie += '; EXPIRES=' + exp_date;

	document.cookie = cookie;
}

function util_getHoursDifferenceFromGMT()
{
   var now = new Date();
   var temp = now.toGMTString();
   var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
   var hoursDiffStdTime = (now - date3) / (1000 * 60 * 60);
   return Math.round(hoursDiffStdTime);
}


function util_fastclickpop()
{
	var doc=document;
	var url=escape(doc.location.href);
	var date_ob=new Date();
	var bust=date_ob.getSeconds();

	doc.cookie='h2=o; path=/;';

	if(doc.cookie.indexOf('e=llo') <= 0 && doc.cookie.indexOf('2=o') > 0)
	{
		doc.write('<scr'+'ipt language="javascript" src="http://media.fastclick.net');
		doc.write('/w/pop.cgi?sid=3375&m=2&v=1.6&u='+url+'&c='+bust+'"></scr'+'ipt>');
		doc.cookie='he=llo; path=/;';
	}
}

function util_adcompop()
{
	if (document.cookie.indexOf('AdComPop85424')==-1)
	{
		// obscurify hostname
		var silly2 = 'ising';
		var silly1 = 'dvert';
		var hostName = 'servedby.a' + silly1 + silly2 + '.com';
		util_setCookie2('AdComPop85424','yes',24);
		var bnum=new Number(Math.floor(99999999 * Math.random())+1);
		document.write('<SCR'+'IPT LANGUAGE="JavaScript" ');
		document.write(' SRC="http://' + hostName + '/pops=6/site=85424/bnum='+bnum+'">');
		document.write('</SCR');
		document.write('IPT>');
	}
}

function util_checkflash()
{
	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');
	}

	if( !MM_FlashCanPlay )
	{
		document.write('<p><center><big>This site requires <a href="http://www.macromedia.com/go/getflashplayer">Macromedia Flash Player 6</a> or later.</big></center></p>');
	}
}


document.writeln('');

