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 Open_url(spage,swidth,sHeight,scrolls,leftpx,toppx,resize){
	var OpenWindow=window.open(spage,"logwindow",'left='+leftpx+',top='+toppx+',height='+sHeight+',width='+swidth+',scrollbars='+scrolls+',toolbar=0,resizable='+resize+',addressbar=0');
	OpenWindow.focus();
	return false;
}
function validatemail(NForm){
	if(!IsValidEmail(NForm)){
		alert("Please enter a valid email");
		return false;
	}
	return true;
}
//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

function showbox(img){
	crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
	crossobj.style.visibility="visible"
else if (ns4)
document.showimage.visibility="visible"

document.getElementById("imgbox").src=img


return false;
}

/******************************************
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

function showbox(img){
	crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
	crossobj.style.visibility="visible"
else if (ns4)
document.showimage.visibility="visible"

document.getElementById("imgbox").src=img


return false;
}