// JavaScript Document
//-----------------top读取系统时间----------------------
function getdates()
{
var w_array=new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
var d=new Date();
var year=d.getFullYear();
var month=d.getMonth()+1;
var day=d.getDate();
var week=d.getDay();
var h=d.getHours();
var mins=d.getMinutes();
var s=d.getSeconds();
if(month<10) month="0" + month
if(day<10) month="0" + day
if(h<10) h="0" + h
if(mins<10) mins="0" + mins
if(s<10) s="0" + s
var shows="今天是:" + year + "-" +month + "-" + day + " " + h + ":" + mins + ":" + s + " " + w_array[week];
document.getElementById("top_date").innerHTML=shows;
setTimeout("getdates()",1000);
}
// ----------------加入收藏 加入收藏-----------------------
function AddFavorite(sURL, sTitle)
{
try
{
window.external.addFavorite(sURL, sTitle);
}
catch (e)
{
try
{
window.sidebar.addPanel(sTitle, sURL, "");
}
catch (e)
{
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
}
//----------------设为首页 设为首页----------------------------
function SetHome(obj,vrl){
try{
obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
}
catch(e){
if(window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',vrl);
}
}
}
//------------------------文字想左滚动----------------------------------
function TxtRoll(){
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML=document.getElementById("demo1").innerHTML;
function Marquee(){
if(demo.scrollLeft-demo2.offsetWidth>=0){
demo.scrollLeft-=demo1.offsetWidth;
}
else{
demo.scrollLeft++;
}
}
var myvar=setInterval(Marquee,30);
demo.onmouseout=function (){myvar=setInterval(Marquee,30);}
demo.onmouseover=function(){clearInterval(myvar);}
}
//--------------------导航条背景及下拉菜单---------------------------------
$(function(){
$("a.Favorite").Favorite();$("a.Homepage").Homepage();
$("#nav li:last").css({"background":"none"});
$("#nav li").mousemove(function(){
$(this).addClass("on").siblings().removeClass("on");
$(this).find("ul").css({"display":"block"}).siblings("#nav li ul").css({"display":"none"});
});
$("#nav li").mouseleave(function(){
$(this).find("ul").css({"display":"none"});
});
$("#index_ad").adFlash2({
});
$("a[href='']").attr({"href":"javascript:;","target":"_self"});
});
$(function(){
$("a.Favorite").Favorite();$("a.Homepage").Homepage();
//$("#nav1 li:last").css({"background":"none"});
$("#nav1 li").mousemove(function(){
$(this).addClass("on").siblings().removeClass("on");
$(this).find("ul").css({"display":"block"}).siblings("#nav li ul").css({"display":"none"});
});
$("#nav1 li").mouseleave(function(){
$(this).find("ul").css({"display":"none"});
});
$("#index_ad").adFlash2({
});
$("a[href='']").attr({"href":"javascript:;","target":"_self"});
});