String.prototype.trim = function() {
    return this.replace(/(^\s+)|(\s+$)/g, "");
}
function Cookie(){
  this.SetValue=function(name,value,hours,path,domain,secure){
    var str=new String();
    var nextTime=new Date();
    nextTime.setHours(nextTime.getHours()+hours);
    str=name+"="+escape(value);
    if(hours)
      str+=";expires="+nextTime.toGMTString();
    if(path)
      str+=";path="+path;
    if(domain)
      str+=";domain="+domain;
    if(secure)
      str+=";secure";
    document.cookie=str;
    }
  this.GetValue=function(name){
    var rs=new RegExp("(^|)"+name+"=([^;]*)(;|$)","gi").exec(document.cookie),tmp;
    if(tmp=rs)
      return unescape(tmp[2]);
    return null;
    }
  }
var ck=new Cookie(); 
function getCookie(str){
	return ck.GetValue(str);
}
String.prototype.replaceAll = function(search, replace){
 var regex = new RegExp(search, "g");
 return this.replace(regex, replace);
}
