// JavaScript Document
function ColumnsSameHeight()
{
	var i1=document.getElementById("side1").offsetHeight;
	var i2=document.getElementById("side2").offsetHeight;
	var i3=0;
	
	if(document.getElementById("main"))	
		i3=document.getElementById("main").offsetHeight;
	else if(document.getElementById("inner"))
		i3=document.getElementById("inner").offsetHeight;

	var newi=0;
	if(i1>=i2 && i1>=i3)	newi=i1;
	else if(i2>=i1 && i2>=i3)	newi=i2;
	else		newi=i3;
	
	newi+=20;
	//alert(i1 + " " +i2 + " " +i3+ " " +newi)
	
	document.getElementById("side1").style.height=newi+"px";
	document.getElementById("side2").style.height=newi+"px";
	
	if(document.getElementById("main"))
		document.getElementById("main").style.height=newi+"px";
	else if(document.getElementById("inner"))
		document.getElementById("inner").style.height=newi+"px";
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function ShowHide(itemid)
{
	if(document.getElementById(itemid))
	{
		if(document.getElementById(itemid).style.display=='block')
			document.getElementById(itemid).style.display='none';
		else
			document.getElementById(itemid).style.display='block';
	}
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
//http://www.rgagnon.com/jsdetails/js-0063.html
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function validateEmail( strValue) 
{
	/************************************************
	DESCRIPTION: Validates that a string contains a
	  valid email pattern.

	 PARAMETERS:
	   strValue - String to be tested for validity

	RETURNS:
	   True if valid, otherwise false.

	REMARKS: Accounts for email with country appended
	  does not validate that email contains valid URL
	  type (.com, .gov, etc.) or valid country suffix.
	*************************************************/
	
	var objRegExp=/(^[a-z]([a-z_\.]*)@([a-z_\.\-]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.\-]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;
	
	//check for valid email
	return objRegExp.test(strValue);
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function  validateNumeric( strValue ) 
{
	/*****************************************************************
	DESCRIPTION: Validates that a string contains only valid numbers.
	
	PARAMETERS:
	   strValue - String to be tested for validity

	RETURNS:
	   True if valid, otherwise false.
	******************************************************************/
	
	var objRegExp=/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;

	//check for numeric characters
	return objRegExp.test(strValue);
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function validateInteger( strValue ) 
{
	/************************************************
	DESCRIPTION: Validates that a string contains only
    	valid integer number.

	PARAMETERS:
	   strValue - String to be tested for validity

	RETURNS:
	   True if valid, otherwise false.
	**************************************************/
	
	var objRegExp  = /(^-?\d\d*$)/;

	//check for integer characters
	return objRegExp.test(strValue);
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function validateNotEmpty( strValue ) 
{
	/************************************************
	DESCRIPTION: Validates that a string is not all
	  blank (whitespace) characters.

	PARAMETERS:
	   strValue - String to be tested for validity

	RETURNS:
	   True if valid, otherwise false.
	*************************************************/
	
	var strTemp = strValue;
	strTemp = trimAll(strTemp);
	if(strTemp.length > 0)
	{
		return true;
	}
	return false;
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function validateUSDate( strValue ) 
{
	/************************************************
	DESCRIPTION: Validates that a string contains only
	    valid dates with 2 digit month, 2 digit day,
    	4 digit year. Date separator can be ., -, or /.
	    Uses combination of regular expressions and
    	string parsing to validate date.
	    Ex. mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy

	PARAMETERS:
	   strValue - String to be tested for validity
	
	RETURNS:
	   True if valid, otherwise false.

	REMARKS:
	   Avoids some of the limitations of the Date.parse()
	   method such as the date separator character.
	*************************************************/
	
	var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/;
 
	//check to see if in correct format
	if(!objRegExp.test(strValue))
    	return false; //doesn't match pattern, bad date
	else
	{
    	var strSeparator = strValue.substring(2,3);
	    var arrayDate = strValue.split(strSeparator); 
	    //create a lookup for months not equal to Feb.
	    var arrayLookup = { '01' : 31,'03' : 31, 
    	                    '04' : 30,'05' : 31,
        	                '06' : 30,'07' : 31,
            	            '08' : 31,'09' : 30,
                	        '10' : 31,'11' : 30,'12' : 31}
	    var intDay = parseInt(arrayDate[1],10); 

		//check if month value and day value agree
    	if(arrayLookup[arrayDate[0]] != null) 
		{
			if(intDay <= arrayLookup[arrayDate[0]] && intDay != 0)       	return true; //found in lookup table, good date
    	}
    
		//check for February (bugfix 20050322)
    	//bugfix  for parseInt kevin
	    //bugfix  biss year  O.Jp Voutat
	    var intMonth = parseInt(arrayDate[0],10);
    	if (intMonth == 2) 
		{ 
			var intYear = parseInt(arrayDate[2]);
			if (intDay > 0 && intDay < 29) 
			{
				return true;
			}
			else if (intDay == 29) 
			{
				if ((intYear % 4 == 0) && (intYear % 100 != 0) ||  (intYear % 400 == 0)) 
				{
					// year div by 4 and ((not div by 100) or div by 400) ->ok
					return true;
				}   
			}
		}
	}  
	
	return false; //any other values, bad date
}

<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->

function trimAll( strValue ) 
{
	/************************************************
	DESCRIPTION: Removes leading and trailing spaces.

	PARAMETERS: Source string from which spaces will
	  be removed;

	RETURNS: Source string with whitespaces removed.
	*************************************************/
	
	var objRegExp = /^(\s*)$/;

    //check for all spaces
    if(objRegExp.test(strValue)) 
	{
    	strValue = strValue.replace(objRegExp, '');
		if( strValue.length == 0)         return strValue;
    }

	//check for leading & trailing spaces
	objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
	if(objRegExp.test(strValue)) 
	{
		//remove leading and trailing whitespace characters
		strValue = strValue.replace(objRegExp, '$2');
    }

	return strValue;
}
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
//http://lawrence.ecorp.net/inet/samples/regexp-format.php#trimming
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
function ltrim(str)
{
	return str.replace(/^\s+/, '');
}

function rtrim(str) 
{
	return str.replace(/\s+$/, '');
}

function alltrim(str) 
{
	return str.replace(/^\s+|\s+$/g, '');
}





















