﻿//Google搜索
function GoogleSearch(name,web)
        {                
           if(name!=null && name!="")
           {
           window.open("http://www.google.com.hk/search?q="+name+"&ie=utf-8&oe=utf-8&hl=zh-CN&btnG=Google%E7%AB%99%E5%86%85%E6%90%9C%E7%B4%A2&domains=http%3A%2F%2F"+web+"&sitesearch=http%3A%2F%2F"+web+"%2F");
           }
        }
//返回多少天的日期        
function GetDateTo(i)
        {
           var now=new Date();
           var today=new Date(now.getYear(),(now.getMonth()),now.getDate());
           var tomorrow=new Date(today.valueOf()+i*24*60*60*1000);           
           var showDatetomorrow=tomorrow.getYear()+"-"+Getod((tomorrow.getMonth()+1))+"-"+Getod(tomorrow.getDate());
           return showDatetomorrow;
        }
//返回今天的日期     
function GetDate()
        {
           var now=new Date();
           var today=new Date(now.getYear(),(now.getMonth()),now.getDate());          
           var showDatetoday=today.getYear()+"-"+Getod((today.getMonth()+1))+"-"+Getod(today.getDate());
           return showDatetoday;           
        }
        //返回日期
function Getod(name)
        {
          if(name<10)
          {
            return "0"+name;
          }
          else
          {
            return name;
          }  
        }
        //返回上一页
function GoHistory()
        {
          window.history.go(-1);
        }
        
 //JS效果       
var lastname="";
function Getcdnr(name)
{
  if(lastname!=name)
  {
  document.getElementById(name).style.display="block";  
  if(lastname!="")
  {
    document.getElementById(lastname).style.display="none";
  }
  lastname=name;
  }
  else
  {
  document.getElementById(name).style.display="none";  
  lastname="";
  }
}
//ajax
var Ajaxhttp;
    function createXMLHttpRequest()
    {
      if(window.ActiveXObject)
      {
        Ajaxhttp=new ActiveXObject("Microsoft.XMLHttp")
      }
      else if(window.XMLHttpRequest)
      {
        Ajaxhttp=new XMLHttpRequest();
      }
    }
function AjaxSub(url,urlParm) {
    var url = "/Ajax/"+url+".ashx?" + urlParm;
    createXMLHttpRequest();
    Ajaxhttp.open("post", url, false);//false同步,异步要另起方法
    Ajaxhttp.send(null);
    return Ajaxhttp.responseText.Trim();
}
 
 
 
 //去空格
String.prototype.Trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function() {
    return this.replace(/(^\s*)/g, "");
}
String.prototype.Rtrim = function() {
    return this.replace(/(\s*$)/g, "");
}
       
//var now=new Date();
//var today=new Date(now.getYear(),(now.getMonth()),now.getDate());
//var tomorrow=new Date(today.valueOf()+1*24*60*60*1000);
//var showDatetoday=today.getYear()+"-"+(today.getMonth()+1)+"-"+today.getDate();
//var showDatetomorrow=tomorrow.getYear()+"-"+(tomorrow.getMonth()+1)+"-"+tomorrow.getDate();
//document.write(showDatetoday); //今天
//document.write("<br />");
//document.write(showDatetomorrow); //明天
