// JavaScript Document
//no link refefrence to the homepage
var y1 = 400;   // change the # on the left to adjuct the Y co-ordinate - main movie
var y2 = 450;	//replay button
var y4 = 430;	//close button
(document.getElementById) ? dom = true : dom = false;

function setCookie(name, value, expires, path, domain, secure) {
     var curCookie = name + "=" + escape(value) +
          ((expires) ? "; expires=" + expires.toGMTString() : "") +
          ((path) ? "; path=" + path : "") +
          ((domain) ? "; domain=" + domain : "") +
          ((secure) ? "; secure" : "");
     document.cookie = curCookie;
}

function getCookie(name) {
     var dc = document.cookie;
     var prefix = name + "=";
     var begin = dc.indexOf("; " + prefix);
     if (begin == -1) {
          begin = dc.indexOf(prefix);
          if (begin != 0) return null;
     } else
          begin += 2;
     var end = document.cookie.indexOf(";", begin);
     if (end == -1)
          end = dc.length;
     return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
     if (getCookie(name)) {
          document.cookie = name + "=" +
          ((path) ? "; path=" + path : "") +
          ((domain) ? "; domain=" + domain : "") +
          "; expires=Thu, 01-Jan-70 00:00:01 GMT";
     }
}

function showMovie(clip,t,w,h) {
   var t;
   var obj = '<object id=automotive4 codeBase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 height='+h+' width='+w+' align="center bottom" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000><PARAM NAME="allowScriptAccess" VALUE="sameDomain"><PARAM NAME="movie" VALUE="'+clip+'"><PARAM NAME="loop" VALUE="false"><PARAM NAME="quality" VALUE="autohigh"><PARAM NAME="salign" VALUE="b"><PARAM NAME="wmode" VALUE="transparent"><PARAM NAME="bgcolor" VALUE="#ffffff">      <embed src="'+clip+'" loop="false" quality="autohigh" salign="b" wmode="transparent" bgcolor="#ffffff" width="'+w+'" height="'+h+'" name="automotive4" align="bottom" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		document.getElementById("layer1").innerHTML = obj;
		setTimeout("showThis('close')",2000);
		setTimeout("closeMovie()",t);
		setTimeout("hideThis('close')",t);
		//setTimeout("hideThis('link')",t);
		setTimeout("hideThis('layer1')",t);
}

function closeMovie() {
document.getElementById("layer1").innerHTML = '';
}

function hideThis(element) {
  if (dom) {document.getElementById(element).style.visibility='hidden';}
  if (document.layers) {document.layers[element].visibility='hide';} }
  
function showThis(element) {
  if (dom) {document.getElementById(element).style.visibility='visible';}
  if (document.layers) {document.layers[element].visibility='show';} }  

function placeIt() {
  if (dom && !document.all) {document.getElementById("layer1").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1))}
  if (document.layers) {document.layers["layer1"].top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1))}
  if (document.all) {document.all["layer1"].style.top = document.body.scrollTop + (document.body.clientHeight - (document.body.clientHeight-y1));}
  //button positioning
  if (dom && !document.all) {document.getElementById("layer2").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y2))}
  if (document.layers) {document.layers["layer2"].top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y2))}
  if (document.all) {document.all["layer2"].style.top = document.body.scrollTop + (document.body.clientHeight - (document.body.clientHeight-y2));}
    //link positioning - removed

      //close button positioning
  if (dom && !document.all) {document.getElementById("close").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y4))}
  if (document.layers) {document.layers["close"].top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y4))}
  if (document.all) {document.all["close"].style.top = document.body.scrollTop + (document.body.clientHeight - (document.body.clientHeight-y4));}
  window.setTimeout("placeIt()", 10); }

window.onload=placeIt;
onResize="window.location.href = window.location.href"
