// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
var features;
features = features + ',top=20,left=20';
  window.open(theURL,winName,features);
}


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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

/*------------------------flash on opera & netscape6-------------------------------*/
function showFlash(){
	
	if (is_nav6||is_opera){
		document.write('<img src="i/header/piramid.gif">');
		}else{
			  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="183" height="138">');
        document.write('<param name="movie" value="/dev/imgs/swf/str_header_new.swf" />');
        document.write('<param name="quality" value="high" />');
        document.write('<param name="wmode" value="transparent" />');
        document.write('<embed src="swf/str%20header_new.swf" width="183" height="138" quality="high"  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
        document.write('</object>');
			}
	}

function showIndexFlash(){
	if (is_nav6||is_opera){
		document.write('<img src="/dev/imgs/swf/index.jpg">');
		}else{
			 document.write(' <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="638" height="237">');
             document.write(' <param name="movie" value="/dev/imgs/swf/index-flash2.swf" />');
             document.write(' <param name="quality" value="high" />');
		     document.write(' <param name="wmode" value="transparent" /> ');
             document.write('<embed src="/dev/imgs/swf/index-flash2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="638" height="237"  wmode="transparent"></embed>');
       		 document.write(' </object>');
			}
	}


/*------------------------END flash on opera & netscape6-------------------------------*/


//--------------DROPDOWN MENU FUNCTIONS-------------------//
//make sure to include all 'submenu id' and 'submenu_sub id' you needed to the arrays bellow
//do not forget all submenus divs id MUST begin with the string 'submenu' + whatever
//all submenus_Sub divs id MUST begin with the string 'submenu_Sub' + whatever

// var submenu_array = ["submenu1","submenu2","submenu3","submenu4"];
var submenu_array = ["submenu1","submenu2","submenu3","submenu4"];
var submenu_Sub_array = [/*"submenu1_Sub1","submenu1_Sub2","submenu2_Sub1","submenu2_Sub2"*/];

function setLyr(obj,lyr)  //controls the positioning of the submenu layer lets you adjust x,y positioning for ie-mac and safari separately
{

	var newX = findPosX(obj);
	var newY = findPosY(obj);
	var x = new getObj(lyr);
//window.alert(newX);
	var fixX //adjasting the diference between ie-mac and other browsers
	var fixY  //adjasting the diference between ie-mac and other browsers
	/*if ((is_ie5up) && (is_mac)){  // fix for ie-mac
		fixX = 25;
		fixY = -1;
	
	}*/	
	if (is_ie5up||is_opera){  // fix for ie-mac
		fixX = 25;
		fixY = -1;
	
	}	
	/*else if (is_safari){ // fix for safari
		fixX = 11;
		fixY = 0;
	} */
	else {
		fixX = 11;
		fixY = 0;
	}
	x.style.top = newY + fixX  + 'px';
	x.style.left = newX + fixY -1 + 'px';
}

function setLyr2(obj,lyr)   //controls the positioning of the submenu_Sub layer let you adjust ie-mac x,y positioning separately
{
		var newX = findPosX(obj)-1;
		var newY = findPosY(obj);
		var x = new getObj(lyr);
		var addX = obj.offsetWidth;
		var fixX
		var fixY
			//window.alert(addX);
	if ((is_ie5up) && (is_mac)){ //fix for ie-mac
		fixX = -1;
		fixY = -30;
	}	
	else {
		fixX = 0;
		fixY = 0;
	}
	x.style.top = newY + fixX + 'px';
	x.style.left = newX+ fixY + addX + 'px';
	
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function getObj(name){
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
 }
}

function FW_clearTimeout(){
	if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);
	fwHideMenuTimer = null;
	fwDHFlag = false;
}

function FW_startTimeout(){
	fwStart = new Date();
	fwDHFlag = true;
	fwHideMenuTimer = setTimeout("fwDoHide()", 1000);
}

function fwDoHide(){
	var printstring = '';
	printstring +=fwStart+' fwHideMenuTimer:'+fwHideMenuTimer+' layers: ';
	/*window.status = printstring;*/
	if (!fwDHFlag) return;
	var elapsed = new Date() - fwStart;
	if (elapsed < 40) {
		fwHideMenuTimer = setTimeout("fwDoHide()", 40-elapsed);
		return;
	}
	fwDHFlag = false;
	hideActiveMenus();
	window.ActiveMenuItem = 0;
}



function hideActiveMenus() {  //goes over each of the submenus in the arrays and hide them
	for (i=0; i<(submenu_array.length); i++){
		  var name=submenu_array[i]; 
			var removeLayer = document.getElementById(name);
			removeLayer.style.visibility="hidden";
		}
		for (i=0; i<(submenu_Sub_array.length); i++){
		  var name=submenu_Sub_array[i]; 
			var removeLayer = document.getElementById(name);
			removeLayer.style.visibility="hidden";
		}
}

function ShowNav(layerName){  // show named layer and hide All other layers from the submenu_array
	
	for (i=0; i<(submenu_array.length); i++){
		var name=submenu_array[i]; 
		var subname=name.substr(0,7); 
		 if(subname=="submenu"){ 
			   if (layerName==name){
				   MM_showHideLayers(layerName,'','show');
			   } else {
				   var removeLayer = document.getElementById(name);
				   removeLayer.style.visibility="hidden";
				}
			}
	}
}

function showSubNav(layerName){ // show named layer and hide All other layers from the submenu_Sub_array
	for (i=0; i<(submenu_Sub_array.length); i++){
		var name=submenu_Sub_array[i]; 
		var subname=name.substr(8,4);
		if(subname=="_Sub"){ 
			if (layerName==name){
				MM_showHideLayers(layerName,'','show');
			} else {
				var removeLayer = document.getElementById(name);
				removeLayer.style.visibility="hidden";
			}
		}
	}
}

function mouseoutMenu(){
	fwDHFlag = false;
	return true;
}

// Pop-up
function doHidePopUp() {
	popdiv=document.getElementById("promopop")
	popdiv.style.visibility="hidden"
}

function doShowPopUp(){
	popdiv=document.getElementById("promopop");
	popdiv.style.position="absolute";
	popdiv.style.left="50%";
	popdiv.style.marginLeft="-280px";
	popdiv.style.top="10";
/*	if ((is_ie5up) && (is_mac)){ //fix for ie-mac does not accept popdiv.style.top="50%"
		popdiv.style.top="0px"
		popdiv.style.marginTop="0px"
	}else{
		popdiv.style.top="50%"
		popdiv.style.marginTop="-293px"
	}
*/
	popdiv.style.visibility="visible"
}