var highlightbehavior="TR";
var renkdegis="";
var hatalifield="";
var formhatali = 0;
var ns6=document.getElementById&&!document.all;
var ie=document.all;
var saklanmali=0;
var submitcount=0;

function returnFalse() {
  return false;
}

function changeto(e,highlightcolor,dgos){
   try { oncsource.style.backgroundColor="" }
   catch (er) { }
   source=ie? event.srcElement : e.target;

   if (source.tagName=="TABLE") return;

   degis = 0;
   if ((source.tagName=="INPUT") || (source.tagName=="SELECT") || (source.tagName=="TEXTAREA")) {
      fnam = source.name.substr(0,7);
      if ((source.name.substr(7,1) >= "0") && (source.name.substr(7,1) <= "9" ))
         fnam = fnam + source.name.substr(7,1);
      if ((source.name.substr(8,1) >= "0") && (source.name.substr(8,1) <= "9" ))
         fnam = fnam + source.name.substr(8,1);
      fnam = fnam + 'hidden';
      snam = source.name.substr(0,6) + 'Sonalan';

      try { eval("document." + source.form.name + "." + snam +  ".value = '" + source.name +  "'"); }
      catch (er) { }

      try { eval("hidval = document." + source.form.name + "." + fnam +  ".value"); }
      catch (er) { hidval = "xxx" }

      if ( ((hidval.substr(0,1) == "#") || (source.name.substr(0,6).toLowerCase() == "txtayr") || (source.name.substr(0,6).toLowerCase() == "gent01")) &&
         ((source.tagName=="xSELECT")) ) {
         if (sors.name.substr(0,6).toLowerCase() != "txtayr" && sors.name.substr(0,6).toLowerCase()!= "gent01") eval("document." + sors.form.name + "." + fnam +  ".value = hidval.substr(1)");
         degis = 1; 
         saklanmali=1; formhatali = 0; if (hatalifield != "") hideddrivetip2(); hatalifield="";
         hidval = "";
      }
   }

   esource = source;
   while(source.tagName!=highlightbehavior && source.tagName!="HTML")
     source=ns6? source.parentNode : source.parentElement;

   if (source.id.substr(0,4) == 'YENI') {eval("document.all." + snam +  ".value = ''")}

   if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore") {
      oncsource = source;
      source.style.backgroundColor=highlightcolor;
      if ((degis==1) && (dgos == "E"))  { source.childNodes(0).style.backgroundColor="Blue" ; }
   }

   if (degis==1) { saklanmali=1; formhatali = 0; if (hatalifield != "") hideddrivetip2(); hatalifield= "";}
}

function changeback(e,originalcolor){
source.style.backgroundColor=originalcolor;
}

function icerikboyut(){
try {
if ( listablo.clientHeight > document.body.clientHeight - solust.clientHeight - icerik2.rows[0].cells[0].clientHeight - 50 )
   { showcursor.style.height = document.body.clientHeight - solust.clientHeight - icerik2.rows[0].cells[0].clientHeight - 50; }
if ( listablo.clientWidth  > document.body.clientWidth - icerik.rows[0].cells[0].clientWidth - 0 )
   { showcursor.style.width  = document.body.clientWidth  - icerik.rows[0].cells[0].clientWidth - 20;
    if (listablo.clientHeight < document.body.clientHeight - solust.clientHeight - icerik2.rows[0].cells[0].clientHeight - 50) {
    	 var xxx = ustbassat.clientHeight;
    	 var yyy = altbassat.clientHeight;
    	 listablo.style.height =  listablo.clientHeight + 34;
    	 showcursor.style.height = showcursor.clientHeight + 34;
    	 ustbassat.style.height = xxx;
    	 altbassat.style.height = yyy;
      }
   	}
}
catch (er) { }
}

function swapClass(obj, cls) {
  obj.className = cls;
}

function acarim(url) {
   d = new Date();
   t = d.getTime();
  popupWin = window.open(url, 'new_page'+t, 'width=850,height=700,scrollbars,resizable');
}

function acarimwh(url,w,h) {
   d = new Date();
   t = d.getTime();
  popupWin = window.open(url, 'new_page'+t, 'width='+w+',height='+h+',scrollbars,resizable');
}

function f2acarimw(url, e, dgos) {
  sors=ie? event.srcElement : e.target ;
  do { sors=ns6? sors.parentNode : sors.parentElement } while (( sors.tagName != 'TR' ) || (sors.id=="ignore" ));
  if (dgos == 'E' ) { sors.childNodes(0).style.backgroundColor="Blue" ; }
  saklanmali=1; formhatali = 0; if (hatalifield != "") hideddrivetip2(); hatalifield="";

  d = new Date(); t = d.getTime();
  popupWin = window.open(url, 'new_page'+t, 'width=700,height=600,scrollbars,resizable');
}

function f2acarim(url, e, dgos) {
  var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
  if (keyCode == 113) {
     sors=ie? event.srcElement : e.target ;
     do { sors=ns6? sors.parentNode : sors.parentElement } while (( sors.tagName != 'TR' ) || (sors.id=="ignore" ));
     if (dgos == 'E' ) { sors.childNodes(0).style.backgroundColor="Blue" ; }
     saklanmali=1; formhatali = 0; if (hatalifield != "") hideddrivetip2(); hatalifield="";
     acarim(url);
  }
}

function pdf1(url) {
  d = new Date();
  t = d.getTime();
  popupWin = window.open(url, 'PDF_Raporu_1'+t, 'width=1000,height=800,scrollbars,resizable,menubar');
}

function sayfaac(adres,restore) {
  eval("location='" + adres +"'");
  if (restore) selObj.selectedIndex=0;
}

function sayfaac2(selObj){ //v3.0
  eval("location='" + selObj.options[selObj.selectedIndex].value+"'");
}

function sayfaac3(selObj, ek){ //v3.0
  eval("location='" + ek + selObj.options[selObj.selectedIndex].value+"'");
}

function MM_jumpMenu2(selObj){ //v3.0
   d = new Date();
   t = d.getTime();
  eval("window.open('" + selObj.options[selObj.selectedIndex].value + "','xxx'+t,'width=700,height=600,scrollbars,resizable')");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function winsors(){
  eval("window.parent.location='view-source:'+window.location.href");
}

function yaklas(){
if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=1.25; else window.parent.document.body.style.zoom=1.6;
}

function uzaklas(){
if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=0.8; else window.parent.document.body.style.zoom=0.625;
}

function savekont(e, skont){
  if (skont == 'E') {
    mesaj = "";
    if ((saklanmali == 1) && (submitcount == 0)) mesaj = "Bilgileri saklamadınız." ;
    if (mesaj != "") event.returnValue = mesaj;
  }
}

var folder='';
function expandit(curobj){
   folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style;
   if (folder.display=="none") folder.display="";
   else folder.display="none";
}

function openit(curobj){
   folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style;
   folder.display="";
}

function closeit(curobj){
   folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style;
   folder.display="none";
}


//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
var display_url=1;

function showmenuie5(){
var rightedge=document.body.clientWidth-event.clientX;
var bottomedge=document.body.clientHeight-event.clientY;

if (rightedge<ie5menu.offsetWidth) ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth;
else ie5menu.style.left=document.body.scrollLeft+event.clientX;

if (bottomedge<ie5menu.offsetHeight) ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight;
else ie5menu.style.top=document.body.scrollTop+event.clientY;

ie5menu.style.visibility="visible";
return false;
}

function hidemenuie5(){
ie5menu.style.visibility="hidden";
}

function highlightie5(){
if (event.srcElement.className=="menuitems"){
	event.srcElement.style.backgroundColor="highlight";
	event.srcElement.style.color="white";
	if (display_url==1) window.status=event.srcElement.url;
	}
}

function lowlightie5(){
	if (event.srcElement.className=="menuitems"){
		event.srcElement.style.backgroundColor="";
		event.srcElement.style.color="black";
		window.status='';
	}
}

function jumptoie5(){
	if (event.srcElement.className=="menuitems") {
   d = new Date();
   t = d.getTime();
	   if (event.srcElement.target=="window") window.open(event.srcElement.url, 'new_page'+t, 'width=700,height=600,scrollbars,resizable');
	   else window.location=event.srcElement.url;
	}
}
//////////////////////////////////////////

function getCookie(name) {
	var cname = escape(name) + "=";
	var dc = document.cookie;

	if (dc.length > 0) {
		begin = dc.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
				return unescape(dc.substring(begin, end));
		}
	}
	return null;
}

function setCookie(name, value, expires, path, domain, secure) {
	document.cookie = escape(name) + "=" + escape(value) +
	((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
	((path == null) ? "" : "; path=" + path) +
	((domain == null) ? "" : "; domain=" + domain) +
	((secure == null) ? "" : "; secure");
}

function delCookie (name,path,domain) {
	if (getCookie(name)) {
		document.cookie = escape(name) + "=" +
		((path == null) ? "" : "; path=" + path) +
		((domain == null) ? "" : "; domain=" + domain) +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function checkSubmit() {
  var don;
  formhatali = 0; if (hatalifield != "") hideddrivetip2(); hatalifield="";
  if (submitcount == 0) {submitcount++; don =  true; }
  else {alert("Form yollanmıştır! Bir defa basmanız yeterli !"); don =  false; }
try {
	updateRTEs();
}
catch (er) { }
return don;
}

moz=document.getElementById&&!document.all 
mozHeightOffset=20 

function resize_iframe(o){ 
o.height=500 ;
try {
   o.height=window.frames[o.id].document.body.scrollHeight+(moz?mozHeightOffset:0)
}
catch (er) { }
} 

function setmessage(){return}

function GetXmlHttpObject()
{ 
  var objXMLHttp=null
  
  try {
    objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //later IE
  } catch (e) {
  try {
    objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); //earlier IE
  } catch (e) {
  objXMLHttp = null;
  }
  }
  
  if (objXMLHttp==null)
  {
    objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
  }
  return objXMLHttp
}

function harac1(o,kull){
   d = new Date(); t = d.getTime();
   if (o.xx.search("showsearch=false")>=0) hwt = screen.width-120 ; else hwt = screen.width-380 ;
   hht = screen.height-150
   as = o.xx+ "&mapwidth="+ hwt + "&mapheight="+ hht + '&kul='+kull
   eval("window.open(as,'win'+t,'width='+screen.width+',height='+screen.height+',scrollbars,resizable,top=0,left=0')");
}


