function popup2(yol){
	w = 200; h = 150;
	var l = (screen.width/2)-(w/2);
	var t = (screen.height/2)-(h/2);
	window.open(yol,"","toolbar=no,resizable,scrollbars=no,width="+w+",height="+h+",left="+l+",top="+t);
						}
function popup4(yol){
	w = 900; h = 600;
	var l = (screen.width/2)-(w/2);
	var t = (screen.height/2)-(h/2);
	window.open(yol,"","toolbar=no,resizable,scrollbars=yes,width="+w+",height="+h+",left="+l+",top="+t);
						}
						
function popup3(yol){
	w = 600; h = 450;
	var l = (screen.width/2)-(w/2);
	var t = (screen.height/2)-(h/2);
	window.open(yol,"","toolbar=no,resizable,scrollbars=yes,width="+w+",height="+h+",left="+l+",top="+t);
						}
						
												
function popup(yol){
	w = 600; h = 450;
	var l = (screen.width/2)-(w/2);
	var t = (screen.height/2)-(h/2);
	window.open(yol,"NewWindow","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizeable=1,width="+w+",height="+h+",left="+l+",top="+t);
						}
function popup33(yol){
	w = 400; h = 200;
	var l = (screen.width/2)-(w/2);
	var t = (screen.height/2)-(h/2);
	window.open(yol,"","toolbar=no,resizable,scrollbars=yes,width="+w+",height="+h+",left="+l+",top="+t);
						}
function silelimmi(neyi,form_name){
	var onay=window.confirm("Seçtiğiniz "+neyi+" silmek istediğinize eminmisiniz?");
	if (!onay){ return false; } 
	else{ var nesne=eval("document."+form_name); nesne.submit(); }
								  }
								  
								  								 						
function degis(nesne,tus){
	var deger=nesne.value;
	var degerLength=deger.length;
	var yeniDeger="";
	var parca1="";
	var parca2="";
	var parca3="";
	var parca4="";
	var parca5="";
	var parca6="";
	var parca7="";
	var i;
	var c=0;
	var index=""; 
	var index2="";
	var index3="";
	var index4="";
	var sonDeger="";
	var enyeni=new Array(5); 
	var dizi=new Array(10);
    var giris;
	if(!tus){  tus=97; }
if(degerLength==1 && (tus==48 || tus==96)){ alert("İlk sayı 0 olamaz"); nesne.value="";  tus=1;  }	
	
	
if((tus>=48 && tus<=57) || (tus>=96 && tus<=105) || tus==37 || tus==39 || tus==8){
	dizi=deger.split(",");
	for(var t=0;t<dizi.length;t++){
	if(dizi[t]){
		yeniDeger=yeniDeger+dizi[t];
				}
						 		  }
		
	if(yeniDeger){ degerLength=yeniDeger.length; }
	else{ degerLength=deger.length; }		
						

    if(degerLength>3){
		c=Math.ceil(degerLength/3);
		if(!yeniDeger){  yeniDeger=deger; }

		for(i=0;i<c;i++){ 
			index=(i+1)*3; index=degerLength-index; if(index<0){ index=0; }  
			if(i+1==c){ index2=degerLength%3; if(index2==0){ index2=3; } }
			else{ index2=3; }  
			enyeni[i]=yeniDeger.substr(index,index2);						   
						   }
		c=c-1;				   				   
		while(c>=0){ 
			sonDeger=sonDeger+enyeni[c];
			if(c>0){ sonDeger=sonDeger+","; }
			c--;
				      }	
		nesne.value=sonDeger;		  			   
						   	
						  }//karakter sayisinin 3 ten büyüksenin sonu
	
	else if(degerLength<=4 && tus==8){ dizi=""; yeniDeger="";
	 			dizi=deger.split(",");
				for(var t=0;t<dizi.length;t++){
					if(dizi[t]){yeniDeger=yeniDeger+dizi[t];}
						 		  			  }
	 			nesne.value=yeniDeger;	
									  	}//karakter sayisinin 3 ten küçüksenin ve silme tuşuna basıldı isenin sonu					  
						  
														}//istediklerimiz tiklandi isenin sonu
else{ //tuslar istemediklerimizse olucaklar
	  yeniDeger=nesne.value.substr(0,degerLength-1);
	  nesne.value=yeniDeger;    
	}

							
							
							}//son


function pchange(obj, myevent){

	if ( myevent == 1 ) {
		obj.style.border = "2 outset #cccccc";
		obj.style.fontSize = "12px";
		//obj.value=obj.value.toCapitalize();
		//obj.style.fontWeight = "100";
		obj.style.background = "#f7f7f7";
	}
	if ( myevent == 0 ) {
		obj.style.border = "1 outset #cccccc" ;
		obj.style.fontSize = "10px";
		obj.style.background = "#ffffff";
		//prevVal = obj.value;
	}
	
}


function pchange2(obj, myevent){

	if ( myevent == 1 ) {
		obj.style.border = "2 outset #cccccc";
		obj.style.fontSize = "12px";
		//obj.value=obj.value.toCapitalize();
		//obj.style.fontWeight = "100";
		obj.style.background = "#f7f7f7";
	}
	if ( myevent == 0 ) {
		obj.style.border = "1 outset #cccccc" ;
		obj.style.fontSize = "10px";
		obj.style.background = "#ffffff";
		//prevVal = obj.value;
	}
	
}

function arkaplan(obj, myevent){
	if ( myevent == 1 ) {
		obj.style.background = "#dddddd"; //text alanına eksik veri girilirse
	}
	if ( myevent == 0 ) {
		obj.style.background = "#ffffff"; //text alanında problem yok ise beyaz
						}					
	
}

function beklet_kapat(layer,time){ 
	setTimeout("kapat(\""+layer+"\")", time)
						}
function kapat(layer){ 

		if (document.all) {
			document.all[layer].style.visibility="hidden";
							}
		else if (document.layers) {
			document.layers[layer].visibility="hide";
								  }
		else{
			document.getElementById(layer).style.visibility="hidden";
			}
		
		
	
				}
										
var tiklandi="";

function sec(form_name){ tiklandi=1; 
	for(i=1;i<toplam+1;i++){  var secili=eval("document."+form_name+".check_"+i);		secili.checked="1";	 } 
              					}
function secme(form_name){ tiklandi=0; 
for(i=1;i<toplam+1;i++) {   var secili=eval("document."+form_name+".check_"+i);	secili.checked=null;}
                 }
				 
				 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var marked_row = new Array;

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;;
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == null || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function


//genel

dil='tr';

function Geri(){
	history.back();
}

function Git(url){
	document.location=url;
}

function Emin(){
	return confirm((dil=='tr') ? 'Emin misiniz?':'Are you sure?');
}

function Aciklama(i){}

function Obj(obj){
	return document.getElementById(obj);
}

function Goster(obj){
	Obj(obj).style.display='block';
}

function Gosterme(obj){
	Obj(obj).style.display='none';
}

function yp(loc,w,h){if (!window.popup){ac(loc,w,h);}else{if (!popup.closed){popup.close();ac(loc,w,h)}else{ac(loc,w,h)}}}
function ac(loc,w,h){popup=window.open(loc,'popup','scrollbars=yes,status=yes,directories=no,menubar=no,resizable=yes,toolbar=no,width='+w+',height='+h+',screenX=50,screenY=50,top=50,left=50');}

function calendarCallback(field,g,a,y){
	Obj(field).value=g+'-'+a+'-'+y;
}

function MesajSec(tr,chk){
	document.all['msj'+tr].style.backgroundColor=(chk.checked) ? '#eee' : '';
}

function MesajSec2(){
	f=document.forms['messil'];
	l=f.elements.length;
	for (i=0; i<l; i++){
		n=f.elements[i].name;
		if (n.substring(0,4)=='msil') Obj(n).click();
	}
}

function MesajSil2(){
	e=document.forms['messil'].elements;
	zubmit=false;
	for (i=0; i<e.length; i++){
		if (e[i].type=='checkbox') if (e[i].name.substring(0,4)=='msil' && e[i].checked) zubmit=true;
		if (zubmit) break;
	}
	if (zubmit) if (Emin()) document.forms['messil'].submit();
}
function resim_degistir(resim1,resim2,id,drm){
if(drm==1){
document.getElementById(id).src='images/'+resim2;
} else {
document.getElementById(id).src='images/'+resim1;
}
}

