// JavaScript Document

//write out the flash from an external file
function PlaceFlash(sFileName,sID,iWidth,iHeight,sImageFile,sAlt)
{
	var sOutput = "<object data=\"" + sFileName + "\" type=\"application/x-shockwave-flash\" style=\"width:" + iWidth + "px\;height:" + iHeight + "px\;margin: 1px\;\" id=\"" + sID + "\">" + "\n";
	sOutput += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />" + "\n";
	sOutput += "<param name=\"movie\" value=\"" + sFileName + "\" />" + "\n";
	sOutput += "<param name=\"quality\" value=\"high\" />" + "\n";
	sOutput += "<param name=\"wmode\" value=\"transparent\" />" + "\n";
	sOutput += "<img src=\"" + sImageFile +"\" style=\"width:" + iWidth + "px;height:" + iHeight + "px;margin: 1px\" alt=\"" + sAlt + "\" />" + "\n";
	sOutput += "</object>" + "\n";
	document.write(sOutput);
};

//onload
function addLoadEvent(func)
{ 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function')
	{ 
		window.onload = func; 
	}
	else
	{ 
		window.onload = function()
		{ 
			if (oldonload)
			{ 
				oldonload(); 
			}
 
			func(); 
		} 
	}
};

//set cookies
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

//get cookies
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  var c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    var c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
};

//roll over and rollout events
function SwapImage(oSender,sImage){
	oSender.getElementsByTagName("img")[0].src=sImage;	
};

//preload images
function PreloadImages(ImgArray){
	for (var i = 0; i< ImgArray.length; i++)
	{	
		var sTargetSrc = ImgArray[i]
		ImgArray[i] = new Image();
		ImgArray[i].src = sTargetSrc;
	}
};

//add px to a value
function AddPX(sValue)
{
	return sValue.toString() + "px";
}