var isSubmit=false;
function isValidUsername(val){
	for(var i=0;i<val.length;i++){
		var ch = val.charCodeAt(i);
		if(!((ch>47 && ch<58) || (ch>96 && ch<123) || ch==45 || ch==46 || ch==95)) return false;
	}
	return true;
}
function done(o){
	if(!isSubmit){
		if(o.temp.value == '' || o.password.value == ''){
			alert('Kullanıcı adınızı ve şifrenizi giriniz !');
			return false;
		}
		else if(!isValidUsername(o.temp.value)){
			alert('Kullanıcı adını hatalı girdiniz !\nKullanıcı adı Türkçe ve özel karakterlerden içermez !');
			return false;		
		}
		else{
			if(o.Type[0].checked == true){
				o.action = "https://uyeler.mynet.com/domain/mulogin.html";
				o.elements["username"].value = o.temp.value + '@pimapen.com.tr';
				o.elements["lurl"].value = "";
			}
			else{
				o.action = "https://uyeler.mynet.com/domain/ologin.html";
				o.elements["username"].value = o.temp.value + '.pimapen.com.tr';
				o.elements["lurl"].value = "http://proservis.mynet.com/EntMessages/vendorMsgList.asp";
			}
			o.submit();
			isSubmit = true;		
		}
	}
	else return false;
}
function Init(){
	var o = document.forms[0].elements;
	if(o.temp.value == '' || o.password.value == '') o["Btn"].disabled = true;
	else if(!isValidUsername(o.temp.value)) o["Btn"].disabled = true;
	else o["Btn"].disabled = false;
	setTimeout("Init()",500);
}
window.onload=Init;
