function precache (){
	var tmp = new Array( 
	"hnt_investor_relations","hnt_about_the_group","hnt_news","hnt_careers","hnt_contacts","icapsitedropimage","hnt_home"
	);
	precache_imgs( tmp );
}

var Imgs = new Array();

function precache_imgs( theimgs ) {

	for(var i=0; i<theimgs.length; i++) {
		var j = Imgs.length;
		var tmp = { id: theimgs[i], on:null,off:null,text:null }
		tmp.on = new Image(); tmp.on.src = "/img/"+theimgs[i]+"_over.gif";
		tmp.off = new Image(); tmp.off.src = "/img/"+theimgs[i]+"_off.gif";
		Imgs[j] = tmp;
	}
}

// called on mouseover, swaps topnav image 
function img_over( name ) {
	var img = null;
	for(var i=0; i<Imgs.length; i++) {
		if( Imgs[i].id == name ) {
			img = Imgs[i]
		}
	}
	if( img != null ) {
//		document.images[ name ].src = img.on.src;		
	}
}

// called on mouseout, Replaces topnav image 
function img_out( name ) {
	var img = null;
	for(var i=0; i<Imgs.length; i++) {
		if( Imgs[i].id == name ) {
			img = Imgs[i]
		}
	}
	if( img != null ) {
//		document.images[ name ].src = img.off.src;
	}
}

// Topnav DHTML Rollover Code

function showmenu(elmnt,name,offset) {

	var c = getAnchorPosition(name);
	var adjust = offset
	//alert("X = "+c.x+" , Y = "+c.y);
	if (document.getElementById) {
		var o = document.getElementById(elmnt);
		if (o.style.visibility=="visible") {
			hidemenu(elmnt);
			//if (elmnt=="icapsitedroplist"){
			//	img_out('icapsitedropimage');
			//}
		} else if (o.style) {
			o.style.left = c.x;
			o.style.top = c.y+ adjust;
			o.style.visibility = "visible";
			//if (elmnt=="icapsitedroplist"){
			//	img_over('icapsitedropimage');
			//}
		}
	} 
}

function hidemenu(elmnt) {
	var o = document.getElementById(elmnt);
	if (o.style) {
			o.style.visibility = "hidden";		
		}
}
// Window Opening / Closing Funcitons 

function openLargePopup( url, windowname ) {
  var popup = window.open( url , windowname, "toolbar=yes,status=yes,scrollbars=yes,menubar=yes,locationbar=yes,top=50,left=70,outerWidth=700,outerHeight=468,width=700,height=468,resizable=yes");
  popup.focus();
}

function openMedPopup( url ) {
  var popup = window.open( url , null, 'height=600,width=900,titlebar=no,resizable=yes');
  popup.focus();
}


function closeWindow() {
  self.close();
}

// Drop-down location.href redirection
 
function dropdown_redirect(select_name) {
 	location.href=select_name.options[select_name.selectedIndex].value
 }
 
 
 // Share Holder Window Opening / Closing Funcitons 

function openSharePopup( url, windowname ) {
  var popup = window.open( url , windowname, "toolbar=no,status=no,scrollbars=no,menubar=no,locationbar=no,top=50,left=70,outerWidth=700,outerHeight=200,width=700,height=200,resizable=yes");
  popup.focus();
}



function popSwfWin(url) {

window.open(url,'grad','height=530,width=800,menubar=0,toolbar=0,status=0,scrollbars=0,resizable=0,left=150,top=100');

}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
	
function changeImages() {
	if (document.images ) {
		for (var i=0; i < changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
