﻿function ShowChart_Profit_Inner(FinCode,Exchg){document.getElementById("ChartBSEPR"+FinCode).className="HomeProfitBold";document.getElementById("ChartNSEPR"+FinCode).className="HomeProfitBold";document.getElementById("Chart"+Exchg+"PR"+FinCode).className="GeneralYellowBold";var so=new SWFObject("../amline/amline.swf","SnapChart_settings","220","170","1","#ECECEC");so.addVariable("path","../amline/");so.addVariable("settings_file",encodeURIComponent("../LiveHome/ProfitExcgChart.xml"));so.addVariable("data_file",encodeURIComponent("../LiveHome/ProfitExcgChart.aspx?timenow="+new Date().getTime()+"&FinCode="+FinCode+"&period=1Y&Exchg="+Exchg));so.write("flashcontentPro"+FinCode);}var XmlHttpGridDetails;function CreateXmlHttpGridDetails(){try{XmlHttpGridDetails=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{XmlHttpGridDetails=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){XmlHttpGridDetails=null;}}if(!XmlHttpGridDetails&&typeof XMLHttpRequest!="undefined"){XmlHttpGridDetails=new XMLHttpRequest();}}function GridDetailsWindow(TdDetails,FinCode,Exchg,rowid,type){var requestUrl
CreateXmlHttpGridDetails();var currentDivObj=document.getElementById(TdDetails);currentDivObj.innerHTML="<img src=../App_Themes/Images/loader.gif />";document.body.style.cursor="progress";if(type=='EQ'){requestUrl="../LiveHome/ProfitMatrixGridDetails.aspx?FinCode="+FinCode+"&Exchg="+Exchg+"&rowid="+rowid;}if(type=='MF'){requestUrl="../LiveHome/MFDetailsView.aspx?SchemeCode="+FinCode+"&Exchg="+Exchg+"&rowid="+rowid;}if(type=='COMM'){requestUrl="../LiveHome/COMMDetailsView.aspx?Symbol="+FinCode+"&Exchg="+Exchg+"&rowid="+rowid;}if(XmlHttpGridDetails!=null){XmlHttpGridDetails.onreadystatechange=function(){ChangeResponseGridDetails(TdDetails,FinCode,Exchg,type)};XmlHttpGridDetails.open('GET',requestUrl,true);XmlHttpGridDetails.send(null);}return false;}function ChangeResponseGridDetails(TdDetails,FinCode,Exchg,type){if(XmlHttpGridDetails.readyState==4){var td_Id=document.getElementById(TdDetails);if(XmlHttpGridDetails.status==200){td_Id.innerHTML=XmlHttpGridDetails.responseText;document.body.style.cursor="auto";if(type=='EQ'){ShowChart_Profit_Inner(FinCode,Exchg);}if(type=='MF'){MFChart(FinCode,'1M','RAW');}if(type=='COMM'){ComChart(FinCode);}}else{td_Id.innerHTML="There was a problem retrieving data from the server.";document.body.style.cursor="auto";}}}var XmlHttpFO;function CreateXmlHttpEye(){try{XmlHttpEye=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{XmlHttpEye=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){XmlHttpEye=null;}}if(!XmlHttpEye&&typeof XMLHttpRequest!="undefined"){XmlHttpEye=new XMLHttpRequest();}}function NewPopupEye(NewsID,NewsDate,NewsType,FinCode){document.body.style.cursor="progress";var requestUrl="../LiveHome/NewsDetails.aspx?FinCode="+FinCode+"&timeStamp="+new Date().getTime()+"&NewsID="+NewsID+"&NewsDate="+NewsDate+"&NewsType="+NewsType;CreateXmlHttpEye();if(XmlHttpEye){XmlHttpEye.onreadystatechange=function(){getNewsRespEye()};XmlHttpEye.open("GET",requestUrl,true);XmlHttpEye.send(null);}}function getNewsRespEye(){if(XmlHttpEye.readyState==4){var td_Id=document.getElementById("divNews").style.display="";document.getElementById("divNews").style.top=tempY+"px";if(XmlHttpEye.status==200){document.getElementById("TDNews").innerHTML=XmlHttpEye.responseText;document.body.style.cursor="auto";}else{td_Id.innerHTML="There was a problem retrieving data from the server.";document.body.style.cursor="auto";}}}function ShowdetailsFull(rowid,FinCode,Exchg,Cnt){var GridId,GridPlusID,GridMinusID;for(i=10;i<=Cnt;i++){GridId="Griddetails"+i;GridPlusID="Grid1Plus"+i;GridMinusID="Grid1Minus"+i;if(i==rowid){document.getElementById(GridId).style.display="";document.getElementById(GridPlusID).style.display="none";document.getElementById(GridMinusID).style.display="";}else{document.getElementById(GridId).style.display="none";document.getElementById(GridPlusID).style.display="";document.getElementById(GridMinusID).style.display="none";}}var tdet="Griddetails"+rowid;GridDetailsWindow(tdet,FinCode,Exchg,rowid,type);}function Showdetails1(rowid,FinCode,Exchg,Cnt,type){var GridId,GridPlusID,GridMinusID,GID,GPID;var tdet;if(type=='EQ'){GID="Griddetails";GPID="Grid1";tdet="Griddetails"+rowid;};if(type=='MF'){GID="GridMFdetails";GPID="Grid1MF";tdet="GridMFdetails"+rowid;};if(type=='COMM'){GID="GridCOMMdetails";GPID="Grid1COMM";tdet="GridCOMMdetails"+rowid;}for(i=10;i<=Cnt-1;i++){GridId=GID+i;GridPlusID=GPID+"Plus"+i;GridMinusID=GPID+"Minus"+i;if(i==rowid){document.getElementById(GridId).style.display="";document.getElementById(GridPlusID).style.display="none";document.getElementById(GridMinusID).style.display="";}else{document.getElementById(GridId).style.display="none";document.getElementById(GridPlusID).style.display="";document.getElementById(GridMinusID).style.display="none";}}GridDetailsWindow(tdet,FinCode,Exchg,rowid,type);}function Showdetails2(rowid,FinCode,Exchg,Cnt,type){var GridId,GridPlusID,GridMinusID,GID,GPID;var tdet;if(type=='EQ'){tdet="Griddetails"+rowid;GID="Griddetails";GPID="Grid2"};if(type=='MF'){tdet="GridMFdetails"+rowid;GID="GridMFdetails";GPID="Grid2MF"};if(type=='COMM'){tdet="GridCOMMdetails"+rowid;GID="GridCOMMdetails";GPID="Grid2COMM"}for(i=20;i<=Cnt-1;i++){GridId=GID+i;GridPlusID=GPID+"Plus"+i;GridMinusID=GPID+"Minus"+i;if(i==rowid){document.getElementById(GridId).style.display="";document.getElementById(GridPlusID).style.display="none";document.getElementById(GridMinusID).style.display="";}else{document.getElementById(GridId).style.display="none";document.getElementById(GridPlusID).style.display="";document.getElementById(GridMinusID).style.display="none";}}GridDetailsWindow(tdet,FinCode,Exchg,rowid,type);}function Hidedetails(Str,type){var GridId,GridPlusID,GridMinusID,DivID,GID,GPID;if(type=='EQ'){GID="Griddetails";GPID="Grid1";};if(type=='MF'){GID="GridMFdetails";GPID="Grid1MF";};if(type=='COMM'){GID="GridCOMMdetails";GPID="Grid1COMM";}GridId=GID+Str;GridPlusID=GPID+"Plus"+Str;GridMinusID=GPID+"Minus"+Str;document.getElementById(GridId).style.display="none";document.getElementById(GridPlusID).style.display="";document.getElementById(GridMinusID).style.display="none";}function Hidedetails2(Str,type){var GridId,GridPlusID,GridMinusID,DivID,GID,GPID;if(type=='EQ'){GID="Griddetails";GPID="Grid2";};if(type=='MF'){GID="GridMFdetails";GPID="Grid2MF";};if(type=='COMM'){GID="GridCOMMdetails";GPID="Grid2COMM";};GridId=GID+Str;GridPlusID=GPID+"Plus"+Str;GridMinusID=GPID+"Minus"+Str;document.getElementById(GridId).style.display="none";document.getElementById(GridPlusID).style.display="";document.getElementById(GridMinusID).style.display="none";}function RedirectPMEye(search){var requestUrl;requestUrl="../CompanyProfile/QuoteFinder.aspx?timeStamp="+new Date().getTime()+"&FinCode="+search+"&Mode=S&id=1";window.location=requestUrl;}function RemoveC2P(){if(document.getElementById("ProfitMatrix1_AddEditProfitMatrix1_txtSchName").value=="Enter Company Name"){document.getElementById("ProfitMatrix1_AddEditProfitMatrix1_txtSchName").value="";}}function RemoveScheme(){if(document.getElementById("ProfitMatrix1_AddEditSchemes1_txtSchName").value=="Enter Scheme Name"){document.getElementById("ProfitMatrix1_AddEditSchemes1_txtSchName").value="";}}function RemoveSymbol(){if(document.getElementById("ProfitMatrix1_AddEditSymbol1_txtSchName").value=="Enter Symbol Name"){document.getElementById("ProfitMatrix1_AddEditSymbol1_txtSchName").value="";}}function SearchSchemes(){document.getElementById("ProfitMatrix1_hddSchmeCode").value="";var txtSchName=document.getElementById("ProfitMatrix1_AddEditSchemes1_txtSchName");if(txtSchName.value=="Enter Scheme Name"){alert("Please Enter some text");}else{var SearchResult=document.getElementById("ProfitMatrix1_AddEditSchemes1_lbSchResult");CreateXmlHttpNewC2P();document.body.style.cursor="progress";var requestUrl="../LiveHome/AjaxGetScheme.aspx?timeStamp="+new Date().getTime()+"&txtSchName="+txtSchName.value;if(XmlHttpNewC2P){XmlHttpNewC2P.onreadystatechange=function(){fillSchemes(SearchResult)};XmlHttpNewC2P.open("GET",requestUrl,true);XmlHttpNewC2P.send(null);}}}function SearchSymbol(){var txtSchName=document.getElementById("ProfitMatrix1_AddEditSymbol1_txtSchName");if(txtSchName.value=="Enter Symbol Name"){alert("Please Enter some text");}else{var SearchResult=document.getElementById("ProfitMatrix1_AddEditSymbol1_lbSchResult");CreateXmlHttpNewC2P();document.body.style.cursor="progress";var requestUrl="../LiveHome/AjaxGetSymbol.aspx?timeStamp="+new Date().getTime()+"&txtSchName="+txtSchName.value;if(XmlHttpNewC2P){XmlHttpNewC2P.onreadystatechange=function(){fillSchemes(SearchResult)};XmlHttpNewC2P.open("GET",requestUrl,true);XmlHttpNewC2P.send(null);}}}function fillSchemes(ig_){if(XmlHttpNewC2P.readyState==4){if(XmlHttpNewC2P.status==200){var strData=XmlHttpNewC2P.responseText
if(strData!=""){var arrSchm=strData.split("|");ig_.length=0;for(i=0;i<arrSchm.length-1;i++){var strSchm=arrSchm[i];var arrSchmCode=strSchm.split("~");ig_.options[i]=new Option();ig_.options[i].value=arrSchmCode[0];ig_.options[i].text=arrSchmCode[1];}}else{ig_.length=0;ig_.options[0]=new Option();ig_.options[0].value="";ig_.options[0].text="No Data Found";}document.body.style.cursor="auto";}else{ig_.length=0;ig_.options[0]=new Option();ig_.options[0].value="";ig_.options[0].text="server is not ready";document.body.style.cursor="auto";}}}function CreateXmlHttpNewC2P(){try{XmlHttpNewC2P=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{XmlHttpNewC2P=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){XmlHttpNewC2P=null;}}if(!XmlHttpNewC2P&&typeof XMLHttpRequest!="undefined"){XmlHttpNewC2P=new XMLHttpRequest();}}function SchResultEye(){var txtSchName=document.getElementById("ProfitMatrix1_AddEditProfitMatrix1_txtSchName");if(txtSchName.value=="Enter Company Name"){alert("Please Enter some text");}else{var SearchResult=document.getElementById("ProfitMatrix1_AddEditProfitMatrix1_lbSchResult");CreateXmlHttpNewC2P();document.body.style.cursor="progress";var requestUrl="../LiveHome/GetSchDataAjax.aspx?timeStamp="+new Date().getTime()+"&txtSchName="+txtSchName.value;if(XmlHttpNewC2P){XmlHttpNewC2P.onreadystatechange=function(){fillSymbolRespEye(SearchResult)};XmlHttpNewC2P.open("GET",requestUrl,true);XmlHttpNewC2P.send(null);}}}function fillSymbolRespEye(ig_){if(XmlHttpNewC2P.readyState==4){if(XmlHttpNewC2P.status==200){var strData=XmlHttpNewC2P.responseText
if(strData!=""){var arrSchm=strData.split("|");ig_.length=0;for(i=0;i<arrSchm.length-1;i++){var strSchm=arrSchm[i];var arrSchmCode=strSchm.split("~");ig_.options[i]=new Option();ig_.options[i].value=arrSchmCode[0];ig_.options[i].text=arrSchmCode[1];}}else{ig_.length=0;ig_.options[0]=new Option();ig_.options[0].value="";ig_.options[0].text="No Data Found";}document.body.style.cursor="auto";}else{ig_.length=0;ig_.options[0]=new Option();ig_.options[0].value="";ig_.options[0].text="server is not ready";document.body.style.cursor="auto";}}}function DeleteSch(type){var SchMineCtrl;if(type=='EQ'){SchMineCtrl="ProfitMatrix1_AddEditProfitMatrix1"};if(type=='MF'){SchMineCtrl="ProfitMatrix1_AddEditSchemes1"};if(type=='COMM'){SchMineCtrl="ProfitMatrix1_AddEditSymbol1"}var SchMine=document.getElementById(SchMineCtrl+"_lbSchMine");if(SchMine.selectedIndex<0){alert("Please select a name from list");return false;}if(SchMine.selectedIndex==0){if(SchMine.options[1]==null){alert('The only remaining Name cannot be deleted');return false;}}SchMine.options[SchMine.selectedIndex]=null;return false;}function MoveUpSch(type){var SchMineCtrl;if(type=='EQ'){SchMineCtrl="ProfitMatrix1_AddEditProfitMatrix1"}if(type=='COMM'){SchMineCtrl="ProfitMatrix1_AddEditSymbol1"}if(type=='MF'){SchMineCtrl="ProfitMatrix1_AddEditSchemes1"}var SchMine=document.getElementById(SchMineCtrl+"_lbSchMine");var TempVal1,TempTxt1;var TempVal2,TempTxt2;if(SchMine.selectedIndex<0){alert("Please select a name from list");return false;}if(SchMine.selectedIndex<=0){return false;}TempVal1=SchMine.options[SchMine.selectedIndex].value;TempTxt1=SchMine.options[SchMine.selectedIndex].text;TempVal2=SchMine.options[SchMine.selectedIndex-1].value;TempTxt2=SchMine.options[SchMine.selectedIndex-1].text;SchMine.options[SchMine.selectedIndex].value=TempVal2;SchMine.options[SchMine.selectedIndex].text=TempTxt2;SchMine.options[SchMine.selectedIndex-1].value=TempVal1;SchMine.options[SchMine.selectedIndex-1].text=TempTxt1;SchMine.selectedIndex=SchMine.selectedIndex-1;}function MoveDownSch(type){var SchMineCtrl;if(type=='EQ'){SchMineCtrl="ProfitMatrix1_AddEditProfitMatrix1"}if(type=='COMM'){SchMineCtrl="ProfitMatrix1_AddEditSymbol1"}if(type=='MF'){SchMineCtrl="ProfitMatrix1_AddEditSchemes1"}var SchMine=document.getElementById(SchMineCtrl+"_lbSchMine");var TempVal1,TempTxt1;var TempVal2,TempTxt2;var len=SchMine.length;if(SchMine.selectedIndex<0){alert("Please select a name from list");return false;}if(SchMine.selectedIndex>=len-1){return false;}TempVal1=SchMine.options[SchMine.selectedIndex].value;TempTxt1=SchMine.options[SchMine.selectedIndex].text;TempVal2=SchMine.options[SchMine.selectedIndex+1].value;TempTxt2=SchMine.options[SchMine.selectedIndex+1].text;SchMine.options[SchMine.selectedIndex].value=TempVal2;SchMine.options[SchMine.selectedIndex].text=TempTxt2;SchMine.options[SchMine.selectedIndex+1].value=TempVal1;SchMine.options[SchMine.selectedIndex+1].text=TempTxt1;SchMine.selectedIndex=SchMine.selectedIndex+1;}function StoreSch(type,SchemeName){var search,SchMine;var SchMineCtrl;if(type=='EQ'){SchMineCtrl="ProfitMatrix1_AddEditProfitMatrix1"}if(type=='MF'){SchMineCtrl="ProfitMatrix1_AddEditSchemes1"}if(type=='COMM'){SchMineCtrl="ProfitMatrix1_AddEditSymbol1"}search=document.getElementById(SchMineCtrl+"_lbSchResult");SchMine=document.getElementById(SchMineCtrl+"_lbSchMine");if(type=='MF'){ if(SchemeName!=''){ChangeWatchList('MF');AddEditProfitMatrix(document.getElementById('hddType').value); }
for (var i=0; i < SchMine.options.length; i++){
if(type=='MF')
{
       if(SchemeName!=undefined)
       {
        if (SchMine.options[i].value.match(SchemeName))
                {alert("Scheme Name already in list");

                    return false;

                }
                else
                {
               // alert("jamir");
                }

            }
            }
            }
            }
            var len=SchMine.length;if(len>=10){alert('You already have the maximum limit of Ten');return false;}for(i=0;i<len;i++){if(SchMine.options[i].text==search.options[search.selectedIndex].text){alert("You already have this Name in your list");return false;}}var Tempstr;SchMine.options[len]=new Option();for(j=len-1;j>-1;j--){SchMine.options[j+1].value=SchMine.options[j].value
SchMine.options[j+1].text=SchMine.options[j].text}SchMine.options[0].value=search.value;SchMine.options[0].text=search.options[search.selectedIndex].text;if(search==""){alert('select Company Name');}return false;}function SaveSch(type){var SchMineCtrl;if(type=='EQ'){SchMineCtrl="ProfitMatrix1_AddEditProfitMatrix1"}if(type=='COMM'){SchMineCtrl="ProfitMatrix1_AddEditSymbol1"}if(type=='MF'){SchMineCtrl="ProfitMatrix1_AddEditSchemes1"}var SchMine=document.getElementById(SchMineCtrl+"_lbSchMine");var len=SchMine.length;for(var i=0;i<len;i++){document.getElementById(SchMineCtrl+"_hidSchValue"+i).value=SchMine.options[i].value;document.getElementById(SchMineCtrl+"_hidSchText"+i).value=SchMine.options[i].text;}document.getElementById("ProfitMatrixVieW").style.display="";document.getElementById("AddEditView").style.display='none';document.getElementById("AddEditMF").style.display='none';}function MovePrev(type,Page){document.getElementById("hddPage").value=Page;document.getElementById("ShowPrev").style.display="none";document.getElementById("ShowNext").style.display="";MatrixGridData(type,1);}function MoveNext(type,Page){document.getElementById("hddPage").value=Page;document.getElementById("ShowPrev").style.display="";document.getElementById("ShowNext").style.display="none";MatrixGridData(type,2);}function AddEditProfitMatrix(type){document.getElementById("ProfitMatrixVieW").style.display="none";if(type=='EQ'){document.getElementById("AddEditView").style.display='';document.getElementById("AddEditMF").style.display='none';document.getElementById("AddEditComm").style.display='none';}if(type=='MF'){document.getElementById("AddEditMF").style.display='';document.getElementById("AddEditView").style.display='none';document.getElementById("AddEditComm").style.display='none';}if(type=='COMM'){document.getElementById("AddEditMF").style.display='none';document.getElementById("AddEditView").style.display='none';document.getElementById("AddEditComm").style.display='';}}function OpenClose(Str){if(Str==1){document.getElementById("ShowGr").style.display="";document.getElementById("Plus").style.display="none";document.getElementById("Minus").style.display="";}if(Str==2){document.getElementById("ShowGr").style.display="none";document.getElementById("Plus").style.display="";document.getElementById("Minus").style.display="none";}}function AddClose(){document.getElementById("AddEditView").style.display='none';document.getElementById("AddEditMF").style.display='none';document.getElementById("AddEditComm").style.display='none';document.getElementById("ProfitMatrixVieW").style.display=""}function ChangeWatchList(type){  var tdid= document.getElementById("id1");if(type=='EQ'){ document.getElementById("tdEquity").className="NewsFirstTabWSelected";document.getElementById("tdMF").className="NewsTabSelectedWhite";document.getElementById("tdComm").className="NewsTabSelectedWhite";   tdid.onclick = function() {idclick('1')};}if(type=='MF'){  tdid.onclick = function() {idclick('2')};document.getElementById("tdEquity").className="NewsFirstTabSelectedWhite";document.getElementById("tdMF").className="NewsTabWSelected";document.getElementById("tdComm").className="NewsTabSelectedWhite";}if(type=='COMM'){tdid.onclick = function() {idclick('3')};document.getElementById("tdEquity").className="NewsFirstTabSelectedWhite";document.getElementById("tdMF").className="NewsTabSelectedWhite";document.getElementById("tdComm").className="NewsTabWSelected";}document.getElementById("hddType").value=type;MatrixRefresh(type,document.getElementById("hddPage").value);AddEditProfitMatrix(type);document.getElementById("ProfitMatrixVieW").style.display='';document.getElementById("AddEditView").style.display='none';document.getElementById("AddEditMF").style.display='none';document.getElementById("AddEditComm").style.display='none';}var XmlHttpMatrixGridData;function CreateXmlHttpMatrixGridData(){try{XmlHttpMatrixGridData=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{XmlHttpMatrixGridData=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){XmlHttpMatrixGridData=null;}}if(!XmlHttpMatrixGridData&&typeof XMLHttpRequest!="undefined"){XmlHttpMatrixGridData=new XMLHttpRequest();}}function MatrixGridData(type,PageNo){CreateXmlHttpMatrixGridData();document.body.style.cursor="progress";var requestUrl="../LiveHome/AjaxProfitMatrixGrid.aspx?PageNo="+PageNo+"&timeStamp="+new Date().getTime()+"&type="+type;document.getElementById("tdMatrixEq").style.display="";document.getElementById("GridBind1").innerHTML="<img src=../App_Themes/Images/loader.gif />";if(XmlHttpMatrixGridData!=null){XmlHttpMatrixGridData.onreadystatechange=function(){ChangeMatrixGridData(type)};XmlHttpMatrixGridData.open('GET',requestUrl,true);XmlHttpMatrixGridData.send(null);}return false;}function ChangeMatrixGridData(type){var td_IdComm;if(XmlHttpMatrixGridData.readyState==4){td_IdComm=document.getElementById("GridBind1");if(XmlHttpMatrixGridData.status==200){td_IdComm.innerHTML=XmlHttpMatrixGridData.responseText;document.body.style.cursor="auto";}else{td_IdComm.innerHTML="There was a problem retrieving data from the server.";document.body.style.cursor="auto";}}}function MatrixRefresh(type,Page){MatrixGridData(type,Page);LoadMintEyeData();}function InitializedrpTimer(){secsd=15;StopdrpTheClock();StartDrpTheTimer();}function StartDrpTheTimer(){if(secsd==0){StopdrpTheClock();MakeGetServerCall_AJAX();InitializedrpTimer();}else{secsd=secsd-1;timerRunning=true;timerID1=self.setTimeout("StartDrpTheTimer()",delay);}}var secs=0;var timerID=null;var callType=1;var timerRunning=false;var delay=16200;function InitializeTimer(){secs=5;StopTheClock();StartTheTimer();}function StopTheClock(){if(timerRunning)clearTimeout(timerID);timerRunning=false}function StartTheTimer(){if(secs==0){StopTheClock();CreateWatch();MatrixRefresh(document.getElementById('hddType').value,'1');InitializeTimer();}else{secs=secs-1;timerRunning=true;timerID=self.setTimeout("StartTheTimer()",delay);}}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;var IE=document.all?true:false
if(!IE)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=getMouseXY;function getMouseXY(e){if(IE){tempY=document.body.scrollTop+50;}else{tempX=e.pageX;tempY=e.pageY;}return true;}var ShowIndexCtrl;function CreateShowIndexCtrl(){try{ShowIndexCtrl=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{ShowIndexCtrl=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){ShowIndexCtrl=false;}}if(!ShowIndexCtrl&&typeof XMLHttpRequest!='undefined'){try{ShowIndexCtrl=new XMLHttpRequest();}catch(e){ShowIndexCtrl=false;}}if(!ShowIndexCtrl&&window.createRequest){try{ShowIndexCtrl=window.createRequest();}catch(e){ShowIndexCtrl=false;}}}function ShowIndexCtrl_Comm(){CreateShowIndexCtrl();var currentDivObj=document.getElementById("IndexControlData_Comm");document.body.style.cursor="progress";var requestUrl="../LiveHome/AjaxIndexControl_Comm.aspx?timeStamp="+new Date().getTime();if(ShowIndexCtrl!=null){ShowIndexCtrl.onreadystatechange=function(){ChangeShowIndexCtrl()};ShowIndexCtrl.open('GET',requestUrl,true);ShowIndexCtrl.send(null);}return false;}function ChangeShowIndexCtrl(){if(ShowIndexCtrl.readyState==4){var Td_DataDeriFii=document.getElementById("IndexControlData_Comm");if(ShowIndexCtrl.status==200){Td_DataDeriFii.innerHTML=ShowIndexCtrl.responseText;document.body.style.cursor="auto";}else{Td_DataDeriFii.innerHTML="There was a problem retrieving data from the server.";document.body.style.cursor="auto";}}}function CreateMtrxLoginObj(){try{MtrxLoginObj=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{MtrxLoginObj=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){MtrxLoginObj=false;}}if(!MtrxLoginObj&&typeof XMLHttpRequest!='undefined'){try{MtrxLoginObj=new XMLHttpRequest();}catch(e){MtrxLoginObj=false;}}if(!MtrxLoginObj&&window.createRequest){try{MtrxLoginObj=window.createRequest();}catch(e){MtrxLoginObj=false;}}}function ChkMatrixLogin(Opt){var requestUrl;if(Opt=='AddCookie'){var MatrixLoginID=document.getElementById("MatrixLoginID").value;var MatrixLoginPass=document.getElementById("MatrixLoginPass").value;if(MatrixLoginID==""){alert("Please enter ID");return false;}if(MatrixLoginPass==""){alert("Please enter Password");return false;}requestUrl="../LiveHome/AjaxCheckMatrixLogin.aspx?UserID="+MatrixLoginID+"&UserPass="+MatrixLoginPass+"&Opt="+Opt;}else if(Opt=='ChkCookie'){requestUrl="../LiveHome/AjaxCheckMatrixLogin.aspx?Opt="+Opt;}CreateMtrxLoginObj()
if(MtrxLoginObj){MtrxLoginObj.onreadystatechange=function(){ChkMatrixLogineResp()};MtrxLoginObj.open("GET",requestUrl,true);MtrxLoginObj.send(null);}}function ChkMatrixLogineResp(){if(MtrxLoginObj.readyState==4){if(MtrxLoginObj.status==200){var strGlData=MtrxLoginObj.responseText;var LoginCtrl=document.getElementById("LoginCtrl");var ShowGr=document.getElementById("ShowGr");if(strGlData=="T"){LoginCtrl.style.display="none";ShowGr.style.display="";}else if(strGlData=="F"){LoginCtrl.style.display="";ShowGr.style.display="none";}}}}function drupdown_stk1(udtab){document.getElementById("hddVal").value=udtab;if(udtab==1){$("#sdiv").slideDown(700);document.getElementById("Minus").style.display="";document.getElementById("Plus").style.display="none";}else if(udtab==2){$("#sdiv").slideUp(700);document.getElementById("Minus").style.display="none";document.getElementById("Plus").style.display="";}if(udtab==3){$("#sdiv").slideDown(700);document.getElementById("Minus").style.display="";document.getElementById("Plus").style.display="none";document.getElementById("tdLogin").style.display=""}else if(udtab==4){$("#sdiv").slideUp(700);document.getElementById("Minus").style.display="none";document.getElementById("Plus").style.display="";document.getElementById("tdLogin").style.display="none"}}function MFChart(SchemeCode,Period,ChType){var so=new SWFObject("../amline/amline.swf","SnapChart_settings","270","190","1","#ECECEC");so.addVariable("path","../amline/");so.addVariable("settings_file",encodeURIComponent("../MutualFund/NavDetailslinechart.xml"));so.addVariable("data_file",encodeURIComponent("../MutualFund/NavDetailschartMFAjax.aspx?TimeStamp="+new Date().getTime()+"&SchemeCode="+SchemeCode+"&Period="+Period+"&ChType="+ChType));so.write("MFChart"+SchemeCode);}function ComChart(Symbol){var so=new SWFObject("../amline/amline.swf","Bullionline_settings","270","190","1","#ECECEC");so.addVariable("path","../amline/");so.addVariable("settings_file",encodeURIComponent("../Commodity/Bullionline_settings.xml"));so.addVariable("data_file",encodeURIComponent("../Commodity/BullionchartComAjax.aspx?TimeStamp="+new Date().getTime()+"&Symbol="+Symbol));so.write("ComChart"+Symbol);}function OpenLogin(){document.getElementById("tdWatchlist").style.display="none";document.getElementById("tdLogin").style.display="";}function CreateWatch(){var url="../LiveHome/AjaxWatchlist.aspx?Val="+document.getElementById("hddVal").value+"&J="+new Date().getTime();ajaxpage(123,url,'AjaxWatch');}
function GetFSData(type)
{
CreateXmlHttpNewC2P();
var lblFS;
if(type=='EQ')
{lblFS="ProfitMatrix1_AddEditProfitMatrix1"};
if(type=='MF')
{lblFS="ProfitMatrix1_AddEditSchemes1"};
if(type=='COMM'){lblFS="ProfitMatrix1_AddEditSymbol1"};
var lblData=document.getElementById(lblFS+"_lbSchMine");
 document.body.style.cursor="progress";
 var requestUrl="../LiveHome/AjaxfillFSData.aspx?timeStamp="+new Date().getTime()+"&type="+type;
 if(XmlHttpNewC2P){
 XmlHttpNewC2P.onreadystatechange=function(){fillFSData(lblData)};
 XmlHttpNewC2P.open("GET",requestUrl,true);XmlHttpNewC2P.send(null);
 }
 }
  function fillFSData(ig_)
  {if(XmlHttpNewC2P.readyState==4)
  {if(XmlHttpNewC2P.status==200){var strData=XmlHttpNewC2P.responseText
if(strData!="")
{
var arrSchm=strData.split("|");ig_.length=0;for(i=0;i<arrSchm.length-1;i++)
{var strSchm=arrSchm[i];var arrSchmCode=strSchm.split("~");ig_.options[i]=new Option();ig_.options[i].value=arrSchmCode[0];ig_.options[i].text=arrSchmCode[1];}
}else{ig_.length=0;ig_.options[0]=new Option();ig_.options[0].value="";ig_.options[0].text="";}
document.body.style.cursor="auto";}
else{ig_.length=0;ig_.options[0]=new Option();ig_.options[0].value="";
ig_.options[0].text="server is not ready";document.body.style.cursor="auto";}
}}
function OpenWatchlist(type)
{
    window.open('../LiveHome/Watchlist.aspx?type='+type,'LiveMint','width=600px;height=400px;')
}

function MarketEyeDetails(type)
{ var requestUrl = "../LiveHome/AjaxMarketEyeDetails.aspx?type="+type+"&timeStamp="+new Date().getTime();	
     ajaxpage(1,requestUrl, 'GridPop')
}
function LoadMintEyeData() 
	{
var time = new Date();
var hour = time.getHours();		
	}
	
	function FixProfitMtrxImg()
	{
	  var xp, yp, op
	    xp = document.getElementById("GridView1").offsetLeft;	// Element's offset x in pixels
	    yp = document.getElementById("GridView1").offsetTop;
	    dname=document.getElementById("GridView1");
	    
        while (dname.offsetParent) 
        {
		    op = dname.offsetParent;	// Get container parent
		    xp = xp + op.offsetLeft;	// Add this element's offset x in pixels
		    yp = yp + op.offsetTop;		// Add this element's offset y in pixels
		    dname = dname.offsetParent;	// Update current container
	    }
         document.getElementById('ProfitMtrxImage').style.left=document.getElementById("GridView1").style.left;
            document.getElementById('ProfitMtrxImage').style.top=document.getElementById("GridView1").style.top;
            document.getElementById('ProfitMtrxImage').style.display='block';
          
	}
