// JavaScript Document
var curractive=null;
var currlistitem=null;
function setActiveSubNav(id)
	{
		if(curractive != null)
		{
			curractive.style.listStyleImage="url(images/arrow_olive.png)";			
		}		
		if(isMapOn)
		{
			removeMap();
		}
		curractive = document.getElementById(id);
		curractive.style.listStyleImage="url(images/arrow_olive_active.png)";			
	
	}
	function changeListBackground(id)
	{
		if(currlistitem != null)
		{			
			currlistitem.style.backgroundColor = "#E1EFF4";
		}	
		currlistitem = document.getElementById(id);
		currlistitem.style.backgroundColor = "#FFFFFF";
	}
function changeEmbassyBackground(container,nm)
{
	if(container == "location")
	{
	}
	else if(container == "sections")
	{
		var cd = document.getElementById("center_main_data");
		cd.innerHTML = '<table cellpadding="1px" cellspacing="0px" border="0px"  id="desc" style="width:510px; height:652px;margin-top:0px; margin-left:5px; background-image:url(images/doublepage_withpen_4.png); background-repeat:no-repeat"> <tr><td valign="top" align="left" style="width:510px; height:350px" >	<div id="ce" style=" margin-top:100px;margin-left:80px; margin-right:50px; font-family: Verdana, Arial,sans-serif; line-height:18px; font-size:12px; color:#004488">'+getsectionInfo(nm)+'</div></td></tr></table>';
	}
}
function getsectionInfo(nm)
{
	if(nm == "visa")
	{
		return "<font style='font-family:Arial, Helvetica, sans-serif;font-size:16px; font-weight:bold'>Visa Section</font><br /><p></p>";
	}
	else if(nm == "consular")
	{
		return "<font style='font-family:Arial, Helvetica, sans-serif;font-size:16px; font-weight:bold'>Consular Affairs</font><br /><p></p>";
	}
	else
	{
		return "";
	}
}
function setListMouseOverColor(id)	
{
	var cur = document.getElementById(id);
	cur.style.backgroundColor = "#E1EFF4";
}
function updateContent(elem,container)
{
	changeBackground(container);
	if(container == "consulates"){
	var da = document.getElementById("center_main_dataarea");
	da.innerHTML = getConsulateDescription(elem);
	da.style.height = "500px";
	da.style.marginTop = "30px";
	document.getElementById("center_main_doublepage").style.height = "664px";
	document.getElementById("center_main_doublepage").style.backgroundImage = "url(images/doublepage_withpen_2.png)";
	}
	else if(container == "embassies"){
	var da = document.getElementById("center_main_dataarea");
	da.innerHTML = getEmbassyDescription(elem);
	da.style.height = "300px";
	da.style.marginTop = "80px";
	document.getElementById("center_main_doublepage").style.height = "517px";
	document.getElementById("center_main_doublepage").style.backgroundImage = "url(images/doublepage_withpen_1.png)";
	}
	else if(container == "other")
	{
		if(elem == "unitednations")
		{
			var da = document.getElementById("center_main_dataarea");
			da.innerHTML = getOther(elem);
			da.style.height = "300px";
			da.style.marginTop = "80px";
			document.getElementById("center_main_doublepage").style.height = "517px";
			document.getElementById("center_main_doublepage").style.backgroundImage = "url(images/doublepage_withpen_1.png)";
		}
	}
}
function getConsulateDescription(country)
{
	for(var i=0;i<consulates.length;i++)
	{
		if(consulates[i][0] == country)
		{
			return consulates[i][1];
		}
	}
	return "";
}
function getEmbassyDescription(country)
{
	for(var i=0;i<embassies.length;i++)
	{
		if(embassies[i][0] == country)
		{
			return embassies[i][1];
		}
	}
	return "";
}
function getOther(country)
{
	for(var i=0;i<other.length;i++)
	{
		if(other[i][0] == country)
		{
			return other[i][1];
		}
	}
	return "";
}
function changeBackground(container)
{
	if(container == "consulates")
	{
		document.getElementById("center_main_dataarea").style.backgroundColor = "#E1EFF4";
		document.getElementById("center_main").style.backgroundColor = "#FCFEFE";		
	}
	else if (container == "embassies")
	{
		document.getElementById("center_main_dataarea").style.backgroundColor = "#F5F4F1";
		document.getElementById("center_main").style.backgroundColor = "#FCFEFE";
	}
}