function showSubMenu (showDivId, hideDivId, subCatNodeId)
{
	var elem = document.getElementById (showDivId);
	var elem2 = document.getElementById (hideDivId);
	document.getElementById ('LinkSet1').style.display = "none";
	document.getElementById ('LinkSet2').style.display = "none";

	if (elem != null){
		elem.style.display = "block";
	}
	if (elem2 != null){
		elem2.style.display = "none";
	}
	showSubCategories (subCatNodeId);
}
function hideSubMenu (hideDivId){
	document.getElementById (hideDivId).style.display = "none";
	document.getElementById ('LinkSet1').style.display = "block";
	document.getElementById ('LinkSet2').style.display = "block";
}
function showSubCategories (nodeId){
	var elem = document.getElementById ('SubCategory_'+nodeId);
	if (elem != null){
		elem.style.display="block";		
	}
	var parentElem = document.getElementById ('childLink_'+nodeId);
	if (parentElem != null){
		parentElem.className="selected";		
	}
	var allElem = document.all ? document.all : document.getElementsByTagName('div');
	for (var i=0; i<allElem.length; i++){
		if (allElem[i].id.substr(0,12)=='SubCategory_'
		&& allElem[i].id != 'SubCategory_' + nodeId){
			allElem[i].style.display='none';
		}
	}
	var children = document.getElementById('Links').getElementsByTagName('a');
	for (var i=0; i<children.length; i++){
		if (children[i].id.substr (0,10) == 'childLink_'
			&& children[i].id != 'childLink_' + nodeId){
			children[i].className = 'normal';
		}
	}
}
function getCurrentYear(){
	var d = new Date();
	document.write(d.getUTCFullYear());
}
function getStormPulseMap(){
	document.write('<script src="http://www.stormpulse.com/api/maps/current/?key=b78df16e7ac03bd5f062233d4bdb7881e634bc0c&width=445&height=450&wmode=transparent" type="text/javascript"></script>');
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	if (expiredays == null)
		expiredays = 36500; // approximately 100 years
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+ ";expires="+exdate.toGMTString() + ";path=/";
}

function SwitchLanguage (newLang){
	if (newLang!= ''){
		setCookie('lang', newLang);
		window.location.reload();
	}
}
