var m_show = 0;
var m_popupid = 0;
var m_color = "FFFFFF";
var m_hcolor = "000000";
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('http://202.87.40.52/images/mc_common/nav_on_bg.jpg')";
 	document.getElementById("imgL"+m_selected).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_curve1.jpg')";
	document.getElementById("imgR"+m_selected).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/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('http://202.87.40.52/images/mc_common/nav_off_bg.jpg')";
			document.getElementById("imgL"+m_id).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_curve1.jpg')";
			document.getElementById("imgR"+m_id).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_curve2.jpg')";
			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_off_bg.jpg')";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/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('http://202.87.40.52/images/mc_common/nav_on_bg.jpg')";
 	document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_curve1.jpg')";
	document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/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";
			
			document.getElementById("menuid"+m_popupid).style.color = m_color;
 			document.getElementById("menuid"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_off_bg.jpg')";
 			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/nav_off_bg.jpg')";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('http://202.87.40.52/images/mc_common/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)
{
	var Stamp = new Date();
	var Hours = Stamp.getHours();
	var Mins = Stamp.getMinutes();

	if(m_obj.id == "menuid1")
		window.location = "http://www.moneycontrol.com/newsindia/";
	else if(m_obj.id == "menuid2")
		window.location = "http://www.moneycontrol.com/stocksmarketsindia/";
	else if(m_obj.id == "menuid3")
		window.location = "http://www.moneycontrol.com/mutualfundindia/";
	else if(m_obj.id == "menuid4")
		window.location = "http://www.moneycontrol.com/india/bestportfoliomanager/"+Hours+"/"+Mins+"/marketinvestments";
		//window.location = "http://www.moneycontrol.com/india/bestportfoliomanager/12/10/stockinvestments";
	else if(m_obj.id == "menuid5")
		window.location = "http://www.moneycontrol.com/mccode/services/homebody.php";
	else if(m_obj.id == "menuid6")
		window.location = "http://www.moneycontrol.com/messageboardblogindia/";
	else if(m_obj.id == "menuid7")
		window.location = "http://www.moneycontrol.com/ipo/";
	else if(m_obj.id == "menuid8")
		window.location = "http://wealth.moneycontrol.com";
	else if(m_obj.id == "menuid9")
		window.location = "http://www.moneycontrol.com/trendsindia/";
	else if(m_obj.id == "menuid10")
		window.location = "http://www.moneycontrol.com/news/video/newsvideo.php";	
	else if(m_obj.id == "menuid11")
		window.location = "http://www.moneycontrol.com/mfbuy/";

	//window.location = "http://www.moneycontrol.com/mccode/video/video.php";
	else if(m_obj.id == "submenu2.1")
		window.location = "http://www.moneycontrol.com/stocksmarketsindia/";
	else if(m_obj.id == "submenu2.2")
		window.location = "http://www.moneycontrol.com/mccode/outlook/";
	else if(m_obj.id == "submenu2.3")
		window.location = "http://www.moneycontrol.com/ipo/";
	else if(m_obj.id == "submenu2.4")
		window.location = "http://www.moneycontrol.com/technicals/";
	else if(m_obj.id == "submenu2.5")
	{
		window.open("http://indiaearnings.moneycontrol.com/");
		
	}	
	else if(m_obj.id == "submenu2.6")
		window.location = "http://www.moneycontrol.com/stocks/marketstats/index.php";
	else if(m_obj.id == "submenu2.7")
		window.location = "http://www.moneycontrol.com/mccode/tools/";	
	
	else if(m_obj.id == "submenu3.1")
		window.location = "http://www.moneycontrol.com/mutualfundindia/";
	else if(m_obj.id == "submenu3.2")
		window.location = "http://www.moneycontrol.com/easymf/learn/";
	else if(m_obj.id == "submenu3.3")
		window.location = "http://www.moneycontrol.com/easymf/evaluate/";
	else if(m_obj.id == "submenu3.4")
		window.location = "http://www.moneycontrol.com/easymf/order_forms/order_forms.php";
	else if(m_obj.id == "submenu3.5")
		window.location = "http://www.moneycontrol.com/easymf/track/";
	else if(m_obj.id == "submenu3.6")
		window.location = "http://www.moneycontrol.com/easymf/tools/";
	else if(m_obj.id == "submenu3.7")
		window.location = "http://www.moneycontrol.com/easymf/interact/";	

	else if(m_obj.id == "submenu5.1")
		window.location = "http://www.moneycontrol.com/mccode/services/homebody.php";
	else if(m_obj.id == "submenu5.2")
		window.open("http://www.easymf.com/");
	else if(m_obj.id == "submenu5.3")
		window.open("http://www.poweryourtrade.com/");
	else if(m_obj.id == "submenu5.4")
		window.location = "http://www.moneycontrol.com/pf/queries/queries.php";
	else if(m_obj.id == "submenu5.5")
		window.open ("http://www.moneycontrol.com/cnbctv18/cnbcbestseller/");
	//else if(m_obj.id == "submenu5.6")
		//window.location = "http://www.moneycontrol.com/mccode/services/homebody.php";
	else if(m_obj.id == "submenu5.7")
		window.open("http://homeshop18.com/");

		
	
	else if(m_obj.id == "submenu7.1")
		window.location = "http://www.moneycontrol.com/mccode/games/homebody.php";
	else if(m_obj.id == "submenu7.2")
		window.open("http://iiy.moneycontrol.com");
	else if(m_obj.id == "submenu7.3")
		window.open("http://portfolio.moneycontrol.com/sensexchallenge/greatsensex.php");
	

	else if(m_obj.id == "submenu8.1")
		window.location = "http://wealth.moneycontrol.com/plan.php";
	else if(m_obj.id == "submenu8.2")
		window.location = "http://wealth.moneycontrol.com/invest.php";
	else if(m_obj.id == "submenu8.3")
		window.location = "http://wealth.moneycontrol.com/spend.php";
	else if(m_obj.id == "submenu8.4")
		window.location = "http://wealth.moneycontrol.com/study.php";
	else if(m_obj.id == "submenu8.5")
		window.location = "http://wealth.moneycontrol.com/work.php";			
}

