var days = 1; 
var today = new Date();
var expires_date = new Date(today.getTime() + (days * 86400000));

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');
}
;

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  //alert("show");
	if ( MM_FlashCanPlay ) {
		for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}
}


function loadMenus() {
//function initMenu() {
	
	//alert("initMenu");
	if ( MM_FlashCanPlay && FlashMenu ) {
		MM_showHideLayers('MenuLayer','','show');
		setTimeout("MM_showHideLayers('MenuLayer','','hide')", 1000);
	}
	else{
	  loadJSMenus();
	}
}

function Get_Cookie(name) {

	var start = document.cookie.indexOf(name+"=");
	//alert(document.cookie);
	var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {

   document.cookie = name + "=" +escape(value) +
	( (expires) ? ";expires=" + expires.toGMTString() : "") +
	( (path) ? ";path=" + path : "") + 
	( (domain) ? ";domain=" + domain : "") +
	( (secure) ? ";secure" : "");
}

function Delete_Cookie(name,path,domain) {

	if (Get_Cookie(name)) document.cookie = name + "=" + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function isCookieEnabled() {
   if (document.all) return navigator.cookieEnabled;
   var val = "testcookie";
   Set_Cookie("testcookie", val);
   var cv = Get_Cookie("testcookie");
   Delete_Cookie("testcookie");
   return (cv == val);
}

function firstTimeVisitor() {

	var beenHere = Get_Cookie('FExplorer');
	if (beenHere == 'yes') {
		return false;
	} else if (isCookieEnabled()) {
		Set_Cookie('FExplorer','yes',expires_date);
	}
	return true;
}


function showPresentation(fileName, width, height) {

	if ( MM_FlashCanPlay ) {
		if (fileName.lastIndexOf(".swf") > 0 && width.length > 1 && height.length > 1) {
			//var firstTime = 0;
			
			if (firstTimeVisitor()) {
				var firstTime = 1;
			} else {
				var firstTime = 0;
			}
			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="home" WIDTH="' + width + '" HEIGHT="' + height + '" ALIGN=""> <PARAM NAME=wmode VALUE=transparent>');
			document.write(' <PARAM NAME=movie VALUE="./flash/' + fileName + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=flashVars VALUE="firstTime=' + firstTime + '"> <PARAM NAME=bgcolor VALUE=#ffffff>  '); 
			document.write(' <EMBED src="./flash/' + fileName + '" quality=high bgcolor=#ffffff wmode="transparent" ');
			document.write(' swLiveConnect=FALSE WIDTH="' + width + '" HEIGHT="' + height + '" NAME="home" ALIGN="" flashvars="firstTime=' + firstTime + '"');
			document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
			document.write(' </EMBED>');
			document.write(' </OBJECT>');
			return true;
		} else {
			return false;
		}

	} else {
		return false;
	}
}