function numbersonly(e, decimal) {
var key;
var keychar;

if (window.event) {
   key = window.event.keyCode;
}
else if (e) {
   key = e.which;
}
else {
   return true;
}
keychar = String.fromCharCode(key);

if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) ) {
   return true;
}
else if ((("0123456789").indexOf(keychar) > -1)) {
   return true;
}
else if (decimal && (keychar == ".")) { 
  return true;
}
else
   return false;
}

function FormKontrolG(){
	alert(document.login.gsifre.value.length)
	if (document.login.gemail.value.length  == 0) {
	beyaz_bg('login');
	document.getElementById('loginuyari').innerHTML = "Lütfen Email Adresinizi Giriniz.";
	document.getElementById('gemail').focus();
	document.getElementById('gemail').style.backgroundColor = '#FFFFCC';
	return false;
	}else if (document.login.gsifre.value.length == 0) {
	beyaz_bg('login');
	document.getElementById('loginuyari').innerHTML = "Lütfen Şifrenizi Giriniz.";
	document.getElementById('gsifre').focus();
	document.getElementById('gsifre').style.backgroundColor = '#FFFFCC';
	return false;
	}
}

function FormKontrolU(){
	if (document.uyeol.ad.value == 0) {
	alert(document.uyeol.ad.value)
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Adınızı Giriniz.";
	document.getElementById('ad').focus();
	document.getElementById('ad').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.soyad.value == 0) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Soyadınızı Giriniz.";
	document.getElementById('soyad').focus();
	document.getElementById('soyad').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.ceptel.value == 0) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Cep Telefonunuzu Giriniz.";
	document.getElementById('ceptel').focus();
	document.getElementById('ceptel').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.evtel.value == 0) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Ev Telefonunuzu Giriniz.";
	document.getElementById('evtel').focus();
	document.getElementById('evtel').style.backgroundColor = '#FFFFCC';
	return false}
	else if (checkEmailAddress(document.uyeol.email.value) == false) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Email Adresinizi Giriniz.";
	document.getElementById('email').focus();
	document.getElementById('email').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.sifre1.value == 0) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Şifrenizi Giriniz.";
	document.getElementById('sifre1').focus();
	document.getElementById('sifre1').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.sifre2.value == 0) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Şifrenizi(tekrar) Giriniz.";
	document.getElementById('sifre2').focus();
	document.getElementById('sifre2').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.sifre1.value =! document.uyeol.sifre2.value) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Girdiğiniz 1.Şifre ile 2.Şifre Uyuşmuyor.";
	document.getElementById('sifre1').focus();
	document.getElementById('sifre1').style.backgroundColor = '#FFFFCC';
	return false}
	else if (document.uyeol.gv.value == 0) {
	beyaz_bg('uyeol');
	document.getElementById('uyari').innerHTML = "Lütfen Güvenlik Kodunu Giriniz.";
	document.getElementById('gv').focus();
	document.getElementById('gv').style.backgroundColor = '#FFFFCC';
	return false};
}


function menumOvr(src,clrOver,bgImage){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.style.backgroundColor = clrOver; 
		//src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		//src.style.backgroundRepeat  = 'no-repeat';
		//src.style.backgroundPosition  =  '128px';
		src.style.borderColor = bgImage;
		src.style.borderRight = '3px Solid';
	} 
} 
function menumOut(src,clrIn,bgImage){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.style.backgroundColor = clrIn; 
		//src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		//src.style.backgroundRepeat  = 'no-repeat';
		//src.style.backgroundPosition  =  '128px';
		src.style.borderColor = '';
		src.style.borderRight = '';
	} 
} 

function ustmenumOvr(src,clrOver,kenar){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.style.backgroundColor = clrOver; 
		//src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		//src.style.backgroundRepeat  = 'no-repeat';
		//src.style.backgroundPosition  =  '128px';
		src.style.borderColor = kenar;
	} 
} 
function ustmenumOut(src,clrIn,kenar){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.style.backgroundColor = clrIn; 
		//src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		//src.style.backgroundRepeat  = 'no-repeat';
		//src.style.backgroundPosition  =  '128px';
		src.style.borderColor = kenar;
	} 
} 

function mOvr(src,clrOver,bgImage){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.style.backgroundColor = clrOver; 
		src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		src.style.backgroundRepeat  = 'no-repeat';
		src.style.backgroundPosition  =  '128px';
	} 
} 
function mOut(src,clrIn,bgImage){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.style.backgroundColor = clrIn; 
		src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		src.style.backgroundRepeat  = 'no-repeat';
		src.style.backgroundPosition  =  '128px';
	} 
} 
function mClk(src){ 
	if(event.srcElement.tagName=='TD')
		src.children.tags('A')[0].click();
}



function UrunOvr(src,clrOver,bgImage){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.style.borderRightColor = clrOver;
		src.style.borderTopColor = clrOver;
		src.style.borderLeftColor = clrOver;
		//src.style.backgroundColor = clrOver; 
		//src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		//src.style.backgroundRepeat  = 'no-repeat';
		//src.style.backgroundPosition  =  '128px';

	} 
} 
function UrunOut(src,clrIn,bgImage){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.style.borderRightColor = clrIn;
		src.style.borderTopColor = clrIn;
		src.style.borderLeftColor = clrIn;

		//src.style.backgroundColor = clrIn; 
		//src.style.backgroundImage  = 'url(/img/' + bgImage + '.gif)';
		//src.style.backgroundRepeat  = 'no-repeat';
		//src.style.backgroundPosition  =  '128px';
	} 
} 


function beyaz_bg(theForm){

var els = document.all(theForm).elements; 

	for(i=0; i<els.length; i++){ 

		switch(els[i].type){

			case "select-one" :
			    els[i].style.backgroundColor = '#FFFFFF';
				break;
			case "text":
			    els[i].style.backgroundColor = '#FFFFFF';
				break;
			case "textarea":
			    els[i].style.backgroundColor = '#FFFFFF';
				break;
			case "checkbox":
			    els[i].style.backgroundColor = '#FBFAFA';
				break;
			case "radio":
			    //els[i].style.backgroundColor = '#FFFFFF';
				break;

		}

	}

}

function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail){
   return true;
} else {
   return false;
   }
}

