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('menu_back1.gif')";
 	document.getElementById("imgL"+m_selected).style.backgroundImage = "url('nav_curve1.jpg')";
	document.getElementById("imgR"+m_selected).style.backgroundImage = "url('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('menu_back1.gif')";
			document.getElementById("imgL"+m_id).style.backgroundImage = "url('nav_curve1.jpg')";
			document.getElementById("imgR"+m_id).style.backgroundImage = "url('nav_curve2.jpg')";
			document.getElementById("imgL"+m_popupid).style.backgroundImage = "menu_back.gif')";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "menu_back.gif')";
 		}
 	}
	 
 	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('menu_back1.gif')";
 	document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('nav_curve1.jpg')";
	document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('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('menu_back.gif')";
 			document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('menu_back.gif')";
			document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('menu_back.gif')";
 		}
 		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://www.josh18.com/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://www.josh18.com/images/mc_common/nav_curve1.jpg')";
		//document.getElementById("imgR"+((m_obj.id).substring(7,8))).style.backgroundImage = "url('http://www.josh18.com/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")
		parent.location = "http://www.josh18.com/";
	else if(m_obj.id == "menuid2")
		parent.location = "http://www.josh18.com/india/news/";
	else if(m_obj.id == "menuid3")
		parent.location = "http://www.josh18.com/india/sports/";
	else if(m_obj.id == "menuid4")
		parent.location = "http://www.josh18.com/india/entertainment/";
	else if(m_obj.id == "menuid5")
		parent.location = "http://www.josh18.com/india/business/";
	else if(m_obj.id == "menuid6")
		parent.location = "http://www.josh18.com/india/livelife/";
	else if(m_obj.id == "menuid7")
		parent.location = "http://www.josh18.com/astrology.html";
	else if(m_obj.id == "menuid8")
		parent.location = "http://www.garamchai.in/";
	else if(m_obj.id == "menuid9")
		parent.location = "http://www.josh18.com/humour.html";
	else if(m_obj.id == "menuid10")
		parent.location = "http://www.josh18.com/literature.html";	
	else if(m_obj.id == "menuid11")
		parent.location = "http://www.josh18.com/photogallery.html";
	else if(m_obj.id == "menuid12")
		parent.location = "http://www.josh18.com/video.html";
		
	//parent.location = "http://www.moneycontrol.com/mccode/video/video.php";
	else if(m_obj.id == "submenu2.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=39";
	else if(m_obj.id == "submenu2.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=40";
	else if(m_obj.id == "submenu2.3")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=101";
	else if(m_obj.id == "submenu2.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=111";
	else if(m_obj.id == "submenu2.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=41";
	
	else if(m_obj.id == "submenu3.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=16";
	else if(m_obj.id == "submenu3.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=412";
	else if(m_obj.id == "submenu3.3")
		parent.location ="http://www.josh18.com/sectionarchive.php?id=121";
	else if(m_obj.id == "submenu3.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=131";
	else if(m_obj.id == "submenu3.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=20";
	else if(m_obj.id == "submenu3.6")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=141";

	else if(m_obj.id == "submenu4.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=26";
	else if(m_obj.id == "submenu4.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=142";
	else if(m_obj.id == "submenu4.3")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=151";
	else if(m_obj.id == "submenu4.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=25";
	else if(m_obj.id == "submenu4.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=161";
	else if(m_obj.id == "submenu4.6")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=24";
		
	else if(m_obj.id == "submenu5.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=32";
	else if(m_obj.id == "submenu5.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=31";
	else if(m_obj.id == "submenu5.3")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=33";
	else if(m_obj.id == "submenu5.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=37";
	else if(m_obj.id == "submenu5.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=212";
	else if(m_obj.id == "submenu5.6")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=30";

	else if(m_obj.id == "submenu6.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=46";
	else if(m_obj.id == "submenu6.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=44";
	else if(m_obj.id == "submenu6.3")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=42";
	else if(m_obj.id == "submenu6.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=171";
	else if(m_obj.id == "submenu6.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=45";
	else if(m_obj.id == "submenu6.6")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=47";	
	else if(m_obj.id == "submenu6.7")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=43";
	else if(m_obj.id == "submenu6.8")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=172";
	else if(m_obj.id == "submenu6.9")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=182";
	else if(m_obj.id == "submenu6.10")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=192";	

	else if(m_obj.id == "submenu7.1")
		parent.location = "http://www.josh18.com/predictions.php?signNm=tab1";
	//else if(m_obj.id == "submenu7.2")
		//parent.location = "sectionarchive.php?id=231";
	else if(m_obj.id == "submenu7.3")
	    parent.location = "http://www.josh18.com/predictions.php?signNm=tab2";
	else if(m_obj.id == "submenu7.4")
		parent.location = "http://www.josh18.com/predictions.php?signNm=tab3";
	else if(m_obj.id == "submenu7.5")
		parent.location = "http://www.josh18.com/chineseAstrology.php";
	else if(m_obj.id == "submenu7.6")
	    parent.location = "http://www.josh18.com/sectionarchive.php?id=261";
	else if(m_obj.id == "submenu7.7")
	    parent.location = "http://www.josh18.com/astro.php";
		
	else if(m_obj.id == "submenu9.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=262";
	else if(m_obj.id == "submenu9.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=272";
	else if(m_obj.id == "submenu9.3")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=281";
	else if(m_obj.id == "submenu9.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=282";
	else if(m_obj.id == "submenu9.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=291";
		
	else if(m_obj.id == "submenu10.1")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=292";
	else if(m_obj.id == "submenu10.2")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=301";
	else if(m_obj.id == "submenu10.3")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=302";
	else if(m_obj.id == "submenu10.4")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=312";
	else if(m_obj.id == "submenu10.5")
		parent.location = "http://www.josh18.com/sectionarchive.php?id=322";
		
	else if(m_obj.id == "submenu11.1")
		parent.location = "http://www.josh18.com/galleryarchive.php?id=7";
	else if(m_obj.id == "submenu11.2")
		parent.location = "http://www.josh18.com/galleryarchive.php?id=3";
	else if(m_obj.id == "submenu11.3")
		parent.location = "http://www.josh18.com/galleryarchive.php?id=2";
	else if(m_obj.id == "submenu11.4")
		parent.location = "http://www.josh18.com/galleryarchive.php?id=0";
		
	else if(m_obj.id == "submenu12.1")
		parent.location = "http://www.josh18.com/videoarchive.php?id=7";
	/*else if(m_obj.id == "submenu12.2")
		parent.location = "http://www.josh18.com/videoarchive.php?id=";*/
	else if(m_obj.id == "submenu12.3")
		parent.location = "http://www.josh18.com/videoarchive.php?id=3";
	else if(m_obj.id == "submenu12.4")
		parent.location = "http://www.josh18.com/videoarchive.php?id=2";
	else if(m_obj.id == "submenu12.5")
		parent.location = "http://www.josh18.com/videoarchive.php?id=0";
}
