// JavaScript Document
var pMenuObj = null, pListObj = null
function $(id) {
    return document.getElementById(id);
}
function menuClick(obj) {
    if (pMenuObj != null) {
        pMenuObj.style.background = "none";
        pMenuObj.style.color = "#FFFFFF";
    }
    obj.style.background = "url(Images/menuBg.jpg) no-repeat";
    obj.style.color = "#7D000F";
    pMenuObj = obj;
}
function listClick(obj) {
    if (pListObj != null)
        pListObj.style.fontWeight = "normal";
    obj.style.fontWeight = "bold";
    pListObj = obj;
}
function MM_jumpMenu(selObj) {
    eval("self.location='" + selObj.options[selObj.selectedIndex].value + "'");
}
function Slide(picUrl, id) {
    var pics = 'Upload/Slide/201008091518921.jpg|Upload/Slide/20100809151831.jpg'
    var links = ''
    var texts = ''
    var focus_width = 950
    var focus_height = 250
    var text_height = 0
    var swf_height = focus_height + text_height
    $(id).innerHTML = '<object type="application/x-shockwave-flash" data="Upload/Slide/slide.swf" width="' + focus_width + '" height="' + swf_height + '" VIEWASTEXT><param name="movie" value="Upload/Slide/slide.swf" /><param name="allowScriptAcess" value="sameDomain" /><param name="quality" value="best" /><param name="bgcolor" value="#F0F0F0" /><param name="scale" value="noScale" /><param name="menu" value="false"><param name="wmode" value="opaque" /><param name="FlashVars" value="playerMode=embedded&pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" /></object>'
}
//AJAX
function createXMLHTTP() {
    var xmlHttp;
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest(); //mozilla浏览器
    }
    else if (window.ActiveXObject) {
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); //IE老版本
        }
        catch (e)
        { }
        try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); //IE新版本
        }
        catch (e)
        { }
        if (!xmlHttp) {
            window.alert("不能创建XMLHttpRequest对象实例！");
            return false;
        }
    }
    return xmlHttp;
}

function GetList(innID, parameter) {
    var url = "";
    var xmlHttp = createXMLHTTP();
    url = "Service.aspx?" + parameter;
    xmlHttp.open("POST", url, true);
    xmlHttp.onreadystatechange = function () { ProListMes(xmlHttp, innID) };
    xmlHttp.send(null);
    //location.href=url;
}
function GetMes(xmlHttp, id) {
    var mes = $(id);
    if (xmlHttp.readyState == 4)//判断对象状态
    {

        if (xmlHttp.status == 200)//信息成功返回，开始处理信息
        {
            if (xmlHttp.responseText != "") {
                mes.innerHTML = xmlHttp.responseText;
            }
            else
                mes.innerHTML = "无相关数据！";
        }
        else
            mes.innerHTML = "获取数据失败！";
    }
    else {
        mes.innerHTML = '<img src="Images/load.gif" alt="" /> 加载中...';
    }
}
//去除首尾空格
function Trim(s) {
    return s.replace(/(^\s+)|(\s+$)/g, "");
}
function CheckCode(code) {
    if (Trim(code).length > 0)
        return true;
    else {
        alert("请输入二维码！");
        return false;
    }
}
