function hightlight(containerId) {
	if (containerId.length > 0) {	
		var container = document.getElementById(containerId);
		container.className = "tab_selected";
	}
//container.title = "hello";
}
function hightlight_top(containerId) {
	if (containerId.length > 0) {
		var container = document.getElementById(containerId);
		container.className = "topsubmenu";
	}
}
function setimage(cid, iurl) {
        var tab = document.getElementById(cid);
        if (tab == undefined) alert('Cant find tab '+cid);

		document[cid].src = iurl;
		//var img = document.getElementById(cid);
		//img.src = iurl;			
}
function hidemenu(num) {
		var cid;
		cid = "submenuwrapper"+num;	
		var ctl = document.getElementById(cid);	
		ctl.style.display = "none";
}

function setmenu2(num) {
		var cid;
		cid = "submenuwrapper"+num;	
		var ctl = document.getElementById(cid);	
		ctl.style.display = "inline";
		//ctl.className = "submenuwrapper_show";
		//ctl.setAttribute( 'style', 'display:inline' );
}
function PI_setmenu() {

	var mselect = [
		[ '', '', 0 ],	
		[ 'default.aspx', '', 0 ],
		[ 'Default.aspx', '', 0 ],
		
		[ 'why_insure_your_pet.html', 'why_insure_your_pet', 1 ],
		[ 'how_it_works.html', 'how_it_works', 1 ],
		[ 'why_bow_wow_meow.html', 'why_bow_wow_meow', 1 ],
		[ 'qna.html', 'qna', 1 ],
		[ 'why_insure_your_pet.aspx', 'why_insure_your_pet', 1 ],
		[ 'how_it_works.aspx', 'how_it_works', 1 ],
		[ 'why_bow_wow_meow.aspx', 'why_bow_wow_meow', 1 ],
		[ 'qna.aspx', 'qna', 1 ],

		[ 'choosing_the_right_plan.html', 'why_insure_your_pet', 2 ],
		[ 'get_a_quote.html', 'get_a_quote', 2 ],		
		[ 'choosing_the_right_plan.aspx', 'why_insure_your_pet', 2 ],
		[ 'get_a_quote.aspx', 'get_a_quote', 2 ],		
		
		[ 'how_to_contact_us.html', 'how_to_contact_us', 3 ],
		[ 'make_a_claim.html', 'make_a_claim', 3 ],		
		[ 'downloads.html', 'downloads', 3 ],		
		[ 'how_to_contact_us.aspx', 'how_to_contact_us', 3 ],
		[ 'make_a_claim.aspx', 'make_a_claim', 3 ],		
		[ 'subscribe.aspx', 'subscribe', 3 ],
        [ 'downloads.aspx', 'downloads', 3 ],		

		[ 'vet_info.html', '', 4 ],
		[ 'vet_info.aspx', '', 4 ]
	]; 


	var sPath = window.location.pathname;
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	var menu = 1;

	for (var i=0; i<mselect.length; i++) {
		if (sPage == mselect[i][0]) {
			hightlight( mselect[i][1] );
			menu = parseInt( mselect[i][2] );
		}
	}
	
    hidemenu(0);

		setmenu2(menu);

		if (menu == 0) {
			setimage('i_home','images/button_home_on.png');			
		}		
		if (menu == 1) {
			setimage('i_learnmore','images/button_learnmore_on.png');			
		}
		if (menu == 2) {
			setimage('i_chooseaplan','images/button_chooseaplan_on.png');	
		}
		if (menu == 3) {
			setimage('i_customerservice','images/button_customerservice_on.png');	
		}
		if (menu == 4) {
			setimage('i_vetinfo','images/button_vetinfo_on.png');
		}
	return;
}
