function ChkImgFile(obj)
{
	var val = obj.value;
	
}

function ChkPpsFile(obj)
{
	var val = obj.value;
	
}

function ShowPhil(id)
{
	var Phil_01 = document.getElementById("Phil_01");
	var Phil_02 = document.getElementById("Phil_02");
	var Phil_03 = document.getElementById("Phil_03");
	var Phil_04 = document.getElementById("Phil_04");
	var Phil_05 = document.getElementById("Phil_05");
	
	if(id=="1")
	{
		Phil_01.style.display = "inline"
		Phil_02.style.display = "none"
		Phil_03.style.display = "none"
		Phil_04.style.display = "none"
		Phil_05.style.display = "none"
	}
	else if(id=="2")
	{
		Phil_01.style.display = "none"
		Phil_02.style.display = "inline"
		Phil_03.style.display = "none"
		Phil_04.style.display = "none"
		Phil_05.style.display = "none"
	}
	else if(id=="3")
	{
		Phil_01.style.display = "none"
		Phil_02.style.display = "none"
		Phil_03.style.display = "inline"
		Phil_04.style.display = "none"
		Phil_05.style.display = "none"
	}
	else if(id=="4")
	{
		Phil_01.style.display = "none"
		Phil_02.style.display = "none"
		Phil_03.style.display = "none"
		Phil_04.style.display = "inline"
		Phil_05.style.display = "none"
	}
	else if(id=="5")
	{
		Phil_01.style.display = "none"
		Phil_02.style.display = "none"
		Phil_03.style.display = "none"
		Phil_04.style.display = "none"
		Phil_05.style.display = "inline"
	}
}
function ShowIndvi(id)
{
	var More = document.getElementById("More");
	var Individual_1 = document.getElementById("Individual_1");
	//var Individual_2 = document.getElementById("Individual_2");
	var Individual_3 = document.getElementById("Individual_3");
	var Individual_4 = document.getElementById("Individual_4");
	//var Individual_5 = document.getElementById("Individual_5");
	
	var Arrow1 = document.getElementById("Arrow1");
	//var Arrow2 = document.getElementById("Arrow2");
	var Arrow3 = document.getElementById("Arrow3");
	var Arrow4 = document.getElementById("Arrow4");
	//var Arrow5 = document.getElementById("Arrow5");
	
	More.style.display = "none";
	if(id==1)
	{
		Individual_1.style.display = "inline";
		//Individual_2.style.display = "none";
		Individual_3.style.display = "none";
		Individual_4.style.display = "none";
		//Individual_5.style.display = "none";
		
		Arrow1.style.display = "inline";
		//Arrow2.style.display = "none";
		Arrow3.style.display = "none";
		Arrow4.style.display = "none";
		//Arrow5.style.display = "none";
	
		document.getElementById("Des1").className = "BlackSubheadBold";
		//document.getElementById("Des2").className = "SubheadBold";
		document.getElementById("Des3").className = "SubheadBold";
		document.getElementById("Des4").className = "SubheadBold";
	//	document.getElementById("Des5").className = "SubheadBold";
	}
	else if	(id==2)
	{
		Individual_1.style.display = "none";
		//Individual_2.style.display = "inline";
		Individual_3.style.display = "none";
		Individual_4.style.display = "none";
		//Individual_5.style.display = "none";
		
		Arrow1.style.display = "none";
		Arrow2.style.display = "inline";
		Arrow3.style.display = "none";
		Arrow4.style.display = "none";
		//Arrow5.style.display = "none";
			
		document.getElementById("Des1").className = "SubheadBold";
		//document.getElementById("Des2").className = "BlackSubheadBold";
		document.getElementById("Des3").className = "SubheadBold";
		document.getElementById("Des4").className = "SubheadBold";
	//	document.getElementById("Des5").className = "SubheadBold";
	}
	else if	(id==3)
	{
		Individual_1.style.display = "none";
		//Individual_2.style.display = "none";
		Individual_3.style.display = "inline";
		Individual_4.style.display = "none";
		//Individual_5.style.display = "none";
		
		Arrow1.style.display = "none";
		//Arrow2.style.display = "none";
		Arrow3.style.display = "inline";
		Arrow4.style.display = "none";
		//Arrow5.style.display = "none";
				
		document.getElementById("Des1").className = "SubheadBold";
		//document.getElementById("Des2").className = "SubheadBold";
		document.getElementById("Des4").className = "SubheadBold";
	//	document.getElementById("Des5").className = "SubheadBold";
		document.getElementById("Des3").className = "BlackSubheadBold";
	}
	else if	(id==4)
	{
		Individual_1.style.display = "none";
		//Individual_2.style.display = "none";
		Individual_3.style.display = "none";
		Individual_4.style.display = "inline";
		//Individual_5.style.display = "none";
		
		Arrow1.style.display = "none";
		//Arrow2.style.display = "none";
		Arrow4.style.display = "inline";
		Arrow3.style.display = "none";
		//Arrow5.style.display = "none";
				
		document.getElementById("Des1").className = "SubheadBold";
		//document.getElementById("Des2").className = "SubheadBold";
		document.getElementById("Des3").className = "SubheadBold";
	//	document.getElementById("Des5").className = "SubheadBold";
		document.getElementById("Des4").className = "BlackSubheadBold";
	}

}
function HideIndvi()
{
	var More = document.getElementById("More");
	var Individual_1 = document.getElementById("Individual_1");
	//var Individual_2 = document.getElementById("Individual_2");
	var Individual_3 = document.getElementById("Individual_3");
	var Individual_4 = document.getElementById("Individual_4");
	//var Individual_5 = document.getElementById("Individual_5");
	
	
	Arrow1.style.display = "none";
	//Arrow2.style.display = "none";
	Arrow3.style.display = "none";
	Arrow4.style.display = "none";
	//Arrow5.style.display = "none";
		
	More.style.display = "inline";
	
	Individual_1.style.display = "none";
	//Individual_2.style.display = "none";
	Individual_3.style.display = "none";
	Individual_4.style.display = "none";
	//Individual_5.style.display = "none";
		
	document.getElementById("Des1").className = "SubheadBold";
	//document.getElementById("Des2").className = "SubheadBold";
	document.getElementById("Des3").className = "SubheadBold";
	document.getElementById("Des4").className = "SubheadBold";
	//document.getElementById("Des5").className = "SubheadBold";
		
}

function ShowYear()
{
	var MonthGrah = document.getElementById("MonthGrah");
	var YearGraph = document.getElementById("YearGraph");
	
	//var MonthTd = document.getElementById("MonthTd");
	//var YearTd = document.getElementById("YearTd");
	
	var MonthOn = document.getElementById("MonthOn");
	var YearOff = document.getElementById("YearOff");
	var MonthOff = document.getElementById("MonthOff");
	var YearOn = document.getElementById("YearOn");
		
		
	//MonthTd.style.display = "none";
	//YearTd.style.display = "inline";	
		
	MonthGrah.style.display = "none";
	YearGraph.style.display = "inline";
	MonthOn.style.display = "none";
	YearOff.style.display = "none";
	MonthOff.style.display = "inline";
	YearOn.style.display = "inline";
}
function ShowMonth()
{
	//var MonthTd = document.getElementById("MonthTd");
	//var YearTd = document.getElementById("YearTd");
	
	var MonthGrah = document.getElementById("MonthGrah");
	var YearGraph = document.getElementById("YearGraph");
	
	var MonthOn = document.getElementById("MonthOn");
	var YearOff = document.getElementById("YearOff");
	var MonthOff = document.getElementById("MonthOff");
	var YearOn = document.getElementById("YearOn");
	
	//MonthTd.style.display = "inline";
	//YearTd.style.display = "none";	
	
	
	MonthGrah.style.display = "inline";
	YearGraph.style.display = "none";
	MonthOn.style.display = "inline";
	YearOff.style.display = "inline";
	MonthOff.style.display = "none";
	YearOn.style.display = "none";
}

function details(sno,secid,subsecid)
 {
	var wind_new;
	wind_new=window.open("../newsdetails.aspx?sno="+sno+"&secid="+secid+"&subsecid="+subsecid+"", "DetailNews", "status = 1, height = 350, width =500, resizable = 0,scrollbars=1,left=200,top=200" )
	wind_new.focus();
 }
function winpopup(strUrl)
{	
	 var strUrl;	
	 var newWin=window.open(strUrl,'MyWindow2','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=1,copyhistory=no,width=580,height=350,screenX=0,screenY=0,left=210,top=200');	
	 newWin.focus();
}	



var tempX = 0;
 var tempY = 0;
 var m_show = 0;
 var f_sc_id = "";
 var f_sc_dispid = "";
 var f_sc_comp = "";
 var f_topic_id = 0;
 var f_buy_id =0;
// smart quotes/buy/ sell/company snapshot/compan/ news/financial summary/chartin
 var m_urls = Array('../profile/CorpInfo.aspx?menu=4&id=8','../profile/CorpInfo.aspx?menu=4&id=9','../profile/CorpInfo.aspx?menu=4&id=10','../profile/CorpInfo.aspx?menu=4&id=15','../profile/CorpInfo.aspx?menu=4&id=13','../profile/CorpInfo.aspx?menu=4&id=16','../profile/CorpInfo.aspx?menu=4&id=14');
 

 //setInterval("hide_popup1()",1000);
 
 var IE = document.all?true:false
 
 if (!IE) document.captureEvents(Event.MOUSEMOVE)
 document.onmousemove = getMouseXY;
 
 function getMouseXY(e) 
 {
 	if(IE)
 	{
 	    tempX = event.clientX + document.body.scrollLeft;
 		tempY = event.clientY + document.body.scrollTop;
 	}
 	else
 	{
 		tempX = e.pageX;
 	    tempY = e.pageY;
 	}
 	return true;
 }
 
 function show_popup1(m_im_id, m_im_shortdesc, m_im_desc, m_ff_desc, m_ff_id, m_fundclass)
 {
 	f_im_id = m_im_id;
 	f_im_shortdesc = m_im_shortdesc;
 	f_im_desc = m_im_desc;
 	f_ff_desc = m_ff_desc;
 	f_ff_id = m_ff_id;
 	f_fundclass = m_fundclass;
 
 	//document.getElementById("head1").innerHTML = " Company Profile " ;
 	document.getElementById("popup").style.left = tempX + "px";
 	document.getElementById("popup").style.top = tempY + "px";
 	document.getElementById("popup").style.visibility = "visible";
 	m_show = 1;
 }
 
 function hide_popup1()
 {
 	if(m_show == 0)
 		document.getElementById("popup").style.visibility = "hidden";
 }
 function id_click(m_id)
 {
 //alert(m_id)
 //alert(m_urls[m_id-1] + "+" + f_im_id);
 	//return false;
 
 	if(m_id == 1)
 		window.location = m_urls[m_id-1]+"&code=" + f_im_id  ;
 	else if(m_id == 2)
 		window.location = m_urls[m_id-1] +"&code=" + f_im_id;
 	else if(m_id == 3)
 		window.location = m_urls[m_id-1] +"&code=" + f_im_id;
 	else if(m_id == 4)
 		window.location = m_urls[m_id-1] +"&code=" + f_im_id;
 	else if(m_id == 5)
 		window.location = m_urls[m_id-1] +"&code=" + f_im_id;
	else if(m_id == 6)
 		window.location = m_urls[m_id-1] +"&code=" + f_im_id;	
	else if(m_id == 7)
 		window.location = m_urls[m_id-1] +"&code=" + f_im_id;
	else
 		window.location = m_urls[m_id-1] + f_im_id;
 
 	
 }
 
 
 function SearchQuote()
	{
		var SrchQuote = document.getElementById("txt_Symbol");
		var PageId = document.getElementById("DD_Quotes").value;
		
		//alert(PageId);
		
		var StrUrl = "CompanySearch.aspx?menu=4&schtxt="+SrchQuote.value+"&id="+PageId;
		
			
		if(SrchQuote.value=="")
		{
			alert("Please enter company name ..!!!");
		}
		else
		{
			window.location = StrUrl;
		}
		
}

function EnterScript(e,id)
{

	if(e.keyCode==13)	
	{
		var Scripid = document.getElementById(id);
		Scripid.click();
	}
}
function EnterScript1(e,id)
{

	if(e.keyCode==13)	
	{
		var Scripid = document.getElementById(id);
		Scripid.click();
	}
}

function EnterScript2(e,id)
{

	if(e.keyCode==13)	
	{
		var Scripid = document.getElementById(id);
		Scripid.click();
	}
}

function Dataempty()
{
if (document.getElementById("txtQuote").value=="Enter Scrip")
{
  	document.getElementById("txtQuote").value="";
 }
}

function Datafill()
{
	var getquote=document.getElementById("txtQuote").value;
	if (getquote=="")
	{
		document.getElementById("txtQuote").value="Enter Scrip";
	}
}

function Userempty()
{
if (document.getElementById("txt_UID").value=="Username")
{
  	document.getElementById("txt_UID").value="";
 }
}

/*function Userfill()
{
	var getquote=document.getElementById("txtName").value;
	if (getquote=="")
	{
		document.getElementById("txtName").value="Username";
	}
}
function Userempty()
{
if (document.getElementById("txtName").value=="Username")
{
  	document.getElementById("txtName").value="";
 }
}
*/
/*function PWDfill()
{
	var getquote=document.getElementById("txtPassword").value;
	if (getquote=="")
	{
		document.getElementById("txtPassword").value="Password";
	}
}
function PWDempty()
{
if (document.getElementById("txtPassword").value=="Password")
{
  	document.getElementById("txtPassword").value="";
 }
}
*/



 function QuoteValidate(PageId)
	{
		var SrchQuote = document.getElementById("txtQuote");
		
		var StrUrl = "Profile/CompanySearch.aspx?menu=4&schtxt="+SrchQuote.value+"&id="+PageId;
		
			
		if((SrchQuote.value=="") ||(SrchQuote.value=="Enter Scrip"))
		{
			alert("Please enter company name ..!!!");
		}
		else
		{
			window.location = StrUrl;
		}
		
}

 function Validate()
	{
		var SrchQuote = document.getElementById("txt_Quote");
		
		var StrUrl = "../Profile/CompanySearch.aspx?menu=4&schtxt="+SrchQuote.value;
		
			
		if((SrchQuote.value=="") ||(SrchQuote.value=="Get Quote"))
		{
			alert("Please enter company name ..!!!");
		}
		else
		{
			window.location = StrUrl;
		}
		
}

function Compempty()
{	

if (document.getElementById("txt_Change").value=="Scrip")
{
  	document.getElementById("txt_Change").value="";
 }
}

function Compfill()
{

	var getquote=document.getElementById("txt_Change").value;
	if (getquote=="")
	{
		document.getElementById("txt_Change").value="Scrip";
	}
}

 function ChangeValidate(id)
	{
		var SrchQuote = document.getElementById("txt_Change");
		
		var StrUrl = "../Profile/CompanySearch.aspx?menu=4&schtxt="+SrchQuote.value+"&id="+id;	
		
			
		if((SrchQuote.value=="") ||(SrchQuote.value=="Change Company"))
		{
			alert("Please enter company name ..!!!");
		}
		else
		{
			window.location = StrUrl;
		}
		
}

 function CompValidate()
	{
		var SrchQuote = document.getElementById("txt_Change");
		
		var StrUrl = "../Profile/CompanySearch.aspx?menu=4&schtxt="+SrchQuote.value;
		
			
		if((SrchQuote.value=="") ||(SrchQuote.value=="Scrip"))
		{
			alert("Please enter company name ..!!!");
		}
		else
		{
			window.location = StrUrl;
		}
		
}



function emptyOne()
{
if (document.getElementById("txt_Quote").value=="Get Quote")
{
  	document.getElementById("txt_Quote").value="";
 }
}

function fillOne()
{
	var getquote=document.getElementById("txt_Quote").value;
	if (getquote=="")
	{
		document.getElementById("txt_Quote").value="Get Quote";
	}
}

function ShowQL()
{
	document.getElementById("QL_On").style.display = "inline";
	document.getElementById("QL_Off").style.display = "none";
	document.getElementById("QuoteSnap").style.display = "inline";
	
}

function HideQL()
{
	document.getElementById("QL_On").style.display = "none";
	document.getElementById("QL_Off").style.display = "inline";
	document.getElementById("QuoteSnap").style.display = "none";
}








function ShowA2Z(redUrl_){
	var A2ZIndexId = document.getElementById("A2Z");
	if(A2ZIndexId.innerHTML==""){
		var A2Z="";
			for(i=65; i<=90; i++)
				A2Z += "<a href='"+ redUrl_ +"&var="+ String.fromCharCode(i) +"'>"+ String.fromCharCode(i) +"</a> <span class='dividerTd'> | </span>";
				A2Z = A2Z.substring(0,A2Z.length -32)
				A2ZIndexId.innerHTML = A2Z;
	}
	else
		A2ZIndexId.innerHTML = "";			
}

function A2ZIndex(Index,Group,id,Opt){
	var A2ZIndexId = document.getElementById("A2ZIndex");
	if(A2ZIndexId.innerHTML==""){
		var A2Z="",A2ZClass ="";
			for(i=65; i<=90; i++)
			{
				var Alpha = String.fromCharCode(i);
				A2ZClass = (Index==Alpha) ? "IndexLinkSel" : "IndexLink";
				A2Z += "<a href='marketinfo.aspx?id="+id+"&Index="+ Alpha +"&Group="+Group+"&Opt="+Opt+"' class="+ A2ZClass +" >"+ Alpha +"</a>";
			}
			A2ZClass = (Index=="0-9") ? "IndexLinkSel" : "IndexLink";	
			A2ZIndexId.innerHTML = A2Z + "<a href='marketinfo.aspx?id="+id+"&Index=0-9&Group="+Group+"&Opt="+Opt+"' class="+ A2ZClass +" >0-9</a>";
	}
	else
		A2ZIndexId.innerHTML = "";
				
	}
	
	
function Favpopup(strUrl)
{	
	 var strUrl;
	 var newWin=window.open(strUrl,'FavWindow','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=0,copyhistory=no,width=580,height=350,screenX=0,screenY=0,left=210,top=200');	
	 newWin.focus();
}	


function trimall(sString) 
			{
				while (sString.substring(0,1) ==" ")
				{
				sString = sString.substring(1, sString.length);
				}
				while (sString.substring(sString.length-1, sString.length) == ' ')
				{
				sString = sString.substring(0,sString.length-1);
				}
				return sString;
			}
function CareerValidate()
{	
	var str1=document.getElementById("txt_Email").value
	var filter1=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	var InputFileId  = document.getElementById("File_Attach");
	var Pfilename = InputFileId.value;
	
	if(trimall(document.getElementById("txt_Name").value) == "")
	{
	alert("Enter Name");
	document.getElementById("txt_Name").focus() 
	return (false);
	} 
	
	if (document.getElementById("txt_Email").value == "")
	  {
	    alert("Please enter a value for the \"E-Mail\" field.");
	    document.getElementById("txt_Email").focus();
	    return (false);  
	  }
	  if (!filter1.test(str1))
		{  
				alert("Invalid E-mail Address! Please re-enter.")
				return (false)
		}	   
	if(document.getElementById("DD_Select").value == "0")
	{
	alert("Select Openings");
	document.getElementById("DD_Select").focus() 
	return (false);
	} 
	if(Pfilename == "")
	{
		alert("Either select Word file");
		InputFileId.focus()
		return false;
	}
	else if(Pfilename != "")
	{
		var i=Pfilename.length;
		i=Pfilename.lastIndexOf('.')+1;
		var ext=Pfilename.substr(i);
		if(ext.toLowerCase()=="doc" || ext.toLowerCase()=="docx")
		return true;
		else
		{
			alert("Select Word File")
			InputFileId.focus()
			return false;
		}
	}
	
}  
function TelCheck(evt) {
    if (evt.keyCode > 31 && (evt.keyCode < 43 || evt.keyCode > 57)) 
	{
        return false;
    }
}




function ContactValidate()
{	
	var str1=document.getElementById("txt_Email").value
	var filter1=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	
	if(document.getElementById("txt_Name").value == "")
	{
	alert("Enter Name");
	document.getElementById("txt_Name").focus() 
	return (false);
	} 
	
	if (document.getElementById("txt_Email").value == "")
	  {
	    alert("Please enter a value for the \"E-Mail\" field.");
	    document.getElementById("txt_Email").focus();
	    return (false);  
	  }
	  if (!filter1.test(str1))
		{  
				alert("Invalid E-mail Address! Please re-enter.")
				return (false)
		}	   
	if(document.getElementById("txt_Phone").value == "")
	{
	alert("Enter Telephone");
	document.getElementById("txt_Phone").focus() 
	return (false);
	}
	if(document.getElementById("txt_Comment").value == "")
	{
	alert("Enter your Comments");
	document.getElementById("txt_Comment").focus() 
	return (false);
	} 
	
	
}  



function Show_Offer(id)
 {
 	var ArrowDown = document.getElementById("ArrowDown");
 	
 	document.getElementById("popup_One").style.visibility = "visible";
 	
 		switch (id)
 		{ 
			case '0' : 
				ArrowDown.src="../images/getinup.gif";	
			break;
			case '1' : 
				ArrowDown.src="../images/intoffer_Up.gif";		
			break; 
			case '4' : 
				ArrowDown.src="../images/smartup.gif";		
			break; 
			case '5' : 
				ArrowDown.src="../images/intfeeddown.gif";	
			break; 
	
			
		} 
}

 function Hide_Offer(id)
 {
 	document.getElementById("popup_One").style.visibility = "hidden";
 	var ArrowDown = document.getElementById("ArrowDown");
 	
 	
 	
 		switch (id)
 		{ 
			case '0' : 
				ArrowDown.src="../images/getindown.gif";	
			break;
			case '1' : 
				ArrowDown.src="../images/intoffer_down.gif";	
			break; 
			case '4' : 
				ArrowDown.src="../images/smartdown.gif";		
			break; 
			case '5' : 
				ArrowDown.src="../images/intfeedup.gif";	
			break; 
		
		} 
 }
 

/*function Show_Offer(id)
 {
 	var ArrowDown = document.ArrowDown.src;
 	var sPop = document.getElementById("popup_One").style.visibility;
 	
 	
 	document.getElementById("popup_One").style.visibility = (sPop!="hidden") ? "hidden":"visible";
 	
 		switch (id)
 		{ 
			case '0' : 
				document.ArrowDown.src= (ArrowDown!="http://www.ei.cmlinks.com/images/getinup.gif") ? "../images/getinup.gif":"../images/getindown.gif";
			break;
			case '1' : 
				document.ArrowDown.src= (ArrowDown!="http://www.ei.cmlinks.com/images/intoffer_Up.gif") ? "../images/intoffer_Up.gif":"../images/intoffer_down.gif";
			break; 
			case '4' : 
				document.ArrowDown.src= (ArrowDown!="http://www.ei.cmlinks.com/images/smartup.gif") ? "../images/smartup.gif":"../images/smartdown.gif";
			break; 
			case '5' : 
				document.ArrowDown.src= (ArrowDown!="http://www.ei.cmlinks.com/images/intfeedup.gif") ? "../images/intfeedup.gif":"../images/intfeeddown.gif";
			break; 
	
			
		} 
}

*/
 
 
 
function ResolutionChk(){
var ScreenWidth = screen.availwidth
	if (ScreenWidth <= 800)
	{
		popup_One.style.left = "587px";
	}
	
}
 
function HomeResolutionChk(){
var ScreenWidth = screen.availwidth
	if (ScreenWidth <= 800)
	{
		AddOn.style.left = "7px";
	}
	
}


function FailMail()
{
	alert("SMTP Connection Failed");
}
/*start here*/
function EnterCode(e)
{	
	if(e.keyCode==13)	
	{
		var boolval = CompValidate();
		if(boolval)
			return true;
		else
			return false;			
	}	
}
function EnterCode1(e)
{	
	if(e.keyCode==13)	
	{
		var boolval = Validate();
		if(boolval)
			return true;
		else
			return false;			
	}	
}
function EnterCode3(e)
{	
	if(e.keyCode==13)	
	{
		var boolval = ChangeValidate();
		if(boolval)
			return true;
		else
			return false;			
	}	
}
function EnterCode4(e)
{	
	if(e.keyCode==13)	
	{
		var boolval = SearchQuote();
		if(boolval)
			return true;
		else
			return false;			
	}	
}
/*End here */
