// JavaScript Document
function __fncOpenHtmlEditor(strOwner, strValue){
	var newWin = window.open("./../htmlEditor.php?owner="+strOwner+"&value="+strValue, "", "ststusbar=1,menubar=0,height=600,width=1000,scrollbars=1");
	newWin.focus();
}

	// JavaScript Document
	function getDivByID(layerID) {
		if (document.getElementById) {
			// this is the way the standards work
			return document.getElementById(layerID);
		} else if (document.all) {
			// this is the way old msie versions work
			return document.all[layerID];
		} else if (document.layers){
			// this is the way nn4 works
			return document.layers[layerID];
		}
		return null;
	}
function __fncCancel(){
	thisForm.txtWhat2Do.value = '';
	thisForm.submit();
}
function HighlightImage (Id)
{
	$('normal_image_'+Id).style.display = 'none';	
	$('over_image_'+Id).style.display = 'block';
	$('popup_'+Id).style.display = 'block';
}
function HideImage (Id)
{
	$('normal_image_'+Id).style.display = 'block';	
	$('over_image_'+Id).style.display = 'none';
		$('popup_'+Id).style.display = 'none';
}
	//Trim Functions
	function ltrim(str) { 
		for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
		return str.substring(k, str.length);
	}
	function rtrim(str) {
		for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
		return str.substring(0,j+1);
	}
	function trim(str) {
		return ltrim(rtrim(str));
	}
	function isAlphaNumeric(val){
		if (val.match(/^[a-zA-Z0-9]+$/))
		{
		return true;
		}
		else
		{
		return false;
		} 
	}
	function isValidUserName(val){
		if (val.match(/^[a-zA-Z0-9_]+$/)){
			if(val.match(/^[_]+$/)){
				return false;
			}else{
				return true;
			}
		}else{
			return false;
		}
	}
	function isWhitespace(charToCheck) {
		var whitespaceChars = " \t\n\r\f";
		return (whitespaceChars.indexOf(charToCheck) != -1);
	}
		//End Trim Functions
	//Email Validation
	function isValidEmail(email){
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (filter.test(email)){
			return true;
		}else{
			return false;
		}
	}
		