function rtclickcheck() {
    if (event.button == 2) {
        alert('Bu ekranda sağ tuş kullanımı kapatılmıştır!');
        return false;
    }
}
document.onmousedown = rtclickcheck;

function disableCtrlKeyCombination(e) {
    var key;
    var isCtrl;
    key = e.keyCode;
    if (e.ctrlKey)
        isCtrl = true;
    else
        isCtrl = false;

    if (isCtrl) {
        if (String.fromCharCode(key).toLowerCase() == 'p') {
            alert('Bu ekranda CTRL + P fonksiyonunun kullanımı kapatılmıştır!');
            return false;
        }
    }
    return true;
}

window.onload = function () {
    setSpecialElements();
    onload_event();
    if (typeof init != 'undefined') init();

    Load_GeriYuklet();
}

	function olay(ev) {
	    var e = window.event.keyCode;

	    if (e == ev) return true;
	    else return false;
	}

	function enteryok() {
	    if (event.keyCode == 13) event.returnValue = false;
	}

	function ondalik() {
	    var key;
	    var keychar;

	    key = window.event.keyCode;
	    keychar = String.fromCharCode(key);

	    if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)) return true;
	    else if ((("0123456789").indexOf(keychar) > -1)) {
	        return true;
	    }
	    else return false;
	}

	function alertX(param) {
	    ht = document.getElementsByTagName("html");
	    ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	    alert(param);
	    ht[0].style.filter = "";
	}

	function HariciMenuAjax(w, h, s, moduleDesc) {
	    var divId = 'dialogDiv1';
	    if (document.getElementById('orh'))
	        HariciMenuAjaxKapat();
	    var ifr = document.createElement("iframe");
	    ifr.id = "orh";
	    ifr.src = s;
	    ifr.frameborder = "0";
	    ifr.scrolling = "no";
	    ifr.width = w;
	    ifr.height = h;
	    document.getElementById('ctl00_dialogPanel1').style.width = w;
	    document.getElementById('dialogTable1').style.width = w;
	    document.getElementById('dialogTable2').style.width = w;
	    document.getElementById('dialogTable3').style.width = w;
	    document.getElementById('dialogDesc').innerHTML = moduleDesc;
	    document.getElementById(divId).appendChild(ifr);
	    document.getElementById('ctl00_dialogUyariKontrol').click();
	}

	function HariciMenuAjaxKapat() {
	    var divId = 'dialogDiv1';
	    document.getElementById(divId).removeChild(document.getElementById('orh'));
	    document.getElementById('ctl00_dialogKapat').click();
	}

	function HariciMenu(w,h,s)
	{
		if (document.all.hm)
		{
			HariciMenuKapat();
		}
	
		var hm = document.createElement("div");
		hm.id = "hm";
		hm.style.position = "absolute";
		hm.style.width = w;
		hm.style.height = h;
		hm.style.left = (document.body.clientWidth/2)-(w/2);
		hm.style.top = (document.body.clientHeight/2)-(h/2);
		hm.style.filter = "progid:DXImageTransform.Microsoft.dropShadow(Color=#808080,offX=2,offY=2,positive=true)";
		hm.style.zIndex = 100;
		//style="FILTER: ;

		var ifr = document.createElement("iframe");
		ifr.id = "furq";
		ifr.src = s;
		ifr.scrolling = "no";
		ifr.width = "100%";
		ifr.height = "100%";

		document.body.appendChild(hm);
		hm.appendChild(ifr);
	}

	function HariciMenu2(w,h,s)
	{
		if (document.all.hm2)
		{
			HariciMenu2Kapat();
		}

		var hm2 = document.createElement("div");
		hm2.id = "hm2";
		hm2.style.position = "absolute";
		hm2.style.width = w;
		hm2.style.height = h;
		hm2.style.left = (document.body.clientWidth/2)-(w/2);
		hm2.style.top = (document.body.clientHeight/2)-(h/2);
		hm2.style.filter = "progid:DXImageTransform.Microsoft.dropShadow(Color=#808080,offX=2,offY=2,positive=true)";
		hm2.style.zIndex = 100;
		//style="FILTER: ;

		var ifr2 = document.createElement("iframe");
		ifr2.id = "furq2";
		ifr2.src = s;
		ifr2.scrolling = "no";
		ifr2.width = "100%";
		ifr2.height = "100%";

		document.body.appendChild(hm2);
		hm2.appendChild(ifr2);
	}

	function HariciMenuKapat()
	{
		document.body.removeChild(document.getElementById("hm"));
	}

	function HariciMenu2Kapat()
	{
		document.body.removeChild(document.getElementById("hm2"));
	}

	function formatCurrency(para)
	{
		if (para.indexOf(',') != -1)
		{
			temp = para.split(',');

			if (temp[1].length == 1)
			{
				temp[1] += "0";
			}
			para = temp[0] + "," + temp[1];	
		}else
		{
			para += ",00";
		}

		return para;
	}

	function formatComma(num, type)
	{
		if (type == 0) return num.replace(/\,/g,'.');
		else return num.replace(/\./g,',');
	}

	function NoktaKoy(price)
	{//basamaklar arasına nokta koyar
      if(price.length > 14)
      {
        price = price.replace(/\./g,'');
        price = price.replace(/\,/g,'');
        price = price.substring(0, 11);
        price = insert(price, ',', price.length-2);
      }
    
      price = price.replace(/\./g,'');
			lira = '';
			kurus = '';

			if (price.indexOf(',') != -1)
			{
				tmp = price.split(',');
				lira = tmp[0];
				kurus = tmp[1];
			}
			else
				lira = price;

      if (lira.length == 4 )
				lira = insert(lira, '.', 1);
      else if (lira.length == 5)
				lira = insert(lira, '.', 2);
			else if( lira.length == 6 )
				lira = insert(lira, '.', 3);
      else if (lira.length == 7 )
			{
				lira = insert(lira, '.', 1);
				lira = insert(lira, '.', 5);
			}
      else if (lira.length == 7 )
        lira = insert(lira, '.', 4);
      else if (lira.length == 8 )
			{
				lira = insert(lira, '.', 2);
				lira = insert(lira, '.', 6);
			}
      else if (lira.length == 9 )
			{
				lira = insert(lira, '.', 3);
				lira = insert(lira, '.', 7);
			}

			if (kurus == '') return lira;
			else return lira + ',' + kurus;	
	}

  function insert(string1, string2, indx)
  {//string2'yi string1'in içine insert eder  
    string = string1.substring(0, indx);
    string = string + string2;
    string = string + string1.substring(indx, string1.length);
    return string;
  }
  
	function setSpecialElements()
	{
		if (!document.forms[0]) return;

		var i, iElements=document.forms[0].elements.length;

		for (i=0; i<iElements; i++)
		{
			var oElement=document.forms[0].elements[i];
			
			if (oElement.type != "text" && oElement.type != "button" && oElement.type != "submit") continue;
		
			if (oElement.getAttribute("Currency") != null)
			{
				var t = "";
				if (oElement.onkeyup) t = oElement.onkeyup.toString();
				t = t.substring(22, t.length-1);
				
				oElement.setAttribute("temp", t);
				//oElement.style.textAlign = 'right';

				oElement.onkeypress = function(){if (olay(8)) eval("this.value = makeYTL(this.value);"); return ondalik();};
				oElement.onkeyup = function(){if (!olay(9)) eval("this.value = makeYTL(this.value);");  eval(this.temp);}
				
				if (oElement.value=="") oElement.value = "0,00";
			}

			if (oElement.getAttribute("Currency2") != null)
			{//basamaklar arasına nokta koyar
				var t = "";
				if (oElement.onkeyup) t = oElement.onkeyup.toString();
				t = t.substring(22, t.length-1);
				
				oElement.setAttribute("temp", t);
				oElement.style.textAlign = 'right';

				oElement.onkeypress = function(){if (olay(8)) eval("this.value = NoktaKoy(makeYTL(this.value));"); return ondalik();};
				oElement.onkeyup = function(){if (!olay(9)) eval("this.value = NoktaKoy(makeYTL(this.value));");  eval(this.temp);}
				
				if (oElement.value=="") oElement.value = "0,00";
			}
			
			if (oElement.getAttribute("Lira") != null)
			{				
				var t = "";
				if (oElement.onkeyup) t = oElement.onkeyup.toString();
				t = t.substring(22, t.length-1);
				
				oElement.setAttribute("temp", t);
				oElement.style.textAlign = 'right';

				oElement.onkeypress = function(){if (olay(8)) eval("this.value = makeLira(this.value);"); return ondalik();};
				oElement.onkeyup = function(){if (!olay(9)) eval("this.value = makeLira(this.value);");  eval(this.temp);}
			}
					
			if (oElement.getAttribute("Kurus") != null)
			{				
				var t = "";
				if (oElement.onkeyup) t = oElement.onkeyup.toString();
				t = t.substring(22, t.length-1);
				
				oElement.setAttribute("temp", t);
				oElement.style.textAlign = 'left';

				oElement.onkeypress = function(){if (olay(8)) eval("this.value = makeKurus(this.value);"); return ondalik();};
				oElement.onkeyup = function(){if (!olay(9)) eval("this.value = makeKurus(this.value);");  eval(this.temp);}
			}
					
			if (oElement.getAttribute("Date") != null)
			{
				var t = "";
				if (oElement.onkeyup) t = oElement.onkeyup.toString();
				t = t.substring(22, t.length-1);
				
				oElement.setAttribute("temp", t);
				
  				oElement.onkeypress = function(){if (olay(8)) eval("this.value = makeDate(this.value);"); return ondalik();};
				oElement.onkeyup = function(){if (!olay(9)) eval("this.value = makeDate(this.value);"); eval(this.temp);}
			
				oElement.maxLength = 10;
			}
			if (oElement.getAttribute("Numeric") != null)
			{
					if (oElement.getAttribute("Numeric") != "NoRight") oElement.style.textAlign = 'right';
  				oElement.onkeypress = function(){return ondalik();};
			}
			if (oElement.getAttribute("NoEnter") != null)
			{
  				oElement.onkeydown = function(){enteryok();};
			}
			if (oElement.getAttribute("Enter") != null)
			{
  				oElement.onkeydown = function(){if (olay(13)) document.forms[0].submit();};
			}

			//if (oElement.type == "button" || oElement.type == "submit")			
			if (oElement.getAttribute("Btn") != null)
			{
				var settings = oElement.getAttribute("Btn");
				
				if (settings.indexOf('|') == -1) continue;
				
				var set_ = settings.split('|');
				
				if (set_.length != 2) continue;
				
				var zemin = set_[0];
				var width = set_[1];
			
				
				oElement.style.background = 'url(../images/btnBeyaz.gif)';
				oElement.style.height = '26';
				oElement.style.width = '90';
				oElement.style.color = 'white';
				oElement.style.border = '0';
				oElement.style.backgroundRepeat = 'no-repeat';
				oElement.style.backgroundAttachment = 'fixed';
			}
		}
	}

	function makeYTL(para)
	{
		if (para.indexOf(',') != -1)
		{
			temp = para.split(',');
			para = temp[0] + '' + temp[1];
		}
		
		if (para.length>2)
		{
			return paraDuzenle(para.substring(0, para.length-2)) + ',' + para.substring(para.length-2, para.length);
		}
		else
		{
			if (para.length == 2) return '0,'+para;
			else return '0,0'+para;
		}
	}
	
	function makeLira(para)
	{
				return para;
	}
	
	function makeKurus(para)
	{
			if (para.length > 6)
			{
					return para.substring(0, 6);
			}
			else return para;
	}

	function paraDuzenle(str)
	{
			for(i=0;i<10;i++)
			{
						if (str.substring(0,1) == '0') str = str.substring(str.length-1,str.length);
			}
			
			return str;
	}

	function makeDate(tarih)
	{
		var key = window.event.keyCode;
		if (key != 8)
		{
		keychar = tarih.substring(tarih.length-2, tarih.length);
		
	//	alert(tarih.length);
		
			switch(tarih.length) 
			{
				case(2): 
					if (keychar>31) return ""; 
			 		break;
				case(5):  
					if (keychar>12) return tarih.substring(0, tarih.length-2); 
					break;
				case(10):  
					keychar = tarih.substring(tarih.length-4, tarih.length);
					if (keychar<1900 || keychar>2100) return tarih.substring(0, tarih.length-4); 
					break;
			}

			if (tarih.length == 2) return tarih.toString() + '/';
			if (tarih.length == 5) return tarih.toString() + '/';
			
			if (tarih.length>2) 
				if (tarih.indexOf('/') == -1)
					return tarih.substring(0, 2) + '/' + tarih.substring(2, tarih.length);
					
			if (tarih.length>5)
				if (tarih.lastIndexOf('/') == 2)
					return tarih.substring(0, 5) + '/' + tarih.substring(5, tarih.length);
		}
		
		return tarih;
	}
	
	
	function RefHazirla(w,h)
	{
		document.all.Ref.style.position = "absolute";
		document.all.Ref.style.width = w;
		document.all.Ref.style.height = h;
		document.all.Ref.style.left = (document.body.clientWidth/2)-(w/2);
		document.all.Ref.style.top = (document.body.clientHeight/2)-(h/2);
		document.all.Ref.style.filter = "progid:DXImageTransform.Microsoft.dropShadow(Color=#808080,offX=4,offY=4,positive=true)";
	}
	
	function PrintX()
	{
			var P = document.createElement("object");
			P.id = "PrintX1";
			P.classid = "CLSID:8DA531A4-4CCD-44A7-A07D-6620375EBB30";
			P.style.display = 'none';
				
			document.body.appendChild(P);

			try
			{
						document.all.PrintX1.IsLoaded();
			}
			catch(e)
			{
						return false;
			}
			
			return true;
   }


	function PrintX2()
	{
			var P = document.createElement("object");
			P.id = "PrintX_2";
			P.classid = "CLSID:DFD16332-1EEF-48B7-9C2F-69BC26FAE3E7";
			P.style.display = 'none';
				
			document.body.appendChild(P);

			try
			{
						document.all.PrintX_2.IsLoaded();
			}
			catch(e)
			{
						return false;
			}
		
			return true;
}

function BarcodeX()
	{
			var B = document.createElement("object");
			B.id = "BarcodeX1";
			B.classid = "clsid:941B03E5-4086-4C00-9352-EEF6253A6B55";
			B.style.display = 'none';
				
			document.body.appendChild(B);

			try
			{
						document.all.BarcodeX1.IsLoaded();
			}
			catch(e)
			{
						return false;
			}
			
				return true;
}

function StickerX()
{
			var StickerX1 = document.createElement("object");
			StickerX1.id = "StickerX1";
			StickerX1.classid = "CLSID:40708B2C-FFED-4B92-AD8B-05876815413A";
			StickerX1.style.display = 'none';
				
			document.body.appendChild(StickerX1);
	
			try
			{
						document.all.StickerX1.IsLoaded();
			}
			catch(e)
			{
						return false;
			}

			return true;
}

function StickerProX()
{
			var StickerProX1 = document.createElement("object");
			StickerProX1.id = "StickerProX1";
			StickerProX1.classid = "CLSID:C476DAC2-A90D-41B7-BF61-A698B576837B";
			StickerProX1.style.display = 'none';
				
			document.body.appendChild(StickerProX1);
	
			try
			{
						document.all.StickerProX1.IsLoaded();
			}
			catch(e)
			{
						return false;
			}

			return true;
}

	function VucutDiagramiX()
	{
			var P = document.createElement("object");
			P.id = "DiagramX1";
			P.classid = "CLSID:BF65F93C-7B27-4D59-8217-63EFEAB1F1A9";
			//P.style.display = 'none';
			P.style.width = '585';
			P.style.height = '448';
				
			document.all.diagram1.appendChild(P);
			

			try
			{
				document.all.DiagramX1.IsLoaded();
			}
			catch(e)
			{
			   P.style.display = 'none';
				return false;
			}
			
			return true;
   }
   
function VucutDiagramiXError()
{
			if (document.all.bilgi)
						document.all.bilgi.innerHTML = "Diagrami goruntuleyebileniz icin VucutDiagramiX Plug-In gerekmektedir! Yuklemek icin <a href=http://"+ getServerName() +"/hbys/plug-in/OtomatipDiagramControl.EXE>tiklayin..</a>";
			else alert("Diagrami goruntuleyebileniz için VucutDiagramiX Plug-In gerekmektedir!");
}

function StickerProXError()
{
			if (document.all.bilgi)
						document.all.bilgi.innerHTML = "Sticker basabilmeniz icin StickerProX Plug-In gerekmektedir! Yuklemek icin <a href=http://"+ getServerName() +"/hbys/plug-in/OtomatipStickerProControl.EXE>tiklayin..</a>";
			else alert("Sticker basabilmeniz için StickerProX Plug-In gerekmektedir!");
}

function StickerXError()
{
			if (document.all.bilgi)
						document.all.bilgi.innerHTML = "Sticker basabilmeniz icin StickerX Plug-In gerekmektedir! Yuklemek icin <a href=http://"+ getServerName() +"/hbys/plug-in/OtomatipStickerControl.EXE>tiklayin..</a>";
			else alert("Sticker basabilmeniz için StickerX Plug-In gerekmektedir!");
}

function BarcodeXError()
{
			if (document.all.bilgi)
						document.all.bilgi.innerHTML = "Kart basabilmeniz icin BarcodeX Plug-In gerekmektedir! Yuklemek icin <a href=http://"+ getServerName() +"/hbys/plug-in/OtomatipBarcodeControl.EXE>tiklayin..</a>";
			else alert("Çıktı alabilmeniz için BarcodeX Plug-In gerekmektedir!");
}

function PrintXError()
{
			if (document.all.bilgi)
						document.all.bilgi.innerHTML = "Cikti alabilmeniz icin PrintX Plug-In gerekmektedir! Yuklemek icin <a href=http://"+ getServerName() +"/hbys/plug-in/OtomatipPrintControl.EXE>tiklayin..</a>";
			else alert("Çıktı alabilmeniz için PrintX Plug-In gerekmektedir!");
}

function PrintXDrawLines(px)
{
/*
				"		current = 10; lines[current] = new Array(); lines[current][0] = 1.7; lines[current][1] = top; lines[current][2] = 2;" +
				"		current = 11; lines[current] = new Array(); lines[current][0] = 2.6; lines[current][1] = top; lines[current][2] = 2;" +

/*				
        //----------------- Çuzuklar -------------------
        px1.DrawLine 0, 3.2, 0.6, 3.2, 2 'Sıra);" +
        px1.DrawLine 0.8, 3.2, 5.4, 3.2, 2 'Adı ve Soyadı);" +
 
*/
			if (isArray(px))
			{
						var x1 = 0;var y1 = 0;var x2 = 0;var y2 = 0;var b = 0;
						for (i=0;i<px.length;i++)
						{
									if (i == 0) x1 = 0;
									else x1 = parseFloat(px[i-1][0])+0.2;
									x2 = parseFloat(px[i][0])+parseFloat(x1);
									y1 = y2 = px[i][1];
									b = px[i][2];
//									alert("document.all.PrintX1.DrawLine("+x1+","+y1+","+x2+","+y2+","+b+");");
									
									document.all.PrintX1.DrawLine(x1,y1,x2,y2,b);
						}		
			}
}

function PrintXClose()
{
			document.body.removeChild(document.getElementById("PrintX1"));
}

function PrintX2Close()
{
			document.body.removeChild(document.getElementById("PrintX_2"));
}

function BarcodeXClose()
{
			document.body.removeChild(document.getElementById("BarcodeX1"));
}

function StickerXClose()
{
			document.body.removeChild(document.getElementById("StickerX1"));
}

function StickerProXClose()
{
			document.body.removeChild(document.getElementById("StickerProX1"));
}

function VucutDiagramiXClose()
{
			document.body.removeChild(document.getElementById("DiagramX1"));
}

//-------------------------------------------------------------------
// isArray(obj)
// Returns true if the object is an array, else false
//-------------------------------------------------------------------
function isArray(obj)
{
			return(typeof(obj.length)=="undefined")?false:true;
}

function BarcodeControl()
{
	if (document.all.bc1)
		if (document.all.bc1.ctrl == "1")
			if (event.keyCode == 13) event.returnValue = false;
	
	if (!document.all.HastaneKodu) return;
	
	var pHastaneKodu = document.all.HastaneKodu.value;
	
	var key = window.event.keyCode;
	var keychar = String.fromCharCode(key);		

	if (!document.all.bc1)
	{
		var bc = document.createElement("input");
		bc.type = "hidden";
		bc.id = "bc1";

		document.body.appendChild(bc);

		document.all.bc1.setAttribute("ctrl", "0");
		document.all.bc1.setAttribute("time1", "0");
		document.all.bc1.setAttribute("time2", "0");
	}

	var _bc1 = document.all.bc1;

	if (_bc1.ctrl == "1" && key == 13)
	{
		if ((parseFloat(_bc1.time2)-parseFloat(_bc1.time1))<0.1000)
		{
			var tckimlik = _bc1.value.substring(4,15);
			var Focused = event.srcElement;
			Focused.value = "";

			BarcodeControl_Load(tckimlik);
		}

		_bc1.ctrl = "0";						
		_bc1.value = "";
	}

	if (_bc1.ctrl == "0")
			if (keychar == pHastaneKodu.substring(0, 1)) _bc1.ctrl = "1";

	if (_bc1.ctrl == "1")
	{
		_bc1.value += keychar;

		if (_bc1.value.length == 4)
			if (_bc1.value != pHastaneKodu)
			{
				_bc1.ctrl = "0";
				_bc1.value = "";
				return;
			}
			else
			{
				//document.body.focus();
			}

		var time = new Date();
		if (_bc1.value.length == 1) _bc1.time1 = time.getSeconds() + '.' + time.getMilliseconds();
		if (_bc1.value.length == 14) _bc1.time2 = time.getSeconds() + '.' + time.getMilliseconds();
	}
}

//window.document.body.onkeydown = BarcodeControl;

function F5KIR()
{
	//alert(window.event.keyCode);
	
	if(window.event && window.event.keyCode == 113) 
		if (document.all.yeni)
			document.all.yeni.click();

	if(window.event && window.event.keyCode == 116) 
  {
		window.event.keyCode = 505;
  }

	if(window.event && window.event.keyCode == 505) 
  {
		return false; 
	}
}

document.onkeydown = F5KIR;

function getServerName()
{
	var test = location.href;

	var x1 = test.indexOf('//');
	test = test.substring(x1+2,x1.length);

	var x2 = test.indexOf('/');
	test = test.substring(0, x2);

	return test;
}

	function UyariMsj(msg)
	{
			return(confirm(msg+'\nDevam edilsin mi?'));
	}

var nFIP  = 0;

function findInPage(str) {
var txt, i, found;

if (str == "") return;

txt = this.document.body.createTextRange();
for (i = 0; i <= nFIP && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
nFIP++;
}
else {
if (nFIP > 0) {
nFIP = 0;
findInPage(str);
}
}
}

function PageQuery(q) {
  if(q.length > 1) q = q.substring(1, q.length);
  else q = null;
  
  this.keyValuePairs = new Array();
  if(q) 
  {
    for(var i=0; i < q.split("&").length; i++) 
    {
      this.keyValuePairs[i] = q.split("&")[i];
    }
  }
  this.getKeyValuePairs = function() { return this.keyValuePairs; }
  this.getValue = function(s) {
  for(var j=0; j < this.keyValuePairs.length; j++) {
  if(this.keyValuePairs[j].split("=")[0] == s)
  return this.keyValuePairs[j].split("=")[1];
  }
  return false;
}

this.getParameters = function() {
  var a = new Array(this.getLength());
  for(var j=0; j < this.keyValuePairs.length; j++) 
  {
    a[j] = this.keyValuePairs[j].split("=")[0];
  }
  return a;
}

this.getLength = function() { return this.keyValuePairs.length; } 
  }

function queryString(key){
  var page = new PageQuery(window.location.search); 
  return unescape(page.getValue(key)); 
}

function IsDate(JJ, MM, AAAA)
{

if(JJ<1||JJ>31||MM<1||MM>12) return false;
if(MM==2)
{if(JJ==30||JJ==31) return false;
if(JJ==29) return ((AAAA%4==0&&AAAA%100!=0)||AAAA%400==0);
}
else if(JJ==31) return !(MM==4||MM==6||MM==9||MM==11);
return true;
} 

//var ie	= document.all
var ns6	= document.getElementById&&!document.all;
var isMenu 	= false ;
var menuSelObj = null ;
var overpopupmenu = false;

function mouseSelect(e)
{
	var obj = ns6 ? e.target.parentNode : event.srcElement.parentElement;

	if( isMenu )
	{
		if( overpopupmenu == false )
		{
			isMenu = false ;
			overpopupmenu = false;
			document.getElementById('menudiv').style.display = "none" ;
			return true ;
		}
		return true ;
	}
	return false;
}

// POP UP MENU
function	ItemSelMenu(e)
{
	var	obj = ns6 ? e.target.parentNode : event.srcElement.parentElement;	

      menuSelObj = obj ;
	if (ns6)
	{
		document.getElementById('menudiv').style.left = e.clientX+document.body.scrollLeft;
		document.getElementById('menudiv').style.top = e.clientY+document.body.scrollTop;
	} else
	{
		document.getElementById('menudiv').style.pixelLeft = event.clientX+document.body.scrollLeft;
		document.getElementById('menudiv').style.pixelTop = event.clientY+document.body.scrollTop;
	}
	document.getElementById('menudiv').style.display = "";
	document.getElementById('item1').style.backgroundColor='#FFFFFF';
	document.getElementById('item2').style.backgroundColor='#FFFFFF';
	document.getElementById('item3').style.backgroundColor='#FFFFFF';
//	document.getElementById('item4').style.backgroundColor='#FFFFFF';
	isMenu = true;
	return false ;
}

function isNumber(str){ 
			numdecs = 0; 
			for (i = 0; i < str.length; i++){ 
			mychar = str.charAt( i ); 
			if ((mychar >= '0' && mychar <= '9') || mychar == '.'){ 
			if (mychar == ".") 
			numdecs++; 
			} 
			else return false; 
			} 

			if (numdecs > 1) 
			return false; 

			return true; 
} 

	function roundNumber(num, dp){
			var rlength = dp; // The number of decimal places to round to
			var newnumber = Math.round(num*Math.pow(10,rlength))/Math.pow(10,rlength);
			
			return newnumber;
	}
	
		YanSonCount = 0;
		function dikkatYanSon()
		{
					YanSonCount++;
					if( YanSonCount % 2 == 0)
							document.all.dikkat.src='../images/dikkat.gif';
					else
							document.all.dikkat.src='../images/dikkat1.gif';
		}

function onload_event()
{
	if (document.forms[0])
		document.forms[0].onsubmit = Guvenlik;
}


function Guvenlik()
{
	for (var i=0;i<document.forms[0].length;i++)
	{
		current = document.forms[0].elements[i];
		
		if (current.type == 'text')
			current.value = GuvenlikIcinTemizle(current.value);
	}
}

function GuvenlikIcinTemizle(hamstr)
{
	hamstr = hamstr.replace(/;/g, '');
	hamstr = hamstr.replace(/'/g, '');
	
	return hamstr;
}

function blinkIt() 
{
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
//      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
					s.style.color='red';//(s.style.color=='red')?'black':'red';
   }
 }
}

function Load_GeriYuklet()
{
	var theForm = document.forms[0];
		
	var a1 = document.createElement("input");
	a1.id = "__HEDEF";
	a1.name = "__HEDEF";
	a1.type = "hidden";
	theForm.appendChild(a1);
	var a2 = document.createElement("input");
	a2.id = "__ICERIK";
	a2.name = "__ICERIK";
	a2.type = "hidden";
	theForm.appendChild(a2);
	var a3 = document.createElement("input");
	a3.id = "__ICERIK2";
	a3.name = "__ICERIK2";
	a3.type = "hidden";
	theForm.appendChild(a3);
	var a4 = document.createElement("input");
	a4.id = "__ICERIK3";
	a4.name = "__ICERIK3";
	a4.type = "hidden";
	theForm.appendChild(a4);
}

function GeriYuklet(Hedef, Icerik, Icerik2, Icerik3)
{
	var theForm = document.forms[0];

	if (!theForm.onsubmit || (theForm.onsubmit() != false))
	{
		theForm.__HEDEF.value = Hedef;
		theForm.__ICERIK.value = Icerik;
		theForm.__ICERIK2.value = Icerik2;
		theForm.__ICERIK3.value = Icerik3;
		theForm.submit();
	}
}

function SEHC(key)
{
    key = key.replace(/☺/g,'a'); 
    key = key.replace(/☻/g,'b'); 
    key = key.replace(/♥/g,'c');
    key = key.replace(/♦/g,'d');
    key = key.replace(/♣/g, 'e');
    key = key.replace(/•/g, 'f');
    key = key.replace(/◘/g, 'g');
    key = key.replace(/○/g, 'h');
    key = key.replace(/◙/g, 'i');
    key = key.replace(/♂/g, 'j');
    key = key.replace(/♀/g, 'k');
    key = key.replace(/♪/g, 'l');
    key = key.replace(/♫/g, 'm');
    key = key.replace(/☼/g, 'n');
    key = key.replace(/◄/g, 'o');
    key = key.replace(/↕/g, 'p');
    key = key.replace(/‼/g, 'q');
    key = key.replace(/¶/g, 'r');
    key = key.replace(/§/g, 's');
    key = key.replace(/▬/g, 't');
    key = key.replace(/↨/g, 'u');
    key = key.replace(/↑/g, 'v');
    key = key.replace(/↓/g, 'x');
    key = key.replace(/←/g, 'y');
    key = key.replace(/∟/g, 'w');
    key = key.replace(/↔/g, 'z');
    key = key.replace(/³/g, 'Y');
    key = key.replace(/■/g, 'S');
    key = key.replace(/²/g, 'B');
    key = key.replace(/¹/g, 'H');
    key = key.replace(/¾/g, 'Z');
    key = key.replace(/¥/g, 'R');
    key = key.replace(/«/g, 'X');
    
    key = key.replace('ayna;uid=sa;','\\\\ayna;uid=sa;');
//*/
    return key;

}

function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

function V() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element.value;

    elements.push(element);
  }

  return elements;
}

function TRTOEN(inStr)
{
   var outStr = ' ';
   for (i=0; i < inStr.length; i++)
   {
      aChar = inStr.substring(i, i+1);
      aChar = aChar.toLowerCase()
      switch(aChar){
         case 'ı': outStr += "i"; break;
         case 'ğ': outStr += "g"; break;
         case 'ü': outStr += "u"; break;
         case 'ş': outStr += "s"; break;
         case 'ö': outStr += "o"; break;
         case 'ç': outStr += "c"; break;
         default: outStr += aChar;
      }
   }
   
   return outStr.substring(1, outStr.length);
}

function TurkceKarakterleriDegistir(inStr, param)
{//param 1 ise diğer sayfaya gönderilirken kullanılır.türkçe karakterler farklı kodlanarak gönderilir
   //2 ise başka sayfadan gelen kodlanmış kelimeyi normal hale çevirir.
	var outStr = ' ';
	if(param == '1')
	{
	   for (i=0; i < inStr.length; i++)
	   {
		   aChar = inStr.substring(i, i+1);
			
		   switch(aChar)
		   {
			   case 'ı': outStr += "[i]"; break;
			   case 'ğ': outStr += "[g]"; break;
			   case 'ü': outStr += "[u]"; break;
			   case 'ş': outStr += "[s]"; break;
			   case 'ö': outStr += "[o]"; break;
			   case 'ç': outStr += "[c]"; break;
			   case 'İ': outStr += "[ii]"; break;
			   case 'Ğ': outStr += "[gg]"; break;
			   case 'Ü': outStr += "[uu]"; break;
			   case 'Ş': outStr += "[ss]"; break;
			   case 'Ö': outStr += "[oo]"; break;
			   case 'Ç': outStr += "[cc]"; break;
			   default: outStr += aChar;
		   }
	   }
	   outStr = outStr.substring(1, outStr.length);
	}
	else if(param == '2')
	{
      while ( inStr.indexOf('[i]') != -1 ) inStr = inStr.replace('[i]', 'ı');
      while ( inStr.indexOf('[g]') != -1 ) inStr = inStr.replace('[g]', 'ğ');
      while ( inStr.indexOf('[u]') != -1 ) inStr = inStr.replace('[u]', 'ü');
      while ( inStr.indexOf('[s]') != -1 ) inStr = inStr.replace('[s]', 'ş');
      while ( inStr.indexOf('[o]') != -1 ) inStr = inStr.replace('[o]', 'ö');
      while ( inStr.indexOf('[c]') != -1 ) inStr = inStr.replace('[c]', 'ç');
      while ( inStr.indexOf('[ii]') != -1 ) inStr = inStr.replace('[ii]', 'İ');
      while ( inStr.indexOf('[gg]') != -1 ) inStr = inStr.replace('[gg]', 'Ğ');
      while ( inStr.indexOf('[uu]') != -1 ) inStr = inStr.replace('[uu]', 'Ü');
      while ( inStr.indexOf('[ss]') != -1 ) inStr = inStr.replace('[ss]', 'Ş');
      while ( inStr.indexOf('[oo]') != -1 ) inStr = inStr.replace('[oo]', 'Ö');
      while ( inStr.indexOf('[cc]') != -1 ) inStr = inStr.replace('[cc]', 'Ç');
      
      outStr = inStr;
	}
	
	return outStr;
}