var doMenu = true;

function SelectPage (menu_id, sub_menu, sub_menu_id)
{
	try
	{
		var menu = document.getElementById(menu_id);
		menu.className = "menu1On";
		if (sub_menu != "")
		{
			var sub_menu = document.getElementById(sub_menu);
			sub_menu.className = "show";
		}
		if (sub_menu_id != "")
		{
			var sub_menu_2 = document.getElementById(sub_menu_id);
			sub_menu_2.className = "menu2On";
		}
	}
	catch (e) {}
}


function showHide(theid, secondid)
{
	if (document.getElementById)
	{
		try
		{
			var switch_id = document.getElementById(theid);
			var topSwitch_id = document.getElementById(theid+'top');
			var second_id = document.getElementById(secondid);

			if(typeof(switch_id)=='object' && switch_id!=null){
				if(switch_id.className != 'show') {
//				   switch_id.className = 'show';
				}
			}

			topSwitch_id.className = 'menu1On';

			if(typeof(second_id)=='object' && second_id!=null){
				second_id.className = 'menu2On';
			}
		} catch (e) {}
    }
}

function showSub(theid)
{
	if (doMenu)
	{
		var switch_id = document.getElementById(theid);
		if (typeof(switch_id)=='object' && switch_id!=null)
		{
			switch_id.className = 'show';
		}
	}
}

function hideSub(theid)
{
	if (doMenu)
	{
		var switch_id = document.getElementById(theid);
		if (typeof(switch_id)=='object' && switch_id!=null)
		{
			switch_id.className = 'hide';
		}
	}
}

function isObject(a){
     return(typeof(a)=='object');
}



	function changeLanguage(val){
		if(val.value!='this'){
			var uri = new Object();
			getURL(uri);
			if(val.value=='fr'){
				window.location=uri.dir+'/fr/'+uri.page+'.'+uri.ext;
			}else{
				window.location=uri.dir.substr(0,uri.dir.length-2)+uri.page+'.'+uri.ext;
			}	
		}
	}
	
	// Current Page Reference
	// copyright Stephen Chapman, 1st Jan 2005
	// you may copy this function but please keep the copyright notice with it
	function getURL(uri) {
	uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
	uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
	uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
	uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
	pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
	pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
	uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
	uri.file = uri.page;
	if (uri.ext != '') uri.file += '.' + uri.ext;
	if (uri.file == '') uri.page = 'index';
	uri.args = location.search.substr(1).split("?");
	return uri;
	}
	
	
