
	function openContact(url, name, width, height)
	{
		if (!width) width = 600;
		if (!height) height = 600;
		//var w = window.open(url, name,"width="+width+",height="+height+",resizable=1,toolbar=0,location=0,status=0,menubar=0,directories=0,scrollbars=yes,top=0,left=0");
		var w = window.open(url, '',"width="+width+",height="+height+",resizable=1,toolbar=0,location=0,status=0,menubar=0,directories=0,scrollbars=yes,top=0,left=0");		
		w.focus();
	}

	function wopen(url,name,w,h,r,s,st) 
	{ 
		var w = window.open(url,name,"width="+w+",height="+h+",resizable="+r+",toolbar=0,location=0,status="+st+",menubar=0,directories=0,scrollbars="+s); 
	}
	
	function setCheckbox( container, checked )
	{
		var oContainer = document.getElementById(container);
		var aElement  = oContainer.getElementsByTagName('input');
		for( var i = 0; i < aElement.length; i++ )
		{
			if( 'checkbox' == aElement[i].type )
			{
				aElement[i].checked = checked;
			}
	    }

		return true;
	}

	
	
/**
* Checks if zip code is valid
*
* @param string aZip zip code
* @return bool
*/
function validZip(aZip)
{
	var r1 = /^[0-9]{5}$/; // US zip code pattern
	var r2 = /^[a-z]{1}\d{1}[a-z]{1}\d{1}[a-z]{1}\d{1}$/i; // Canada postal code pattern
	return (r1.test(aZip) || r2.test(aZip));
}

/**
* Checks if username is valid
*
* @param string aUsername username to check
*
* @return bool
*/
function validUsername(aUsername)
{
	var r = /^[a-z0-9\_-]{3,20}$/i;
	return r.test(aUsername);
}

/**
* Checks if email is valid
*
* @param string aEmail email to check
*
* @return bool
*/
function validEmail(aEmail)
{
	var r = /^[a-z0-9\-_\.]+@[a-z0-9\-_]+(\.[a-z0-9]{2,3})+$/i;
	return r.test(aEmail);
}

/**
* Checks if description is valid
*
* @param string aDescription description to check
*/
function validDescription(aDescription)
{
	return (aDescription.length > 0);
}

