var dom = (document.getElementById)? true : false; 
var nn4 = (document.layers)? true : false; 
var ie = (document.all)? true : false; 
var opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false; 
var contentWidth = 778; 
var winHeight; 
var posLeft; 
var posHeight; 
var offsetWidthValue = 0;


function ImButton1(img,phase) 
{ 
if (phase==1) 
document.images["im_"+img].src="/images/menu/"+img+"_on.gif" 
else 
document.images["im_"+img].src="/images/menu/"+img+"_off.gif" 
}
function ImButton(img,phase,folder) 
{ 
if (phase==1) 
document.images["im_"+img].src="/images/"+folder+"/"+img+"_on.gif" 
else 
document.images["im_"+img].src="/images/"+folder+"/"+img+"_off.gif" 
}


function showElem() 
{ 
	var a = showElem.arguments; 
	offsetWidthValue = 0;
	if (a != null) 
	{ 
		for (i = 0; i < a.length; i ++) 
		{ 
			setPosition(a[i]); 
			if (opera) 
			{ 
				if (window.document.body.offsetWidth > contentWidth) 
				{ 
					offsetWidthValue = (window.document.body.offsetWidth - contentWidth)/2; 
				} 
				else 
				{ 
					offsetWidthValue = 0; 
				} 
				if (posLeft > 0)
				{
					offsetWidthValue = offsetWidthValue + 10; 
				}
				winHeight = window.document.body.offsetHeight; 
				document.all[a[i]].style.top = posHeight; 
				document.all[a[i]].style.left = posLeft + offsetWidthValue;
				document.all[a[i]].style.visibility = 'visible'; 
			} 
			else if (ie) 
			{ 
				if (window.document.body.offsetWidth > contentWidth) 
				{ 
					offsetWidthValue = (window.document.body.offsetWidth - contentWidth)/2; 
				} 
				else 
				{ 
					offsetWidthValue = 0; 
				} 
				winHeight = window.document.body.offsetHeight; 
				document.all[a[i]].style.top = posHeight;
				 				
				if (posLeft == 0)
				{
					document.all[a[i]].style.left = posLeft + offsetWidthValue - 10;
				}
				else
				{
					document.all[a[i]].style.left = posLeft + offsetWidthValue; 
				}
				document.all[a[i]].style.visibility = 'visible'; 
			} 
			else if (dom) 
			{
				if (window.document.body.offsetWidth > contentWidth) 
				{ 
					offsetWidthValue = (window.document.body.offsetWidth - contentWidth)/2; 
				} 
				else 
				{ 
					offsetWidthValue = 9; 
				} 
				winHeight = window.document.body.offsetHeight; 
				document.getElementById(a[i]).style.top = posHeight; 
				document.getElementById(a[i]).style.left = posLeft + offsetWidthValue; 
				document.getElementById(a[i]).style.visibility = 'visible'; 
			} 
			else if (nn4) 
			{ 
				if (window.innerWidth > contentWidth) 
				{ 
					offsetWidthValue = (window.innerWidth - contentWidth)/2; 
				} 
				else 
				{ 
					offsetWidthValue = 9; 
				} 
				winHeight = window.innerHeight; 
				eval("document." + a[i] + ".top = " + posHeight); 
				eval("document." + a[i] + ".left = " + (posLeft + offsetWidthValue)); 
				eval("document." + a[i] + ".visibility = 'visible'"); 
			} 
			else 
			{ 
				//alert('Your brouser doesn'+"'"+'t allow to change visibility'); 
			} 
		} 
	} 
} 
function hideElem() 
{ 
	var a = hideElem.arguments; 
	if (a != null) 
	{ 
		for (i = 0; i < a.length; i ++) 
		{ 
			if (dom) 
			{ 
				document.getElementById(a[i]).style.visibility = 'hidden'; 
			} 
			else if (ie) 
			{ 
				document.all[a[i]].style.visibility = 'hidden'; 
			} 
			else if (nn4) 
			{ 
				eval("document." + a[i] + ".visibility = 'hide'"); 
			} 
			else 
			{ 
				//alert('Your brouser doesn'+"'"+'t allow to change visibility'); 
			} 
		} 
	}
} 
function setPosition(id) 
{ 
	switch(id)
	{ 
		case "menu_aboutus":
		posLeft = 145; 
		posHeight = 15; 
		break;

		case "menu_yourchallenges":
		posLeft = 145; 
		posHeight = 15; 
		break;

		case "menu_ourservices":
		posLeft = 145; 
		posHeight = 15; 
		break;
		
		case "menu_informationcentre":
		posLeft = 145; 
		posHeight = 15; 
		break;
	} 
}

function GoButton(field) 
{ 
	eval("document.location = document.forms[0].elements['" + field + "'].value");

}
function showElement() 
{ 
	var a = showElement.arguments; 
	if (a != null) 
	{ 
		for (i = 0; i < a.length; i ++) 
		{ 
			if (dom) 
			{ 
				document.getElementById(a[i]).style.visibility = 'visible'; 
			} 
			else if (ie) 
			{ 
				document.all[a[i]].style.visibility = 'visible'; 
			} 
			else if (nn4) 
			{ 
				eval("document." + a[i] + ".visibility = 'show'"); 
			} 
			else 
			{ 

			} 
		} 
	}
} 
function selectItem(item,phase) 
{ 
	if (phase==1) 
	{
			//document.all[item].class = 'dropItemActive';
			if (dom) 
			{ 
				document.getElementById(item).style.background = '#9BAA1E'; 
			} 
			else if (ie) 
			{ 
				document.all[item].style.background = '#9BAA1E';
			} 
			else if (nn4) 
			{ 
				eval("document." + item + ".background = '#9BAA1E'"); 
			} 
		}
	else 
	{
				if (dom) 
				{ 
					document.getElementById(item).style.background = '#DFE3D2'; 
				} 
				else if (ie) 
				{ 
					document.all[item].style.background = '#DFE3D2';
				} 
				else if (nn4) 
				{ 
					eval("document." + item + ".background = '#DFE3D2'"); 
				}
			}
}

