﻿// JScript File


if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",encodeURIComponent(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",encodeURIComponent(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;



 var containerid="contentarea";var bustcachevar=1
var loadedobjects=""
var rootdomain="http://"+window.location.hostname

var bustcacheparameter=""
function ajaxpage(id,url, containerid)
{

    var page_request = false
        if (window.XMLHttpRequest) // if Mozilla, Safari etc
        page_request = new XMLHttpRequest()
        else if (window.ActiveXObject)
        { // if IE
                try {
                    page_request = new ActiveXObject("Msxml2.XMLHTTP")
                    } 
                catch (e){
                        try{
                            page_request = new ActiveXObject("Microsoft.XMLHTTP")
                            }
                        catch (e){}
                        }
        }


        page_request.onreadystatechange=function()
        {
            loadpage(page_request, containerid)
        }
        if (bustcachevar) //if bust caching of external page
        bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
        page_request.open('GET', url+bustcacheparameter, true)
         document.body.style.cursor = "auto";	
        page_request.send(null)    
}

function loadpage(page_request, containerid)
{
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
 {   
   if(containerid=='tdscheminfo')
        {
			var SNDate = document.getElementById("tdschemname");
			var strData = page_request.responseText;
			
			if(strData != "")
			 {	
			    var arrSchm = strData.split("|");
			   
			    for(i=0; i<arrSchm.length-1; i++) 
			    {	
				    var strSchm = arrSchm[i];
				   
				    var arrSchmCode = strSchm.split("~");
				     document.getElementById(containerid).innerHTML = arrSchmCode[0];
				    
				    SNDate.innerHTML = arrSchmCode[1];
			    }
			}
	}
	
	else  if(containerid=='errmsg')
	{
	  var strData=page_request.responseText;
        if(strData!='not')
           redirectUrl(strData);
           else
           document.getElementById(containerid).innerHTML="Invalid UserID / Password";
	  
	  }  
	     else{ var strData=page_request.responseText;document.getElementById(containerid).innerHTML=strData;}
   }
}
//Movepopup
// JScript File
var dragObj = new Object();
// Determine browser and version.
function getID(id)
{
	return document.getElementById(id);
}

function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    return;
  }

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    return;
  }
}
var browser = new Browser();

function dragStart(event, id) {
  var x, y;
  dragObj.elNode = getID(id);
  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Save starting positions of cursor and element.

  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;

  // Capture mousemove and mouseup events on the page.

  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
}
function dragGo(event) {

  var x, y;

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Move drag element by the same amount the cursor has moved.

  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}

function dragStop(event) {

  // Stop capturing mousemove and mouseup events.

  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}


//Ends here

//Swf/Ajax Ends
var XmlHttp

function CreateXmlHttp()
{
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttp = null;				
		}
	}
	if(!XmlHttp && typeof XMLHttpRequest != "undefined")
	{
		XmlHttp = new XMLHttpRequest();
	}
}


//function ChangeControl(Opt,Exch)
function ChangeControl(Opt)
{
 var Exch=document.getElementById("MarketTop1_HomeChart_ChartExch").value
// alert(Exch);
	CreateXmlHttp();
       var currentDivObj = document.getElementById("Td_Data");
        
		//currentDivObj.innerHTML ="<img src=App_Themes/CommonTheme/Images/ajax-loader.gif>";
	document.body.style.cursor = "progress";
	
	
	var requestUrl = "Home/AjaxDataGLVV.aspx?Option="+ Opt +"&Exchange="+ Exch+"&TimeStamp="+new Date().getTime();
//  alert(requestUrl);
	if(XmlHttp!=null)	
	        {
				XmlHttp.onreadystatechange = function(){ChangeControlResponse(Opt,Exch)}
				XmlHttp.open('GET', requestUrl,  true);
				XmlHttp.send(null);
			}
			 return false; 
}	
	
function ChangeControlResponse(Opt,Exch)
{
    
     
     var tdgain =document.getElementById("tdgain");
     var tdlos =document.getElementById("tdlos");
     var tdvol =document.getElementById("tdvol");
     var tdval =document.getElementById("tdval");
    
    
    
  if(document.getElementById("Heading")!=null)
 {
        var Head_td =document.getElementById("Heading");
         tdgain.className ="GLVALVOLUNSelect";
		 tdlos.className="GLVALVOLUNSelect";
		 tdvol.className="GLVALVOLUNSelect";
		 tdval.className="GLVALVOLUNSelect";
	switch (Opt)
	{
	
	case "GAIN":
		Head_td.innerHTML=Exch+" GAINERS";
	   
		 tdgain.className ="GLVALVOLSelect";
		break;
		
	case "LOSE":
	
		Head_td.innerHTML=Exch+" LOSERS";
		 tdlos.className="GLVALVOLSelect";


	break;
	
	case "Vol":
		Head_td.innerHTML=Exch+" VOLUME";
		 tdvol.className="GLVALVOLSelect";

	break;
	
	case "Val":
	    Head_td.innerHTML= Exch+ " VALUE";
		 tdval.className="GLVALVOLSelect";

	break;
	
	}
}

	// To make sure receiving response data from server is completed
	
	if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		var td_Id = document.getElementById("Td_Data");
	 
		if(XmlHttp.status == 200)//
		{
			td_Id.innerHTML =  XmlHttp.responseText;
				
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}	


//News 
function ChooseNewsHome(NewsTxt)
{
//document.getElementById("SpanNews").innerHTML=NewsTxt;
NewsTxt = NewsTxt.toUpperCase();
   if(NewsTxt =="MUTUAL FUNDS NEWS")
    {
        GetNewsHotGlobalHome('2','3');
        
    }
  if(NewsTxt =="COMMODITIES NEWS")
    {
        GetNewsHotGlobalHome('3','5,7,31,37');
       
    }

 if(NewsTxt =="DERIVATIVE NEWS")
    {
        GetNewsHotGlobalHome('4','47');
    }
   if(NewsTxt =="IPOS NEWS")
    {
        GetNewsHotGlobalHome('1','2');
    }
    if(NewsTxt =="HOT STOCKS")
    {
        GetNewsHotGlobalHome('4','38');
    }
    if(NewsTxt =="OTHER MARKET")
    {
        GetNewsHotGlobalHome('6','12,13,14,45');
    }
    if(NewsTxt =="MARKET PULSE")
    {
        GetNewsHotGlobalHome('5','56');
    }
    if(NewsTxt =="ECONOMY")
    { 
        GetNewsHotGlobalHome('5','23,24,25,26,36,43,44,49');
    }

   if(NewsTxt =="MKT.COMMENTARY")
    {
        GetNewsHotGlobalHome('4','40,41,42');
    }

    if(NewsTxt=="CORPORATE NEWS")
    {
        GetNewsHotGlobalHome('7','15');
    }
   
  
    if(NewsTxt =="FII POSITION")
    {
        GetNewsHotGlobalHome('9','22');
    }
    
    if(NewsTxt =="OPENING BELL")
    {
        GetNewsHotGlobalHome('4','40');
    }

    if(NewsTxt=="CLOSING BELL")
    {
        GetNewsHotGlobalHome('4','42');
    }
   
  
    if(NewsTxt =="MIDDAY REVIEW")
    {
        GetNewsHotGlobalHome('4','41');
    }
    
    
       if(NewsTxt =="STOCK ALERTS")
    {
        GetNewsHotGlobalHome('4','46');
    }

    if(NewsTxt =="POLITICAL NEWS")
    {
        GetNewsHotGlobalHome('5','11');
    }

     if(NewsTxt =="FOREIGN MARKETS")
    {
        GetNewsHotGlobalHome('4','27');
    }

     if(NewsTxt =="F&O UPDATE")
    {
        GetNewsHotGlobalHome('4','47');
    }
      
      

}
function CreateXmlHttpNewsHome()
{
	try
	{
		XmlHttpNewsHome = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpNewsHome = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpNewsHome = null;				
		}
	}
	if(!XmlHttpNewsHome && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpNewsHome = new XMLHttpRequest();
	}
}
function GetNewsHotGlobalHome(SecID,SubSec)
{	
    
    CreateXmlHttpNewsHome();
	document.body.style.cursor = "progress";
	document.getElementById("NewsTdGlobal").innerHTML="<table align=center><tr><td><img src =App_Themes/Common/images/loader.gif /></td></tr></table>";
	var requestUrl = "Home/HomenewsAjaxHome.aspx?Sec="+ SecID +"&SubSec="+SubSec+"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
	//alert(requestUrl);
	if(XmlHttpNewsHome)
	{
	    XmlHttpNewsHome.onreadystatechange = function(){getDataResponseHotHome();};
		XmlHttpNewsHome.open("GET", requestUrl,  true);
		XmlHttpNewsHome.send(null);
	}
	
}

function getDataResponseHotHome()
{
    if(XmlHttpNewsHome.readyState == 4)
	{	
	    if(XmlHttpNewsHome.status == 200)
		{				
		    var NewTd = document.getElementById("NewsTdGlobal");
			var NewData = XmlHttpNewsHome.responseText;
			if(NewData != "")
				NewTd.innerHTML = NewData;				
			document.body.style.cursor = "auto";
			
		}
	}
}

 function OpenNewsGlobalHome(NewsID,SecID,SubSecID,FinCode,Opt)
    {
		  var requestUrl ="Home/PopupNewsData.aspx?timeStamp="+ new Date().getTime() +"&SecId="+SecID+"&SubSecID="+SubSecID+"&NewsID="+NewsID;
          document.getElementById("divNews").style.display="";
		  ajaxpage(1,requestUrl,'TdNews');  
    }
//News Ends

//NFO Starts

function CreateXmlHttpNFO()
	{
		try
		{
			XmlHttpNFO = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpNFO = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpNFO = null;
					
			}
		}
		if(!XmlHttpNFO && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpNFO = new XMLHttpRequest();
		}
	}
	
	function GetNFO()
	{	
	//alert(Exchg);	
		CreateXmlHttpNFO();
		document.body.style.cursor = "progress";
		//document.getElementById("NFOID").innerHTML = " <img src='../App_Themes/Common/images/loading.gif'>";
		//if(Exchg=="NSE"){document.NseTickImg.src="../images/NSEon.gif";document.BseTickImg.src="../images/BSEoff.gif";}else{document.NseTickImg.src="../images/NSEoff.gif";document.BseTickImg.src="../images/BSEon.gif";}
		var requestUrl = "Home/AjaxNFOData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
		
		if(XmlHttpNFO){
			XmlHttpNFO.onreadystatechange = function(){getDataResponseGetNFO();};
			XmlHttpNFO.open("GET", requestUrl,  true);
			XmlHttpNFO.send(null);
		}
}
function getDataResponseGetNFO()
{
	if(XmlHttpNFO.readyState == 4)
	{	
	
		if(XmlHttpNFO.status == 200)
		{				
		
			
			var TalkingStockTD = document.getElementById("NFOID");
			var NewData = XmlHttpNFO.responseText;
			//alert(NewData);
						
			if(NewData != "")
		
				TalkingStockTD.innerHTML = NewData;				
				document.body.style.cursor = "auto";
				
		}
		
		//else
			//MarqueeId.innerHTML = "<img src='../CommonImgs/loading1.gif'>";
	}
}
	
	

//NfoEnds
 ////  IPO Update  ///////////
 
 
 	function CreateXmlHttpIPO()
{
	try
	{
		XmlHttpIPO = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpIPO = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpIPO = null;				
		}
	}
	if(!XmlHttpIPO && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpIPO = new XMLHttpRequest();
	}
}


function GetIPO()
	{	
	
		CreateXmlHttpIPO();
		document.body.style.cursor = "progress";
		
		var requestUrl = "Home/IpoAjaxData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
		if(XmlHttpIPO){
			XmlHttpIPO.onreadystatechange = function(){getDataResponseIPO();};
			XmlHttpIPO.open("GET", requestUrl,  true);
			XmlHttpIPO.send(null);
		}
}
function getDataResponseIPO()
{
	if(XmlHttpIPO.readyState == 4)
	{	
	
		if(XmlHttpIPO.status == 200)
		{				
		
			
			var tdIpoData = document.getElementById("IPOdata");
			var IPOData = XmlHttpIPO.responseText;
						
			if(IPOData != "")
		
				tdIpoData.innerHTML = IPOData;				
				document.body.style.cursor = "auto";
				
		}
		
		
	}
}



 //////  End IPO Update  ////////
  
 function RedirectQuotes()
{
 
    var SrchQuote = document.getElementById("txtCompany").value;
    SrchQuote=SrchQuote.trim();
    if(SrchQuote =="")
    {
         alert("Please Enter Company Name ..!!!");
         document.getElementById("txtCompany").value="";
         document.getElementById("txtCompany").focus();
        return false;
    }
    else
    {
         window.location.href = "../CompanyProfile/CompanyList.aspx?SrchQuote="+ SrchQuote+"&id=65";
 
    }
 }
 function RemoveQ()
{
        if(document.getElementById("txtCompany").value=="SEARCH QUOTES")
        {
            document.getElementById("txtCompany").value="";
        }
}
function FillQ()
{
    if(document.getElementById("txtCompany").value=="")
    {
 
    document.getElementById("txtCompany").value="SEARCH QUOTES";
    }
}
 
    function CheckAlphaNumericNameQ(_char, _mozChar) 
{
       
 if(_mozChar != null) 
  { // Look for a Mozilla-compatible browser
    if( (_mozChar==08)||(_mozChar==32)||(_mozChar >= 65 && _mozChar <= 90)|| (_mozChar >= 48 && _mozChar <= 57) || (_mozChar >= 97 && _mozChar <= 122) || (_mozChar == 13) || (_mozChar==47) ||(_mozChar ==39)) _RetVal= true;
    else 
    {
     
      alert('Please enter alphanumeric values  only.');
       _RetVal = false;
    }
  }
  else { // Must be an IE-compatible Browser
    if((_char == 32)|| (_char >= 65 && _char <= 90)|| (_char >= 48 && _char <= 57) ||  (_char >= 97 && _char <= 122) || (_char == 13) || (_char==47)||(_char==39)) _RetVal = true;
    else 
    {
      
      alert('Please enter alphanumeric values  only.');
      _RetVal = false;
    }
  }
  return _RetVal;
} 
    
 String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
   
 /******************************************************************************************************/
function Menu()
{
  
  var url = window.location.href;
 
  url=url.toLowerCase();
    
  if(url.indexOf("/product/")>0)
  {

   document.getElementById("P1").className="naviSel";
    }
    
  else if((url.indexOf("/equity/")>0)||(url.indexOf("/companyprofile/")>0)||(url.indexOf("/news/")>0)||(url.indexOf("/othermarket/")>0)||(url.indexOf("/corporateaction/")>0))
    {
    document.getElementById("P2").className="naviSel";
    }
     else if(url.indexOf("/derivatives/")>0)
    {
    document.getElementById("P3").className="naviSel";
    }
     else if(url.indexOf("/currencyderivatives/")>0)
    {
    document.getElementById("P4").className="naviSel";
    }
      else if(url.indexOf("/commodity/")>0)
    {
    document.getElementById("P5").className="naviSel";
    }
      else if(url.indexOf("/mutualfund/")>0)
    {
    document.getElementById("P6").className="naviSel";
    }
      else if(url.indexOf("/ipo/")>0)
    {
    document.getElementById("P7").className="naviSel";
    }
       
      else if(url.indexOf("/static/pms")>0)
    {
    document.getElementById("P8").className="naviSel";
    }
      else if(url.indexOf("/download/")>0)
    {
    document.getElementById("P9").className="naviSel";
    }
    else if(url.indexOf("/static/aboutus")>0)
    {
     document.getElementById("Abt").className="navisel1";
    }
     else if(url.indexOf("/static/contactus")>0)
    {
     document.getElementById("Con").className="navisel1";
    }
     else if(url.indexOf("/static/career")>0)
    {
     document.getElementById("career").className="navisel1";
    }
     else if(url.indexOf("arcadia.aspx")>0 )
    {
     document.getElementById("HomeA").className="navisel1";
    }
    else if (url.indexOf("arcadiastock.com/") == 7 && url.indexOf("static/joinus") == -1)
    {
     document.getElementById("HomeA").className="navisel1";
    }
}
/*************************************************Footer******************************************************/
function Disclaimer()
    { 
     window.open("../Static/Disclaimer.aspx",'Arcadia','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=580,height=500,screenX=0,screenY=0,left=210,top=200');
    }
    function PrivacyPolicy()
{
  window.open("../Static/PrivacyPolicy.aspx",'Arcadia','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=580,height=500,screenX=0,screenY=0,left=210,top=200');
}  
function Grievance()
{
  window.open("../Static/Grievance.aspx",'Arcadia','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=580,height=500,screenX=0,screenY=0,left=210,top=200');
} 
/***********************************************************************************************************/

/***************************************************HomeChart**************************************************/
function ShowHomeChart(Exchg)
{
   
  if(Exchg =="BSE")
  {
    document.getElementById("BSE").className = "HomeSelect";
     document.getElementById("NSE").className = "HomeUnSelect";
     document.getElementById("Sensex").style.display = "";
     document.getElementById("nifty").style.display = "none";
     document.getElementById("updtimeBSEHM").style.display="";   
     document.getElementById("updtimeNSEHM").style.display="none";
  }
  else
   {
    document.getElementById("NSE").className = "HomeSelect";
     document.getElementById("BSE").className = "HomeUnSelect";
     document.getElementById("Sensex").style.display = "none";
   document.getElementById("nifty").style.display = "";
     document.getElementById("updtimeBSEHM").style.display="none";   
     document.getElementById("updtimeNSEHM").style.display="";
   }
   
      var so = new SWFObject("amline/amline.swf", "BSENSEline", "205px", "100%", "0", "#ffffff");
        
		so.addVariable("path", "amline/");
		so.addParam("wmode","opaque");
		so.addVariable("preloader_color", "#ededed");
		so.addVariable("settings_file", encodeURIComponent("Home/Equity_settings.xml"));
		so.addVariable("data_file", encodeURIComponent("Home/BSENSEchartAjax.aspx?Exchg="+Exchg+"&TimeStamp="+new Date().getTime()));
//		alert("Home/BSENSEchartAjax.aspx?Exchg="+Exchg+"&TimeStamp="+new Date().getTime());
		so.write("chart");
//		alert(document.getElementById("MarketTop1_HomeChart_ChartExch"));
//		if(document.getElementById("MarketTop1_GLVolVal1_HiddExch")!=null)
//		{	
           document.getElementById("MarketTop1_HomeChart_ChartExch").value=Exchg;
//	     document.getElementById("MarketTop1_GLVolVal1_HiddExch").value=Exchg;
//	    }
	
//    ChangeControl('GAIN',Exchg);
 ChangeControl('GAIN');
}
/**************************************************************************************************************/
