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 view(){
	var str=document.getElementById('img').src;
	if(str.indexOf('right_down')!=-1){
	document.all('photo').style.display="";
	str=str.replace('right_down','right_up');
	document.getElementById('img').src=str;
	}else{
		document.all('photo').style.display="none";
		str=str.replace('right_up','right_down');
		document.getElementById('img').src=str;
	}
}

function viewAttachments(){
	var str=document.getElementById('img1').src;
	if(str.indexOf('right_down')!=-1){
	document.all('Attachments').style.display="";
	str=str.replace('right_down','right_up');
	document.getElementById('img1').src=str;
	}else{
		document.all('Attachments').style.display="none";
		str=str.replace('right_up','right_down');
		document.getElementById('img1').src=str;
	}
}

function viewpPerson(){
	var sta=document.getElementById('checkPer').checked;
	if(sta){
		document.all('Person').style.display="";
	}else{
		document.all('Person').style.display="none";
	}
}

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_bg11.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_bg1.jpg')";
			//document.getElementById("menuid"+m_popupid).style.backgroundcolor = "888888";
			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('images/nav_on_bg.jpg')";
 	document.getElementById("imgL"+m_popupid).style.backgroundImage = "url('images/nav_curve1.jpg')";
	document.getElementById("imgR"+m_popupid).style.backgroundImage = "url('images/nav_curve2.jpg')";
 	m_show = 1;
	if(m_popupid == m_selected)
 		{
			document.getElementById("menuid"+m_popupid).style.backgroundImage = "url('images/nav_on_bg11.jpg')";
		}

 }

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('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";
	//m_obj.style.backgroundcolor = "red";
	//m_obj.style.backgroundImage = "url('images/nav_on_bg.jpg')";
	//m_obj.style.backgroundImage = "url('images/textback.jpg')";
	//m_obj.style.backgroundImage = "url('images/nav_on_bg.jpg')";
	/*if((m_obj.id).substring(0,8) != "submenu")
	{*/
		//m_obj.style.backgroundImage = "url('images/nav_on_bg.jpg')";
		//alert("imgL"+((m_obj.id).substring(7,8)));
		//document.getElementById("imgL"+((m_obj.id).substring(7,8))).style.backgroundImage = "url('images/nav_curve1.jpg')";
		//document.getElementById("imgR"+((m_obj.id).substring(7,8))).style.backgroundImage = "url('images/nav_curve2.jpg')";
	//}
}


function mouse_out(m_obj)
{
	//m_obj.style.textDecoration= "none";
		m_obj.style.backgroundImage = "url('images/top_nav_bg2.jpg')";

}

function mouse_click(m_obj)
{
		//document.getElementById("menuid"+m_obj).style.backgroundImage = "url('images/nav_on_bg.jpg')";

	if(m_obj.id == "menuid1")
		window.location = "indexmid.php";
	else if(m_obj.id == "menuid2")
		window.location = "new_search.php?type=1";
	else if(m_obj.id == "menuid3")
		window.location = "mylist.php";
	else if(m_obj.id == "menuid4")
		window.location = "new_experts.php";
	else if(m_obj.id == "menuid5")
		window.location = "dash.php";
	else if(m_obj.id == "menuid6")
		window.location = "pageus1.php?id=3";
	else if(m_obj.id == "menuid7")
		window.location = "Corporate/";
	else if(m_obj.id == "menuid8")
		window.location = "pageus2.php?id=13";


	else if(m_obj.id == "menuid9")
		window.location = "accbuyer.php";
	//else if(m_obj.id == "menuid10")
		//window.location = "http://www.moneycontrol.com/mccode/video/video.php";
	//else if(m_obj.id == "menuid11")
		//window.location = "http://www.moneycontrol.com/pf/queries/queries.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");*/

	else if(m_obj.id == "submenu2.1")
		window.location = "new_search.php?type=1&t=<?=$t?>";
	else if(m_obj.id == "submenu2.2")
		window.location = "new_search.php?type=2&t=<?=$t?>";
	else if(m_obj.id == "submenu2.3")
		window.location = "new_search.php?type=3&t=<?=$t?>";
	else if(m_obj.id == "submenu2.4")
		window.location = "new_search.php?type=4&t=<?=$t?>";
	else if(m_obj.id == "submenu2.5")
		window.location = "new_search.php?type=5&t=<?=$t?>";
	else if(m_obj.id == "submenu2.6")
		window.location = "new_search.php?type=6&t=<?=$t?>";
	else if(m_obj.id == "submenu2.7")
		window.location = "new_search.php?type=7&t=<?=$t?>";
	else if(m_obj.id == "submenu2.8")
		window.location = "new_search.php?type=8&t=<?=$t?>";
	else if(m_obj.id == "submenu2.9")
	{
		window.open("#");

	}

	else if(m_obj.id == "submenu3.1")
		window.location = "business_listing_feature.php";
	else if(m_obj.id == "submenu3.2")
		window.location = "feature.php";
	else if(m_obj.id == "submenu3.3")
		window.location = "large_business_feature.php";
	else if(m_obj.id == "submenu3.4")
		window.location = "franchise_feature.php";
	else if(m_obj.id == "submenu3.5")
		window.location = "investmentbusiness_listing_feature.php";
	else if(m_obj.id == "submenu3.6")
		window.location = "assets_feature.php";
	else if(m_obj.id == "submenu3.7")
		window.location = "internationallarge_business_feature.php";
	else if(m_obj.id == "submenu3.8")
		window.location = "internationalfeature.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 == "submenu5.1")
		window.location = "#";
	else if(m_obj.id == "submenu5.2")
		window.open("#");
	else if(m_obj.id == "submenu5.3")
		window.open("#");
	else if(m_obj.id == "submenu5.4")
		window.location = "#";
	else if(m_obj.id == "submenu5.5")
		window.open ("#");
	//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("#");



	/*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 == "submenu7.1")
		window.location = "#";
	else if(m_obj.id == "submenu7.5")
		window.location = "#";
		else if(m_obj.id == "submenu7.2")
		window.location = "#";
	else if(m_obj.id == "submenu7.3")
		window.location = "#";
	else if(m_obj.id == "submenu7.6")
		window.location = "#";
	else if(m_obj.id == "submenu7.4")
		window.open("#");


	else if(m_obj.id == "submenu8.1")
		window.location = "#";
	else if(m_obj.id == "submenu8.2")
		window.location = "#";
	else if(m_obj.id == "submenu8.3")
		window.location = "#";
	else if(m_obj.id == "submenu8.4")
		window.location = "#";
	else if(m_obj.id == "submenu8.5")
		window.location = "#";
	else if(m_obj.id == "submenu8.6")
		window.location = "#";
	else if(m_obj.id == "submenu8.7")
		window.location = "#";
	else if(m_obj.id == "submenu8.8")
		window.location = "#";
	else if(m_obj.id == "submenu8.9")
		window.location = "#";
	else if(m_obj.id == "submenu8.10")
		window.location = "#";




	/*else if(m_obj.id == "submenu9.1")
		window.open("/cnbctv18/cnbcbestseller/");
	else if(m_obj.id == "submenu10.1")
		window.open("http://www.tv18online.com","tv18");
	else if(m_obj.id == "submenu10.2")
		window.open("http://cnbc-tv18.moneycontrol.com/cnbc/homebodycnbc.php","cnbc_tv18");
	else if(m_obj.id == "submenu10.3")
		window.open("http://www.tv18online.com/awaaz.html","awaaz");
	else if(m_obj.id == "submenu10.4")
		window.open("http://www.southasiaworld.tv","saw");
	else if(m_obj.id == "submenu10.5")
		window.open("http://www.ibnlive.com","ibnlive");
	else if(m_obj.id == "submenu10.7")
		window.open("http://cnbcwatch.moneycontrol.com","cnbcwatch");
	else if(m_obj.id == "submenu10.8")
		window.open("http://poweryourtrade.com","poweryourtrade");*/
}

function check_state(){
  if(document.form1.t6.value!='United States'){
			document.getElementById('td_state').style.display="none";
			document.getElementById('td_select').style.display="none";
			document.getElementById('state1').style.display="none";
			document.getElementById('td_list').style.display="none";
			document.getElementById('state_separator').style.display="none";
 }
  else{
		document.getElementById('td_state').style.display="block";
		document.getElementById('td_select').style.display="block";
		document.getElementById('state1').style.display="block";
		document.getElementById('td_list').style.display="block";
	   document.getElementById('state_separator').style.display="block";
  }
}
