var BekletD,BekletI;
function BilGoster(e){fiId('BilResim').src='images/bildirge/'+e+'oboy.gif';}
function BilGizle(){fiId('BilResim').src='images/img_bildirge.jpg';}

function VidGoster(e){fiId('VideoResim').src='images/video/'+e+'oboy.gif';}
function VidGizle(){fiId('VideoResim').src='images/img_video.jpg';}

function Gizle(e) { $('table#'+e).fadeOut('normal');}
function Goster(e) {$('table#'+e).fadeIn('normal'); }
function Seffaf(e, k) { $('table#'+e).fadeTo('normal', k); }


function fiId(e){ return document.getElementById(e); }
function IdBul(e){ return document.getElementById(e); }
function fiZamanla(e , i){ window.setTimeout(e , i); }
var FontSize =10;

var FntSz=10;
function BuyutKucult(e){
   if(e)FntSz = (FntSz-2);   else FntSz = FntSz+2;
   if(FntSz>=20)FntSz = 20;
   if(FntSz<=8)FntSz = 8;
   PopDivObj=document.getElementById('IcerikDiv');
   PopDivObj.className = 'f'+ FntSz;
   //alert(FntSz);
}


/* Sık kullanılanlara ekleme */
function bookmarksite(title,url){
   if (window.sidebar){ // firefox
	  window.sidebar.addPanel(title, url, "");
   }else if(window.opera && window.print){ // opera
   	var elem = document.createElement('a');
   	elem.setAttribute('href',url);
   	elem.setAttribute('title',title);
   	elem.setAttribute('rel','sidebar');
   	elem.click();
    }else if(document.all){// ie
      window.external.AddFavorite(url, title);
    }
}



function DivAcKapa(ID){ //Status
   if(document.getElementById(ID).style.display=='' || document.getElementById(ID).style.display=='block' ){
      document.getElementById(ID).style.display='none'
   }else{
      document.getElementById(ID).style.display='block'
   }
}

function UyariAc(){
   PopDivObj=document.getElementById('UyariDiv');
   PopDivObj.style.position = 'absolute';
   PopDivObj.style.width="70%";
   PopDivObj.style.top=30 +"%";
   PopDivObj.style.left=15+"%";
   BekletD = window.setTimeout("PopDivObj.style.display='block'",1000) ;
   //window.status = getDivSize(PopDivObj);
   window.scrollTo(0,0);
}
function PP(Ed , B , Val, w, h){
//   alert(Val)
   if(fiId('popTamam')){
      fiId('popTamam').disabled=false;
      fiZamanla("fiId('popIKpt').focus();",190);
      fiZamanla("fiId('popTamam').focus();",200);
   }
   var windowX = (screen.width/2);
   var windowY = (screen.height/4);
   PopDivObj = fiId( "popTable");

   PopDivObj.style.position = 'absolute';
   PopDivObj.style.width= windowX +"px";// (w ? w : (windowX+"px")) ;
   //PopDivObj.style.height= (h ? h : "") ;
   //var top = getTop(Ed);
   //(getTop(fiId(Ed)))+ fiId(Ed).offsetHeight
   PopDivObj.style.top=  windowY + "px"
   PopDivObj.style.left=25+"%";
   Goster('popTable');
   //BekletD = window.setTimeout("PopDivObj.style.display='block'",100) ;
   if(B){ fiId( "popBaslik").innerHTML =B;}
   if(Val){ fiId( "popGovde").innerHTML =Val;}

   //window.status = document.body.offsetWidth + "-" +document.body.offsetHeight + " - " + windowX + "x" + windowY + "-->" + dd.offsetTop;
   //window.scrollTo(0,0);
}

getLeft=function(element){
   return element.getBoundingClientRect().left;
};
getTop=function(element){
   return element.getBoundingClientRect().top;
};

function PPKpt(Ed){
   PopDivObj = fiId( Ed ? Ed : "popTable");
   Gizle('popTable');
   //BekletD = window.setTimeout("PopDivObj.style.display='none';",100) ;
}
function ABekle(s , v){
   PP('UyariDiv', (s==1?':: Arama Yapılıyor ':' :: Uyarı') , '<img src="images/w.gif" border="0">  Lütfen Bekleyin'+ (s==1?' Arama İşleminiz Tamamlanıyor':'') +(v?" <b>("+v+" )</b>":"") +'...');
   //document.getElementById('GnlAraDiv').innerHTML='<br><br><center><img src="images/w.gif" border="0"> Lütfen Bekleyin ...</center><br>';
}
function EventOgren(e) {
   if(e){ tus = e;} else{ tus = tus || event; }
    if(window.event){ return window.event.keyCode; }else if(tus.which){   return tus.which;}
}
function dinle(Key, ed) {
    var K;
    K = EventOgren(Key);
    if((K==13) ){
      document.getElementById(ed).onclick();
    }
}
function sfac(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function bekleK(){
   if(BekletD)clearTimeout(BekletD);
   if(BekletI)clearTimeout(BekletI);
   if(document.getElementById('DisDiv'))document.getElementById('DisDiv').style.display='none';
   if(document.getElementById('IcDiv'))document.getElementById('IcDiv').style.display='none';
}
function bekle(){
   var Kalan =(screen.width-600)/2
   var Leftt = ((Kalan*100)/screen.width);
   PopDivObj = fiId( "IcDiv");
   PopDivObj.style.position = 'absolute';
   PopDivObj.style.width="600px";// (w ? w : (windowX+"px")) ;
   //PopDivObj.style.height='400px' ;
   PopDivObj.style.top="20%"
   PopDivObj.style.left=(Leftt-5)+"%";
   document.getElementById('DisDiv').style.width='100%';
   document.getElementById('DisDiv').style.height=screen.height+'px';
   BekletD = window.setTimeout("document.getElementById('DisDiv').style.display='block'",1000) ;
   BekletI = window.setTimeout("document.getElementById('IcDiv').style.display='block'",2000) ;
   window.scrollTo(0,0);
}

  function getFile(filename) {
    oxmlhttp = null;
    try {
      oxmlhttp = new XMLHttpRequest();
      oxmlhttp.overrideMimeType("text/xml");
    }
    catch(e) {
      try { oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
      catch(e) { return null; }
    }
    if(!oxmlhttp) return null;
    try {
      oxmlhttp.open("GET",filename,false);
      oxmlhttp.send(null);
    }
    catch(e) { return null; }
    return oxmlhttp.responseText;
  }
  
  var nwSayfa=Array();
function Pac(DosyaAdi, SayfaAdi, BoyutW, BoyutH , V) {
   //alert('1 '+self.name);
   if(!V)V=0; 
   var windowX = (screen.width/2)-(BoyutW/2);
   var windowY = (screen.height/2)-(BoyutH/2);
   	
	Komut = "alwaysRaised=yes,copyhistory=0,directories=0,location=0,menubar=0,scrollbars="+V+",status=1,toolbar=0,width="+BoyutW+",height="+BoyutH+",top="+windowY+",left="+windowX+",resizable=0,";
   try{
	  if(nwSayfa[SayfaAdi].closed==false) {
         nwSayfa[SayfaAdi].focus();
      } else {
         nwSayfa[SayfaAdi]=window.open(DosyaAdi,SayfaAdi, Komut);
      };
   }catch(error){
      nwSayfa[SayfaAdi]=window.open(DosyaAdi,SayfaAdi, Komut);
   };
  	return false;
}







//var message="Bu Özellik Kapalı!";

function clickIE4(){
   if (event.button==2){
      //alert(message);
      return false;
   }
}

function clickNS4(e){
   if (document.layers||document.getElementById&&!document.all){
      if (e.which==2||e.which==3){
         //alert(message);
         return false;
      }
   }
}

if (document.layers){
   document.captureEvents(Event.MOUSEDOWN);
   document.onmousedown=clickNS4;
}else if (document.all&&!document.getElementById){
   document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")

/* Hata göstermeyi engelleme
function stoperror(){
return true
}
window.onerror=stoperror
*/

// form tags to omit in NS6+:
/* Seçmeyi engelleme */
var omitformtags=["input", "textarea", "select", "div"]

omitformtags=omitformtags.join("|")

function disableselect(e){
   if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
      return false
}

function reEnable(){
   return true
}

if (typeof document.onselectstart!="undefined")
   document.onselectstart=new Function ("return false")
else{
      document.onmousedown=disableselect
      document.onmouseup=reEnable
}


/* Seçmeyi engelleme  Son */




function SadeceHarf(e) {
	var whichCode = (window.Event) ? e.which : e.keyCode;

	if (whichCode == 13) return true;  // Enter
	if (whichCode == 44) return true;  // Comma
	if (whichCode > 47 && whichCode < 58){
	return false;}
}
function SadeceNumara(e) {
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;

	if (whichCode == 13) return true;  // Enter
	if (whichCode == 44) return true;  // Comma
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;}
}
function ParaFormati(thisis) {
	//alert(thisis.value);
	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0){// çalışma
	//alert(str);
	//str = str.replace(\".\",\"\");
	//alert(str);

	while ( 15 > i) {
		str = str.replace(".","");
		i=i+1;
		}
	commacount=0;
	commapos=str.indexOf(";");

	if (commapos>=0)
	{
		aftercomma=str.substr(commapos);
		str=str.substr(0,commapos);
	}
	else
		aftercomma="";

	if (str.length > 3)
	{
		tempstr=str;
		newstr="";
		while (tempstr.length>3)
		{
			newstr="."+tempstr.substr(tempstr.length-3)+newstr;
			tempstr=tempstr.substr(0,tempstr.length-3);
		}
		thisis.value = tempstr+newstr+aftercomma;
	}
	}//indexOf
	return true;
}
function SadeceEmail(thisis,e) {
         var str,i,isay;
         var gecersiz = "üÜğĞışŞİçÇöÖ!#/^\\'*\\\"{[()]}%&\\<>|é?-+,;:æß ";
         var gecerli  = "uUgGisSIcCoO          ";
         var whichCode = (window.Event) ? e.which : e.keyCode;
         if ((whichCode == 46) || (whichCode == 39) || (whichCode == 37) || (whichCode == 8)){
         }else{
           str = thisis.value;
           for (isay=0; isay<gecersiz.length; isay++){
             str = str.replace(gecersiz.charAt(isay),gecerli.charAt(isay));
             thisis.value = str;
           }
         }
         return true;
}

 //onkeyup="return SadeceEmail(this,event)"
 //onkeypress="return SadeceNumara(event)"
 //onkeypress="return SadeceHarf(event)"
 //onkeyup="return ParaFormati(this)"



