﻿
//function menuFix() {
//    var sfEls = document.getElementById("nav").getElementsByTagName("li");
//    for (var i = 0; i < sfEls.length; i++) {
//        sfEls[i].onmouseover = function() {
//            this.className += (this.className.length > 0 ? " " : "") + "sfhover";
//        }
//        sfEls[i].onMouseDown = function() {
//            this.className += (this.className.length > 0 ? " " : "") + "sfhover";
//        }
//        sfEls[i].onMouseUp = function() {
//            this.className += (this.className.length > 0 ? " " : "") + "sfhover";
//        }
//        sfEls[i].onmouseout = function() {
//            this.className = this.className.replace(new RegExp("( ?|^)sfhover\\b"),
//"");
//        }
//    }
//}
//window.onload = menuFix;


//------------------------------------


var bsYear;
var bsDate;
var bsWeek;
var arrLen = 8; //数组长度 
var sValue = 0; //当年的秒数 
var dayiy = 0; //当年第几天 
var miy = 0; //月份的下标 
var iyear = 0; //年份标记 
var dayim = 0; //当月第几天 
var spd = 86400; //每天的秒数 

var year1999 = "30;29;29;30;29;29;30;29;30;30;30;29"; //354 
var year2000 = "30;30;29;29;30;29;29;30;29;30;30;29"; //354 
var year2001 = "30;30;29;30;29;30;29;29;30;29;30;29;30"; //384 
var year2002 = "30;30;29;30;29;30;29;29;30;29;30;29"; //354 
var year2003 = "30;30;29;30;30;29;30;29;29;30;29;30"; //355 
var year2004 = "29;30;29;30;30;29;30;29;30;29;30;29;30"; //384 
var year2005 = "29;30;29;30;29;30;30;29;30;29;30;29"; //354 
var year2006 = "30;29;30;29;30;30;29;29;30;30;29;29;30";

var month1999 = "正月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"
var month2001 = "正月;二月;三月;四月;闰四月;五月;六月;七月;八月;九月;十月;十一月;十二月"
var month2004 = "正月;二月;闰二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"
var month2006 = "正月;二月;三月;四月;五月;六月;七月;闰七月;八月;九月;十月;十一月;十二月"
var Dn = "初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十";

var Ys = new Array(arrLen);
Ys[0] = 919094400; Ys[1] = 949680000; Ys[2] = 980265600;
Ys[3] = 1013443200; Ys[4] = 1044028800; Ys[5] = 1074700800;
Ys[6] = 1107878400; Ys[7] = 1138464000;

var Yn = new Array(arrLen); //农历年的名称 
Yn[0] = "己卯年"; Yn[1] = "庚辰年"; Yn[2] = "辛巳年";
Yn[3] = "壬午年"; Yn[4] = "癸未年"; Yn[5] = "甲申年";
Yn[6] = "乙酉年"; Yn[7] = "丙戌年";
var D = new Date();
var yy = D.getYear();
var mm = D.getMonth() + 1;
var dd = D.getDate();
var ww = D.getDay();
if (ww == 0) ww = " 星期日 ";
if (ww == 1) ww = " 星期一 ";
if (ww == 2) ww = " 星期二 ";
if (ww == 3) ww = " 星期三 ";
if (ww == 4) ww = " 星期四 ";
if (ww == 5) ww = " 星期五 ";
if (ww == 6) ww = " 星期六 ";
ww = ww;
var ss = parseInt(D.getTime() / 1000);
if (yy < 100) yy = "19" + yy;

for (i = 0; i < arrLen; i++)
    if (ss >= Ys[i]) {
    iyear = i;
    sValue = ss - Ys[i]; //当年的秒数 
}
dayiy = parseInt(sValue / spd) + 1; //当年的天数 

var dpm = year1999;
if (iyear == 1) dpm = year2000;
if (iyear == 2) dpm = year2001;
if (iyear == 3) dpm = year2002;
if (iyear == 4) dpm = year2003;
if (iyear == 5) dpm = year2004;
if (iyear == 6) dpm = year2005;
if (iyear == 7) dpm = year2006;
dpm = dpm.split(";");

var Mn = month1999;
if (iyear == 2) Mn = month2001;
if (iyear == 5) Mn = month2004;
if (iyear == 7) Mn = month2006;
Mn = Mn.split(";");

var Dn = "初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十";
Dn = Dn.split(";");

dayim = dayiy;

var total = new Array(13);
total[0] = parseInt(dpm[0]);
for (i = 1; i < dpm.length - 1; i++) total[i] = parseInt(dpm[i]) + total[i - 1];
for (i = dpm.length - 1; i > 0; i--)
    if (dayim > total[i - 1]) {
    dayim = dayim - total[i - 1];
    miy = i;
}
bsWeek = ww;
bsDate = yy + "年" + mm + "月";
bsDate2 = dd + "日";
bsYear = "农历" + Yn[iyear];
bsYear2 = Mn[miy] + Dn[dayim - 1];
if (ss >= Ys[7] || ss < Ys[0]) bsYear = Yn[7];
function CAL() {
    document.write("<font color=#B30121>" + bsDate + "</font><font color=#B30121>" + bsDate2 + "</font>");
    document.write("<font color=#B30121>" + "&nbsp;" + bsWeek + "</font>");
    //document.write(bsYear+bsYear2); 
}

//----------------------------------------------------------------------

//图片交互
function mouseOver(obj) {
    var src = obj.src;
    var src1, src2;
    src1 = src.substring(0, src.lastIndexOf("."));
    src2 = "2.jpg";
    obj.src = src1 + src2;
}
function mouseOut(obj) {
    var src = obj.src;
    var src1, src2;
    src1 = src.substring(0, src.lastIndexOf(".") - 1);
    src2 = ".jpg";
    obj.src = src1 + src2;

}

//function getContent(content) {
//    if (content == null || content == "") {
//        document.write("&nbsp;");
//    } else {
//        var length = content.length;
//        var newcontent;
//        if (length > 108) {
//            newcontent = "——" + content.substr(0, 108) + "...";
//        } else {
//            newcontent = "——" + content.substr(0, length);
//        }
//        document.write(newcontent);
//    }
//}
//function getTitle(title) {
//    var length = title.length;
//    var newtitle;
//    if (length > 24) {
//        newtitle = title.substr(0, 24) + "...";
//    } else {
//        newtitle = title.substr(0, length);
//    }
//    document.write(newtitle);
//}
//function getTitleList(title) {
//    var length = title.length;
//    var newtitle;
//    if (length > 29) {
//        newtitle = title.substr(0, 29) + "...";
//    } else {
//        newtitle = title.substr(0, length);
//    }
//    document.write(newtitle);
//}
//function checkForm() {
//    var title = document.sousuo.title.value;
//    if (title == "") {
//        alert("搜索条件不能为空！");
//        document.sousuo.title.focus();
//        return false;
//    }
//    document.sousuo.submit();
//}

////-------------------------------------------------------


//function getDays(sdate2) {     //sdate2是2004-10-18格式   
//    var curDate = new Date();
//    var sdate1 = curDate.getYear() + "-" + (curDate.getMonth() + 1) + "-" + curDate.getDate();
//    var adate, odate1, odate2, idays;
//    adate = sdate1.split("-");
//    odate1 = new Date(adate[1] + - +adate[2] + - +adate[0]);    //转换为10-18-2004格式   
//    adate = sdate2.split("-");
//    odate2 = new Date(adate[1] + - +adate[2] + - +adate[0]);
//    idays = parseInt((odate1 - odate2) / 1000 / 60 / 60 / 24);   //把相差的毫秒数转换为天数
//    if (idays >= 0 && idays <= 1) {
//        document.write("<img src='../images/newimages/new.gif' border=0 />");
//    } else {
//        document.write("&nbsp;");
//    }
//}

////-------------------------------------------------------------------


//function getCookieVal(offset) {
//    var endstr = document.cookie.indexOf(";", offset);
//    if (endstr == -1)
//        endstr = document.cookie.length;
//    return unescape(document.cookie.substring(offset, endstr));
//}

//function GetCookie(name) {
//    var arg = name + "=";
//    var alen = arg.length;
//    var clen = document.cookie.length;
//    var i = 0;
//    while (i < clen) {
//        var j = i + alen;
//        if (document.cookie.substring(i, j) == arg)
//            return getCookieVal(j);
//        i = document.cookie.indexOf(" ", i) + 1;
//        if (i == 0) break;
//    }
//    return null;
//}

//function SetCookie(name, value) {
//    var argv = SetCookie.arguments;
//    var argc = SetCookie.arguments.length;
//    var expires = (argc > 2) ? argv[2] : null;
//    var path = (argc > 3) ? argv[3] : null;
//    var domain = (argc > 4) ? argv[4] : null;
//    var secure = (argc > 5) ? argv[5] : false;
//    document.cookie = name + "=" + escape(value) +
//((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
//((path == null) ? "" : ("; path=" + path)) +
//((domain == null) ? "" : ("; domain=" + domain)) +
//((secure == true) ? "; secure" : "");
//}

//function check_ssl() {
//    if (document.form2.usessl.checked == true) {
//        document.form2.usessl.value = 1;
//    } else {
//        document.form2.usessl.value = 0;
//    }
//}

//function ssl() {
//    if (document.form2.usessl.checked == true) {
//        SetCookie('ssl', 1, exp);
//    } else {
//        SetCookie('ssl', 0, exp);
//    }
//}

//var expDays = 30;
//var exp = new Date();
//exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000));


////----------------------------------------------------------------------


//function merge() {
//    with (document.form3) {
//        account.value = temp_account.value + "@" + domain.value;
//    }
//}
