<!-- //
$(function() {
	$('#cahg_header').hover(
		function() {
			$(this).attr("src","/resources/images/cahg_header_over.gif");
			},
		function() {
			$(this).attr("src","/resources/images/cahg_header.gif");
			}
		);
	});

// Preload header rollover
hdr = new Image();
hdr.src = "/resources/images/cahg_header_over.gif";


arrNav = new Array("who","clients","units","global","press","careers","contact");

for (x = 0; x < arrNav.length; x++) { 
	thisNavOver = "nOver"+x;
	thisNavOver = new Image();
	thisNavOver.src = "/resources/images/nav_"+arrNav[x]+"_over.gif";
	
	thisNavOn = "nOn"+x;
	thisNavOn = new Image();
	thisNavOn.src = "/resources/images/nav_"+arrNav[x]+"_on.gif";
	}

	
function navOver(nav) {
	navName = "nav_"+nav;
	document.images[navName].src = "/resources/images/nav_"+nav+"_over.gif";
	}
	
function navOut(nav) { 
	navName = "nav_"+nav;
	document.images[navName].src = "/resources/images/nav_"+nav+"_off.gif";	
	}

function showPopUp(id, width, top, marginLeft) {

	// IE calculates positioning differently, so fix it.
	ua = navigator.userAgent.toLowerCase();
	if(ua.indexOf('msie') != -1) {
		marginLeft = (marginLeft-806);	
		}
		
	thisDiv = $('#'+id);
	thisDiv.css("width",width+"px");
	thisDiv.css("top",top+"px");
	thisDiv.css("margin","0 0 0 "+marginLeft+"px");
	$('#'+id).show();
	}

function hidePopUp(id) {
	$("#"+id).fadeOut();
	}
	
	
function setCurrent(id) {
	// Marks the subnav item as the current highlighted
	$("#sNav"+id).css({'background-color': '#daddf2'});
	}

function audioPlayer(file) {
	// Embeds a general audio player bug. Pass root addressed .mp3
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="20" height="20" id="audio_player" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/resources/audio_player.swf?fp='+file+'" /><param name="quality" value="high" /><param name="bgcolor" value="#eaeef3" />	<embed src="/resources/audio_player.swf?fp='+file+'" quality="high" bgcolor="#eaeef3" width="20" height="20" name="audio_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	}
	
function mmAds() {
	mmAdsFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="470" id="mmAds_1" align="middle">';
	mmAdsFlash += '<param name="allowScriptAccess" value="sameDomain" />';
	mmAdsFlash += '<param name="movie" value="/images/mmAds.swf" />';
	mmAdsFlash += '<param name="quality" value="high" />';
	mmAdsFlash += '<param name="bgcolor" value="#ffffff" />';
	mmAdsFlash += '<embed src="/images/mmAds.swf" quality="high" bgcolor="#ffffff" width="550" height="470" name="mmAds" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	mmAdsFlash += '</object>';
	
	//document.getElementById("mmAds").innerHTML = mmAdsFlash;
	
	// domEl( e , c , a , p , x );
	domEl('div', mmAdsFlash, [['class','popup'] , ['id','mmAds']], document.getElementById('mmAds'),1);

	showPopUp("mmAds", 550, 170, 50);
	}

	


// -->