
function CheckAvail(Email,Type)
  {  
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	      {
      if(xmlHttp.readyState==4)
        {
//	alert(xmlHttp.responseText)
		if (xmlHttp.responseText!='0')
		{
		alert ('Bu e-mail adresi sistemde zaten mevcuttur.')
		document.all.RegEmail.value=''
		document.all.RegEmail.focus()
		}
	  
        }
      }
	
    xmlHttp.open("GET","Ajax/check_avail.asp?Email=" + Email + '&Type=' + Type,true);
    xmlHttp.send(null);  
	
}





function Login(Email,Sifre,F,S)
  {  
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	      {
      if(xmlHttp.readyState==4)
        {
		
		if (xmlHttp.responseText!='0')
		{
window.location.href='firma.asp?F=' +F + '&S=' + S
		}
		else
		{
		alert ('Giriş bilgilerinizde hata vardır. Lütfen kontrol ediniz.')
		}
	  
        }
      }
    xmlHttp.open("GET","Ajax/login.asp?Email=" + Email + '&Sifre=' +Sifre,true);
    xmlHttp.send(null);  

}





function Survey(Anket,Cevap)
  {  
if (navigator.userAgent.indexOf("MSIE")!=-1) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} else {xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function()
	      {
      if(xmlHttp.readyState==4)
        {
		
		if (xmlHttp.responseText!='Fail')
		{
		alert ('Cevabınız gönderilmiştir.')
		}
		else
		{
		alert ('Bu ankete daha önce katılmış olduğunuz için cevabınız gönderilemedi.')
		}
	  
        }
      }
	  if (document.all.AnketCevap.value=='')
	  {
	 alert ('Lütfen, bir şıkkı işaretleyiniz.') 
	  }
	  else
	  {
    xmlHttp.open("GET","Ajax/survey.asp?Anket=" + Anket + '&Cevap=' + Cevap,true);
    xmlHttp.send(null);  
	}
}



function ShowSendNews(Baslik,NewsID)
{
document.all.NewsToSend.value=NewsID
document.all.NewsToSendTitle.innerText=Baslik
document.all.NewsToSendTitle.textContent=Baslik
document.all.SendNewsWin.style.top=document.body.scrollTop + (screen.availHeight*0.1)
document.all.SendNewsWin.style.left=screen.width*0.25
document.all.SendNewsWin.style.display='block'
//document.all.SendNewsEmail.focus()

}




function SoruGonder()
{
if (document.all.Ad.value=='') {alert ('Lütfen, adınızı giriniz.');document.all.Ad.focus();return false}
if (document.all.Email.value=='') {alert ('Lütfen, email adresinizi giriniz.');document.all.Email.focus();return false}
if (document.all.Capt.value=='') {alert ('Lütfen, güvenlik kodunu giriniz.');document.all.Capt.focus();return false}
}

function TypeSearch()
{

document.all.SearchKey.style.color='black'
document.all.SearchKey.value=''

}

function FirmaKaydet()
{
if (document.all.FirmaAd.value=='') {alert ('Lütfen, firmanızın adını giriniz.');document.all.FirmaAd.focus();return false}
if (document.all.Sektor.value=='') {alert ('Lütfen, sektörünüzü seçiniz.');document.all.Sektor.focus();return false}
if (document.all.Yetkili.value=='') {alert ('Lütfen, yetkili adını giriniz.');document.all.Yetkili.focus();return false}
if (document.all.Gorev.value=='') {alert ('Lütfen, görevinizi giriniz.');document.all.Gorev.focus();return false}
if (document.all.Email.value=='') {alert ('Lütfen, email adresinizi giriniz.');document.all.Email.focus();return false}
if (document.all.Telefon1.value=='') {alert ('Lütfen, telefon numaranızı giriniz.');document.all.Telefon1.focus();return false}
if (document.all.Sehir.value=='') {alert ('Lütfen, genel merkezin bulunduğu şehri seçiniz.');document.all.Sehir.focus();return false}
if (document.all.Adres.value=='') {alert ('Lütfen, firmanızın adresini giriniz.');document.all.Adres.focus();return false}

}



function UyeKaydet()
{
if (document.all.Ad.value=='') {alert ('Lütfen, adınızı giriniz.');document.all.Ad.focus();return false}
if (document.all.Soyad.value=='') {alert ('Lütfen, soyadınızı giriniz.');document.all.Soyad.focus();return false}
if (document.all.RegEmail.value=='') {alert ('Lütfen, email adresinizi giriniz.');document.all.RegEmail.focus();return false}
if (document.all.SifreSec)
{
if (document.all.SifreSec.value=='') {alert ('Lütfen, şifrenizi giriniz.');document.all.SifreSec.focus();return false}
if (document.all.SifreTekrar.value=='') {alert ('Lütfen, şifrenizi tekrar giriniz.');document.all.SifreTekrar.focus();return false}
if (document.all.SifreSec.value!=document.all.SifreTekrar.value) {alert ('İki şifre aynı değil. Lütfen, kontrol ediniz.');document.all.SifreTekrar.focus();return false}
}
if (document.all.Gun.value=='') {alert ('Lütfen, doğum gününüzün gününü giriniz.');document.all.Gun.focus();return false}
if (document.all.Ay.value=='') {alert ('Lütfen, doğum gününüzün ayını giriniz.');document.all.Ay.focus();return false}
if (document.all.Yil.value=='') {alert ('Lütfen, doğum gününüzün yılını giriniz.');document.all.Yil.focus();return false}
if (document.all.Sehir.value=='') {alert ('Lütfen, şehrinizi seçiniz.');document.all.Sehir.focus();return false}
if (document.all.SectorChecked.value=='0') {alert ('Lütfen, ilgilendiğiniz sektörleri seçiniz.');return false}


}

function ShowLogin(F,S)
{
document.all.F.value=F
document.all.S.value=S
document.all.LoginWin.style.top=document.body.scrollTop + (screen.availHeight*0.1)
document.all.LoginWin.style.left=screen.width*0.35
document.all.LoginWin.style.display='block'
document.all.LoginEmail.focus()

}



function BuyukResim(ID)
{
document.all.FullSize.style.top=document.body.scrollTop + (screen.availHeight*0.1)
document.all.FullSize.style.left=screen.width*0.25
document.all.FullSize.style.display='block'
document.all.imgFullSize.src='http://' + document.domain + '/Upload/Haber/' + ID + '.jpg'

}

