function menuAdayOver(satir){ 
		satir.style.backgroundColor = '#A7B9C8';
}
function menuAdayOut(satir){ 
		satir.style.backgroundColor = '';
}
function listeOver(satir){ 
		satir.style.backgroundColor = '#F2F6FA';
}
function listeOut(satir){ 
		satir.style.backgroundColor = '';
}
function listeOver_b(satir){ 
		satir.style.backgroundColor = '#f7f3eb';
}
function listeOut_b(satir){ 
		satir.style.backgroundColor = '';
}
function Trim(value)
{
	value = value.match(/^\s*(\S+(\s+\S+)*)\s*$/);
	return (value == null) ? "" : value[1];
}
function Only_LetterANDDigit(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode; 
	
	
	if (whichCode <14) return true;  // Tab
	if (whichCode > 47 && whichCode < 58) return true;
	if (whichCode > 96 && whichCode < 123) return true;
	if (whichCode > 64 && whichCode < 91) return true;

	var validChars="üÜğĞışŞİçÇöÖ ";

	for (i=0; i<validChars.length; i++)
	{
		if (whichCode==validChars.charCodeAt(i)) return true;
	}
	
	return false;

}
function Only_Digit(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13) return true;  // Enter
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){ 
	return false;}
}
function izinYok2() {	
	if (window.event && window.event.keyCode == 8) {
        // try to cancel the backspace
        window.event.cancelBubble = true;
        window.event.returnValue = false;
        return false;
    }
}
function getSayfa(adres){
	var strText = null;
	var rndTime = new Date();
	var rndTime2 = rndTime.toTimeString().replace(" ", "");
	var gonderUrl = adres + '&rnd=' + rndTime2;
	$.ajax({
		url: gonderUrl,
		async: false, dataType: 'text',
		success: function(text) {
			strText = text;
		}, 
		error: function(http, message, exc) {
			strText = null;
	}});
	//alert(strText);
	return strText;
}
function displayMessage(dest, genislik, baslik){
var divContent=getSayfa(dest);
var dialogWidth=500;
var dialogTitle="MY Executive";
if(genislik)
	dialogWidth=genislik;
if(baslik)
	dialogTitle=baslik;
$(function() {
	$('#dialogView').html(divContent);
	$('#dialogView').dialog({
		width: dialogWidth,
		autoOpen: false,
		title: dialogTitle,
		modal: true
	});
	$('#dialogView').dialog('open');
});
}
function popupSelect3(adres,id)
{
	var id_value = document.getElementById(id).value;
	var dest = adres+".asp?baba=3012&ID="+id_value;
	detail_window = window.open(dest, "displayWindow", "width=300,height=350,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no");
	self.name = "anne";
	return false;
}
function popupSelect2(adres,id,aciklama)
{
	var sektorid = document.getElementById(id).value;
	if(sektorid==0){
		alert("Lütfen önce "+aciklama+" seçiniz!");
		return false;
	}
	else{
		var dest = adres+".asp?baba=3012&ID="+sektorid;
		detail_window = window.open(dest, "displayWindow", "width=300,height=350,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no");
		self.name = "anne";
		return false;
	}
	return false;
}
function popupSelect(adres,lng)
{
	var dest = adres+".asp?lng="+lng+"&baba=3012";
	detail_window = window.open(dest, "displayWindow", "width=300,height=350,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no");
	self.name = "anne";
	return false;
}
function fieldReset(field)
{
	document.getElementById(field).value="";
	return false;
}
function fieldReset2(field1,field2)
{
	document.getElementById(field1).value="";
	document.getElementById(field2).value="";
	return false;
}
function replace2(s, from1, to1) {
	var p,str;
	str=s;
	p = str.indexOf(from1);
	while (p > -1) {
		str=str.substring(0, p) + to1 + str.substring(p+from1.length);
		p = str.indexOf(from1);
	}
	return str;
}
function toggle(id)
{
	el = document.getElementById(id);
	var display = el.style.display ? '' : 'none';
	el.style.display = display;
}
function fillIn(anaparentID,parentID,catID,hiddenText,hiddenID,kolon,anaID,anaVar,fieldType,aciklama)
{
	var hiddenTextVal="";
	var hiddenIDVal="";
	var anaIDVal="";

	if(hiddenText!="")
		hiddenTextVal = document.getElementById(hiddenText).value;
	if(hiddenID!="")
		hiddenIDVal = document.getElementById(hiddenID).value;
	if(anaID!="")
		anaIDVal = document.getElementById(anaID).value;
	var dest = "fill.asp?baba=3012&anaparentID="+anaparentID+"&parentID="+parentID+"&catID="+catID+"&hiddenText="+hiddenTextVal+"&hiddenID="+hiddenIDVal+"&fieldText="+hiddenText+"&fieldHidden="+hiddenID+"&kolon="+kolon+"&anaID="+anaIDVal+"&anaVar="+anaVar+"&fieldType="+fieldType;
	detail_window = window.open(dest, "displayWindow", "width=500,height=500,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no");
	self.name = "anne";
	return false;
}
function fillIn2(anaparentID,parentID,catID,hiddenText,hiddenID,kolon,anaID,anaVar,fieldType,aciklama)
{
	var hiddenTextVal="";
	var hiddenIDVal="";
	var anaIDVal="";

	if(hiddenText!="")
		hiddenTextVal = document.getElementById(hiddenText).value;
	if(hiddenID!="")
		hiddenIDVal = document.getElementById(hiddenID).value;
	if(anaID!="")
		anaIDVal = document.getElementById(anaID).value;
	var dest = "fill2.asp?baba=3012&anaparentID="+anaparentID+"&parentID="+parentID+"&catID="+catID+"&hiddenText="+hiddenTextVal+"&hiddenID="+hiddenIDVal+"&fieldText="+hiddenText+"&fieldHidden="+hiddenID+"&kolon="+kolon+"&anaID="+anaIDVal+"&anaVar="+anaVar+"&fieldType="+fieldType;
	detail_window = window.open(dest, "displayWindow", "width=300,height=500,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no");
	self.name = "anne";
	return false;
}
function selectTemizle2(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	objCheckBoxes.options[0].selected = CheckValue;
}
function selectTemizle(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.options.length;
	for(var i = 0; i < countCheckBoxes; i++)
		objCheckBoxes.options[i].selected = CheckValue;
}
function checkTemizle(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}
function degerTemizle(FormName, FieldName)
{
	if(!document.forms[FormName])
		return;
	var objField = document.forms[FormName].elements[FieldName];
	if(!objField)
		return;
	objField.value="";
}
function degerEsitle(FormName, FieldName, FieldValue)
{
	if(!document.forms[FormName])
		return;
	var objField = document.forms[FormName].elements[FieldName];
	if(!objField)
		return;
	objField.value=FieldValue;
}
function checkDenet(FormName, FieldName)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes){
		if(objCheckBoxes.checked)
			return true;
		else
			return false;
	}
	else{
		// set the check value for all check boxes
		var islemTamam = 0;
		for(var i = 0; i < countCheckBoxes; i++)
			if(objCheckBoxes[i].checked)
				islemTamam = 1;
		if(islemTamam==1)
			return true;
		else
			return false;
	}
}
function Tillah(chemin)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>Çiçek Pasajı.com - Kapatmak için resmin üzerine tıklayın...</TITLE></HEAD><BODY bgcolor="#F9FAF7" LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><div align="center"><a href="javascript:window.close()"><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+15,document.imageTest.height+35)"></a></div></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	};
function saatigoster() {
	 var d, saat_,dakika_,saniye_,x1,x2,s;
	 d = new Date();
	 saat_ = d.getHours(); if (saat_.toString(10).length==1) { saat_="0"+saat_; }
	 dakika_= d.getMinutes();if (dakika_.toString(10).length==1) { dakika_="0"+dakika_; }
	 saniye_= d.getSeconds();if (saniye_.toString(10).length==1) { saniye_="0"+saniye_; }
	 s = saat_ + ":" + dakika_ + ":" + saniye_;
	 saat.innerText = s; 
}
function popSifre(lng)
{
	var dest = "popSifre.asp?lng=" + lng + "&baba=3012";
	detail_window = window.open(dest, "displayWindow", "width=450,height=235,scrollbars=no,resizable=no,toolbar=0,location=no,menubar=no,status=yes")
	self.name = "anne";
}
