//SWAP IMAGE
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_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 swapImage() {
	strImage = (arguments[1]=='on')?'style/images/leftmenu_r.gif':'style/images/leftmenu.gif';
	MM_swapImage(arguments[0],'',strImage,1)
}

function MM_homeMenu(targ,selObj,restore){ //v3.0
	if (selObj.selectedIndex == 4 || selObj.selectedIndex == 0 ) {
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		}
		else {
			window.open(selObj.options[selObj.selectedIndex].value,'new')
		}
  if (restore) selObj.selectedIndex=0;
	return false;
}



// Exit disclaimer
var popupWidth;
var popupHeight;

// check type size
function textSizeDetect() {
	var intTextSize = (document.layers)?document.layers["textsizedetect"]:(document.all)?document.all["textsizedetect"]:(document.getElementById)?document.getElementById("textsizedetect"):"";

	if (intTextSize) {
		 intTextSize = intTextSize.offsetHeight
	}
	if (intTextSize>14){
		//set the height and width of the popup
		popupWidth=220;
		popupHeight=240;
	} else if (intTextSize>12){
		//set the height and width of the popup
		popupWidth=220;
		popupHeight=220;
	} else{
		popupWidth=220;
		popupHeight=200;
	
	}
}


// get all links with the class name disclaimer and add to them
// an onclick event going to the disclaimer, and an onKeyPress event 
// going to the onClick event
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("disclaimer")) {
      links[i].onclick = function() {
		textSizeDetect()
		window.open(this.href,'disclaimer','width='+popupWidth+',height='+popupHeight+',scrollbars=auto,resizable');
        return false;
      }
	  links[i].onkeypress = function(){
	  	verifyKey(this,'this.onclick();');
	  }
    }
  }
}
// Called in on index.asp
// window.onload = doPopups;

// Set external links
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if(anchor.getAttribute("href")&&anchor.getAttribute("rel") == "external"){
       anchor.target = "_blank";
       var strTitle = anchor.getAttribute("title");
       if((strTitle=="")||(strTitle==null)){
          anchor.title = "Opens in a new browser window.";
       }else{
          if(strTitle.indexOf("browser window")<0){
             anchor.title = strTitle+". Opens in a new browser window.";
          }
       }
       var strTitle = "";
    }
  }
  // call table rollover function
  //tableLinkActive();
}
window.onload=externalLinks;






// Keypress checker
function verifyKey(oElement,oEvent){
  if(oEvent.keyCode==13 && oElement.onclick){
     oEvent();
  }
}





window.onload = externalLinks;


// -----------------------------
// --- form button rollovers ---
// -----------------------------
function bluearrow(blue_arrow, arrow_src)
   {
   document.getElementById(blue_arrow).src = arrow_src;
   return true;
   }
   
function bot_bluearrow(bot_blue_arrow, arrow_src)
   {
   document.getElementById(bot_blue_arrow).src = arrow_src;
   return true;
   }
   
function vacancyarrow(vacancy_arrow, arrow_src)
   {
   document.getElementById(vacancy_arrow).src = arrow_src;
   return true;
   }
   
function whoarrow(who_arrow, arrow_src)
   {
   document.getElementById(who_arrow).src = arrow_src;
   return true;
   }
   
function emailarrow(email_arrow, arrow_src)
   {
   document.getElementById(email_arrow).src = arrow_src;
   return true;
   }
   
function searcharrow(search_arrow, arrow_src)
   {
   document.getElementById(search_arrow).src = arrow_src;
   return true;
   }
   
function nextarrow(next_arrow, arrow_src)
   {
   document.getElementById(next_arrow).src = arrow_src;
   return true;
   }
   
function prevarrow(prev_arrow, arrow_src)
   {
   document.getElementById(prev_arrow).src = arrow_src;
   return true;
   }

function highlight(element) {
	element.className = 'button_f2';
}
function restore(element) {
	element.className = 'button';
}

//TOPMENU ROLLOVER FUNCTION
function TMimagerollover(target){
	document.getElementById(target).style.backgroundImage="url(images/site_objects/bg_mainnav_left_blank.gif)";
	document.getElementById(target).style.backgroundRepeat="no-repeat";
}

//TOPMENU ROLLOUT FUNCTION
function TMimagerollout(target){
	document.getElementById(target).style.backgroundImage="url(images/site_objects/bg_mainnav_left.gif)";
}


//TOPMENU ROLLOVER FUNCTION
function TMimagerollleft(target){
	document.getElementById(target).style.backgroundImage="url(images/site_objects/bg_mainnav_left_blank.gif)";
	document.getElementById(target).style.zIndex ="330000";
}

//TOPMENU ROLLOUT FUNCTION
function TMimagerolloutleft(target){
	document.getElementById(target).style.backgroundImage="url(images/site_objects/bg_mainnav_left_f2.gif)";
}



//Map changes//
function mapChange(location){
// change the image
imgSrc = "images/pictures/map/p_map_" + location + ".gif";
	document.images['maplocation'].src= imgSrc;
}


//changeStyleById//

function viewObById(id,dsp){
if (document.getElementById)
   {
   var nodeObj = document.getElementById(id)
   nodeObj.style.display = dsp
   }
}

function viewObjById(showPlace){
	var arrPlaces= new Array("east","west","south","north");
	for(x in arrPlaces){
		if(arrPlaces[x]==showPlace){
			var strObject=document.getElementById(arrPlaces[x]);
			if(strObject){
				document.getElementById(arrPlaces[x]).style.display="block";	
			}
		}else{
			var strObject=document.getElementById(arrPlaces[x]);
			if(strObject){
				document.getElementById(arrPlaces[x]).style.display="none";
			}
		}
	}
}
