var m_show = 0;
var m_popupid = 0;
var m_color = "999999";
var m_hcolor = "ffffff";
var m_scolor = "0E3F6E";
//var m_selected = "2"
setInterval("hide_popup()",10);

function init()
{
	document.getElementById("popup"+m_selected).style.display = "block";
 	document.getElementById("menuid"+m_selected).style.color = m_hcolor;
 	document.getElementById("menuid"+m_selected).style.textDecoration = "none";
 	document.getElementById("menuid"+m_selected).style.backgroundImage = "url(images/nav_on_bg.jpg)";
 	document.getElementById("imgL"+m_selected).style.backgroundImage = "url(images/nav_curve1.jpg)";
	document.getElementById("imgR"+m_selected).style.backgroundImage = "url(images/nav_curve2.jpg)";
}

function show_popup(m_id)
 {
 	if(m_popupid > 0)
 	{
 		if(m_popupid != m_selected)
 		{
			//alert(m_id);
			document.getElementById("popup"+m_popupid).style.display = "none";
 			document.getElementById("menuid"+m_popupid).style.color = m_color;
			document.getElementById("menuid"+m_popupid).style.textDecoration = "none";
			document.getElementById("menuid"+m_popupid).style.backgroundImage = "url(images/nav_off_bg.jpg)";
			document.getElementById("imgL"+m_id).style.backgroundImage = "url(images/nav_curve1.jpg)";
			document.getElementById("imgR"+m_id).style.backgroundImage = "url(images/nav_curve2.jpg)";
			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url(images/nav_off_bg.jpg)";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url(images/nav_off_bg.jpg)";
 		}
 	}
	 
 	m_popupid = m_id;	
	document.getElementById("popup"+m_selected).style.display = "none";
	document.getElementById("popup"+m_popupid).style.display = "block";
 	document.getElementById("menuid"+m_popupid).style.color = m_hcolor;
 	document.getElementById("menuid"+m_popupid).style.textDecoration = "none";
 	document.getElementById("menuid"+m_popupid).style.backgroundImage = "url(testhtm/images/nav_on_bg.jpg)";
 	document.getElementById("imgL"+m_popupid).style.backgroundImage = "url(testhtm/images/nav_curve1.jpg)";
	document.getElementById("imgR"+m_popupid).style.backgroundImage = "url(testhtm/images/nav_curve2.jpg)";
 	m_show = 1;
	
 }

function hide_popup()
 {
 	if(m_show == 0 && m_popupid > 0)
 	{
 		if(m_popupid != m_selected)
 		{
			document.getElementById("popup"+m_selected).style.display = "block";
	 		document.getElementById("popup"+m_popupid).style.display = "none";
			if(m_popupid==7)
				document.getElementById("menuid"+m_popupid).style.color = "#999999";
			else
				document.getElementById("menuid"+m_popupid).style.color = m_color;
 			document.getElementById("menuid"+m_popupid).style.backgroundImage = "url(images/nav_off_bg.jpg)";
 			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url(images/nav_off_bg.jpg)";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url(images/nav_off_bg.jpg)";
 		}
 		document.getElementById("menuid"+m_popupid).style.textDecoration= "none";
 		m_popupid = 0;
 	}
 }

function mouse_over(m_obj)
{
	m_obj.style.textDecoration= "underline";
	if((m_obj.id).substring(0,8) != "submenu")
	{
		//m_obj.style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_on_bg.jpg')";
		//alert("imgL"+((m_obj.id).substring(7,8)));
		//document.getElementById("imgL"+((m_obj.id).substring(7,8))).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_curve1.jpg')";
		//document.getElementById("imgR"+((m_obj.id).substring(7,8))).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_curve2.jpg')";
	}
}

 
function mouse_out(m_obj)
{
	m_obj.style.textDecoration= "none";
}

function mouse_click(m_obj)
{
	if(m_obj.id == "menuid1")
		window.location = "http://peninsula.co.in/index.php";
	

	/*else if(m_obj.id == "submenu1.1")
		window.location = "/india/news/stockmarket/business/"+hr+"/"+min+"/3";
	else if(m_obj.id == "submenu1.2")
		window.location = "/india/news/stockmarket/markets/"+hr+"/"+min+"/11";
	else if(m_obj.id == "submenu1.3")
		window.location = "/india/news/stockmarket/economy/"+hr+"/"+min+"/26";
	else if(m_obj.id == "submenu1.4")
		window.location = "/india/news/stockmarket/politics/"+hr+"/"+min+"/25";
	else if(m_obj.id == "submenu1.6")
		window.location = "/india/news/stockmarket/interviews/"+hr+"/"+min+"/33";
	else if(m_obj.id == "submenu1.7")
	{
		window.open("http://www.indiaearnings.com/");
		//window.location = "/india/news/stockmarket/companyresults/"+hr+"/"+min+"/27";
	}
	else if(m_obj.id == "submenu1.8")
		window.location = "/india/news/stockmarket/sports/"+hr+"/"+min+"/103";
	else if(m_obj.id == "submenu1.9")
		window.location = "/india/news/stockmarket/worldnews/"+hr+"/"+min+"/104";
	else if(m_obj.id == "submenu1.10")
		window.location = "/india/news/stockmarket/currentaffairs/"+hr+"/"+min+"/105";
	else if(m_obj.id == "submenu1.11")
		window.location = "/india/news/stockmarket/pressreleases/"+hr+"/"+min+"/40";
	else if(m_obj.id == "submenu1.12")
		window.open("/survey/football_survey.php?con=full");*/

	if(m_obj.id == "menuid1")
		window.location = "http://peninsula.co.in/index.php";
		
	else if(m_obj.id == "menuid2")
		window.location = "http://peninsula.co.in/aboutus/about.php";
	else if(m_obj.id == "submenu2.1")
		window.location = "http://peninsula.co.in/aboutus/about.php";
	else if(m_obj.id == "submenu2.2")
		window.location = "http://peninsula.co.in/aboutus/our_vision.php";
	else if(m_obj.id == "submenu2.3")
		window.location = "http://peninsula.co.in/aboutus/comp_history.php";
	else if(m_obj.id == "submenu2.4")
		window.location = "http://peninsula.co.in/aboutus/comp_vision.php";
	else if(m_obj.id == "submenu2.5")
		window.location = "http://peninsula.co.in/aboutus/comp_value.php";
	
	else if(m_obj.id == "menuid3")
		window.location = "http://peninsula.co.in/company/comp.php";
	else if(m_obj.id == "submenu3.1")
		window.location = "http://peninsula.co.in/company/landlimited/comp_pll.php";
	else if(m_obj.id == "submenu3.2")
		window.location = "http://peninsula.co.in/company/facility/comp_facility.php";
	else if(m_obj.id == "submenu3.3")
		window.location = "http://peninsula.co.in/company/realtyfund/comp_fund.php";
	
	else if(m_obj.id == "menuid4")
		window.location = "http://peninsula.co.in/projects/projects.php";
	else if(m_obj.id == "submenu4.1")
		window.location = "http://peninsula.co.in/projects/retail/retail.php";
	else if(m_obj.id == "submenu4.2")
		window.location = "http://peninsula.co.in/projects/commercial/peninsula.php";
	else if(m_obj.id == "submenu4.3")
		window.location = "http://peninsula.co.in/projects/residential/ashok.php";
	
	/*else if(m_obj.id == "submenu4.1")
		window.location = "/easymf/evaluate/";
	else if(m_obj.id == "submenu4.2")
		window.location = "/easymf/evaluate/";*/
/*else if(m_obj.id == "menuid4")
		window.location = "http://peninsula.co.in/projects/projects.php";
	else if(m_obj.id == "submenu4.1")
		window.location = "http://www.peninsula.co.in/crossroads.htm";
	else if(m_obj.id == "submenu4.2")
		window.open = "http://www.peninsula.co.in/peninsula.htm";
	else if(m_obj.id == "submenu4.3")
		window.open = "http://www.peninsula.co.in/ashok.htm";
	
	
	/*else if(m_obj.id == "submenu6.1")
		window.location = "/india/messageboardblog/msgboard/"+hr+"/"+min+"/category/Stocks";
	else if(m_obj.id == "submenu6.2")
		window.location = "/india/messageboardblog/viewtradingtips/"+hr+"/"+min+"/stocktips";	
	else if(m_obj.id == "submenu6.13")
		window.open("/cnbctv18/cnbcbestseller/");*/
	
else if(m_obj.id == "menuid5")
		window.location = "http://peninsula.co.in/newsevents/news.php";
	else if(m_obj.id == "submenu5.1")
		window.location = "http://peninsula.co.in/newsevents/grouprelated_news/news_company.php";
	else if(m_obj.id == "submenu5.2")
		window.location = "http://peninsula.co.in/newsevents/realestatenews/news_general.php";
	else if(m_obj.id == "submenu5.3")
	window.location = "http://peninsula.co.in/newsevents/newspress/news_press.php";
	else if(m_obj.id == "submenu5.4")
		window.location = "http://peninsula.co.in/newsevents/archives/archives.php";
		
else if(m_obj.id == "menuid6")
		window.location = "http://peninsula.co.in/buyersguide/buyer.php";
	else if(m_obj.id == "submenu6.1")
		window.location = "http://peninsula.co.in/buyersguide/residential.php";
	else if(m_obj.id == "submenu6.2")
		window.location = "http://peninsula.co.in/buyersguide/commercial_sez.php";
	else if(m_obj.id == "submenu6.3")
		window.location = "http://peninsula.co.in/buyersguide/buyer_stampduty.php";
	else if(m_obj.id == "submenu6.4")
		window.location = "http://peninsula.co.in/buyersguide/buyer_nri.php";

else if(m_obj.id == "menuid7")
		window.location = "http://peninsula.co.in/career/careers.php";
		else if(m_obj.id == "submenu7.1")
		window.location = "http://peninsula.co.in/career/careers_currentjob.php";
		
	else if(m_obj.id == "menuid8")
		window.location = "http://peninsula.co.in/contact/contact.php";	
}