 /*Onemli Aciklama: Orn : 58éhttps://www.atayatirim.com.tr/piyasalar/default.asp?Level=14$TL Mevduat
 Cookie icerisinde ",," iki datayi birbirinden ayirmak icin kullanilir...
 "#" isareti URL'i Display Text'ten ayirmayi saglar...
 "é" isareti Id'yi URL'den ayrimayi saglar... */

var counter = 0;

function setCookie(sName, sValue) 

{
	var strCookie = sName + "=" + escape(sValue) + ";expires=Tue, 31 Dec 2050 23:59:59 UTC;";
	document.cookie = strCookie;				
}	

function getCookie(sName) 
{
	var aCookie = document.cookie.split(";");
	for (var i=0; i < aCookie.length; i++) 
	{
	    var aCrumb = aCookie[i].split("=");
	    while(aCrumb[0].indexOf(" ") == 0) aCrumb[0] = aCrumb[0].substr(1);
		    if (sName == aCrumb[0])
				return unescape(aCrumb[1]);
		}
		return null;
	}

function checkbox_onclick(value)
{					
	TempPoint= 'é';
	IdCharPoint = value.search(TempPoint);
	var Idchar = value.substring(0,IdCharPoint);
	checkcontrol = "document.all.checkbox" + Idchar + ".checked";

		
	if (eval(checkcontrol))
	{			
		counter= counter + 1;
	}
	else
	{
		counter= counter - 1;
	}	
	if (counter < 16)
	{				
		var strCookie = getCookie("SiteMap");		
		if ((strCookie == null) || (strCookie == "") )
		{
			cookievalue='0,'+ value + ',';			
			setCookie("SiteMap",cookievalue);
		}
		else
		{
			TempPoint= 'é';
			TempBreakPoint = value.search(TempPoint);				
			TempBreakPoint = value.substring(0,TempBreakPoint+1);
			BreakPoint = strCookie.search(TempBreakPoint);
			
			if (BreakPoint == '-1')
			{				
				strCookie= strCookie + ',' + value + ',';
				setCookie("SiteMap",strCookie);
			}
			else
			{
				Point			 = ',' + value + ',';
				Emptiness	 = '';
				strCookie	 = strCookie.replace(Point,Emptiness)
				setCookie("SiteMap",strCookie);
			}
		}	
	}
	else
	{
		alert("Maksimum 15 kutucuk isaretleyebilirsiniz!");
		checkcontrol = "document.all.checkbox" + Idchar + ".checked=false;";
		eval(checkcontrol);
	}
}

function getchecked()
{
	var strCookie = getCookie("SiteMap");
	var lastcomma = strCookie.lastIndexOf(",");
	var	Comma	 = ',';
			
				
	if ((strCookie !==null) || (strCookie !=="") )
	{
		Point = /é/i;
		BreakPoint = strCookie.search(Point);

		if (BreakPoint !== -1)
		{		
			for (i = 0;i = lastcomma;i++)
			{
				Point = /,,/i;
				BreakPoint = strCookie.search(Point);
				if (BreakPoint==-1)
				{
					break;
				}
				else
				{
					strCookie	 = strCookie.replace(Point,Comma)
				}	
			}
			var newstrCookie = strCookie.split(",");
			newstrcookielen	 = newstrCookie.length;

			
			for (i = 1;i <= newstrcookielen -2;i++)
			{
				strCookie= newstrCookie[i];
				var laststrcookie =strCookie.split("é");
				strId=laststrcookie[0];
				var controlmec = "document.all.checkbox"+strId+".checked=true;";
				eval(controlmec);
				counter = counter + 1;
			}
		}
	}
}

function combochg()
{	

	var strCookie = getCookie("SiteMap");
	
	if (strCookie==null)  return;
	
	
	var lastcomma = strCookie.lastIndexOf(",");
	var	Comma	 = ',';
//	setCookie("SiteMap",strCookie);	
	
	if ((strCookie ==null) || (strCookie =="") )
	{
		sValue='0,';
		var strCookie = sName + "=" + escape(sValue) + ";expires=Tue, 31 Dec 2050 23:59:59 UTC;";
		document.cookie = strCookie;				
	}
	else	
	{
		Point = /é/i;
		BreakPoint = strCookie.search(Point);		

		if (BreakPoint !== -1)
		{		
			for (i = 0;i = lastcomma;i++)
			{
				Point = /,,/i;
				BreakPoint = strCookie.search(Point);
				if (BreakPoint==-1)
				{
					break;
				}
				else
				{
					strCookie	 = strCookie.replace(Point,Comma)
				}	
			}
			var newstrCookie = strCookie.split(",");
			newstrcookielen	 = newstrCookie.length;

			for (i = 1;i <= newstrcookielen -2 ;i++)
			{
				strCookie= newstrCookie[i];
				var laststrcookie =strCookie.split("#");
				var Tempstr=laststrcookie[0];
				var SplitTempstr =strCookie.split("é");

				strId=SplitTempstr[0];
				strUrl=SplitTempstr[1];
				
				var SplitstrUrl =strUrl.split("#");
				strUrl=SplitstrUrl[0];
				
				strText=laststrcookie[1] + "...";

				var oOption = document.createElement("OPTION");
				HizliErisim.options.add(oOption);
				oOption.innerText = strText;
				oOption.value = strUrl;
			}
		}
	}
}

function yukle()
{	
	this.location= HizliErisim.options[HizliErisim.selectedIndex].value;			
}