// PRELOADER
var aTop=new Array();
addToTopNav("email",31,14);
addToTopNav("map",26,14);
addToTopNav("download-press-release",129,14);
function addToTopNav(img,w,h) {
	var iPos=aTop.length;
	aTop[iPos]=new Object();
	aTop[iPos].img=new Image(w,h); aTop[iPos].img.src="img/"+img+".gif";
	aTop[iPos].imgo=new Image(w,h); aTop[iPos].imgo.src="img/"+img+"o.gif";
}

var aNav=new Array();
function addToNav(img,w,h) {
	var iPos=aNav.length;
	aNav[iPos]=new Object();
	aNav[iPos].img=new Image(w,h); aNav[iPos].img.src="img/nav/"+img+".gif";
	aNav[iPos].imgo=new Image(w,h); aNav[iPos].imgo.src="img/nav/"+img+"o.gif";
}
function mOv(stub,i) {
	if (stub=='Top')
		setImg(stub,i,aTop[i].imgo.src);
	else if (stub=='Nav')
		setImg(stub,i,aNav[i].imgo.src);
}
function mOut(stub,i) {
	if (stub=='Top')
		setImg(stub,i,aTop[i].img.src);
	else if (stub=='Nav')
		setImg(stub,i,aNav[i].img.src);
}
function setImg(id,i,src) {
	if (src!=null) {
		var img=getImage(id+i);
		if (img) img.src=src;
	}
}
function getImage(id) {
	if (document.images && document.images[id])
		return document.images[id];
	else
		return null;
}

// FLASH STUFF
var fVer = 0;	
var bFlashOK = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('if (flash5Installed) then \n');	
	document.write('fVer=5 \n');	
	document.write('elseif (flash4Installed) then \n');	
	document.write('fVer=4 \n');	
	document.write('end if \n');	
	document.write('</SCR' + 'IPT\> \n');
}

function detectFlash(){	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]|| navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			fVer = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		}
	}
	
	if(navigator.userAgent.indexOf("WebTV") != -1) fVer = 2;	
	if (fVer >= 4) bFlashOK = true;
}

detectFlash();

function drawFlashLink(s,w,h,a,u) {
   if (!drawFlash(s,w,h))
      document.write('<a href="'+u+'"><img src="img/'+s+'.gif" width="'+w+'" height="'+h+'" alt="'+a+'" border="0" /></a>');
}
function drawFlashJPG(s,w,h,a) {
   if (!drawFlash(s,w,h))
      document.write('<img src="swf/'+s+'.jpg" width="'+w+'" height="'+h+'" alt="'+a+'" border="0" />');
}
function drawFlash(s,w,h) {
	if (bFlashOK) {
		document.write('<object width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">');
		document.write('<param name="movie" value="swf/'+s+'.swf"><param name="bgcolor" value="#342f28"><param name="loop" value="false"><param name="menu" value="false"><param name="quality" value="high"><param name="scale" value="exactfit">');
		document.write('<embed src="swf/'+s+'.swf" width="'+w+'" height="'+h+'" bgcolor="#342f28" loop="false" menu="false" quality="high" scale="exactfit" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
		document.write('</object>');
		return true;
   }
   else
		return false;

}
function goPop(sURL,sName,iW,iH,sExtra) {
	if (sExtra==null) sExtra="";
    var win=window.open(sURL,sName,"width="+iW+",height="+iH+sExtra);
	win.focus();
}