function Show(files)
{	
	fileName = files;
  	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'win1','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=780,height=455,screenX=0,screenY=0,left=107,top=186');	
}
function ChangeNCMCDX(Exchg)
{
	var url="MCXNCPrice.asp?sid=" + Math.random() + "&Exchg=" + Exchg
	
	xmlHttp=GetXmlHttpObject(stateChangeNCMCX)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
	
}

function stateChangeNCMCX() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("McxNcdex").innerHTML=xmlHttp.responseText 
} 
} 


function Ticker(ex,typ)
{

if (ex == "MCX")
{
	
	if (typ=="S")
	{
	document.getElementById("Spot").className='tabSelectedticker';
	document.getElementById("Future").className='NotSelected';
	}
	else
	{
	document.getElementById("Future").className='tabSelectedticker';
	document.getElementById("Spot").className='NotSelected';
	}
	var url="Tickersource_mcx.asp?exch=" + document.getElementById("Ech").value +"&typ="+typ
	xmlHttp=GetXmlHttpObject(stateChange)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}
}

function Ticker1(ex,typ)
{
	
	if(ex == "NCDEX")
{
	
	if (typ=="SS")
	{
	document.getElementById("NCDEXSpot").className='tabSelectedticker';
	document.getElementById("NCDEXFuture").className='NotSelected';
	}
	else
	{
	document.getElementById("NCDEXFuture").className='tabSelectedticker';
	document.getElementById("NCDEXSpot").className='NotSelected';
	}
	var url="Tickersource_ncdex.asp?exch=" + document.getElementById("NCDEXEch").value +"&typ="+typ
	var ajax = new Ajax.Updater('NCDEXtp',url);
	
}

}
function stateChange() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("tp").innerHTML=xmlHttp.responseText 
} 
} 
function stateChangeNCDEX() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("NCDEXtp").innerHTML=xmlHttp.responseText 
} 
} 


function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 
function ShowArt(files)
{	
fileName = files;
  	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'win1','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=587,height=458,screenX=0,screenY=0,left=334,top=186');	
}
function ShowKyc(files)
{	
fileName = files;
  	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'win1','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=300,height=300,screenX=0,screenY=0,left=334,top=186');	
}
function ShowHistory(files)
{	
	fileName = files;
  	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'win1','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=780,height=550,screenX=0,screenY=0,left=107,top=92');	
}
function Story(type,sno,secid,subsecid)
{	
	fileName = "NewsDetails.asp?type="+ type+"&sno="+ sno+"&secid="+ secid+"&subsecid="+ subsecid;
  	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'win1','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=580,height=360,screenX=0,screenY=0,left=300,top=237');	
}

function glToggle(strVal)
{
 var strVal;
 var TopG = document.getElementById("TopG")
 var TopL = document.getElementById("TopL")
 var maxgain = document.getElementById("maxgain")
 var maxlose = document.getElementById("maxlose")
 if(strVal=='G'){
 		TopGImg.src = "images/GainersOn.gif";
		TopLImg.src = "images/LosersOff.gif"
		TopG.style.display = "inline";
		maxgain.style.display = "inline";
		TopL.style.display = "none";
		maxlose.style.display = "none";
	}
	else if(strVal=='L') {
 		TopGImg.src = "images/GainersOff.gif";
		TopLImg.src = "images/LosersOn.gif"
		TopG.style.display = "none";
		maxgain.style.display = "none";
		TopL.style.display = "inline";	
		maxlose.style.display = "inline";
	}
}



function newsToggle(strVal)
{
 var strVal;
 var Filestock = document.getElementById("stock")
 var Filebuss  = document.getElementById("buss")
  var Filemutual  = document.getElementById("mutual")
 if(strVal=='S'){
	 	MutualImg.src = "images/MFNEWSon.gif"
		StockImg.src = "images/StockOn.gif";
		BussImg.src = "images/BusinessOff.gif"
		Filestock.style.display = "inline";
		Filebuss.style.display = "none";
		Filemutual.style.display = "none";
		document.getElementById("StockMore").style.display = "inline";
		document.getElementById("BussMore").style.display = "none";
		document.getElementById("mutualMore").style.display = "none";
	}
	else if(strVal=='B') {
		MutualImg.src = "images/MFNEWSon.gif"
 		StockImg.src = "images/StockOff.gif";
		BussImg.src = "images/BusinessOn.gif"
		Filestock.style.display = "none";
		Filebuss.style.display = "inline";
		Filemutual.style.display = "none";
		document.getElementById("StockMore").style.display = "none";
		document.getElementById("BussMore").style.display = "inline";
		document.getElementById("mutualMore").style.display = "none";
	}
	else if(strVal=='M') {
		MutualImg.src = "images/MFNEWS.gif"
 		StockImg.src = "images/StockOff.gif";
		BussImg.src = "images/BusinessOff.gif"
		Filemutual.style.display = "inline";
		Filestock.style.display = "none";
		Filebuss.style.display = "none";	
		document.getElementById("mutualMore").style.display = "inline";
		document.getElementById("StockMore").style.display = "none";
		document.getElementById("BussMore").style.display = "none";
		
	}
}
function newsToggle_IBT(strVal)
{
 var strVal;
 var Filestock = document.getElementById("stock")
 var Filebuss  = document.getElementById("buss")
 var Filemutual  = document.getElementById("mutual")
 var Filecomm = document.getElementById("comm")
 if(strVal=='S'){
	 	MutualImg.src = "images/MFNEWSon.gif"
		StockImg.src = "images/StockOn.gif";
		BussImg.src = "images/Business_Off.jpg"
		CommImg.src = "images/Commodity_Off.gif"
		Filestock.style.display = "inline";
		Filebuss.style.display = "none";
		Filemutual.style.display = "none";
		Filecomm.style.display = "none";
		document.getElementById("StockMore").style.display = "inline";
		document.getElementById("BussMore").style.display = "none";
		document.getElementById("mutualMore").style.display = "none";
		document.getElementById("commMore").style.display = "none";
	}
	else if(strVal=='B') {
		MutualImg.src = "images/MFNEWSon.gif"
 		StockImg.src = "images/StockOff.gif";
		BussImg.src = "images/Business_On.gif"
		CommImg.src = "images/Commodity_Off.gif"
		Filestock.style.display = "none";
		Filebuss.style.display = "inline";
		Filemutual.style.display = "none";
		Filecomm.style.display = "none";
		document.getElementById("StockMore").style.display = "none";
		document.getElementById("BussMore").style.display = "inline";
		document.getElementById("mutualMore").style.display = "none";
		document.getElementById("commMore").style.display = "none";
	}
	else if(strVal=='M') {
		MutualImg.src = "images/MFNEWS.gif"
 		StockImg.src = "images/StockOff.gif";
		BussImg.src = "images/Business_Off.jpg"
		CommImg.src = "images/Commodity_Off.gif"
		Filemutual.style.display = "inline";
		Filestock.style.display = "none";
		Filebuss.style.display = "none";
		Filecomm.style.display = "none";
 		document.getElementById("mutualMore").style.display = "inline";
		document.getElementById("StockMore").style.display = "none";
		document.getElementById("BussMore").style.display = "none";
		document.getElementById("commMore").style.display = "none";
	}
	else if(strVal=='C'){
		MutualImg.src = "images/MFNEWSon.gif"
 		StockImg.src = "images/StockOff.gif";
		BussImg.src = "images/Business_Off.jpg"
		CommImg.src = "images/Commodity_On.gif"
		Filestock.style.display = "none";
		Filebuss.style.display = "none";
		Filemutual.style.display = "none";
		Filecomm.style.display = "inline";
		document.getElementById("StockMore").style.display = "none";
		document.getElementById("BussMore").style.display = "none";
		document.getElementById("mutualMore").style.display = "none";
		document.getElementById("commMore").style.display = "inline";
	}
}
function resolutionChk()
{
	if (screen.width == 640) {
		menu1Left1 = 250 
		menu1Left2 = 380
		menu1Left3 = 515
		menu1Left4 = 645
	}	
	if (screen.width == 800) {
		menu1Left1 = 248 
		menu1Left2 = 380
		menu1Left3 = 513
		menu1Left4 = 645	
	}
	if (screen.width == 1024) {
		menu1Left1 = 360 
		menu1Left2 = 495
		menu1Left3 = 625
		menu1Left4 = 758	
	}
	if (screen.width == 1280) {
		menu1Left1 = 487 
		menu1Left2 = 622
		menu1Left3 = 755
		menu1Left4 = 884	
	}

		document.write('<STYLE type=text/css >')
		document.write('#menu1 {LEFT: '+ menu1Left1 +'px; VISIBILITY: hidden; POSITION: absolute; TOP: 335px; width: 270px}');
		document.write('#menu2 {LEFT: '+ menu1Left2 +'px; VISIBILITY: hidden; POSITION: absolute; TOP: 335px; width: 170px}');
		document.write('#menu3 {LEFT: '+ menu1Left3 +'px; VISIBILITY: hidden; POSITION: absolute; TOP: 335px; width: 170px}');
		document.write('#menu4 {LEFT: '+ menu1Left4 +'px; VISIBILITY: hidden; POSITION: absolute; TOP: 335px; width: 130px}');
		document.write('</STYLE>');		
}		

<!--
function ShowPage()
{
	var opt;
	opt=document.frmPriceAnal.Opt.value;
	location.href=opt;
}

function PagelinkHighLow(){
var opt;
opt=document.frmPriceAnal.GroupName.value;
switch (opt){ 
	case 'A' : 
		document.location= "Bse52HighLow.asp?PageOpt=3&Fld=A&FldG=R&Exchg=BSE"
	break; 
	case 'B1' : 
		document.location="Bse52HighLow.asp?PageOpt=3&Fld=B1&FldG=R&Exchg=BSE"
	break; 
	case 'B2' : 
		document.location= "Bse52HighLow.asp?PageOpt=3&Fld=B2&FldG=R&Exchg=BSE"
	break; 
	case 'T' : 
		document.location= "Bse52HighLow.asp?PageOpt=3&Fld=T&FldG=R&Exchg=BSE"
	break; 
	case 'Z' : 
		document.location= "Bse52HighLow.asp?PageOpt=3&Fld=Z&FldG=R&Exchg=BSE"
	break; 
	case 'ALL' : 
		document.location= "Bse52HighLow.asp?PageOpt=3&Fld=ALL&FldG=R&Exchg=BSE"
	break;
} 
}


function PagelinkVolume(){
var opt;
opt=document.frmPriceAnal.GroupName.value;
switch (opt){ 
	case 'A' : 
		document.location= "BseTopVol.asp?PageOpt=2&Fld=A&FldG=R&Exchg=BSE"
	break; 
	case 'B1' : 
		document.location="BseTopVol.asp?PageOpt=2&Fld=B1&FldG=R&Exchg=BSE"
	break; 
	case 'B2' : 
		document.location= "BseTopVol.asp?PageOpt=2&Fld=B2&FldG=R&Exchg=BSE"
	break; 
	case 'T' : 
		document.location= "BseTopVol.asp?PageOpt=2&Fld=T&FldG=R&Exchg=BSE"
	break; 
	case 'Z' : 
		document.location= "BseTopVol.asp?PageOpt=2&Fld=Z&FldG=R&Exchg=BSE"
	break; 
	case 'ALL' : 
		document.location= "BseTopVol.asp?PageOpt=2&Fld=ALL&FldG=R&Exchg=BSE"
	break;
} 
}


/*function for Mutual Fund*/
// JScript source code

			//Global Variables
			var XmlHttp;
			
			//Creating object of XMLHTTP For AJAX Method
			function CreateXmlHttp()
				{
					//Creating object of XMLHTTP in IE
					try
					{
						XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
					}
					catch(e)
					{
						try
						{
							XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
						} 
						catch(oc)
						{
							XmlHttp = null;	
						}
					}
					//Creating object of XMLHTTP in Mozilla and Safari 
					if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
					{
						XmlHttp = new XMLHttpRequest();
					}
				}


function getScheme(typ)
	{
		
		fund = document.getElementById("fund").value;
		//category = document.getElementById("cat").value;
		
		scheme = document.getElementById("sch").value;
		//document.body.style.cursor = "progress";
			CreateXmlHttp();
			var requestUrl = "scheme.asp?fund="+fund;
			//alert(requestUrl)
			
			if(XmlHttp)	
			{
				XmlHttp.onreadystatechange = getSchDataResponse;
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);		
			}
			
	}
	function getSchDataResponse()
				{
					// 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
						if(XmlHttp.status == 200)
						{	
							var strData = XmlHttp.responseText
							//alert(strData)
							//addData("s1",strdata)
							var dropDown = document.getElementById("sch");
							dropDown.length = 0;
							var tdata = strData.split("|");
							for(i=0; i<tdata.length; i++)
							{	
								var temp1 = tdata[i].split("~");
								dropDown.options[i] = new Option(); 
								dropDown.options[i].value = temp1[1];
								dropDown.options[i].text = temp1[0];
							}
						}
					}		
				}	
				
				
function getScheme1(typ)
	{
		
		fund = document.getElementById("fund").value;
		//category = document.getElementById("cat").value;
		
		var temp = new Array();
		temp = fund.split(',');
       	fund=temp[0]
		fundname=temp[1]
		
		scheme = document.getElementById("sch").value;
		//document.body.style.cursor = "progress";
			CreateXmlHttp();
			var requestUrl = "scheme.asp?fund="+fund;
			//alert(requestUrl)
			
			if(XmlHttp)	
			{
				XmlHttp.onreadystatechange = getSchDataResponse1;
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);		
			}
			
	}
	function getSchDataResponse1()
				{
					// 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
						if(XmlHttp.status == 200)
						{	
							var strData = XmlHttp.responseText
							//alert(strData)
							//addData("s1",strdata)
							var dropDown = document.getElementById("sch");
							dropDown.length = 0;
							var tdata = strData.split("|");
							for(i=0; i<tdata.length; i++)
							{	
								var temp1 = tdata[i].split("~");
								dropDown.options[i] = new Option(); 
								dropDown.options[i].value = temp1[1];
								dropDown.options[i].text = temp1[0];
							}
						}
					}		
				}					
function winnav(r1,r2,r3,mnuOpt)	
{
    location.href="MF_Profile.asp?PageOpt=3&a=7a&tab=3&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
}
function pop6(r1,r2,r3,mnuOpt)
{
	location.href="MF_Profile.asp?PageOpt=3&a=7a&tab=4&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
}
function pop3(r1,r2,r3,mnuOpt)
{
	location.href="MF_Profile.asp?PageOpt=3&a=7a&tab=6&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
}
function pop4(r1,r2,r3,mnuOpt)
{	 
 location.href="MF_Profile.asp?PageOpt=3&a=7a&tab=5&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
}	

function pagelink(urlname,opt,glopt,Exchng){
	CreateXmlHttp();
	
	var requestUrl = "BseTopG.asp?Exchg="+ Exchng +"&VAL="+ glopt +"&Fld="+ opt;
	//alert(Exchg);
	if(XmlHttp)	{
	      
				XmlHttp.onreadystatechange = BsetopG
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);
			}
}
function BsetopG()
{
		
		if(XmlHttp.readyState == 4)
		{
		
			if(XmlHttp.status == 200)
			{
				
				document.getElementById("TopG").innerHTML = XmlHttp.responseText;
				document.body.style.cursor = "auto";
			}
			
		}
}

function pagelinkNew(urlname,opt,glopt,Exchng){
	CreateXmlHttp();
	
	var requestUrl = "BseTopL.asp?Exchg="+ Exchng +"&VAL="+ glopt +"&Fld="+ opt;
	//alert(Exchg);
	if(XmlHttp)	{
	      
				XmlHttp.onreadystatechange = BsetopL
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);
			}
}
function BsetopL()
{
		
		if(XmlHttp.readyState == 4)
		{
		
			if(XmlHttp.status == 200)
			{
				
				document.getElementById("TopL").innerHTML = XmlHttp.responseText;
				document.body.style.cursor = "auto";
			}
			
		}
}

// Commodity section //

function CommValidate(){
	//var Exchng = document.getq_form.Exchng.options[document.getq_form.Exchng.selectedIndex].value
	var Symbol =  document.getq_form.Symbol.options[document.getq_form.Symbol.selectedIndex].value
	var ExpDate =  document.getq_form.ExpDate.options[document.getq_form.ExpDate.selectedIndex].value

	var msg = "Please select "		
		/*if(Exchng==""){
			alert(msg + "Commodity Exchange ...!")
			return false;
		}*/
		if(Symbol==""){
			alert(msg + "Symbol ...!")
			return false;
		}
		if(ExpDate==""){
			alert(msg + "Expiry Date ...!")
			return false;
		}
}




