﻿function Trim()
{
	return this.replace(/\s+$|^\s+/g,"");
}
String.prototype.Trim=Trim;
function CheckString(string,content)
{
	var count=0;
	var CheckArray=new Array("<",">","##","$","&");
	for(i=0;i<string.length;i++)
	{
		for(j=0;j<CheckArray.length;j++)
		{
			if(string.substring(i,i+1)==CheckArray[j])
			{
				count++;
				break;
			}
		}
	}
	if(count>0)
	{
		//alert("在"+content+"中包含了非法字符，请重新设置");
		alert("Contains illegal characters in the "+content+",please re-instated")
		return false;
	}
	else
	{
		return true;
	}
}

function SearchBg(value)
{
	if(value == 1)
	{
		document.getElementById("Image5").style.backgroundImage = '/images/search_iconB.gif';
	}
	else
	{
		document.getElementById("Image5").style.backgroundImage = '/images/search_icon.gif';
	}
}
function $(obj) 
{ 
  return document.getElementById(obj);
}
function getFormAction(str)
{
	var obj=$("TrackOrder");	
	if (str=="0")
	{
		obj.action="/users/search.cfm";
	}
	else if (str=="1")
	{
		obj.action="/users/powerlevel.cfm";
	}
}
