function getParameter ( queryString, parameterName ) {
   // Add "=" to the parameter name (i.e. parameterName=value)
   var parameterName = parameterName + "=";
   var unescaped;
   if ( queryString.length > 0 ) {
      // Find the beginning of the string
      begin = queryString.indexOf ( parameterName );
      // If the parameter name is not found, skip it, otherwise return the value
      if ( begin != -1 ) {
         // Add the length (integer) to the beginning
         begin += parameterName.length;
         // Multiple parameters are separated by the "&" sign
         end = queryString.indexOf ( "&" , begin );
      if ( end == -1 ) {
         end = queryString.length
      }
      // Return the string
      unescaped= unescape ( queryString.substring ( begin, end ) );
     
       return unescaped.replace("#", "");
   }
   // Return "null" if no parameter has been found
   return "null";
   }
}

function toggleStyle (siblingItemsClass, setDiv, onStyle, offStyle)
{
	var siblingItems = $$(siblingItemsClass);
	for(var i = 0; i < siblingItems.length; i++)
   	{
   		siblingItems[i].className =offStyle;
   	}
   $(setDiv).className=onStyle;

}

function charAlert(field, max, alertText) {
var textField = $(field);

if(textField.value.length > max){

textField.value= textField.value.substring(0,max);
textField.blur();
alert(alertText);
}

}
function trim(str)
{
var result = str.replace(/^\s+|\s+$/g, '') ;
 return result;
}
function escapeHTML (str)
{
 var i,e={'&':'%26','"':'%22'};
 for(i in e) str=str.replace(new RegExp(i,'g'),e[i]); return str;
}