function getObject(objectId) {
	// checkW3C DOM, then MSIE 4, then NN 4.
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId);
	}
	else if (document.all && document.all(objectId)) {
		return document.all(objectId);
	}
	else if (document.layers && document.layers[objectId]) {
		return document.layers[objectId];
	} else {
		return;
	}
}

function uriEncoding(arg) {
	return encodeURIComponent(arg);
}

function trim(inputString) {
	// Removes leading and trailing spaces from the passed string. Also removes
	// consecutive spaces and replaces it with one space. If something besides
	// a string is passed in (null, custom object, etc.) then return the input.
	if (typeof inputString != "string") { return inputString; }
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	while (ch == " ") { // Check for spaces at the beginning of the string
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") { // Check for spaces at the end of the string
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
	while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
		retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	}
	return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}
function isnull(arg) {
	if(trim(arg)=="") {
		return true;
	}
	return false;
}

function str_length(str, Limitlen){
    var len = str.length;
    var cut_str="";
    if( len >Limitlen){
        cut_str = str.slice(0,Limitlen) +'..';

        return cut_str;
    }
    else
        return str;
}

function XSScheck(str)
{
	var num=0;
	var rtnStr;
	rtnStr= "";
	var subStr;
	
	for(i=0;i<str.length;i++)
	{
		if(str.charAt(i)=="<")
		{  
			subStr = str.substr(i,7);
			if (subStr == "<script")
			{
				// alert(subStr);
				return true;
			}
			if (subStr == "<iframe")
			{
				// alert(subStr);
				return true;
			}
		}
	}
	
	return false;
}

String.prototype.replaceAll = replaceAll;
function replaceAll(strValue1, strValue2){
  var strTemp = this;
  while(1){
    if( strTemp.indexOf(strValue1) != -1 )
       strTemp = strTemp.replace(strValue1, strValue2);
    else
       break;
  }
   return strTemp;
 
}



