<!-- 
 var ajaxFileURL="/CustomAction/JScript.aspx";
 var ajaxContentURL="/User/GetContent.aspx";
 var slideImageArrayList=[];
 
 function GetSlideImageArray(index)
 {
    if(index>=0 && slideImageArrayList.length>0){    
        return index<slideImageArrayList.length ? slideImageArrayList[index] : slideImageArrayList[slideImageArrayList.length-1];
    }
    else{
        return null;
    }    
 }
 function GetXmlHttpObject()
 {
    var MSXML=['Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP'];
    try{
        return new XMLHttpRequest();
    }catch (e){
        for(var i=0; i<MSXML.length; i++)
        {
            try{
                return new ActiveXObject(MSXML[i]);
            }catch (e){                  
            }
        }
    }
    return null;
}    
function DoAjax(url,method,args,func)
{
    var xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
        alert ("您的浏览器不支持AJAX！");    
        return false;        
    }
    else
    {
        var arg = [];
        arg.push(null);
        for(var i=4; i<arguments.length; i++){
            arg.push(arguments[i]);
        }        

        xmlHttp.onreadystatechange=function(){        
            if(xmlHttp.readyState==4 && xmlHttp.status==200){     
                arg[0]=xmlHttp;
                if(func){
                    func.apply(this,arg);       
                }
            }
        }       
        xmlHttp.open(method,url,true);
        if(method&&method.toLowerCase()=='post'){
            xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        }
        xmlHttp.send(args);
    }
    return true;
}
function addLoadEvent(func){
    var oldonload=window.onload;
    var arg = [];
    for(var i=1; i<arguments.length; i++){
        arg.push(arguments[i]);
    } 
    if(typeof window.onload !="function"){
        window.onload=function(){
            func.apply(this,arg);
        }
    }else{    
        window.onload=function(){
            oldonload();            
            func.apply(this,arg);
        }
    }
} 
function docEle(id)
{
    return document.getElementById(id) || false;
}
function getNodeValue(node,name)
{    
    var item  = node!=null ? node.getElementsByTagName(name) : null;    
    var node = (item!=null && item.length>0) ? item[0].firstChild : null; 
    return node!=null ? node.nodeValue : '';    
}
function setLink(id,href,text,title)
{
    var obj=docEle(id);
    if(obj!=null){
        obj.href=href;
        obj.innerHTML=text;
        obj.title=title||text;
    }
}
function setHTML(id,htmlValue)
{
    var obj=docEle(id);
    if(obj!=null){
        obj.innerHTML=htmlValue;  
        if(obj.style) obj.style.display='';  
    }
}
function setObjHTML(obj,htmlValue)
{    
    if(obj!=null){
        obj.innerHTML=htmlValue;    
        if(obj.style) obj.style.display='';  
    }
}
function setValue(id,value)
{
    var obj=docEle(id);
    if(obj!=null){
        obj.value=value;
        if(obj.style) obj.style.display='';  
    }
}
function setObjValue(obj,value)
{    
    if(obj!=null){
        obj.value=value;
        if(obj.style) obj.style.display='';  
    }
}
function setOptionSelected(id,value)
{
    var obj=docEle(id);   
    if(obj!=null && (obj.type=='select' || obj.type=='select-one')){
        value=value.toLowerCase();
        for(var i=0; i<obj.options.length;i++){
            if(obj.options[i].value.toLowerCase()==value)
            {               
                obj.options[i].selected=true;
                break;
            }
        }
    }
}
//写cookies
function setCookie(value, name, key) {
    var Days = 1;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    if (key == null || key == "") {
        document.cookie = name + "=" + escape(encodeURI(value)) + ";expires=" + exp.toGMTString()+";path=/";
    }
    else {
        var nameValue = getCookie(name);        
        if (nameValue==null || nameValue == "") {
            document.cookie = name + "=" + key + "=" + escape(encodeURI(value)) + ";expires=" + exp.toGMTString() + ";path=/";
        }
        else {
            var keyValue = getCookie(name, key);
            if (keyValue!=null && keyValue != "") {
                nameValue = nameValue.replace(key + "=" + keyValue, key + "=" +escape(encodeURI ( value)));
                document.cookie = name + "=" + nameValue + ";expires=" + exp.toGMTString() + ";path=/";
            }
            else {                                          
                document.cookie = name + "=" + nameValue + "&" + key + "=" + escape(encodeURI(value)) + ";expires=" + exp.toGMTString() + ";path=/";
            }
        }
    }
}

function getCookie(name,key)
{
  var arr = document.cookie.match(new RegExp("(^| )"+name+(key!=null && key!='' ? ('='+key):'')+"=([^;]*)(;|$)"));
  if(arr != null) return unescape(decodeURI(arr[2])); return null;
}

function getCookieValue(cookie,key)
{
  var value =cookie!=null ? cookie.match(new RegExp("(^|&)"+key+"=([^&]*)(&|$)")) : null; 
  if(value != null) return unescape(decodeURI(value[2])); return '';
}

function delCookie(name)
{
  var exp = new Date();
  exp.setTime(exp.getTime() - 1);
  var cval=getCookie(name);
  if(cval!=null) document.cookie=name +"="+escape(encodeURI(cval))+";expires="+exp.toGMTString();
}
-->
