var w = screen.width;
var h = screen.height;
v_close = function(){
	var vP = document.getElementById("v");
	vP.style.visibility = "hidden";
	vP.style.top = '-10000px';
	vP.innerHTML = '';
}
formcat = function(){
	this.success = false;
	
	this.length_input = function(s,e,n,m){
		if ((n.value.length>=s)&&(n.value.length<=e)){
			this.success = true;
			return true;
		}
		else{
			alert(m);
			this.success = false;
			return false;
		}		
	}
	
	this.post_code = function(n,m){
		if (n.value.match(/^[0-9]{2}\-[0-9]{3}$/)){
			this.success = true;
			return true;
		}
		else{
			alert(m);
			this.success = false;
			return false;
		}	
	}
	
	this.chars_val = function(n,m){
		if (n.value.match(/^[a-zA-Z]$/)){
			this.success = true;
			return true;
		}
		else{
			alert(m);
			this.success = false;
			return false;
		}	
	}
	
	this.email_val = function(n,m){
		if (n.value.match(/^[^@^\#^\=^\!^\&^\(^\)^\%^\,^\.^\\^\|^\[^\{^\]^\}^\<^\>^\?^\/^\+^\$^\*^\~^\`^\^^\'^\"]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/)){
			this.success = true;
			return true;
		}
		else{
			alert(m);
			this.success = false;
			return false;
		}			
	}
	this.checkpass = function(p1,p2,m){
		if (p1.value === p2.value){
			this.success = true;
			return true;
		}
		else{
			alert(m);
			this.success = false;
			return false;
		}		
	}
	this.notEmpty = function(n,m){
		if (n.value.length>0){
			this.success = true;
			return true;
		}
		else{
			alert(m);
			this.success = false;
			return false;
		}	
	}
}
