﻿function tick() {
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today, theday;
today = new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
theday = today.getFullYear()+"年" + [today.getMonth()+1]+"月" +today.getDate() + "日" +"&nbsp;"+ d[today.getDay()+1];
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜";
} else if (intHours < 12) {
hours = intHours+":";
xfile = "上午";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午";
} else {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = theday;
document.getElementById("Clocks").innerHTML = timeString;
window.setTimeout("tick();", 100);
}
function geturl() {

    if (indexpp(120100) != "-1") {
        document.getElementById("a1").className = "alinkc";
    }
    else if (indexpp(120200) != "-1") {
        document.getElementById("a2").className = "alinkc";
    }
    else if (indexpp(120300) != "-1") {
        document.getElementById("a3").className = "alinkc";
    }
    else if (indexpp(120400) != "-1") {
        document.getElementById("a4").className = "alinkc";
    }
    else if (indexpp(130100) != "-1") {
        document.getElementById("a5").className = "alinkc";
    }
    else if (indexpp(130200) != "-1") {
        document.getElementById("a6").className = "alinkc";
    }
    else if (indexpp(130300) != "-1") {
        document.getElementById("a7").className = "alinkc";
    }
    else if (indexpp(130400) != "-1") {
        document.getElementById("a8").className = "alinkc";
    }
    else if (indexpp(140100) != "-1") {
        document.getElementById("a9").className = "alinkc";
    }
    else if (indexpp(140200) != "-1") {
        document.getElementById("a10").className = "alinkc";
    }
    else if (indexpp(140300) != "-1") {
        document.getElementById("a11").className = "alinkc";
    }
    else if (indexpp(140400) != "-1") {
        document.getElementById("a12").className = "alinkc";
    }
    else if (indexpp(110100) != "-1") {
        document.getElementById("a13").className = "alinksc";
    }
    else if (indexpp(110200) != "-1") {
        document.getElementById("a14").className = "alinksc";
    }
}

function indexpp(str2) {
    var str1 = window.location.href;
    var s = str1.indexOf(str2);
    return (s);
}

window.onload = function() {
    tick();
    geturl();
}
