
function load_content(ustsayfa,framead)
 {
	if (parent.document.getElementById(framead)) 
	   {parent.document.getElementById(framead).innerHTML=document.getElementById('inner_frame').innerHTML;	}
	if (!parent.document.getElementById(framead))  {window.location=(ustsayfa);}
 }


function wopen(url, name, w, h)
{
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;

  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=yes');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}


function Goster(SatirReferans,IkonReferans)
{
 var row = document.getElementById(SatirReferans);
  if   (row.style.display == '') 
       {row.style.display = 'none'
       if (IkonReferans != 'ikon_0') {document[IkonReferans].src='images/bullet_right.jpg'}}
  else {
  
     for (i=0 ; i <= 16; i++)
           {
             var rowx  = document.getElementById('row_' + i);
             rowx.style.display ='none'           
             ikonx = 'ikon_' +  (i);
             if (i !=0 ) {document[ikonx].src = 'images/bullet_right.jpg'}
           }
         
       row.style.display = ''
       if (IkonReferans != 'ikon_0') {document[IkonReferans].src='images/bullet_down.jpg'}
         }

}


function validate_email(field,alerttxt)
  {
    with (field)
  {
    apos=value.indexOf("@");
    dotpos=value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2) 
    { alert(alerttxt);return false;}
      else {return true;}
    }
   }


function vf_sub(ALAN_ICERIK,ALAN_UZUNLUK,HATA_MESAJI,ALAN_TURU)
{

if (ALAN_TURU == 'METIN') 
         { checkOK  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ĞÜŞÖÇİğüşöçı";   }
else if (ALAN_TURU == 'SAYI') 
         { checkOK  = "0123456789";             }
else if (ALAN_TURU == 'TELEFON')
         { checkOK  = "0123456789 ()-+";        }
else if (ALAN_TURU == 'TARIH')
         { checkOK  = "0123456789 ./-";         }
else     { checkOK  == " ";                     }

  var checkStr = ALAN_ICERIK;  
  var allValid = true;
  if (checkStr  == null || checkStr  == "" || checkStr.length < ALAN_UZUNLUK)
     { alert (HATA_MESAJI + ' bölümünü boş veya HATALI giriş yaptınız (Hata Kodu:01)') ; return false   }
  for (i = 0;  i < checkStr.length;  i++)
  {   ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
      break;
      if (j == checkOK.length)
         { allValid = false;alert(HATA_MESAJI + ' bölümünü boş veya HATALI giriş yaptınız (Hata Kodu:02)');
           return false;break}
   }

}

function validate_form(thisform)
{
with (thisform)
{

 if (vf_sub(textbox_AdSoyad.value,'6','AD SOYAD','METIN')==false)        { textbox_AdSoyad.focus();textbox_AdSoyad.style.backgroundColor='#ffff99';return false }        else { textbox_AdSoyad.style.backgroundColor='#ffffff';}
 if (vf_sub(textbox_Telefon.value,'7','TELEFON','TELEFON')==false)          { textbox_Telefon.focus();textbox_Telefon.style.backgroundColor='#ffff99';return false }        else { textbox_Telefon.style.backgroundColor='#ffffff';}
 if (validate_email(textbox_Email,"Lütfen geçerli bir E-MAIL adresi yazınız")==false)
    {textbox_Email.focus();textbox_Email.style.backgroundColor ='#ffff99';return false;}   else { textbox_Email.style.backgroundColor='#ffffff';} 
 if (option_iletisim[0].checked == false && option_iletisim[1].checked == false) {alert ('Lütfen İLETİŞİM ŞEKLİ bölümünden seçim yapın');return false;}
 if (vf_sub(textbox_Konu.value,'4','KONU','METIN')==false)               { textbox_Konu.focus();textbox_Konu.style.backgroundColor='#ffff99';return false }              else { textbox_Konu.style.backgroundColor='#ffffff';} 
  
}

}


