var loadstatustext="<img src='images/loading.gif' />Mesajınız gönderiliyor lütfen bekleyiniz ..."
var cacheControl="";
function CreateObject() 
 {
    var ReqObject;
    var brwser = navigator.appName;
    if(brwser == "Microsoft Internet Explorer") ReqObject = new ActiveXObject("Microsoft.XMLHTTP");
    else     ReqObject = new XMLHttpRequest();
    return ReqObject;
 }
function IletisimGonder(dil)
{
     var Hata="";
	 var name = document.getElementById("name").value;
	 var phone = document.getElementById("phone").value;
	 var e_mail = document.getElementById("e_mail").value;
	 var goodEmail = document.getElementById("e_mail").value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	 var subject = document.getElementById("subject").value;
	 var comment = document.getElementById("comment").value;
	 
	 if(dil=="tr")
	 {
	 if(name=="") Hata="Lütfen  Adınızı Giriniz!\n"; 
     if(e_mail=="") Hata+="Lütfen Email Adresinizi Giriniz!\n"; 
     if (goodEmail==null) Hata+="Lütfen Email Adresinizin Yazımını Kontrol Ediniz!\n"; 
	 if(subject=="") Hata+="Lütfen Konu Giriniz!\n"; 
     if(comment=="") Hata+="Lütfen İstek/Görüş Giriniz!\n"; 
	 }
	 else
	 {
	 if(name=="") Hata="Please enter your name!\n"; 
     if(e_mail=="") Hata+="Please enter your email address!\n"; 
     if (goodEmail==null) Hata+="Please check the spelling of your email address!\n"; 
	 if(subject=="") Hata+="Please enter the subject!\n"; 
     if(comment=="") Hata+="Please enter your wishes!\n"; 	 
	 
	 }
	 if(Hata=="") 
 	  {
	  var dataSource="email.php?name="+name+"&phone="+phone+"&comment="+comment+"&e_mail="+e_mail+"&subject="+subject+"&dil="+dil;
	  var http = CreateObject();
	  var maindiv = document.getElementById("IletisimSonuc");
	  maindiv.innerHTML=loadstatustext;
	  cacheControl=(dataSource.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	  http.open("GET",dataSource+cacheControl);
	  http.onreadystatechange = function()  
	   {
		 if (http.readyState == 4 && http.status == 200)  
		  {
			maindiv.innerHTML = http.responseText;
		  }
	   }
	 http.send(null);	  
 }
 else
 {
  alert(Hata);	 
 }
}


function doLogin(dil)
{
 var frm=document.getElementById("frmLogin");
 var hata="";
 var goodEmail = frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
 if (frm.email.value=="") 
  {
  if(dil=="tr") hata=hata+ "Lütfen Email adresinizi giriniz.\n";
  else hata=hata+ "Please Enter Your Mail Address.\n";
  }
 if(goodEmail==null) 
  {
  if(dil=="tr") hata=hata+ "Geçersiz bir e-posta adresi girdiniz.Kontrol ediniz.\n";
  else hata=hata+ "Invalid Mail Address.\n"; 
  }
 if (frm.sifre.value=="") 
 {
	if(dil=="tr") hata=hata+ "Lütfen şifrenizi giriniz.\n";
	else hata=hata+ "Please enter your password.\n";
 }
 if (hata=="") document.frmLogin.submit();
 else alert(hata);
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
 

function KontrolSifremiUnuttum(dil)
{

var goodEmail = document.frmSifremiUnuttum.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
 if (document.frmSifremiUnuttum.email.value=="")
  {
    if(dil=="tr") alert("Lütfen Email adresinizi giriniz !");
	else  alert("Please Enter Your Email Address !");
    document.frmSifremiUnuttum.email.focus();
	return false;
  }
 if(goodEmail==null)
  {
   if(dil=="tr") alert("Geçersiz bir e-posta adresi girdiniz.Kontrol ediniz!");
   else alert("Invalid Email Address!");
   document.frmSifremiUnuttum.email.focus();
   return false;
  } 
 
return true;
}



function KontrolFirmaKayit(dil)
{

 var goodEmail = document.frmFirmaKayit.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
 
 if (document.frmFirmaKayit.firma_ad.value=="")
  {
    if(dil=="tr") alert("Lütfen Firma Adını giriniz !");
	else alert("Please Enter Your Firm Name !");
    document.frmFirmaKayit.firma_ad.focus();
	return false;
  } 
 
 if (document.frmFirmaKayit.email.value=="")
  {
    if(dil=="tr") alert("Lütfen E-posta adresinizi giriniz !");
	else alert("Please enter email address !");
    document.frmFirmaKayit.email.focus();
	return false;
  }
  if(goodEmail==null)
  {
   alert("Geçersiz bir e-posta adresi girdiniz.Kontrol ediniz!");
   document.frmFirmaKayit.email.focus();
   return false;
  } 
   if (document.frmFirmaKayit.sifre.value=="")
  {
    alert("Lütfen şifrenizi giriniz!");
    document.frmFirmaKayit.sifre.focus();
	return false;
  } 
   if (document.frmFirmaKayit.sifre.value!=document.frmFirmaKayit.sifretekrar.value)
  {
    alert("Sifre tekrarinda hata yaptiniz.Tekrar deneyiniz!");
    document.frmFirmaKayit.sifretekrar.focus();
	return false;
  }
    if (document.frmFirmaKayit.yetkili.value=="")
  {
    if(dil=="tr") alert("Lütfen yetkili adını giriniz!");
	else alert("Please enter Authority name!"); 
    document.frmFirmaKayit.yetkili.focus();
	return false;
  } 
  
     if (document.frmFirmaKayit.adres.value=="")
  {
    alert("Lütfen adres giriniz!");
    document.frmYeniKayit.adres.focus();
	return false;
  } 
      if (document.frmFirmaKayit.posta_kod.value=="")
  {
    alert("Lütfen posta kodunuzu giriniz!");
    document.frmYeniKayit.posta_kod.focus();
	return false;
  } 
  
  
  
return true;
}

indexz = -1;

function FlashDoc(w, h, src)
{
	document.write('<div style="width: ' + w + '; height: ' + h + '; z-index: ' + indexz + ';">');
	document.write('<object width="' + w + '" height="' + h + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">');
	document.write('<param name="movie" value="' + src + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="opaque">');
	document.write('<param name="scale" value="1">');
	document.write('<embed style="z-index: ' + indexz + ';" src="' + src + '" width="' + w + '" height="' + h + '" scale="exactfit" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	indexz++;
}


