function checkCoookie(flas){
	if(flas == 0){
		alert('Please Enable cookies in your browser to continue purchase');
		return false;
	}
	else{
		return true;
	}

}

function validChars(e,goods,field,max) {
	
	var key, keychar;
	key = (window.event) ? window.event.keyCode : ((e) ? e.which : null);
	if (key == null) return true;
 
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	goods = goods.toLowerCase();
 
	if (goods.indexOf(keychar) != -1)
		return true;
 
	if (key==null || key==0 || key==8 || key==9 || key==13 || key==27)
		return true;
 
	return false;
}

function validateTransaction(){
var root=document.add_user;
var fullName = root.name.value;
var maila = root.mail.value;
var address = root.address.value;
var country = root.countries.value;
var phone = root.phone.value;
var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

	if(fullName==''){
		alert("Please insert your full name.");
		root.name.focus();
		return false;
	}
	if(maila==''){
		alert("Please specify an email address.");
		root.mail.focus();
		return false;
	}
	flag=maila.match(pattern);
	if(!flag){
		alert('Please insert a valid email address.');
		root.mail.focus();
		return false;
	}
	if(address ==""){
		alert('Please insert a valid email address.');
		root.address.focus();
		return false;
	}
	if(country == ''){
		alert('Please choose your country.');
		root.countries.focus();
		return false;
	}	
	if(phone == ''){
		alert('Please insert your phone number.');
		root.phone.focus();
		return false;
	}

}