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://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_on_bg.jpg')";
 	document.getElementById("imgL"+m_selected).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_curve1.jpg')";
	document.getElementById("imgR"+m_selected).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/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://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_off_bg.jpg')";
			document.getElementById("imgL"+m_id).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_curve1.jpg')";
			document.getElementById("imgR"+m_id).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_curve2.jpg')";
			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_off_bg.jpg')";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/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://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_on_bg.jpg')";
 	document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_curve1.jpg')";
	document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/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://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_off_bg.jpg')";
 			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/nav_off_bg.jpg')";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('http://origin-budget2008.moneycontrol.com/images/budget2008_main/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";

}

 
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.open("http://www.moneycontrol.com/newsindia/");
	else if(m_obj.id == "menuid2")
		window.open("http://www.moneycontrol.com/stocksmarketsindia/");
	else if(m_obj.id == "menuid3")
		window.open("http://www.moneycontrol.com/mutualfundindia/");
	else if(m_obj.id == "menuid4")
		window.open("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.open("http://www.moneycontrol.com/mccode/services/homebody.php");
	else if(m_obj.id == "menuid6")
		window.open("http://www.moneycontrol.com/messageboardblogindia/");
	else if(m_obj.id == "menuid7")
		window.open("http://www.moneycontrol.com/ipo/");
	else if(m_obj.id == "menuid8")
		window.open("http://www.moneycontrol.com/personalfinanceindia/");
	else if(m_obj.id == "menuid9")
		window.open("http://www.moneycontrol.com/trendsindia/");
	else if(m_obj.id == "menuid10")
		window.open("http://www.moneycontrol.com/news/video/newsvideo.php");
	else if(m_obj.id == "menuid11")
		window.open("http://origin-budget2008.moneycontrol.com/unionbudget2008/"+Hours+"/"+Mins);

	//window.location = "http://www.moneycontrol.com/mccode/video/video.php";
	else if(m_obj.id == "submenu2.1")
		window.open("http://www.moneycontrol.com/stocksmarketsindia/");
	else if(m_obj.id == "submenu2.2")
		window.open("http://www.moneycontrol.com/mccode/outlook/");
	else if(m_obj.id == "submenu2.3")
		window.open("http://www.moneycontrol.com/ipo/");
	else if(m_obj.id == "submenu2.4")
		window.open("http://www.moneycontrol.com/technicals/");
	else if(m_obj.id == "submenu2.5")
	{
		window.open("http://www.indiaearnings.com/");
		
	}	
	else if(m_obj.id == "submenu2.6")
		window.open("http://www.moneycontrol.com/stocks/marketstats/index.php");
	else if(m_obj.id == "submenu2.7")
		window.open("http://www.moneycontrol.com/mccode/tools/");	
	
	else if(m_obj.id == "submenu3.1")
		window.open("http://www.moneycontrol.com/mutualfundindia/");
	else if(m_obj.id == "submenu3.2")
		window.open("http://www.moneycontrol.com/easymf/learn/");
	else if(m_obj.id == "submenu3.3")
		window.open("http://www.moneycontrol.com/easymf/evaluate/");
	else if(m_obj.id == "submenu3.4")
		window.open("http://www.moneycontrol.com/easymf/order_forms/order_forms.php");
	else if(m_obj.id == "submenu3.5")
		window.open("http://www.moneycontrol.com/easymf/track/");
	else if(m_obj.id == "submenu3.6")
		window.open("http://www.moneycontrol.com/easymf/tools/");
	else if(m_obj.id == "submenu3.7")
		window.open("http://www.moneycontrol.com/easymf/interact/");

	else if(m_obj.id == "submenu5.1")
		window.open("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.open("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.open("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.open("http://www.moneycontrol.com/personalfinanceindia/");
	else if(m_obj.id == "submenu8.2")
		window.open("http://www.moneycontrol.com/taxpage/");
	else if(m_obj.id == "submenu8.3")
		window.open("http://www.moneycontrol.com/pf/queries/queries.php");
	else if(m_obj.id == "submenu8.4")
		window.open("http://www.moneycontrol.com/insuranceindia/");
	else if(m_obj.id == "submenu8.5")
		window.open("http://www.moneycontrol.com/property/");
	else if(m_obj.id == "submenu8.6")
		window.open("http://www.moneycontrol.com/loans/index.php");
	else if(m_obj.id == "submenu8.7")
		window.open("http://www.moneycontrol.com/cards/homepage/index.php");
	else if(m_obj.id == "submenu8.8")
		window.open("http://www.moneycontrol.com/fixedincome/index.php");
	else if(m_obj.id == "submenu8.9")
		window.open("http://www.moneycontrol.com/mccode/expert/");	
	else if(m_obj.id == "submenu8.10")
		window.open("http://www.moneycontrol.com/planning_desk/index.php");	
}
