//禁止使用右键 function Click(){ alert('不许动,哈哈哈哈!'); window.event.returnValue=false; } document.oncontextmenu=Click;
function $showdiv(objtitid,objconid){
if($(objconid).style.display=="none"){
$(objconid).style.display="block";
var Ka=navigator.userAgent.toLowerCase();
var rt=Ka.indexOf("opera")!=-1;
var r=Ka.indexOf("msie")!=-1&&(document.all&&!rt);
if(r){
document.attachEvent("onmousedown",function
(){$(objconid).style.display="none";
document.onmousedown = null; } );
$(objtitid).attachEvent("onmousedown",function(){event.cancelBubble=true;});
$(objconid).attachEvent("onmousedown",function(){event.cancelBubble=true;});
} else {
document.addEventListener("onmousedown",function
(){$(objconid).style.display=
"none";document.onmousedown = null;
},false);
$(objtitid).addEventListener("onmousedown",function(){event.cancelBubble=true;},false);
$(objconid).addEventListener("onmousedown",function(){event.cancelBubble=true;},false);
}
}else{
$(objconid).style.display="none";
}
}
//最大化、最小化
function $SH(id){
if($(id).style.display=='none'){
$(id).style.display='block';
}
else{
$(id).style.display='none';
}
}
//有图标的最大化最小化
function $SHimg(id,imgid){
if($(id).style.display=='none'){
$(id).style.display='block';
$(imgid).src="images/opentriangle.gif";
//$(imgid).style.background='url("images/opentriangle.gif")';
//$(imgid).style.backgroundRepeat='no-repeat';
//$(imgid).style.backgroundposition="5px";
}
else{
$(id).style.display='none';
$(imgid).src="images/triangle.gif";
//$CN(imgid,"tagtit")
//$(imgid).style.background='url("images/triangle.gif")';
//$(imgid).style.backgroundRepeat='no-repeat';
//$(imgid).style.backgroundposition="5px";
}
}
//左上
function $lu(divname){
document.getElementById(divname).style.top=(document.documentElement.scrollTop)+"px";
document.getElementById(divname).style.left=(document.documentElement.scrollLeft)+"px";
}
//右上
function $ru(divname){
document.getElementById(divname).style.top=(document.documentElement.scrollTop)+"px";
document.getElementById(divname).style.left=(document.documentElement.scrollLeft+
document.documentElement.clientWidth-document.getElementById(divname).offsetWidth)+"px";
}
//左下
function $ld(divname){
document.getElementById(divname).style.top=(document.documentElement.scrollTop+
document.documentElement.clientHeight-document.getElementById(divname).offsetHeight)+"px";
document.getElementById(divname).style.left=(document.documentElement.scrollLeft)+"px";
}
//右下
function $rd(divname){
document.getElementById(divname).style.top=(document.documentElement.scrollTop+
document.documentElement.clientHeight-document.getElementById(divname).offsetHeight)+"px";
document.getElementById(divname).style.left=(document.documentElement.scrollLeft+
document.documentElement.clientWidth-document.getElementById(divname).offsetWidth)+"px";
}
function $(objID) {
return document.getElementById(objID)
}
/*使用时仍要这样调用$(objid)
function $() {
return document.getElementById(arguments[0])
}
*/
function $F(objID,html){
$(objID).innerHTML=html;
}
function $FJ(objID,html){
$(objID).innerHTML+=html;
}
//改变样式名称
function $CN(objID,objClassName){
$(objID).className=objClassName;
}
//改变样式objstyle="none"是为不显示 objstyle="block"时为显示
function $CS(objID,objStyle)
{
$(objID).style.display=objStyle;
}
//此脚本为像QQ上线的冒泡提示调用方法:popmsg("消息内容")
var PopWidth=150; //信息框宽度
var PopHeight=80; //信息框高度
var PopBorder=25; //距屏幕边缘的距离
var PopShow=2000; //信息框的显示时间
var PopTop=0;
var showtime,hidetime;
var oPopup=window.createPopup();
function popmsg(msgstr){
oPopup.document.body.innerHTML='<table style="border:#84B9F4
solid 1px" width="'+PopWidth+
'"height="'+PopHeight+'" cellpadding="0"
cellspacing="0" bgcolor="#CFEEFA">'+'<tr><td
valign="top">' +msgstr+'</td></tr></table>';
//信息框的样式
popshow();
oPopup.document.body.onclick = pophide; //单击信息框时开始隐藏
}
function popshow(){
//信息框显示程序
var tmpHeight=PopTop<PopHeight?PopTop:PopHeight;//当不足以显示信息框全部时,缩小信息框高度
oPopup.show(screen.width - (PopWidth + PopBorder),screen.height-PopTop,PopWidth,tmpHeight);
//信息框定位,screen.width:屏幕宽度、screen.height:屏幕高度
if (PopTop < (PopHeight + PopBorder)){
PopTop = PopTop + 10; //信息框位置递增
}
else
{
setTimeout("pophide();", PopShow); //准备隐藏信息框
}
showtime = setTimeout("popshow();",100);
}
function pophide(){
//信息框隐藏程序
if (showtime) {
clearTimeout(showtime); //清除显示时间句柄
}
var tmpHeight=PopTop<PopHeight?PopTop:PopHeight;
oPopup.show(screen.width-(PopWidth+PopBorder),screen.height-PopTop,PopWidth,
tmpHeight);
if (PopTop>0){
PopTop=PopTop-10;
hidetime=setTimeout("pophide();",100);
}
else
{
clearTimeout(hidetime);
oPopup.hide(); //完全隐藏信息框
}
}
//========================冒泡提示结束
//日期函数
<!--
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="<font color=RED>星期日";
if (ww==1) ww="星期一";
if (ww==2) ww="星期二";
if (ww==3) ww="星期三";
if (ww==4) ww="星期四";
if (ww==5) ww="星期五";
if (ww==6) ww="<font color=RED>星期六";
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+"月";
var bsDate2=dd;
bsYear="农历";
bsYear2=Mn[miy]+Dn[dayim-1];
if (ss>=Ys[7]||ss<Ys[0]) bsYear=Yn[7];
function cal(){
document.write("<span title='"+bsYear+""+bsYear2+"'>"+bsDate+""+bsDate2+"日
");
document.write(bsWeek+"</span>");
}
//div 层的增加与减小
function ResizeDiv(obj,pm)
{
if(pm=="+")
$[obj].style.pixelHeight = $[obj].style.pixelHeight
+ 50;
else if(pm=="-")
$[obj].style.pixelHeight = $[obj].style.pixelHeight
- 50;
}
//控制字体大小
function setFontSize(id,pt){
try{
var t=document.getElementById(id);
if(t){
t.style.fontSize=pt+"pt";
}
}catch(e){}
} |