//preload images; 

var img_lib=new Object();
var nav_base='images/static/tabs/';


function NewcountryRoll(theCountry)
{
	ChangeImg("map_main", theCountry)
}

function NewcountrySel(theCountry)
{

}

function NewcountryOff()
{
	ChangeImg("map_main", "world")
}

function NewAddNavImg(img_name)
{
	img_lib[img_name+'_over']=new Image();
	img_lib[img_name+'_over'].src=nav_base+img_name+'_over.gif';
	img_lib[img_name+'_off']=new Image();
	img_lib[img_name+'_off'].src=nav_base+img_name+'_off.gif';
}
function NewAddImg(id, src)
{
	img_lib[id]=new Image();
	img_lib[id].src=src;
}


// nav rollover functions;
function NewNavROver(id)
{
	var img=(document.images)?document.images[id]:
			((document.all)?document.all[id]:((document.getElementById)?document.getElementByID(id):0));
	if (img) img.src=img_lib[id+'_over'].src;			
}
function NewNavROut(id)
{
	var img=(document.images)?document.images[id]:
			((document.all)?document.all[id]:((document.getElementById)?document.getElementByID(id):0));
	if (img) img.src=img_lib[id+'_off'].src;			
}
function NewChangeImg(img_id, src_id)
{
	var img=(document.images)?document.images[img_id]:
			((document.all)?document.all[img_id]:((document.getElementById)?document.getElementByID(img_id):0));
	if (img) img.src=img_lib[src_id].src;
}
	
//function to do highlighting of menu
	var BgMenu1Over='#ff9900';
	var BgMenu1Out='#ffffff';
	
	var BgMenu2Over='#FFCC66';
	var BgMenu2Out='#FFCC99';
	var Browser = NewCheckBrowser();
			
	function NewChangeMenuBgColor(id, color)
	{
		var el1 = NewGetCell(id + '_1');
		el1.bgColor = color;
		var el2 = NewGetCell(id + '_2');
		el2.bgColor = color;
	}
	
	function NewGetCell(id)
	{
		return document.all ? document.all(id) : document.getElementById ? document.getElementById(id) : null
	}


//Returns the document object
	function NewGetImage(id)	{
	var img=(document.images)?document.images[id]:
			((document.all)?document.all[id]:((document.getElementById)?document.getElementByID(id):0));
			return img;
		//if (Browser.IE4plus || Browser.IEmac) return document.all[id];
		//if (Browser.NS4) return document.images[id];		
		//if (Browser.NS6) return document.getElementById(id);
	}
	
	//Returns the document object
	function NewGetElement(id)	{
		if (Browser.IE4plus || Browser.IEmac) return document.all[id];
		if (Browser.NS4) return document[id];		
		if (Browser.NS6 || navigator.userAgent.indexOf("Mozilla") || navigator.userAgent.indexOf("Opera") ||navigator.userAgent.indexOf("Safari")) return document.getElementById(id);
	}
	
	function NewSwapClass(id, className)	{
		var el = NewGetElement(id).className = className;
	}

	function NewCheckBrowser()	{
		var br = new Object();
		br.isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
		br.NS4 = (document.layers) ? true : false;
		br.IEmac = ((document.all)&&(br.isMac)) ? true : false;
		br.IE4plus = (document.all) ? true : false;
		br.IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
		br.IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
		br.IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
		ver4 = (br.NS4 || br.IE4plus) ? true : false;
		br.NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;
	
		br.IE5plus = br.IE5 || br.IE6;
		br.IEMajor = 0;
	
		if (br.IE4plus) {
			var start = navigator.appVersion.indexOf("MSIE");
			var end = navigator.appVersion.indexOf(".",start);
			br.IEMajor = parseInt(navigator.appVersion.substring(start+5,end));
			br.IE5plus = (br.IEMajor>=5) ? true : false;
		}
		return br
	}
	
	function NewOnLoadSpecs()
	{
		var cnt = 1;
		while (NewGetCell('sp_'+ cnt + 'text'))
		{
			ToggleSpecs('sp_'+ cnt); 
			cnt++;
		}
	}
 
	function NewToggleSpecs(id)
	{
		var oImage = NewGetCell(id + 'image');
		var oText = NewGetCell(id + 'text');
		var oGutter = NewGetCell(id + 'gutter');
		var oContent = NewGetCell(id + 'content');
		if (oContent.style.display != 'none') 
		{
		//Show (expand)
			if (oImage) oImage.src = 'images/4360_1.gif';
			if (oText) oText.style.color = '#000000';
			if (oGutter) oGutter.style.display = '';
			if (oContent) oContent.style.display = 'none';
		}else{
		//Hide (collapse)
			if (oImage) oImage.src = 'images/4359_1.gif';
			if (oText) oText.style.color = '#FF9900'; 
			if (oGutter) oGutter.style.display = 'none';
			if (oContent) oContent.style.display = '';
		}
	}
	function contextPopup(url) {
		var wincontext = window.open(url, 'wincontext', 'width=357,height=425,scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,menubar=no,status=yes');
		wincontext.focus();
	}
	
	//Changed to support the case when there is no rollover image given
	function New_SwapImage(ImgId,ImgSrc){
		if (document.images && ImgSrc!='' && ImgSrc!= null)
		{	
			document.images[ImgId].src = ImgSrc;
		}
	}
	
	function New_PreloadImage(ImgSrc)
		{
		 myImg = new Image();
		 myImg.src = ImgSrc;
		}
function New_BrowserWindow(theURL,winName,features)
	{ 
	  window.open(theURL,winName,features);
	}
function MM_openBrWindow(theURL,winName,features) {
					window.open(theURL,winName,features);
}

function openLargePopupWin2(URL) {
  aWindow = window.open(URL,"largepopup","toolbar=no,width=750,height=580,status=no,scrollbars=yes,resizable=yes,menubar=no");
}