// macromedia
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function showLAYER(layName){                                    
	if(document.getElementById)         //e5,e6,n6,n7,m1,o6,o7,s1
		document.getElementById(layName).style.visibility='visible';
	else if(document.all)               //e4
		document.all(layName).style.visibility='visible';
	else if(document.layers)            //n4
		document.layers[layName].visibility='show';
}
function hideLAYER(layName){
	if(document.getElementById)         //e5,e6,n6,n7,m1,o6,o7,s1
		document.getElementById(layName).style.visibility='hidden';
	else if(document.all)               //e4
		document.all(layName).style.visibility='hidden';
	else if(document.layers)            //n4
		document.layers[layName].visibility='hide';
}

var	menuOverCurrent = "";
var	menuOverCurrentMain = "";
var onMenuLayer = "";
function showMe(showThis){
	hideMenu();
	menuOverCurrent = showThis;
	menuOverCurrentMain = showThis + "Main";
	showLAYER(showThis);
	keepRollOver(menuOverCurrentMain);
	showLAYER("MenuWrapper");
}
function hideMe(hideThis){
	hideLAYER(hideThis);
}
function hideMenu(){
	if( menuOverCurrent && menuOverCurrentMain ){
		hideLAYER(menuOverCurrent);
		if( onMenuLayer == menuOverCurrentMain )
			document.getElementById(menuOverCurrentMain).className = "onmenu";
		else
			document.getElementById(menuOverCurrentMain).className = "menu";
	}
}
function keepRollOver(theParent){
	if( document.getElementById(theParent).className == "onmenu" ){
		onMenuLayer = theParent;
	}
	document.getElementById(theParent).className = "menuHover";
}
/* created by Jeffrey Johnston aka pyrox of sega <http://one-three-three-seven.com> */
function init() {
if (!document.getElementById) return
var imgOriginSrc;
var imgTemp = new Array();
var imgarr = document.getElementsByTagName('img');
for (var i = 0; i < imgarr.length; i++) {
if (imgarr[i].getAttribute('newimg')) {
imgTemp[i] = new Image();
imgTemp[i].src = imgarr[i].getAttribute('newimg');
imgarr[i].onmouseover = function() {
imgOriginSrc = this.getAttribute('src');
this.setAttribute('src',this.getAttribute('newimg'))
}
imgarr[i].onmouseout = function() {
this.setAttribute('src',imgOriginSrc)
}
}
}
}
onload=init;



//Popup Window Function
function popupWindow(url,w,h,left,top,name) {
	if (name == "0") name="popupwindow";
// Set left and top for centered window	
	if (left == "center")
	{
		left = (screen.availWidth / 2) - ((w / 2) + 4);
		if (left < 0)
		{
			left = 0;
		}
	}
	if (top == "center") 
	{
		top = (screen.availHeight / 2) - ((h / 2) + 14);
		if (top < 0)
		{
			top = 0;
		}
	}
// Set height and width for maximized window
	if (w == "max")
	{
		w = screen.availWidth-10;
	}
	if (h == "max")
	{
		h = screen.availHeight-30;
	}
	var scroll="no";
	windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=no,copyhistory=yes,alwaysRaised=yes,width=" + w + ",height=" + h + ",left=" + left + ",top=" + top + "'");
//	remote = window.open("","popupwindow","left=15,top=15,width=340,height=320");
	remote = window.open("",name,windowops);
	remote.location.href = url;
	remote.focus();
	if (remote.opener == null) remote.opener = window;
}

