function setCookie( name, value, nHour, path, domain, secure ) 
{
var today = new Date();
today.setTime( today.getTime() );
if ( nHour ){
expires = 1 * 1000 * 60 * 60 * nHour;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}

function showbox() {
var seen = getCookie("pl");
if (seen != "yes")
  {
  document.getElementById("extralayer").style.display="block";
  }
}

function hidebox() {
document.getElementById("extralayer").style.display="none";
setCookie('pl', 'yes', 48, '/', '', '' );
return false
}

function jobdone() {
setCookie('pl', 'yes', 48, '/', '', '' );
}


function writeFlash (url,flashvar,width,height) {
	document.write ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="1" align="middle">');
	document.write ('<param name="FlashVars" value="' + flashvar + '" />');
	document.write ('<param name="scale" value="noscale" />');
	document.write ('<param name="wmode" value="transparent" />');
	document.write ('<param name="allowScriptAccess" value="sameDomain" />');
	document.write ('<param name="movie" value="' + url + '" /><param name="quality" value="high" /><embed wmode="transparent" src="' + url + '" FlashVars="' + flashvar + '" quality="high" width="' + width + '" height="' + height + '" name="1" align="middle" allowScriptAccess="sameDomain" scale="noscale" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write ('</object>');
}

window.onload = showbox;
