function show(id)
{
	document.getElementById(id).style.display = 'block';
	return true;
}

function hide(id)
{
	document.getElementById(id).style.display = 'none';
	return true;
}


function switchinputclass(type,name,msg,error)
{
    if(error==true)
    {
        document.getElementById(name).className='form' + type + '_error';
	document.getElementById(msg).className='formmsg_show';
    }
    else
    {
        document.getElementById(name).className='form' + type;
        document.getElementById(msg).className='formmsg_hide';
    }
}

function isBlank(val){
	if(val==null){return true;}
	for(var i=0;i<val.length;i++) {
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
		}
	return true;
	}
	
function isInteger(val){
	if (isBlank(val)){return false;}
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
		}
	return true;
	}

function isNumeric(val){return(parseFloat(val,10)==(val*1));}

function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
	}

	
function isFloat(val){
	if (isBlank(val)){return false;}
	for(var i=0;i<val.length;i++){
		if(!isDigitFloat(val.charAt(i))){return false;}
		}
	return true;
	}	
	
function isDigitFloat(num) 
{
	if (num.length>1){return false;}
	var string="1234567890.,";
	if (string.indexOf(num)!=-1){return true;}
	return false;
}	

function isEmail(email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = email
   if(reg.test(address) == false)  { return false;  }
}

function isPostcode(postcode) 
{  
	return typeof postcode=='string' ?postcode.match(/[1-9][0-9]{3} ?[a-zA-Z]{2}/)==postcode    :false;  
	
}
