function beginrefresh(){
		if (!document.images)
			return
		if (parselimit==1)
			window.location.reload()
		else{ 
			parselimit-=1
			curmin=Math.floor(parselimit/60)
			cursec=parselimit%60
			if (curmin!=0)
				curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
			else
				curtime=cursec+" seconds left until page refresh!"
			window.status=curtime
			setTimeout("beginrefresh()",1000)
		}
}

function URLEncode(pText)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var plaintext = pText;
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
	return encoded;
};

	function vobgrafikgoster()
	{
		var obj, sembol;
		obj = document.getElementById("selectgrafik");
		//alert(obj.selectedIndex);
		sembol = obj.options[obj.selectedIndex].value;
		document.getElementById("vobgrafik").src = "http://chart.matriksdata.com/ichart.net/BuildChart.aspx?s1=" + sembol + "&p=" + URLEncode("M") + "&t=" + URLEncode("L") + "&c=" + URLEncode("CALIKBANK") + "&w=" + URLEncode("174") + "&h=" + URLEncode("122");
		return true;
	}

	function imkbgrafikgoster(pActive, pPasif )
	{
		//document.getElementById("imkbgrafik").src = "http://chart.matriksdata.com/ichart.net/BuildChart.aspx?s1=XU"+pActive+"&p=D&t=H&c=CALIKBANK&w=205&h=103";		
		//document.getElementById("imkbgrafik").src = "http://chart.matriksdata.com/ichart.net/BuildChart.aspx?s1=XU" + pActive + "&p=" + URLEncode("D") + "&t=" + URLEncode("H") + "&c=" + URLEncode("CALIKBANK") + "&w=" + URLEncode("205") + "&h=" + URLEncode("103");
		
		
		document.getElementById("imkbgrafik").src = "http://chart.matriksdata.com/ichart.net/BuildChart.aspx?s1=XU"+pActive+"&p=D&t=H&c=CALIKBANK&w=205&h=103";
		
		document.getElementById("img_imkb"+pActive).src="img/imkb"+pActive+"_aktif.gif"
		document.getElementById("img_imkb"+pPasif).src="img/imkb"+pPasif+"_pasif.gif"
		
		//alert("");
		return true;
	}
	
	function togglePanel(pActive, pPasif) 
	{
		document.getElementById(pPasif).style.display='none';
		document.getElementById(pActive).style.display='block';
		
		document.getElementById("img_"+pActive).src="img/"+pActive+"_aktif.gif"
		document.getElementById("img_"+pPasif).src="img/"+pPasif+"_pasif.gif"
		return true;
	} 

	function OpenWindow(pUrl, pName, pWidth, pHeight)
	{
		//var w = window.open("haber_detay.asp","popup","tolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0, resizable=no,width=400,height=200");
		var w = window.open(pUrl, pName, "scrollbars=1, resizable=yes,width="+pWidth+",height="+pHeight);
		w.focus();
	}
	
	function TakvimEkle()
	{
		alert('ok');
		return true;
	}	
	
	function HisseAnaliz(pFonksiyon)
	{
		var obj, deg, sembolid, sembol, arr;		
		obj = document.getElementById("hisse");
		deg  = obj.options[obj.selectedIndex].value;
		arr = deg.split(';')
		sembolid = arr[0];
		sembol = arr[1];
				
		if(sembolid<0){
			alert ("Lütfen Bir Senet Seçiniz?");
			return;
		}
			
		if(pFonksiyon=="PGC")
			OpenWindow('webanaliz_pgc.asp?sembolid=' + sembolid,'webanaliz','710','800');

		if(pFonksiyon=="TAKAS")
			OpenWindow('webanaliz_takas.asp?sembolid=' + sembolid,'webanaliz','800','800');

		if(pFonksiyon=="JAVAMATRIKS")
			OpenWindow('webanaliz_javamatriks.asp','javata','830','625');
			
		if(pFonksiyon=="DETAY")	
			document.location='hisseanaliz.asp?hisse=' + sembolid + '&sembol=' + sembol;
			
		if(pFonksiyon=="TEMEL")
			OpenWindow('http://www.matriks.web.tr/kurumlar/turkish/malitablolar.asp?hisse=' + sembolid + '&sembol=' + sembol,'temelanaliz','710','800');			
	}