// JavaScript Document
function navigateTo (strUrl)
{
	window.location = strUrl;
	
} // navigateTo() :void;

function popWindow (strUrl, intWidth, intHeight)
{
	var strParams = 'resizable=yes,scrollbars=yes,width=' + intWidth + ',height=' + intHeight;
	
	try
	{
		winPop.close();
	}
	catch (e) {  }
	
	winPop = window.open (strUrl, 'winPop', strParams);
	
	return false;
	
} // popWindow() :false

function trim(strIn)
{
	return strIn.replace(/^\s\s*/, '').replace(/\s\s*$/, '');

} // trim() :string

function validateEmail (strEmail) 
{
	return /^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*\.[a-zA-Z]{2,4})+$/.test(strEmail);

} // validateEmail() :boolean

function validateFileTypes (strFileName, strFileExt)
{
	if (strFileExt == "undefined")
		strFileExt = "jpg|gif|png|jpeg";

	return new RegExp("^.+\.(" + strFileExt + ")$", "i").test(strFileName);
	
} // validateFileTypes() :boolean

function validatePhone (strPhone)
{
	return /^(([0-9]{1})*[- .(]*([0-9a-zA-Z]{3})*[- .)]*[0-9a-zA-Z]{3}[- .]*[0-9a-zA-Z]{4})+$/.test(strPhone);
	
} // validatePhone() :boolean
		
function watchFloat (obj)
{
	while ( !/^(\-)?([0-9]+)?(\.)?([0-9]+)?$/.test(obj.value) )
		obj.value = obj.value.substring(0, obj.value.length - 1);
	
} // watchFloat() :void
		
function watchInteger (obj)
{
	while ( !/^(\-)?([0-9]+)?$/.test(obj.value) )
		obj.value = obj.value.substring(0, obj.value.length - 1);
	
} // watchInteger() :void