/**Pop Up Pencere**/
function popup(url,w,h){newWindow=window.open(url,"newGebruikersnaamWin","width="+w+",height="+h+",left=200,top=50,status=no,resizable=no,menubar=no,directories=no,toolbar=no,scrollbars=yes")}
function popup2(url,w,h){newWindow=window.open(url,"newGebruikersnaamWin","width="+w+",height="+h+",left=50,top=20,status=no,resizable=no,menubar=no,directories=no,toolbar=no,scrollbars=yes")}

/**Resim dosya kontrol Formu**/
function check()
{
if(document.frm.blob.value=="")
{
alert("Lütfen Bir Resim Dosyası Seçiniz...")
return false
}
if((document.frm.blob.value.lastIndexOf(".jpg")==-1) && (document.frm.blob.value.lastIndexOf(".gif")==-1) && (document.frm.blob.value.lastIndexOf(".png")==-1) && (document.frm.blob.value.lastIndexOf(".JPG")==-1) && (document.frm.blob.value.lastIndexOf(".GIF")==-1)&& (document.frm.blob.value.lastIndexOf(".PNG")==-1))
{
alert("Sadece *.gif,*.png ve *.jpg uzantılı dosyalar yükleyebilirsiniz...")
return false
}
return true
}

/**Firma Mesaj Gonderme Formu**/
function firmamesajsubmit(){
    if(document.firmamesaj.ad.value==''){alert("Hata!!! Lütfen Adınızı Belirtiniz...");return false;}
	if(document.firmamesaj.email.value==''){alert("E-mail adresi giriniz...");return false;}
	if(document.firmamesaj.email.value.indexOf('@') <= 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;} 
	if(document.firmamesaj.email.value.indexOf('.') <= 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;}
	if(document.firmamesaj.email.value.indexOf(' ') > 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;}
    if(document.firmamesaj.mesaj.value==''){alert("Hata!!! Lütfen Bir Mesaj Giriniz...");return false;}
	}

/**arama Gonderme Formu**/
function searchsubmit(){
	if(document.araxx.q.value==''){alert("Lütfen bir arama metni giriniz...");return false;}
	if(document.araxx.q.value.length > 100) {alert("En fazla 100 karakter girebilirsiniz!");return false;}
	if(document.araxx.q.value.length < 3) {alert("En az 3 kararkter girebilirsiniz!");return false;}
	}
/**Yarisma Formu**/
function yarismasendsubmit(){
    if(document.yarismasend.adi.value==''){alert("Hata!!! Lütfen Adınızı Belirtiniz...");return false;}
	if(document.yarismasend.email.value==''){alert("E-mail adresi giriniz...");return false;}
	if(document.yarismasend.email.value.indexOf('@') <= 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;} 
	if(document.yarismasend.email.value.indexOf('.') <= 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;}
	if(document.yarismasend.email.value.indexOf(' ') > 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;}
    if(document.yarismasend.mesaj.value==''){alert("Hata!!! Lütfen Bir Mesaj Giriniz...");return false;}
	if(document.yarismasend.File2.value==""){alert("Lütfen Bir Dosya Dosyası Seçiniz...");return false;}

if((document.yarismasend.File2.value.lastIndexOf(".jpg")==-1) && (document.yarismasend.File2.value.lastIndexOf(".gif")==-1) && (document.yarismasend.File2.value.lastIndexOf(".JPG")==-1)&& (document.yarismasend.File2.value.lastIndexOf(".GIF")==-1))
{
alert("Sadece *.gif, *.jpg  uzantılı dosyalar yükleyebilirsiniz...")
return false
}
return true


	}


function bultensubmit(){
    if(document.bulten.ad.value==''){alert("Lütfen Adınızı Belirtiniz...");return false;}
	if(document.bulten.ad.value.length < 6) {alert("Adınız en az 6 karakter olmalıdır!");return false;}
	if(document.bulten.email.value==''){alert("E-mail Adresi Giriniz...");return false;}
	if(document.bulten.email.value.indexOf('@') <= 0) {alert("Lütfen E-Posta adresinizi doğru belirtiniz!");return false;} 
	if(document.bulten.email.value.indexOf('.') <= 0) {alert("Lütfen E-Posta adresinizi doğru belirtiniz!");return false;}
	if(document.bulten.email.value.indexOf(' ') > 0) {alert("Lütfen E-Posta adresinizi doğru belirtiniz!");return false;}
	}


/*Yorum Koşulları Onaylama */
function kosulonay() {
			if(document.getElementById('kosul').checked == true) {
				document.getElementById('gonder').disabled = false;
			} else {
				document.getElementById('gonder').disabled = true;
			}
		}

/**Silme Formu**/
function sil()
{
	if (confirm('Silmek istediğinize emin misiniz?'))
	{
		return true;
	}
	else
	{
		return false;
	}
}


/**İletisim Formu**/
function iletisimsubmit(){
    if(document.iletisim.ad.value==''){alert("Hata!!! Lütfen Adınızı Belirtiniz...");return false;}
	if(document.iletisim.email.value==''){alert("E-mail adresi giriniz...");return false;}
	if(document.iletisim.email.value.indexOf('@') <= 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;} 
	if(document.iletisim.email.value.indexOf('.') <= 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;}
	if(document.iletisim.email.value.indexOf(' ') > 0) {alert("Lütfen E-mail adresinizi doğru belirtiniz!");return false;}
    if(document.iletisim.mesaj.value==''){alert("Hata!!! Lütfen Bir Mesaj Giriniz...");return false;}
	}



/**Sag Tiklama Engelleme**/
//var message="";
//function clickIE() {if (document.all) {(message);return false;}}
//function clickNS(e) {if 
//(document.layers||(document.getElementById&&!document.all)) {
//if (e.which==2||e.which==3) {(message);return false;}}}
//if (document.layers) 
//{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
//else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
//document.oncontextmenu=new Function("return false")



/**Pop Up Pencere Acma**/
PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function zoomx(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Yükleniyor...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=(document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){'); 
writeln('window.innerWidth=document.images["MKeskin"].width;');writeln('window.innerHeight=document.images["MKeskin"].height;}}');
writeln('function doTitle(){document.title="'+imageURL+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<a href="javascript:window.close()"><img name="MKeskin" src='+imageURL+' border="0" Title="Kapatmak İçin Tıklayınız..." style="display:block"></body></html>');
close(); 
}}







/**Karakter Sinirlandirma**/

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> karakteriniz kaldı...'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

