var pltsPop=null;
var pltsoffsetX = 10;   // 弹出窗口位于鼠标左侧或者右侧的距离；3-12 合适
var pltsoffsetY = 15;  // 弹出窗口位于鼠标下方的距离；3-12 合适
var pltsPopbg="#FFFFEE"; //背景色
var pltsPopfg="#ffffff"; //前景色
var pltsTitle="";
document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');
function pltsinits()
{
document.onmouseover   = plts;
document.onmousemove = moveToMouseLoc;
}
function plts()
{  var o=event.srcElement;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
pltsPop=o.dypop;
if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
{
pltsTipLayer.style.left=-1000;
pltsTipLayer.style.display='';
var Msg=pltsPop.replace(/\n/g,"<br>");
Msg=Msg.replace(/\0x13/g,"<br>");
var re=/\{(.[^\{]*)\}/ig;
if(!re.test(Msg))pltsTitle="信息提示";
else{
re=/\{(.[^\{]*)\}(.*)/ig;
pltsTitle=Msg.replace(re,"$1")+"&nbsp;";
re=/\{(.[^\{]*)\}/ig;
Msg=Msg.replace(re,"");
Msg=Msg.replace("<br>","");}
var content =
'<table style="FILTER:alpha(opacity=85) shadow(color=#808080,direction=145);" id=toolTipTalbe border=0 ><tr><td width="100%"><table class=tableBorder="1" cellspacing="1" cellpadding="0" style="width:100%">'+
'<tr id=pltsPoptop bgcolor="#000000"><th height=18 valign=bottom><font size="2" color=white><b><p id=topleft align=left>↖'+pltsTitle+'</p><p id=topright align=right style="display:none">'+pltsTitle+'↗</font></b></font></th></tr>'+
'<tr bgcolor="#000000"><td "+attr+" class=tablebody1 style="padding-left:14px;padding-right:14px;padding-top: 6px;padding-bottom:6px;line-height:135%">'+Msg+'</td></tr>'+
'<tr id=pltsPopbot style="display:none" bgcolor="#000000"><th height=18 valign=bottom><font color=white size="2"><b><p id=botleft align=left>↙'+pltsTitle+'</p><p id=botright align=right style="display:none">'+pltsTitle+'↘</font></b></font></th></tr>'+
'</table></td></tr></table>';
pltsTipLayer.innerHTML=content;
toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
moveToMouseLoc();
return true;
}
else
{
pltsTipLayer.innerHTML='';
pltsTipLayer.style.display='none';
return true;
}
}

function moveToMouseLoc()
{
if(pltsTipLayer.innerHTML=='')return true;
var MouseX=event.x;
var MouseY=event.y;
//window.status=event.y;
var popHeight=pltsTipLayer.clientHeight;
var popWidth=pltsTipLayer.clientWidth;
if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
{
popTopAdjust=-popHeight-pltsoffsetY*1.5;
pltsPoptop.style.display="none";
pltsPopbot.style.display="";
}
else
{
popTopAdjust=0;
pltsPoptop.style.display="";
pltsPopbot.style.display="none";
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
topleft.style.display="none";
botleft.style.display="none";
topright.style.display="";
botright.style.display="";
}
else
{
popLeftAdjust=0;
topleft.style.display="";
botleft.style.display="";
topright.style.display="none";
botright.style.display="none";
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;
}
pltsinits();

//复制地址
CopyURL=function(){
try{
clipboardData.setData('text',location.href); 
alert("复制成功，请把此网址在你喜欢的论坛或QQ里面发给你的朋友！");
}catch(e){
}
}
//文章内容字体控制
var initial_fontsize    = 10;
var initial_lineheight  = 18;
function fontsize(type,objname){
var whichEl = document.getElementById(objname);
if (whichEl!=null) {
if (type==1){
if(initial_fontsize<64){
whichEl.style.fontSize=(++initial_fontsize)+'pt';
whichEl.style.lineHeight=(++initial_lineheight)+'pt';
}
}else {
if(initial_fontsize>8){
whichEl.style.fontSize=(--initial_fontsize)+'pt';
whichEl.style.lineHeight=(--initial_lineheight)+'pt';
}
}
}
}
// 滚动脚本
var rollspeed=30
var myInter;
function MarqueeV(){
var ooRollV=document.getElementById("oRollV");
var ooRollV1=document.getElementById("oRollV1");
var ooRollV2=document.getElementById("oRollV2");
if(ooRollV2.offsetTop-ooRollV.scrollTop<=0) {
ooRollV.scrollTop-=ooRollV1.offsetHeight;
}else{
ooRollV.scrollTop++;
}
}
function StartRollV() {
var ooRollV=document.getElementById("oRollV");
var ooRollV1=document.getElementById("oRollV1");
var ooRollV2=document.getElementById("oRollV2");
if (ooRollV) {
if (parseInt(ooRollV.style.height)>=ooRollV2.offsetTop) {
ooRollV.style.height = ooRollV2.offsetTop;
return;
}
ooRollV2.innerHTML=ooRollV1.innerHTML;
myInter=setInterval(MarqueeV,rollspeed);
ooRollV.onmouseover=function() {clearInterval(myInter)};
ooRollV.onmouseout=function() {myInter=setInterval(MarqueeV,rollspeed)};
}
}
function MarqueeH(){
var ooRollH=document.getElementById("oRollH");
var ooRollH1=document.getElementById("oRollH1");
var ooRollH2=document.getElementById("oRollH2");
if(ooRollH2.offsetLeft-ooRollH.scrollLeft<=0) {
ooRollH.scrollLeft-=ooRollH1.offsetWidth;
}else{
ooRollH.scrollLeft++;
}
}
function StartRollH() {
var ooRollH=document.getElementById("oRollH");
var ooRollH1=document.getElementById("oRollH1");
var ooRollH2=document.getElementById("oRollH2");
if (ooRollH) {
if (parseInt(ooRollH.style.width)>=ooRollH2.offsetLeft) {
oRollH.style.width = oRollH2.offsetLeft;
return;
}
ooRollH2.innerHTML=ooRollH1.innerHTML;
myInter=setInterval(MarqueeH,rollspeed);
ooRollH.onmouseover=function() {clearInterval(myInter)};
ooRollH.onmouseout=function() {myInter=setInterval(MarqueeH,rollspeed)};
}
}
// 图片缩放脚本
var flag=true; 
function DrawImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width>=700){ 
ImgD.width=700; 
ImgD.height=(image.height*700)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
}  
} 
} 
// 图片缩放脚本
var flag=true; 
function DownImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width>=300){ 
ImgD.width=300; 
ImgD.height=(image.height*300)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
}  
} 
} 
// 图片脚本1--------------------------
function hx66img(img,url,alt,blank)
{
if (blank==null)
blank=false;
with(document){
write("<table class='hx66img'>");
write("<tr><td>");
write("<a href='");
write(url);
if (blank)
write("' >"); // 添加onClick='return newpage(this.href);'为跳窗脚本
else
write("' target='_blank'>");
write("<img width='120' height='80' src='"); //  在width='150'后面添加height='高度'为图片固定大小
write(img);
write("' title='");
write(alt);
write("' ");
write("></a></td></tr></table>");
}
}
// 图片脚本2--------------------------
function hximg(img,url,alt,blank)
{
if (blank==null)
blank=false;
with(document){
write("<table class='hx66img'>");
write("<tr><td>");
write("<a href='");
write(url);
if (blank)
write("' >"); // 添加onClick='return newpage(this.href);'为跳窗脚本
else
write("' target='_blank'>");
write("<img width='120' height='120' src='"); //  在width='150'后面添加height='高度'为图片固定大小
write(img);
write("' title='");
write(alt);
write("' ");
write("></a></td></tr></table>");
}
}
function showElement(sid) {
var whichEl = document.getElementById(sid);
if (whichEl!=null) {
if (whichEl.style.display == "none"){
whichEl.style.display='';
}else{
whichEl.style.display='none';
}
}
}

function ShowLink(sid) {
var whichEl = document.getElementById(sid);
if (whichEl!=null) {
if (whichEl.style.display == "none"){
whichEl.style.display='';
}else{
whichEl.style.display='none';
}
}
}
//创建一个数组,用于存放每个月的天数
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11) 
{
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;
}
//实现月历
function calendar() {
var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
year = today.getYear() +1900;
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2) firstDay.setDate(0);
startDay = firstDay.getDay();
document.write("<table width='185' align=center border='0' cellspacing='1' cellpadding='2' height=220>");
document.write("<TR><th colspan='7' bgcolor='#666666'>");
var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var now = new Date(); 
document.writeln("<TR bgcolor='#666666'><TH ><FONT STYLE='font-size:10pt;color:#FFFFFF'>日</FONT></TH>");
document.writeln("<th ><FONT STYLE='font-size:10pt;color:#FFFFFF'>一</FONT></TH>");
document.writeln("<TH ><FONT STYLE='font-size:10pt;color:#FFFFFF'>二</FONT></TH>");
document.writeln("<TH ><FONT STYLE='font-size:10pt;color:#FFFFFF'>三</FONT></TH>");
document.writeln("<TH ><FONT STYLE='font-size:10pt;color:#FFFFFF'>四</FONT></TH>");
document.writeln("<TH ><FONT STYLE='font-size:10pt;color:#FFFFFF'>五</FONT></TH>");
document.writeln("<TH ><FONT STYLE='font-size:10pt;color:#FFFFFF'>六</FONT></TH>");
document.write("</TR><TR>")
column = 0;
for (i=0; i<startDay; i++) {
document.writeln("\n<TD></TD>");
column++;
}

for (i=1; i<=nDays; i++) {
if (i == thisDay) {
document.writeln("</TD><TD ALIGN='CENTER' BGCOLOR='#666666'><B>")
}
else {
document.writeln("</TD><TD ALIGN='CENTER'>");
}
document.writeln(i);
if (i == thisDay) document.writeln("</FONT></TD>")
column++;
if (column == 7) {
document.writeln("<TR>"); 
column = 0;
}
}
document.writeln("<TR><TD COLSPAN='7' ALIGN='CENTER' VALIGN='TOP' >")
document.writeln("<FORM NAME='clock' onSubmit='0'>")
document.write("</TD></TR><TR><th colspan='7' bgcolor='#666666'>");
document.writeln("<FONT STYLE='font-size:10pt;color:#FFFFFF'>"+ now.getYear() + "年" + monthNames[now.getMonth()] + " " + now.getDate() + "日 " + dayNames[now.getDay()]);  
document.writeln("</TH></TR></TABLE>")
}

var timerID = null;
var timerRunning = false;

function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}

//显示当前时间
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = " " + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " 下午 " : " 上午 "
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);//设置超时,使时间动态显示
timerRunning = true;}

function startclock () {
stopclock();
showtime();}
function openwindow( url, winName, width, height) 
{
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ))
{
xposition = (screen.width - width) / 2;
yposition = (screen.height - height) / 2;
}
theproperty= "width=" + width + "," 
+ "height=" + height + "," 
+ "location=0," 
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=0,"
+ "status=0," 
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //仅适用于Netscape
+ "screeny=" + yposition + "," //仅适用于Netscape
+ "left=" + xposition + "," //IE
+ "top=" + yposition; //IE 
window.open( url,winName,theproperty );
}