function FlasHaber(Konu,Sektor)
  {  
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)
	Resp=xmlHttp.responseText.split ("||")
	
		if (Resp[0]=='OK')
		{
		alert ('Bülten gönderilmiştir.')
			document.all.Stat.innerHTML='<font color="red">Bülten gönderilmiştir!</font>'
document.all.btnSend.disabled=false
document.getElementById('Remaining').innerHTML="Kalan gönderim:" + Resp[1]
		}
	  
        }
      }
	  

	if (confirm ('Flaş haberi göndermek istediğinizden emin misiniz?'))
	{
	document.all.btnSend.disabled=true
	document.all.Stat.innerHTML='<b>Bülten Gönderiliyor...</b><li>Bülten gönderimi 2-3 dakika sürebilir.</li><li>Bu süre içinde bu sayfayı kapatmayınız ya da yenilemeyiniz.</li><li>Bültenin gönderilme işlemi sonucunda bilgilendirileceksiniz. Lütfen bekleyiniz.</li>'
    xmlHttp.open("GET","../bulten_gonder.asp?Konu=" +Konu + '&Sektor=' + Sektor,true);
    xmlHttp.send(null);  
	}
	
}


function ShowCats(Sector)
  {  
  
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)
//alert (ShowOK)

document.all.CatList.innerHTML=xmlHttp.responseText
	   
	         }
      }
	 // alert (MType)
	  xmlHttp.open("GET","ajax/show_cats.asp?Sector=" + Sector ,true);
    xmlHttp.send(null);  
	
	}


function CheckAvail(Email,MType)
  {  
  
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)
//alert (ShowOK)
       if (xmlHttp.responseText!='0')
	   {
alert ('Bu e-mail adresine sahip başka bir üye vardır.')
document.all.RegEmail.value=''
document.all.RegEmail.focus()

	   }
	 
//	   document.all.btnAvail.disabled=true
	   
	         }
      }
	 // alert (MType)
	 if (Email!='')
	 {
	  xmlHttp.open("GET","../ajax/check_avail.asp?Email=" + Email + '&Type=' + MType ,true);
    xmlHttp.send(null);  
	}
	}
	
	
function FirmaKat(Firma,SelCat)
  {  
  
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)
//alert (ShowOK)
       if (xmlHttp.responseText!='0')
	   {
 window.open('firma_popup.asp?SelCat='  +SelCat + '&F=' + Firma,'FirmaSektor','width=400,height=200,left=0,top=0,status=no,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizable=no,alwaysRaised=yes')
	   }
	 
//	   document.all.btnAvail.disabled=true
	   
	         }
      }
	  if (Firma!=0)
	  {
	  xmlHttp.open("GET","ajax/firma_kat.asp?Firma=" + Firma + '&SelCat=' + SelCat ,true);
    xmlHttp.send(null);  
	}
	}
	

function CheckCatExists(Caption,Sector)
  {  
  
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)
//alert (ShowOK)
       if (xmlHttp.responseText!='0')
	   {
alert ('Bu sektör altında ' + Caption + ' adında bir kategori zaten bulunmaktadır!')

	   }
	 
//	   document.all.btnAvail.disabled=true
	   
	         }
      }
	  xmlHttp.open("GET","ajax/check_cat_exists.asp?Caption=" + Caption + '&Sector=' + Sector ,true);
    xmlHttp.send(null);  
	
	}
	
	
	
	
	
	function CheckFirmExists(Caption)
  {  
  
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)
//alert (ShowOK)
       if (xmlHttp.responseText!='0')
	   {
alert (Caption + ' adında bir firma zaten bulunmaktadır!')

	   }
	 
//	   document.all.btnAvail.disabled=true
	   
	         }
      }
    xmlHttp.open("GET","ajax/check_firm_exists.asp?Caption=" + Caption,true);
    xmlHttp.send(null);  
	
	}
	
	

