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;  
	
}

<!--
// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

//-->
