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];}
}

//--------------------------------------------------------------
//email kontrol
var yasakAdres=new Array()
yasakAdres[0]="hotmail"
yasakAdres[1]="mynet"
yasakAdres[2]="yahoo"
//istediginiz kadar uzatabilirsiniz listeyi yasakAdres[3]="uzatabilirsiniz"

var testSonuc
function kontrolet()
{
	var yanlisKontrol=0;
	var str=document.onayla.mailgirildi.value
	var filtrele=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	
	if (filtrele.test(str))
	{
		var bagla=str.split("@")
		bagla=bagla[1].split(".")
		for (i=0;i<yasakAdres.length;i++)
		{
			if (bagla[0]==yasakAdres[i])
			yanlisKontrol=1
		}
		
		if (yanlisKontrol!=1)
			testSonuc=true
		else{
		alert("Lütfen mynet,yahoo,hotmail harici mail adresi giriniz")
		testSonuc=false
	}
}
else
{
	alert("Mail adresinizi eksik yada yanlis girdiniz!")
	testSonuc=false
}
	return (testSonuc)
}

function kontrol12(){
if (document.layers||document.getElementById||document.all)
return kontrolet()
else
return true
}
//--------------------------------------------------------------
//bu fonksiyon ile ilk verilen tarih ikinciden küçük olmalı
function tarih_kontrol(tarih_bsl,tarih_bts,mesaj)
{
var tarih_1=tarih_bsl.value;
var tarih_2=tarih_bts.value;
//15-02-2004
tarih_1=tarih_1.substring(6,10)+tarih_1.substring(3,5)+tarih_1.substring(0,2);
tarih_2=tarih_2.substring(6,10)+tarih_2.substring(3,5)+tarih_2.substring(0,2);
     if (tarih_1>tarih_2)
         {
        uyari=uyari+"\n"+mesaj+" tarihlerinde mantıksızlık var";
         }
         else
         {
         i++;
         };
};
//--------------------------------------------------------------
//bu fonksiyon da adı geçen iki değere birebir mantığı ile girmeli
function birebir(hedef_1,hedef_2,mesaj)
{
  if (hedef_1.value.length>0 || hedef_2.value.length>0)
  {
        if (hedef_1.value.length>0 && hedef_2.value.length>0)
        {
        i++;
        }
        else
        {
        uyari=uyari+"\n"+mesaj+" beraber tanımlanmalı";
        };
  }
  else
 {
  i++;
  };
};
//--------------------------------------------------------------
//bu fonsiyon uyari ya dışarıdan mesaj ekleriz
function uyari_ekle(mesaj)
{
uyari=uyari+"\n"+mesaj;
};
//--------------------------------------------------------------
//bu fonsiyon stok_kart, cari_kart gibi değerlere bakarız
function gozat(sayfa,deger)
{
var x=document.gozat_form;
x.id.value=deger;
x.method="Post";
x.target=sayfa;
x.action=sayfa;
x.submit();
};
//--------------------------------------------------------------
//bu fonsiyon tarih seçimim için 108.php yi açarız
//artık anlamını yitirdi silinebilir
function tarih_sectir(hedef)
{
pencere('108.php','takvim','210','215');
var x=document.tarih_form;
var secili_tarih=eval("document.form."+hedef).value;
x.tarih.value=secili_tarih;
x.hedef.value=hedef;
x.method="Post";
x.target='takvim';
x.action="108.php";
x.submit();
};
//--------------------------------------------------------------
//bu fonsiyon karekter uzunluğunun belli bir rakamdan büyük olması sağlanır
function karakter(hedef,deger,mesaj)
{
  if (hedef.value.length<deger)
  {
  uyari=uyari+"\n"+mesaj+" en az "+deger+" karekter olmalı";
  }
  else
  {
  i++;
  };

};
//--------------------------------------------------------------
//bu fonsiyon ile popup pencere açarız barlar mevcut şekilde
function pencere_2(adres,adi,en,boy)
{
window.open(adres,adi,"scrollbars=yes,width="+en+",height="+boy);
};
//--------------------------------------------------------------
//bu fonsiyon ile popup pencere açarız
function pencere(adres,adi,en,boy)
{
window.open(adres,adi,"width="+en+",height="+boy);
};
//--------------------------------------------------------------
//bu fonksiyon ile adı geçen değer başka değere eşitse uyarı verir
function esitmi(hedef_1,hedef_2,mesaj)
{
  if (hedef_1==hedef_2)
  {
  uyari=uyari+"\n"+mesaj+" eşit olamaz";
  }
  else
  {
  i++;
  };
};

//--------------------------------------------------------------
//bu fonksiyon da adı geçen iki input a birden girdi yapamaz
function ikilimi(hedef_1,hedef_2,mesaj)
{
  if (hedef_1.value.length>0 && hedef_2.value.length>0)
  {
  uyari=uyari+"\nİki "+mesaj+" değeri birden seçtiniz";
  }
  else
  {
  i++;
  };
};
//--------------------------------------------------------------
function zorunlu_para_sayimi(hedef,mesaj)
{
   if (hedef.value.length>0)
   {
     hedef=hedef.value;
     do
     hedef = hedef.replace(',','');
     while (hedef.indexOf(',',0)>-1);
     if (hedef==hedef*1) {i++;}else{uyari=uyari+"\n"+mesaj+" Sayı Olmalı";}
   }
   else
   {
   uyari=uyari+"\n"+mesaj+" Girmediniz";
   };
};
//--------------------------------------------------------------
function para_sayimi(hedef,mesaj)
{
hedef=hedef.value;
do
hedef = hedef.replace(',','');
while (hedef.indexOf(',',0)>-1);
if (hedef==hedef*1) {i++;}else{uyari=uyari+"\n"+mesaj+" Sayı Olmalı";}
};
//--------------------------------------------------------------
function formatla(form_adi){
        var ie4 = (document.all)? true:false
        if (ie4) {
        if (form_adi.value=='') {

                } else {

                        var deger = form_adi.value;
                        var deger2 = deger;
                        do
                           deger2 = deger2.replace(',','');
                        while (deger2.indexOf(',',0)>-1);
                        form_adi.value = virgul_ekle(deger2);
                }
        }
}
//--------------------------------------------------------------
function virgul_ekle(deger2){
                var doviz = deger2.indexOf('.',0);
                if (doviz > -1) {
                        var kalan_deger = deger2.substr(doviz,deger2.length-doviz);
                        var gelen_deger = deger2.substr(0,doviz);
                } else {
                        kalan_deger = '';
                        gelen_deger = deger2;
                }

                var gelen_deger_uzunluk = gelen_deger.length;

                if ((gelen_deger_uzunluk/3)==Math.floor(gelen_deger_uzunluk/3)) {
                        var yuvarla = Math.floor(gelen_deger_uzunluk/3)-1;
                        var ayrac=3;
                } else {
                        yuvarla = Math.floor(gelen_deger_uzunluk/3);
                        var ayrac = gelen_deger_uzunluk -(yuvarla*3);
                }

                var olusan_deger = '';
                for (s = 1; s < yuvarla+1; s++)
                {
                         olusan_deger = ',' + gelen_deger.substr(gelen_deger_uzunluk - (s*3),3) + olusan_deger;
                }

                olusan_deger = gelen_deger.substr(0,ayrac) + olusan_deger;
                olusan_deger = olusan_deger + kalan_deger;
                return olusan_deger
};
//--------------------------------------------------------------
function yalanci_popup(adi)
{
 window.open('about:blank',adi);
};
//--------------------------------------------------------------
//belli rakamdan büyük mü?
function buyuk_esitmi(hedef,mesaj,deger)
         {
         if (hedef.value.length>0 & deger.length>0)
         {
                  if (hedef.value>deger-1)
                  {
                  i++;
                  }
                  else
                  {
                  uyari=uyari+"\n"+mesaj+" "+deger+" Rakamından Büyük Olmalı";
                  };
         }
         else
         {
         i++;
         };
         };
//--------------------------------------------------------------
//belli rakamdan büyük mü?
function buyukmu(hedef,mesaj,deger)
         {
         if (hedef.value.length>0 & deger.length>0)
         {
                  if (parseFloat(hedef.value)>parseFloat(deger))
                  {
                  i++;
                  }
                  else
                  {
                  uyari=uyari+"\n"+mesaj+" "+deger+" Rakamından Büyük Olmalı";
                  };
         }
         else
         {
         i++;
         };
         };
//--------------------------------------------------------------
//belli rakamdan kucukmu mü?
function kucuk_mu(hedef,mesaj,deger)
         {

         if (hedef.value.length>0 & deger.length>0)
         {
                  if (parseFloat(deger)>=parseFloat(hedef.value))
                  {
                  i++;
                  }
                  else
                  {
                  uyari=uyari+"\n"+mesaj+" "+deger+" değerinden büyük olamaz";
                  };
         }
         else
         {
         i++;
         };
         };

//--------------------------------------------------------------
//iki rakam arasında mı?
function ara(hedef,mesaj,birinci,ikinci)
         {
         if (hedef.value==hedef.value*1)
         {
                  if (birinci<=hedef.value & hedef.value<=ikinci) {i++;}else{uyari=uyari+"\n"+mesaj+" değeri "+birinci+" ile "+ikinci+" arası olmalı";}
         }
         else{uyari=uyari+"\n"+mesaj+" Sayı Olmalı";}
         };
//--------------------------------------------------------------
function sayimi(hedef,mesaj)
         {
         if (hedef.value==hedef.value*1) {i++;}else{uyari=uyari+"\n"+mesaj+" Sayı Olmalı";}
         };
//--------------------------------------------------------------
function bosmu(hedef,mesaj)
         {
         if (hedef.value.length==0) {uyari=uyari+"\n"+mesaj+" Girmediniz";}else{i++;}
         };
//--------------------------------------------------------------
function zorunlu_sayi(hedef, mesaj)
         {
         if (hedef.value.length==0)
         {
         uyari=uyari+"\n"+mesaj+" Girmediniz";
         }
         else
         {
          if (hedef.value==hedef.value*1 && hedef.value>0)
          {i++;}
          else
          {uyari=uyari+"\n"+mesaj+" Rakam Olmalı";}
         };
         };
//--------------------------------------------------------------
function popup_bosmu(hedef,mesaj)
         {
         if (hedef.value=="") {uyari=uyari+"\n"+mesaj+"dınız";}else{i++;}
         };
//--------------------------------------------------------------
function tetik(son_nokta)
       {
       if (i==son_nokta)
       {
       i=0;
       uyari="--------HATA--------";
       document.form.submit();
       }
       else
       {
       alert (uyari);
       i=0;
       uyari="--------HATA--------";
       };
       };
//--------------------------------------------------------------
function tetik_ozel(son_nokta,formadi)
       {
       if (i==son_nokta)
       {
       i=0;
       uyari="--------HATA--------";
       eval(formadi).submit();
//       document.formadi.submit();
       }
       else
       {
       alert (uyari);
       i=0;
       uyari="--------HATA--------";
       };
       };
//--------------------------------------------------------------
//bu fonksiyon ile tıklanınca değişen
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

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = 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;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = 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;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
        }
    } // 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
//--------------------------------------------------------------
//bu fonksiyon da adı geçen iki değerden en az birini girdi yapar
function en_az_biri(hedef_1,hedef_2,mesaj_1,mesaj_2)
{
  if (hedef_1.value.length>0 || hedef_2.value.length>0)
  {
        i++;
  }
  else
  {
        uyari=uyari+"\n"+mesaj_1+" veya "+mesaj_2+" alanlarından birini giriş yapın";
  };
};
//--------------------------------------------------------------
//bu fonksiyon resmin boyutuna göre popup pencere açar
PositionX = 100;
PositionY = 100;
defaultWidth  = 700;
defaultHeight = 530;
var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Yükleniyor...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["Photo Gallery"].width;');writeln('window.innerHeight=document.images["Photo Gallery"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) 
			writeln('</head><body bgcolor=000000 scroll="yes" onload="reSizeToImage();doTitle();self.focus()">')
		else 
			writeln('</head><body bgcolor=000000 scroll="yes" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<img name="Photo Gallery" src='+imageURL+' style="display:block"></body></html>');
	close();		
	}
}