function GetXmlHttpObject()
  {
  xHRObject = false;
  if (window.XMLHttpRequest)
    {
		xHRObject = new XMLHttpRequest();
    }
  else if (window.ActiveXObject)
    {
		xHRObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
  return xHRObject;
  }
function sms_gonder(cepno,mesaj)
  {
  hesap_adi='';
  hesap_sifre='';
  mesaj=mesaj;
  cepno=cepno;
  gon_ad='Medikalbank';
  xmlHttp=GetXmlHttpObject();
  var url="/api/send.php?";
  url=url+"hesap_adi"+hesap_adi;
  url=url+"&hesap_sifre"+hesap_sifre;
  url=url+"&mesaj"+mesaj;
  url=url+"&cep_no"+cepno;
  url=url+"&gon_ad"+gon_ad;
  if (xmlHttp)
    {
    xmlHttp.open("GET",url,true);
	  }
  }  
function adresle(tip,deger,mult,jsFonk)
  {
  //alert(tip);
  i_src=document.getElementById('is_src').value;
  if (tip=='ulke')
    {
    gonder='uid';
    if (i_src==1){document.getElementById('global_div').value='div_bolge##div_il';}
    else if(i_src==2){document.getElementById('global_div').value='div_bolge2##div_il2';}
    }
  if (tip=='bolge')
    {
    gonder='bid';
    if (i_src==1){document.getElementById('global_div').value='div_il';}
    else if(i_src==2){document.getElementById('global_div').value='div_il2';}
    }
  else if (tip=='il')
    {
    gonder='ilid';
    if (i_src==1){document.getElementById('global_div').value='div_ilce';}
    else if (i_src==2){document.getElementById('global_div').value='div_ilce2';}
    }
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    var url="ajax.php?t=adres";
    url=url+"&"+gonder;
    url=url+"="+deger;
    url=url+"&mult="+mult;
    url=url+"&js="+jsFonk;
    //alert(url);
    xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange=global_div;
		xmlHttp.send(null);
    }    
  }
function global_div()
  {
  if (xmlHttp.readyState==4)
    {
    degerler=xmlHttp.responseText.split('##'); 
    div=document.getElementById('global_div').value;
    divler=div.split('##');
    don=divler.length;
    //alert(degerler[0]);
    for (i=0;i<don;i++)
      {
      //if (degerler[i]!='undefined')
      document.getElementById(divler[i]).style.display='inline';
      document.getElementById(divler[i]).innerHTML=degerler[i];
      //alert(degerler[i]);
      }
    //document.getElementById(div).innerHTML=xmlHttp.responseText;
    //window.scrollTo(0,0);
    }
  }

//*****************************  
function sayfala(sayfa,tip)
  {
  document.getElementById('global_div').value='listeyeri';
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    var url="ajax.php?t=sayfa";
    url=url+"&p="+sayfa+"&pi="+tip;
    xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange=global_div;
		window.scrollTo(0,0);
		xmlHttp.send(null);
    }
  }
// tip :1 için display:
// tip :2 için inner_html:none;  
             
function src_ihale(tip)
  {
  //alert(tip);
  document.getElementById('is_src').value=2;
  for (i=1;i<=7;i++)
    {
    div_id='s_'+i;
    if (tip==i)
      {
      document.getElementById(div_id).style.display='inline';  
      }
    else 
      {
      document.getElementById(div_id).style.display='none';
      }  
    }
  }
function adres_yaz(yer)
  {
  XM='<span class="src_in" OnMouseOver="this.style.cursor=\'pointer\';"';
  //alert(yer);
  if (yer=='bolge')
    {
    open_div='g_bolge';
    yaz_div='yaz_g_bolge';
    dondur='bolgeler[]';
    }
  else if (yer=='il')
    {
    open_div='g_il';
    yaz_div='yaz_g_il';
    dondur='il[]';
    }
  else if (yer=='ihale_tur')
    {
    open_div='g_5';
    yaz_div='yaz_g_5';
    dondur='ihale_tur[]';
    //X=XM+' OnClick="alert(\'Boo\')"> x </span>';
    }
  else if (yer=='ihale_grup')
    {
    open_div='g_7';
    yaz_div='yaz_g_7';
    dondur='ihale_grup[]';
    //X=XM+' OnClick="alert(\'Boo\')"> x </span>';
    }        
  ids=document.getElementById(dondur);
  de=document.getElementById(dondur).options.length
  //alert(de);
  doldur='';
  for (i=1;i<de;i++)
    {
    if(ids.options[i].selected==true)
      {
      deg=ids.options[i].value;
      //alert(deg);
      X=XM+' OnClick="adres_cikar(\''+deg+'\',\''+yer+'\')"> x </span>';
      doldur=doldur+X+ids.options[i].text+'<br>';
      }
    }  
  document.getElementById(open_div).style.display='inline';
  document.getElementById(yaz_div).innerHTML=doldur;
  }
function adres_cikar(deger,yer)
  {
  if (yer=='bolge')
    {
    src_ihale('2');
    dondur='bolgeler[]';
    }
  else if (yer=='il')
    {
    src_ihale('2');
    dondur='il[]';
    }
  else if (yer=='ihale_tur')
    {
    src_ihale('6');
    dondur='ihale_tur[]';
    }
  else if (yer=='ihale_grup')
    {
    src_ihale('7');
    dondur='ihale_grup[]';
    //alert(deger);
    }
   idm=document.getElementById(dondur);
  //jms=idm.options[deger].selected;
  idm.options[deger].selected=false;
  //alert(idm.options[deger].selected);
  adres_yaz(yer);
  }
function deger_cikar(tip,deger)
  {
  //alert(tip+deger);
  if (tip=='ihale_no')
    {
    close_div='g_1';
    midde_close_div='s_1'
    yaz_div='yaz_g_1';
    dell_div='ihale_no';
    }
  else if (tip=='urun')
    {
    close_div='g_3';
    midde_close_div='s_3'
    yaz_div='yaz_g_3';
    dell_div='urun';
    }  
  document.getElementById(close_div).style.display='none';
  document.getElementById(yaz_div).innerHTML='';
  document.getElementById(dell_div).value='';  
  document.getElementById(midde_close_div).style.display='none';
  }  
function deger_yaz(tip,deger,sira)
  {
  XM='<span class="src_in" OnMouseOver="this.style.cursor=\'pointer\';"';
  if (tip=='ihale_no')
    {
    open_div='g_1';
    yaz_div='yaz_g_1';
    X=XM+' OnClick="deger_cikar(\'ihale_no\',\''+deger+'\')"> x </span>';
    }
  else if (tip=='urun')
    {
    open_div='g_3';
    yaz_div='yaz_g_3';
    X=XM+' OnClick="deger_cikar(\'urun\',\''+deger+'\')"> x </span>';
    } 
  document.getElementById(open_div).style.display='block';
  yeni=X+deger;
  document.getElementById(yaz_div).innerHTML=yeni;
  }      
function arama_des()
  {
  if (document.getElementById('src_area').style.display=='inline')
    {
    document.getElementById('src_area').style.display='none';
    document.getElementById('src_ret').innerHTML='<img src="images/ara_icon.jpg" border="0" alt="Detaylı Arama" style="vertical-align: middle;">Detaylı Arama';
    }
  else 
    {
    document.getElementById('src_area').style.display='inline';
    document.getElementById('src_ret').innerHTML='Kapat';
    //var y=screen.height;
    //document.getElementById('karartma').style.height=y;
    //document.getElementById('karartma').style.backgroundImage="url('images/karart.png')";
    }  
  }
function arama_des2()
  {
  if (document.getElementById('alan_arama').style.display=='inline')
    {
    document.getElementById('alan_arama').style.display='none';
    document.getElementById('src_ret').innerHTML='<img src="images/ara_icon.jpg" border="0" alt="Detaylı Arama" style="vertical-align: middle;">Detaylı Arama';
    }
  else 
    {
    document.getElementById('alan_arama').style.display='inline';
    document.getElementById('src_ret').innerHTML='<img src="images/close.png" border="0" alt="Kapat" style="vertical-align: middle;">';
    //var y=screen.height;
    //document.getElementById('karartma').style.height=y;
    //document.getElementById('karartma').style.backgroundImage="url('images/karart.png')";
    }  
  }  
function changeStatus(div)
  {
  if (document.getElementById(div).style.display=='inline')
    {document.getElementById(div).style.display='none'}
  else
    {document.getElementById(div).style.display='inline';}
  }
function odemeStatus(ac,kapat)
  {
  document.getElementById(ac).style.display='inline';
  document.getElementById(kapat).style.display='none';
  }  
function changeIndex(div)
  {
  if (document.getElementById(div).style.display=='none')
    {
    opn=div+"_open";
    yaz='<a href="JavaScript:void(0)" onClick="changeIndex(\''+div+'\')">Kapat</a>';
    document.getElementById(div).style.display='inline';
    document.getElementById(opn).innerHTML=yaz;
    }
  else if (document.getElementById(div).style.display=='inline')
    {
    opn=div+"_open";
    yaz='<a href="JavaScript:void(0)" onClick="changeIndex(\''+div+'\')">Aç</a>';
    document.getElementById(div).style.display='none';
    document.getElementById(opn).innerHTML=yaz;
    }  
  }   
function EkranUyari(tip) // tip a= açmak için k=kapatmak için
  {
  if (tip=='k')
    {
    document.getElementById('UyariAc').style.display='inline';
    document.getElementById('ekranuyari').style.display='none';
    set='k';
    }
  else 
    {
    document.getElementById('UyariAc').style.display='none';
    document.getElementById('ekranuyari').style.display='inline';
    set='a';
    }
  var url="ajax.php?t=uyari_ses";
  url=url+"&de="+set;
  //alert(url);
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    xmlHttp.open("GET",url,true);
    //xmlHttp.onreadystatechange=
		xmlHttp.send(null);
    }    
  }  
function del_uyari(id)
  {
  sira_div='u_'+id;
  document.getElementById('global_div').value=sira_div;
  var url="ajax.php?t=uyari_sil";
  url=url+"&de="+id;
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    xmlHttp.open("GET",url,true);
    document.getElementById(sira_div).style.display='none';
		xmlHttp.send(null);
    }
  }          
function notuser(deger)
  {
  if (confirm('Bu sayfayı görmek için giriş yapmalısınız veya üye olmasınız')==true)
    {
    url='ihale_goster.php?id='+deger;
    window.location.href=url;
    }
  }
function txt_close(ihale_id)
  {
  nt_div='nt'+ihale_id;
  nt_txt='txt'+ihale_id;
  //document.getElementById(nt_div).style.display='none';
  ekran=document.getElementById(nt_txt).value;
  //alert(ekran);
  degerler=ekran.split(' ');
  don=degerler.length;
  gonder='';
  for (i=0;i<don;i++)
    {
    if (gonder=='') gonder=degerler[i];
    else gonder=gonder+']['+degerler[i];
    }
  //alert(gonder);
  change_div="usr"+ihale_id;
  document.getElementById('global_div').value=change_div;
  var url="ajax.php?t=userset";
  url=url+"&de="+ihale_id;
  url=url+"&tip=n";
  url=url+"&act="+gonder;
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
      //alert(url)
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
    
  }
function txt_close2(ihale_id)
  {
  nt_div='nt_'+ihale_id;
  nt_txt='txt_'+ihale_id;
  //document.getElementById(nt_div).style.display='none';
  ekran=document.getElementById(nt_txt).value;
  //alert(ekran);
  degerler=ekran.split(' ');
  don=degerler.length;
  gonder='';
  for (i=0;i<don;i++)
    {
    if (gonder=='') gonder=degerler[i];
    else gonder=gonder+']['+degerler[i];
    }
  //alert(gonder);
  change_div="usr"+ihale_id;
  document.getElementById('global_div').value=change_div;
  var url="ajax.php?t=userset";
  url=url+"&de="+ihale_id;
  url=url+"&tip=n";
  url=url+"&act="+gonder;
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
      //alert(url)
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
    
  }
function mymesaj(id,tip)
  {
  var url="ajax.php?t=mymesaj";
  url=url+"&de="+id;
  url=url+"&tip="+tip;
  document.getElementById('global_div').value='listeyeri';
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange=global_div;
		xmlHttp.send(null);
    }
  }        
function IhaleUserSetting2(ihale_id,tip,action)
  {
  if (tip=='del')
    {
    nt_txt='txt_'+ihale_id;
    
    document.getElementById(nt_txt).innerHTML='';
    var url="ajax.php?t=userset";
    url=url+"&de="+ihale_id;
    url=url+"&tip="+tip;
    url=url+"&act="+action;
    change_div="usr"+ihale_id;
    document.getElementById('global_div').value=change_div;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
    }  
  }
function IhaleUserSetting(ihale_id,tip,action)
  {
  //alert(ihale_id);
  //alert(tip);
  //alert(action);
  if (tip=='n')
    {
    nt_div='nt'+ihale_id;
    //alert(nt_div);
    document.getElementById(nt_div).style.display='inline';
    //alert('Not Ready Yet');
    }
  else if (tip=='del')
    {
    nt_txt='txt'+ihale_id;
    document.getElementById(nt_txt).value='';
    var url="ajax.php?t=userset";
    url=url+"&de="+ihale_id;
    url=url+"&tip="+tip;
    url=url+"&act="+action;
    change_div="usr"+ihale_id;
    document.getElementById('global_div').value=change_div;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
    }  
  else 
    { 
    var change_div='usr'+ihale_id;
    document.getElementById('global_div').value=change_div;
    var url="ajax.php?t=userset";
    url=url+"&de="+ihale_id;
    url=url+"&tip="+tip;
    url=url+"&act="+action;
    //alert(url);
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
    }   
  }
function bolge_design()
  {
  ids=document.getElementById('bolgeler[]');
  de=document.getElementById('bolgeler[]').options.length
  git='';
  for (i=1;i<de;i++)
    {
    if(ids.options[i].selected==true)
      {
      deg=ids.options[i].value;
      
      if (deg>0)
        {
        if (git=='')git=deg;
        else git=git+','+deg;
        }
      }
    }
  document.getElementById('global_div').value='my_bolge_in';
  var url="ajax.php?t=bolgeset";
  url=url+"&de="+git;
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }  
  }
function BolgeIlCikart(ilid)
  {
  //alert(ilid);
  document.getElementById('global_div').value='my_bolge_in';
  olaniller=document.getElementById('bolgem_iller').value;
  var url="ajax.php?t=bolgeset_il";
  url=url+"&de="+olaniller;
  url=url+"&no="+ilid;
  //alert(url)
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
  }
function bakmadiklarim(tip)
  {
  document.getElementById('global_div').value='listeyeri';
  var url="ajax.php?t=bakmadiklarim";
  url=url+"&de="+tip;
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
  }
function show_graff(tip)
  {
  if (tip==1){document.getElementById('graffFrame').src="graph/chart.html?ofc=data.json";}
  else if (tip==2){document.getElementById('graffFrame').src="graph/chart.html?ofc=tips.json";}
  else if (tip==3){document.getElementById('graffFrame').src="graph/map.html";}
  else if (tip==4){document.getElementById('graffFrame').src="graph/chart.html?ofc=zaman.json";}
  }
function Now_Src(tip)
  {
  de=" Arama sorgusuna yerleştirilmemiştir. Lütfen site içerisinde bulunduğu yerleri kontrol ediniz. Eksik yerleri iletiniz.";
  //alert(de);
  //alert(tip);
  document.getElementById('global_div').value='listeyeri';
  var url="ajax.php?t=Now_src";
  url=url+"&de="+tip;
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange=global_div;
		xmlHttp.send(null);
    }
  }
function firmatakip(firma_id,islem,tip)
  {
  if (tip==1)yer='listeyeri'
  else if (tip==2){yer='takip_'+firma_id;}
  document.getElementById('global_div').value=yer;
  var url="ajax.php?t=firmatakip";
  url=url+"&de="+firma_id;
  url=url+"&tip="+islem;
  url=url+"&ne="+tip;
  //alert(url);
  
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      //alert(url);
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
  }
function firmatakip2(firma_id,islem)
  {
  divs='takip_'+firma_id;
  document.getElementById('global_div').value=divs;
  var url="ajax.php?t=firmatakip";
  url=url+"&de="+firma_id;
  url=url+"&tip="+islem;
  //alert(url);
  
  xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      //alert(url);
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
  }
// ihale_no,urun,konu için   # tip direk olarak içi acılığ yazılacak div adı;
function src_direk_yaz(tip,deger)
  {
  //yaz=document.getElementById('g_iha_no').innerHTML;
  //alert(yaz);
  if (tip=='g_iha_no') {
    first='<span class="src_ac">  İhale No :<br></span>';
    first=first+'<a href="JavaScript:void(0)" onClick="src_direk_sil(\'g_iha_no\')" class="src_3" title="Arama Kriterlerinden Kaldır">x</a>';
    }
  else if (tip=='g_konu') {
    first='<span class="src_ac">  İhale Konusu :<br></span>';
    first=first+'<a href="JavaScript:void(0)" onClick="src_direk_sil(\'g_konu\')" class="src_3" title="Arama Kriterlerinden Kaldır">x</a>';
    }
  else if (tip=='g_kurum') {
    first='<span class="src_ac">  İhale Kurumu :<br></span>';
    first=first+'<a href="JavaScript:void(0)" onClick="src_direk_sil(\'g_kurum\')" class="src_3" title="Arama Kriterlerinden Kaldır">x</a>';
    }
  else if (tip=='g_urun') {
    first='<span class="src_ac">  Ürün :<br></span>';
    first=first+'<a href="JavaScript:void(0)" onClick="src_direk_sil(\'g_urun\')" class="src_3" title="Arama Kriterlerinden Kaldır">x</a>';
    }    
    
  document.getElementById(tip).style.display='inline';
  ekran=first+deger;
  document.getElementById(tip).innerHTML=ekran;  
  }
function src_diziden_yaz(tip)
  {
  if (tip=='ihale_tur')
    {
    nesne='ihale_tur[]';
    open_div='g_iha_tur';
    }
  else if (tip=='ihale_grup')
    {
    nesne='ihale_grup[]';
    open_div='g_iha_grup';
    }
  else if (tip=='bolge')
    {
    nesne='bolgeler[]';
    open_div='g_bolge';
    }
  else if (tip=='il')
    {
    nesne='il[]';
    open_div='g_sehir';
    }
  ids=document.getElementById(nesne);        
  de=document.getElementById(nesne).options.length
  document.getElementById('global_div').value=open_div;
  document.getElementById(open_div).style.display='inline';
  gonder='0';
  for (i=1;i<de;i++)
    {
    if(ids.options[i].selected==true)
      {
      deg=ids.options[i].value;
      gonder=gonder+','+deg;
      }
    }
  var url="ajax.php?t=src_dizi";
  url=url+"&tip="+tip;
  url=url+"&de="+gonder;
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp)
    {
    xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange=global_div;
		xmlHttp.send(null);
    }
  }              
// ihale_no,urun,konu için   # tip direk olarak içi acılığ yazılacak div adı;
function src_direk_sil(tip)
  {
  if (tip=='g_iha_no')
    {
    deger_null='f_iha_no';
    }
  else if (tip=='g_konu')
    {
    deger_null='f_konu';
    }
  else if (tip=='g_urun')
    {
    deger_null='f_urun';
    }
  document.getElementById(tip).innerHTML='';
  document.getElementById(deger_null).value='';
 }
function src_diziden_cikart(tip,deger)
  {
  if (tip=='ihale_tur')
    {
    nesne='ihale_tur[]';
    open_div='g_iha_tur';
    v=2;
    }
  else if (tip=='ihale_grup')
    {
    nesne='ihale_grup[]';
    open_div='g_iha_grup';
    v=2;
    }
  else if (tip=='bolge')
    {
    nesne='bolgeler[]';
    open_div='g_bolge';
    v=1;
    }
  else if (tip=='il')
    {
    nesne='il[]';
    open_div='g_sehir';
    v=1;
    }
  if (v==1)
    {  
    idm=document.getElementById(nesne);
    idm.options[deger].selected=false;
    }
  else 
    {
    ids=document.getElementById(nesne);        
    de=document.getElementById(nesne).options.length;
    for (i=1;i<de;i++){if(ids.options[i].value==deger){ids.options[i].selected=false;}}
    }
  src_diziden_yaz(tip);   
 }
function src_OpenArea(deger)
  {
  var divler=new Array("","iha_no","bol_seh","iha_urun","iha_tar","iha_tur","iha_grup","iha_konu","iha_kurum");
  don=divler.length;
  for (i=1;i<=don;i++)
    {
    div=divler[i];
    if (deger==i){d='inline';}
    else {d='none';}
  
    if(div) document.getElementById(div).style.display=d;   
    }
  }
function src_OpenKayit(tip)
  {
  if (tip==1)
    {
    ekran='Kayıt İsmi:<input type="text" id="kayit_name" class="input_text"><a href="JavaScript:void(0)" onClick="src_Kayit()">Kaydet</a>';
    yaz_div='kayit_name_div';
    document.getElementById(yaz_div).innerHTML=ekran;  
    }
  else if (tip==2)
    {
    var url="ajax.php?t=src_come";
    url=url+"&de="+1;
    document.getElementById('global_div').value='kayit_name_div';
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
    }  
  }
function src_Come(id)
  {
   var url="ajax.php?t=src_open";
    url=url+"&de="+id;
    document.getElementById('global_div').value='src_area2';
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=src_Reboot;
		  xmlHttp.send(null);
      }
  }
function open_Sonuc(id,ac)
  {
  div='sonuc_'+id;
  var url="ajax.php?t=open_sonuc";
  url=url+"&de="+id;
  url=url+"&ac="+ac;
  //alert(url);
  document.getElementById('global_div').value=div;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
  }  
function src_Reboot()
  {
  if (xmlHttp.readyState==4)
    {
    degerler=xmlHttp.responseText.split('##'); 
    div=document.getElementById('global_div').value;
    divler=div.split('##');
    don=divler.length;
    //alert(degerler[0]);
    for (i=0;i<don;i++)
      {
      //if (degerler[i]!='undefined')
      document.getElementById(divler[i]).innerHTML=degerler[i];
      //alert(degerler[i]);
      }
    //document.getElementById(div).innerHTML=xmlHttp.responseText;
    document.getElementById('src_form').submit();
    }
  }    
function src_Kayit()
  {
  // ismi için
  stop=0;
  adi=document.getElementById('kayit_name').value;
  if (adi==''){alert('Bir İsim vermeniz Gerekmektedir');stop=1;}
  adi=adi.split(" ");
  gidenler='adi##';
  degerler=adi+'##';
  
  // ihale no için
  ihale_no=document.getElementById('f_iha_no').value;
  if (ihale_no!="")
    {
    ihale_no=ihale_no.split(" ");
    gidenler=gidenler+'ihale_no##';
    degerler=degerler+ihale_no+'##';
    }
  
  // bolgeler için
  ids=document.getElementById('bolgeler[]');        
  de=document.getElementById('bolgeler[]').options.length;
  bolge='0';
  for (i=1;i<de;i++)
    {
    if (ids.options[i].selected==true)
      {
      bolge=bolge+','+ids.options[i].value;
      }
    }
  if (bolge!=0)
    {
    gidenler=gidenler+'bolgeler##';
    degerler=degerler+bolge+'##';
    }
  
  // iller için
  ids=document.getElementById('il[]');        
  de=document.getElementById('il[]').options.length;
  il='0';
  for (i=1;i<de;i++)
    {
    if (ids.options[i].selected==true)
      {
      il=il+','+ids.options[i].value;
      }
    }
  if (il!=0)
    {
    gidenler=gidenler+'il##';
    degerler=degerler+il+'##';
    }    
  
  // ürün için
  urun=document.getElementById('f_urun').value;
  if (urun!="")
    {
    urun=urun.split(" ");
    gidenler=gidenler+'urun##';
    degerler=degerler+urun+'##';
    }
  // konu için
  konu=document.getElementById('f_konu').value;
  if (konu!="")
    {
    konu=konu.split(" ");
    gidenler=gidenler+'konu##';
    degerler=degerler+konu+'##';
    }  
  
  // ihale Tür
  ids=document.getElementById('ihale_tur[]');        
  de=document.getElementById('ihale_tur[]').options.length;
  ihale_tur='0';
  for (i=1;i<de;i++)
    {
    if (ids.options[i].selected==true)
      {
      ihale_tur=ihale_tur+','+ids.options[i].value;
      }
    }
  if (ihale_tur!=0)
    {
    gidenler=gidenler+'ihale_tur##';
    degerler=degerler+ihale_tur+'##';
    }
  // ihale grup
  ids=document.getElementById('ihale_grup[]');        
  de=document.getElementById('ihale_grup[]').options.length;
  ihale_grup='0';
  for (i=1;i<de;i++)
    {
    if (ids.options[i].selected==true)
      {
      ihale_grup=ihale_grup+','+ids.options[i].value;
      }
    }
  if (ihale_grup!=0)
    {
    gidenler=gidenler+'ihale_grup##';
    degerler=degerler+ihale_grup+'##';
    }
  if (stop!=1)
    {    
    document.getElementById('global_div').value='kayit_name_div';    
    var url="ajax.php?t=src_kayit";
    url=url+"&giden="+gidenler;
    url=url+"&de="+degerler;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
      {
      xmlHttp.open("GET",url,true);
		  xmlHttp.onreadystatechange=global_div;
		  xmlHttp.send(null);
      }
   }   
  }
function src_clear()
  {
  var divler=new Array("","g_iha_no","g_bolge","g_sehir","g_urun","g_iha_tar","g_iha_tur","g_iha_grup","g_konu");
  don=divler.length;
  for (i=1;i<don;i++)
    {
    div=divler[i];
    document.getElementById(div).innerHTML='';
    document.getElementById(div).style.display='none';
    }
  document.getElementById('ih_ka').selected=false;  
  }       
