function submitlogin(nform){
	if(!nform.login.value){
		alert("Account required!");
		nform.login.focus();
		return false;
	}
	if(!nform.password.value){
		alert("PIN required!");
		nform.password.focus();
		return false;
	}
	if(!nform.service.value){
		alert("Choose the Service that you want to login into");
		nform.service.focus();
		return false;
	}
	switch (nform.service.value){
		
		case "http://gateway.vodafonenetworks.com/vsr/admin/index.aspx": 
			nform.action="http://gateway.vodafonenetworks.com/vsr/admin/index.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/index.htm": 
			nform.type.value="cdr";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/indexip.htm": 
			nform.type.value="cdrIP";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/indexe164.htm": 
			nform.type.value="cdre164";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/indexcallb.htm": 
			nform.type.value="cdrcallback";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/indexPIN.htm": 
			nform.type.value="cdrPIN";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/webphone.htm": 
			nform.type.value="pc2phone";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/webcallb.htm": 
			nform.type.value="callback";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/WR/rates.aspx": 
			nform.type.value="callback";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		case "http://gateway.vodafonenetworks.com/webphone/WR/ratescallb.aspx": 
			nform.type.value="callback";
			nform.action="http://gateway.vodafonenetworks.com/webphone/login.aspx";
			break;
		default : 
			alert("Invalid Login Data");
			return false;
			break;
	}

	var OpenWindow=window.open("","logwindow",'left=150,top=20,height=600,width=800,toolbar=0,resizable=1,addressbar=0');
	OpenWindow.document.write("<TITLE>Login</TITLE>")
	nform.submit();
}

function IsValidEmail(NForm){
        NForm.email.focus();
        var str = NForm.email.value; 
        var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid 
        var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid 
        if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid 
                return true; 
        }else{ 
                 return false; 
        } 
}
function validatecontct(nform){
	if(!nform.fullname.value){
		alert("Full name is a required field!");
		nform.fullname.focus();
		return false;
	}
	if(!IsValidEmail(nform)){
		alert("Enter A valid Email address!");
		nform.email.focus();
		return false;
	}
	if(!nform.country.value){
		alert("Country is a required field!");
		nform.country.focus();
		return false;
	}

	if(!nform.subject.value){
		alert("Subject is a required field!");
		nform.subject.focus();
		return false;
	}
	if(!nform.message.value){
		alert("Comment is a required field!");
		nform.message.focus();
		return false;
	}
	return true;
}
function validateapllynow(nform){
	if(!nform.prog.value){
		alert("Please kindly Select the program you are applying for.");
		nform.prog.focus();
		return false;
	}
	if(nform.title[0].checked==false && nform.title[1].checked==false && nform.title[2].checked==false){
		alert("Salutation is a required field!");
		nform.title[0].focus();
		return false;
	}
	if(!nform.fullname.value){
		alert("Full name is a required field!");
		nform.fullname.focus();
		return false;
	}
	if(nform.lang[0].checked==false && nform.lang[1].checked==false && nform.lang[2].checked==false && nform.lang[3].checked==false){
		alert("Language is a required field!");
		nform.title[0].focus();
		return false;
	}
	if(nform.lang[3].checked==true  && nform.otherl.value==""){
		alert("Please write down your language!");
		nform.otherl.focus();
		return false;
	}
	if(!nform.add.value){
		alert("Address is a required field!");
		nform.country.focus();
		return false;
	}
	if(!nform.country.value){
		alert("Country is a required field!");
		nform.country.focus();
		return false;
	}
	if(!nform.city.value){
		alert("City is a required field!");
		nform.city.focus();
		return false;
	}
	if(!IsValidEmail(nform)){
		alert("Enter a valid Email address!");
		nform.email.focus();
		return false;
	}
	if(!nform.bsdesc.value){
		alert("Describe your current business!");
		nform.bsdesc.focus();
		return false;
	}
	if(!nform.subject.value){
		alert("Subject is a required field!");
		nform.subject.focus();
		return false;
	}
	if(!nform.message.value){
		alert("Comment is a required field!");
		nform.message.focus();
		return false;
	}
	return true;
}

function res_login(){
	var myref=window.open('http://gateway.vodafonenetworks.com/vsr/admin/index.aspx','mywin','left=150,top=20,height=600,width=800,toolbar=0,resizable=1,addressbar=0');
	myref.focus();
	return false;
}
function changeSty(classpassed,id){
	document.getElementById(id).className=classpassed;
}