 function radioValue(obj){
	var i;

	for(i = 0; i < obj.length; i++){
		if(obj[i].checked){
			return obj[i].value;
		}
	}
 }


 function isEmail(ml){

     emailfrmt=/([a-z]|[0-9]|[A-Z]|[.]|[-]|[_])*[@]{1}([a-z]|[0-9]|[-]|[_])+[.]{1}[a-z]{2}/;

     val=(ml.search(emailfrmt) == -1)?false:true;

	return val;

 }


 function isVAT(vat){

     vatfrmt=/[0-9]{9}/;

     val=(vat.search(vatfrmt) == -1)?false:true;

     return val;

 }


 function isValidUsrPass(up){

     upfrmt=/^([a-z]|[0-9]|[!]|[@]|[#]|[$]|[%]|[&]|[*]|[^\s]){4,8}$/;

     val=(up.search(upfrmt) == -1)?false:true;

	return val;

 }


function moveSelection(vSelObj, dir){

	vIndex	= vSelObj.selectedIndex;
	vDoIt	= false;
	
	if (vIndex == -1){
	
		alert('Πρέπει να επιλέξετε κάποιο');
		
	}else {
	
		vSource = vSelObj.options[vIndex];
		
		switch (dir) {
			case '-' :
				if (vIndex > 0){
					vTarget	= vSelObj.options[vIndex - 1];
					vDoIt	= true;
				}
				break;
			case '+' :
				if (vIndex < vSelObj.length - 1){
					vTarget	= vSelObj.options[vIndex + 1];
					vDoIt	= true;
				}
				break;
			default :
		   		vDoIt	= false;
		}
		
		if (vDoIt) {
		
			vTempV = vTarget.value;
			vTempT = vTarget.text;
			
			vTarget.value = vSource.value
			vTarget.text  = vSource.text
			vSource.value = vTempV;
			vSource.text  = vTempT;

			vSelObj.selectedIndex = eval(vIndex + dir + 1);
		
		}
	}
}


 function showInfo(){

	var info	='Form Functions:\n';
	      info +='\nradioValue(obj);';
	      info +='\nisEmail(ml);';
	      info +='\nisVAT(vat);';
	      info +='\nisValidUsrPass(up);';
	      info +='\nmoveSelection(vSelObj, dir);';
	      info +='\nshowInfo();';
	      info +='\n\n© 2001 - Andreas Vassilakis.';
	alert(info);

	window.defaultStatus='© 2001 - Andreas Vassilakis.';
}