﻿// JavaScript Document//搜索文本框事件function clearnDefaultKeyWord() {    document.all.txtKeyWord.value = "";    document.all.txtKeyWord.style.color = "black";}function setDefaultKeyWord() {    if (document.all.txtKeyWord.value == "") {        document.all.txtKeyWord.value = "请输入关键字，点击搜索";        document.all.txtKeyWord.style.color = "#CCCCCC";    }}//导航栏样式变化function high(which2) {    clearInterval(time_id);    which2.filters.alpha.opacity = 100;}function low(which2) {    theobject = which2;    time_id = setInterval("highlightit(theobject)", 50);}function highlightit(cur2) {    if (cur2.filters.alpha.opacity > 80)        cur2.filters.alpha.opacity -= 10;    else if (window.time_id)        clearInterval(time_id);}//设置ID为"fontZoom"控件的文字大小function fontZoom(size) {    document.getElementById('fontZoom').style.fontSize = size + 'px';}//打印function printPage() {    if (window.print)        window.print();    else        alert('No printer driver in your PC');}//得到浏览器大小，包括滚动区域function getPageSize() {    var xScroll, yScroll;    if (window.innerHeight && window.scrollMaxY) {        xScroll = document.body.scrollWidth;        yScroll = window.innerHeight + window.scrollMaxY;    } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac        xScroll = document.body.scrollWidth;        yScroll = document.body.scrollHeight;    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari        xScroll = document.body.offsetWidth;        yScroll = document.body.offsetHeight;    }    var windowWidth, windowHeight;    if (self.innerHeight) {	// all except Explorer        windowWidth = self.innerWidth;        windowHeight = self.innerHeight;    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode        windowWidth = document.documentElement.clientWidth;        windowHeight = document.documentElement.clientHeight;    } else if (document.body) { // other Explorers        windowWidth = document.body.clientWidth;        windowHeight = document.body.clientHeight;    }    // for small pages with total height less then height of the viewport    if (yScroll < windowHeight) {        pageHeight = windowHeight;    } else {        pageHeight = yScroll;    }    // for small pages with total width less then width of the viewport    if (xScroll < windowWidth) {        pageWidth = windowWidth;    } else {        pageWidth = xScroll;    }    arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)    return arrayPageSize;}//首页左上Tab切换function setTab(name, cursel, n) {    //for(var i = 1; i <= n; i++)    //{    //	var menu = document.getElementById(name + i);    //var con = document.getElementById("con_" + name + "_" + i);    //menu.className = (i == cursel ? "Menubox" : "Menubox1");    //con.style.display = (i == cursel ? "block" : "none");    //	}    for (var i = 1; i <= n; i++) {        var menu = document.getElementById(name + i);        var con = document.getElementById("con_" + name + "_" + i);        menu.className = (i == cursel ? "hover" : "");        con.style.display = (i == cursel ? "block" : "none");    }}function changeStyle(obj, style) {    obj.className = style;}function writeDateInfo() {    var day = "";    var month = "";    var ampm = "";    var ampmhour = "";    var myweekday = "";    var year = "";    mydate = new Date();    myweekday = mydate.getDay();    mymonth = mydate.getMonth() + 1;    myday = mydate.getDate();    myyear = mydate.getYear();    year = (myyear > 200) ? myyear : 1900 + myyear;    if (myweekday == 0)        weekday = " 星期日";    else if (myweekday == 1)        weekday = " 星期一";    else if (myweekday == 2)        weekday = " 星期二";    else if (myweekday == 3)        weekday = " 星期三";    else if (myweekday == 4)        weekday = " 星期四";    else if (myweekday == 5)        weekday = " 星期五";    else if (myweekday == 6)        weekday = " 星期六";    document.write(mymonth + "月" + myday + "日");}var AjaxBridge = {    _url: "/becool/dll/sys/AjaxBridge.aspx",    _element: null,    _labelName: "",    writeContentByAjaxBridge: function (labelName, element) {        this._labelName = "{becool:" + labelName + "}";        this._element = element;        var pars = "type=getLabelRealContent&labelName=" + encodeURI(this._labelName);        //因为下面函数是回调的，故里面的this就不是自己了，而是调用者，例如一个aspx页面        //局部变量element是在本函数体内，压入堆栈的        var success1 = function (response) {            AjaxBridge.success(response, element);        };        var fail1 = function (request) {            AjaxBridge.fail(request, element);        };        var myAjax = new Ajax.Request(    				this._url,    				{    				    method: "get",    				    parameters: pars,    				    onFailure: fail1,    				    onSuccess: success1    				});    },    writeContentByAjaxBridge2: function (parameters, element) {        this._element = element;        var pars = encodeURI(parameters);        //因为下面函数是回调的，故里面的this就不是自己了，而是调用者，例如一个aspx页面        //局部变量element是在本函数体内，压入堆栈的        var success1 = function (response) {            AjaxBridge.success(response, element);        };        var fail1 = function (request) {            AjaxBridge.fail(request, element);        };        var myAjax = new Ajax.Request(    				this._url,    				{    				    method: "get",    				    parameters: pars,    				    onFailure: fail1,    				    onSuccess: success1    				});    },    fail: function (request, element) {        element.innerHTML = "服务器失效。request:" + request.responseText;    },    success: function (response, element) {        element.innerHTML = response.responseText;    }}//document.domain="xtol.cn"; 
