var IS_IE = document.all && window.ActiveXObject &&  navigator.userAgent.toLowerCase().indexOf("msie") > -1 ;   
var  IS_GECKO = document.implementation && document.implementation.createDocument  && window.XMLHttpRequest && true;    
if (IS_GECKO) {http3 = new XMLHttpRequest();} else if(IS_IE) {http3= new ActiveXObject("Microsoft.XMLHTTP");}
if (IS_GECKO) {http4 = new XMLHttpRequest();} else if(IS_IE) {http4= new ActiveXObject("Microsoft.XMLHTTP");}
var phone = "()- 0123456789";var numb = "0123456789";var alpha = ".@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-";
function numkontrol(t,v) {var w = "";for (i=0; i < t.value.length; i++) {x = t.value.charAt(i);if (v.indexOf(x,0) != -1)w += x;}t.value = w;}
function degistir(text,bul,degis) {temp = "" + text; while (temp.indexOf(bul)>-1) {pos= temp.indexOf(bul);temp = "" + (temp.substring(0, pos) + degis + temp.substring((pos + bul.length), temp.length));}return temp;}
function LTrim( value ) {var re = /\s*((\S+\s*)*)/;	return value.replace(re, "$1");}
function RTrim( value ) {var re = /((\s*\S+)*)\s*/;	return value.replace(re, "$1");}

function ilceler(ilce){
var yenisatir2;
var il=document.getElementById('il');
var selindex=il.selectedIndex;il=il.options[selindex].value;
var ilcesi=document.getElementById('ilce');ilcesi.innerHTML="";
    http4.open("get", "ajaxdetay.php?il="+il+"&ilce="+ilce);
    http4.onreadystatechange =function(){if(http4.readyState == 4){
	ilcesi.innerHTML="";	var text=http4.responseText;	var yenisatir=text.split("&");
					for (i=0;i<yenisatir.length-1;i++){
					yenisatir2=yenisatir[i].split("~");
					option1=document.createElement("option");txt1=document.createTextNode(yenisatir2[1]);option1.appendChild(txt1); option1.setAttribute("value",yenisatir2[0]);if(yenisatir2[0]==ilce){option1.setAttribute("selected","selected");}ilcesi.appendChild(option1);
					}}}
http4.send(null);
}	

function sektorler(kategori){
var yenisatir2;
var sektor=document.getElementById('sektor');
var selindex=sektor.selectedIndex;sektor=sektor.options[selindex].value;
var altkategori=document.getElementById('altkategori');altkategori.innerHTML="";
    http3.open("get", "ajaxdetay.php?sektor="+sektor);
    http3.onreadystatechange =function(){if(http3.readyState == 4){
	altkategori.innerHTML="";	var text=http3.responseText;	var yenisatir=text.split("&");
					for (i=0;i<yenisatir.length-1;i++){yenisatir2=yenisatir[i].split("~");
					option1=document.createElement("option");txt1=document.createTextNode(yenisatir2[1]);option1.appendChild(txt1); option1.setAttribute("value",yenisatir2[0]);if(yenisatir2[0]==kategori){option1.setAttribute("selected","selected");}altkategori.appendChild(option1);
					}}}
http3.send(null);
}



function hideLayer(){
deg=document.getElementById("dek");
if (overdiv == "0") {deg.style.visibility='hidden';}
}
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;


function firmakaydikontrol(){
var h=document.getElementById("dek");
var il=document.getElementById('il');
var gkodu=document.getElementById('gkodu');
var selindex=il.selectedIndex;il=il.options[selindex].value;
var sektor=document.getElementById('sektor');
var selindex=sektor.selectedIndex;sektor=sektor.options[selindex].value;
h.style.visibility='visible';h.style.left=700;h.style.top=y-20;
if(il=="" || sektor==""){tipyazi="<font size='2' face='tahoma' color='red'><font color='blue'>*</font> ile İşaretli Bölümlerin Seçilmesi veya Doldurulması Zorunludur.<br><br>Lütfen Form Üzerindeki Zorunlu Bölümleri Seçiniz veya Doldurunuz</font>";
h.innerHTML="<div style='background-color:white;width:250px;height:100px;border:1px solid gray;' ><div align='right' style='width:250px;height:15px;background-color:#aeaeae;font-family:tahoma;font-size:12px;color:red;'><div style='float:left'>Bilgilerde eksik yada Hata Var</div></div><font size=2 face=tahoma>"+tipyazi+"</font></div>";return false;}else{tipyazi="";h.innerHTML="";}
	var et=new Array("firma","adres","email","tel1","password","password2");
	var eto=new Array("Firma Ünvanı","Adres","E-mail","Telefon 1","Şifre","Şifre Tekrarı");
	for(a=0;a<et.length;a++){m=et[a];
	d=document.getElementById(m).value;
		if(d==""){tipyazi="<font size='2' face='tahoma' color='red'><font color='blue'>*</font> ile İşaretli Bölümlerin Doldurulması Zorunludur.<br><br>Lütfen Form Üzerindeki <font color='black'>"+eto[a]+"</font> Bölümünü Doldurunuz</font>";}else{tipyazi="";h.innerHTML="";}
		if(m=="email"){	if (d.indexOf("@") < 1 || d.lastIndexOf(".") <= d.indexOf("@") || d.indexOf("@") == d.length || d.indexOf("..") >=0 || d.indexOf(".") == d.length-1){tipyazi="<font size='2' face='tahoma' color='red'>Girmiş Olduğunuz E-mail adresi geçerli değildir. Lütfen Düzeltiniz</font>";}else{tipyazi="";h.innerHTML="";}}
		if(m=="password2"){if(d!=document.getElementById('password').value){tipyazi="<font size='2' face='tahoma' color='red'> Her 2 şifre aynı değil</font>";}else{tipyazi="";h.innerHTML="";}}		
		if(tipyazi!=""){h.innerHTML="<div style='background-color:white;width:250px;height:100px;border:1px solid gray;' ><div align='right' style='width:250px;height:15px;background-color:#aeaeae;font-family:tahoma;font-size:12px;color:red;'><div style='float:left'>Bilgilerde eksik yada Hata Var</div></div><font size=2 face=tahoma>"+tipyazi+"</font></div>";return false;	}
}
}


function firmakaydiguncellekontrol(){
var h=document.getElementById("dek");
var il=document.getElementById('il');
var selindex=il.selectedIndex;il=il.options[selindex].value;
var sektor=document.getElementById('sektor');
var selindex=sektor.selectedIndex;sektor=sektor.options[selindex].value;
h.style.visibility='visible';h.style.left=700;h.style.top=y-20;
if(il=="" || sektor==""){tipyazi="<font size='2' face='tahoma' color='red'><font color='blue'>*</font> ile İşaretli Bölümlerin Seçilmesi veya Doldurulması Zorunludur.<br><br>Lütfen Form Üzerindeki Zorunlu Bölümleri Seçiniz veya Doldurunuz</font>";
h.innerHTML="<div style='background-color:white;width:250px;height:100px;border:1px solid gray;' ><div align='right' style='width:250px;height:15px;background-color:#aeaeae;font-family:tahoma;font-size:12px;color:red;'><div style='float:left'>Bilgilerde eksik yada Hata Var</div></div><font size=2 face=tahoma>"+tipyazi+"</font></div>";return false;}else{tipyazi="";h.innerHTML="";}
	var et=new Array("firma","adres","tel1");
	var eto=new Array("Firma Ünvanı","Adres","Telefon 1");
	for(a=0;a<et.length;a++){m=et[a];
	d=document.getElementById(m).value;
		if(d==""){tipyazi="<font size='2' face='tahoma' color='red'><font color='blue'>*</font> ile İşaretli Bölümlerin Doldurulması Zorunludur.<br><br>Lütfen Form Üzerindeki <font color='black'>"+eto[a]+"</font> Bölümünü Doldurunuz</font>";}else{tipyazi="";h.innerHTML="";}
		if(tipyazi!=""){h.innerHTML="<div style='background-color:white;width:250px;height:100px;border:1px solid gray;' ><div align='right' style='width:250px;height:15px;background-color:#aeaeae;font-family:tahoma;font-size:12px;color:red;'><div style='float:left'>Bilgilerde eksik yada Hata Var</div></div><font size=2 face=tahoma>"+tipyazi+"</font></div>";return false;	}
}
}


overdiv="0";
x=0;
y=0;
function haritagetir(enboy){
deg=document.getElementById("harita");
enlem="(29.285151958465576, 40.86059631958096)";
zoom=11;
if(enboy!=""){
enl=enboy.split(",");
enlem=enl[0];
boylam=enl[1];
enlem=enlem+","+boylam;
zoom=enl[2];
}
deg.innerHTML="<iframe src='googlemap.php?enlemboylam="+enlem+"&zoom="+zoom+"' width=620 height=450 frameborder=0 marginheight=0 marginwidth=0></iframe>";
}
function tips(d){
deg=document.getElementById("dek");
if(d==1){tipyazi="Firma Ünvanı Bölümüne Firmanızın Ünvanını Eksiksiz Giriniz<br>Örnek: ABC Danışmanlık San. ve Tic. Ltd.Şti";}
if(d==2){tipyazi="Firmanızın daha rahat bulunabilmesi için sizin için önemli 10 adet kelimeyi aralarında <font color=red>virgül</font> kullanarak giriniz";}
if(d==3){tipyazi="Websitenizde bulunan hakkımızda sayfasını buraya kopyalayınız veya Firmanızı ve Hizmetlerinizi Anlatan Detaylı Bir Yazı Yazınız";}
if(d==5){tipyazi="Bilgisayarınızda bulunan jpg formatındaki firma logosunu Bu Bölümden Ekleyebilirsiniz";}
if(d==6){tipyazi="Firmanızla ilgili Youtube,Google Video,Dailymotion vb video paylaşım sitelerine eklediğiniz videoyu ilgili siteden EMBED kodunu alarak buraya yapıştırınız";}
if(d==7){tipyazi="Harita Ekle butonunu kullanarak firmanızın bulunduğu yeri google haritasından seçerek izleyicilere gösterebilirsiniz. ";}
if(d==8){tipyazi="Bilgisayarınızda bulunan firmanıza ait resimleri yükleyebilirsiniz. Resim formatı <font color=red>JPG</font> olmalıdır";}
if(d==9){tipyazi="Bu bölüme seçtiğiniz parolayı girebilirsiniz.";}
if(d==10){tipyazi="Bir önceki bölüme girdiğiniz parolayı giriniz.";}
if(d==11){tipyazi="Yukarıda gördüğünüz Güvenlik kodunu bu bölüme yazınız<br><br>Eğer kodu okuyamıyorsanız <font color=red>KODU YENİLE</font> yazısına tıklayınız";}
if(d==12){tipyazi="Microsoft Messenger Programı kullanıyor iseniz izleyicilerin sizi ekleyebilmeleri için isterseniz MSN Adresinizi yazabilirsiniz.";}
deg.innerHTML="<div style='background-color:white;width:450px;height:100%;border:1px solid gray;' ><div align='right' style='width:450px;height:15px;background-color:gray;font-family:tahoma;font-size:12px;color:white;'><div style='float:left'>İpucu</div></div><font size=2 face=tahoma>"+tipyazi+"</font></div>";
deg.style.visibility='visible';
deg.style.left=(x-480);
deg.style.top=y-20;
}
function tipsg(d){
deg=document.getElementById("dek");
if(d==1){tipyazi="Firma Ünvanı Bölümüne Firmanızın Ünvanını Eksiksiz Giriniz<br>Örnek: ABC Danışmanlık San. ve Tic. Ltd.Şti";}
if(d==2){tipyazi="Firmanızın daha rahat bulunabilmesi için sizin için önemli 10 adet kelimeyi aralarında <font color=red>virgül</font> kullanarak giriniz";}
if(d==3){tipyazi="Websitenizde bulunan hakkımızda sayfasını buraya kopyalayınız veya Firmanızı ve Hizmetlerinizi Anlatan Detaylı Bir Yazı Yazınız";}
if(d==5){tipyazi="Bilgisayarınızda bulunan jpg formatındaki firma logosunu Bu Bölümden Ekleyebilirsiniz veya Güncelleyebilirsiniz";}
if(d==6){tipyazi="Firmanızla ilgili Youtube,Google Video,Dailymotion vb video paylaşım sitelerine eklediğiniz videoyu ilgili siteden EMBED kodunu alarak buraya yapıştırınız";}
if(d==7){tipyazi="Harita Ekle butonunu kullanarak firmanızın bulunduğu yeri google haritasından seçerek izleyicilere gösterebilirsiniz. ";}
if(d==8){tipyazi="Bilgisayarınızda bulunan firmanıza ait resimleri yükleyebilirsiniz veya güncelleyebilirsiniz.  Resim formatı <font color=red>JPG</font> olmalıdır";}
if(d==12){tipyazi="Microsoft Messenger Programı kullanıyor iseniz izleyicilerin sizi ekleyebilmeleri için isterseniz MSN Adresinizi yazabilirsiniz.";}
deg.innerHTML="<div style='background-color:white;width:450px;height:100%;border:1px solid gray;' ><div align='right' style='width:450px;height:15px;background-color:gray;font-family:tahoma;font-size:12px;color:white;'><div style='float:left'>İpucu</div></div><font size=2 face=tahoma>"+tipyazi+"</font></div>";
deg.style.visibility='visible';
deg.style.left=(x-480);
deg.style.top=y-20;
}
function Limiti(d,n) {d=document.getElementById(d);var taObj=event.srcElement;if (taObj.value.length>n*1) taObj.value=taObj.value.substring(0,n*1);if (d) d.innerText=n-taObj.value.length;}
function guvkoddegistir(){
document.getElementById("guvenlik").innerHTML="";
document.getElementById("guvenlik").innerHTML="<img src='gkodpop.php'>";
}
