cc.js
- /******************************************************************************
- Crossday Discuz! Board - Common Modules for Discuz!
- Modified by: Crossday Studio (http://crossday.com)
- Based upon: http://www.cnzzz.com
- *******************************************************************************/
- /* SkySoft.js
- * ==============
- * kernel of SkySoft js source, copyright by oursky.net, all rights reserved.
- * any use of this code or part of these code, must keep these lines
- *
- */
- // {{{ SSObject
- SSObj = function() {
- this.loaded = false;
- }
- SSp = SSObj.prototype;
- // fix IE memory leak?
- SSp.cleanListen = function() {
- for (var i in this.listens) {
- this.listens[i][0].detachEvent('on' + this.listens[i][1]);
- }
- }
- SSp.listen = function(target, name, handler) {
- var _SS = this;
- var cb = function(e) {
- _SS.applyEventHandler(target, handler, e);
- };
- if (target.addEventListener) {
- target.addEventListener(name, cb, false);
- }
- else if (target.attachEvent) {
- if (!this.listens) {
- this.listens = [];
- this.listen(window, 'unload', function(){_SS.cleanListen()});
- }
- this.listens[this.listens.length] = [target, name];
- target.attachEvent('on' + name, cb);
- }
- else {
- var oldhandler = target['on' + name];
- if (oldhandler) {
- target['on' + name] = function(e) {
- _SS.applyEventHandler(target, oldhandler, e);
- _SS.applyEventHandler(target, handler, e);
- }
- }
- else {
- target['on' + name] = cb;
- }
- }
- }
- SSp.applyEventHandler = function(target, handler, event) {
- if (!event) {
- event = window.event;
- if (!event) return;
- }
- if (handler.call) {
- ret = handler.call(target, event);
- }
- else if (handler instanceof Function) {
- target.__tmp = handler;
- ret = target.__tmp(event);
- }
- else if (handler) {
- ret = eval(handler);
- }
- else {
- return;
- }
- if (ret === false) {
- event.returnValue = ret;
- if (event.preventDefault) {
- event.preventDefault();
- }
- }
- if (event.cancelBubble && event.stopPropagation) {
- event.stopPropagation();
- }
- }
- SSp.getBody = function(doc) {
- doc = doc||document;
- return !is.cssCompatMode ? doc.documentElement : doc.body;
- }
- // create object
- SS = new SSObj();
- SS.listen(window, 'load', function() {SS.loaded = true});
- // }}}
- // {{{ browser detection
- /* code from dynapi3, Powered by oursky.net
- */
- function Browser() {
- var b = navigator.appName;
- var v = this.version = navigator.appVersion;
- var ua = navigator.userAgent.toLowerCase();
- this.v = parseInt(v);
- this.safari = ua.indexOf("safari") != -1; // always check for safari & opera
- this.opera = ua.indexOf("opera") != -1; // before ns or ie
- this.ns = !this.opera && !this.safari && (b=="Netscape");
- this.ie = !this.opera && (b=="Microsoft Internet Explorer");
- this.gecko = ua.indexOf('gecko') != -1;
- if (this.ns) {
- this.ns4 = (this.v==4);
- this.ns6 = (this.v>=5);
- this.b = "Netscape";
- }
- else if (this.ie) {
- this.v=parseFloat(v.substr(v.indexOf("MSIE")+4));
- if (this.v > 7) {}
- else if (this.v >= 6) {this.ie6 = true;}
- else if (this.v >= 5) {this.ie5 = true;}
- else if (this.v >= 4) {this.ie4 = true;}
- this.b = "MSIE";
- }
- else if (this.opera) {
- this.v=ua.substr(ua.indexOf("opera")+6,1) * 1; // set opera version
- if (this.v >= 7) {this.opera7 = true;}
- else if (this.v >= 6) {this.opera6 = true;}
- this.b = "Opera";
- }
- else if (this.safari) {
- this.ns6 = (this.v>=5); // ns6 compatible correct?
- this.b = "Safari";
- }
- this.dom = (document.createElement
- && document.appendChild
- && document.getElementsByTagName)? true : false;
- this.def = (this.ie||this.dom);
- this.win32 = ua.indexOf("win")>-1;
- if (this.win32) {
- this.win = true;
- if (ua.indexOf("nt")>-1) {
- this.nt = true;
- if (ua.indexOf("nt 5")>-1) {
- this.nt5 = true;
- if (ua.indexOf("nt 5.1")>-1) {
- this.nt51 = true
- }
- }
- }
- }
- else if (ua.indexOf("mac")>-1) { this.mac = true; }
- else if (ua.indexOf("x11")>-1) { this.x = true; }
- this.filter = this.ie && this.v>=6;
- this.other = (!this.win32 && !this.mac);
- this.detectCharset();
- var minver = navigator.appMinorVersion||'';
- if (minver.indexOf('SP1')) this.sp1 = true;
- this.hand = this.ie ? 'hand' : 'pointer';
- this.blankpage = this.opera ?
- (self.siteurl||'') + '/blank.html' : 'about:blank';
- this.cssCompatMode = !document.compatMode||
- document.compatMode=='BackCompat';
- this.supported = (this.def||this.ns4||this.ns6||this.opera);
- if (!this.supported) {
- window.status = '无法识别的浏览器. 本站脚本可能不支持该浏览器.';
- }
- if (!window.navigate) {
- window.navigate = function(url) {
- window.location.href = phpurl(url);
- }
- }
- }
- Browser.prototype.detectCharset = function () {
- if (!self.document) return setTimeout("is.detectCharset()", 0);
- this.en = this.english = self.english;
- this.charset = (document.charset||document.characterSet||"").toLowerCase();
- var c = this.charset;
- this.cht = (c=="big5"||c=="big5-hkscs"||c=="euc-tw");
- // gb2312 hz-gb-2312 x-gbk
- this.chs = (c.indexOf("gb")>=0?true:false);
- }
- is = SS.browser = new Browser();
- var ie = is.ie;
- var ns = is.ns;
- // }}}
- // {{{ title
- var titleCurTitle = null;
- var titleCurObj = null;
- var titleDiv = null;
- var titleDiv1 = null;
- var titleDivS = null;
- var titleAlpha = 80;
- var useRadiusShadow = false;
- var titleAlphaS = 50;
- var title_tmr = 0;
- var titlehide_tmr = 0;
- var titleShowing = false;
- var titleHalfShowing = false;
- var titleHideDelay = 100;
- var titleShowDelay = 300;
- var titleEvent = [];
- var titleHoverobj = null;
- var titleBgColor = "#CCEEFF";
- var title_ifmhtml = '\
- <iframe id="mytitle1" frameborder="0" \
- scroll="no" style="display:none" src="'+is.blankpage+'"\
- onload="setTimeout(titleInit,1000)">IFrame</iframe>';
- function insertTitle()
- {
- if (!self.document || !self.document.body) return false;
- if (self.noTitleCreate) {
- return false;
- }
- var b = SS.getBody(document);
- if (!is.dom && !b.appendChild) {
- return false;
- }
- if (is.ie && is.v >= 5.5) {
- b.insertAdjacentHTML("BeforeEnd", title_ifmhtml);
- titleDiv1 = document.getElementById("mytitle1");
- if (useRadiusShadow) {
- titleDivS = document.createElement("DIV");
- titleDivS.id = "mytitleshadow";
- b.appendChild(titleDivS);
- titleAlpha = 100;
- }
- }
- titleDiv = document.createElement("DIV");
- titleDiv.id = "mytitle";
- b.appendChild(titleDiv);
- titleInit();
- }
- function titleInit()
- {
- if (titleDiv1) {
- var ts1 = titleDiv1.style;
- ts1.position = "absolute";
- ts1.display = "none";
- if (is.filter) {
- try { ts1.filter = "alpha(opacity=1)"; }
- catch(e) {}
- }
- }
- if (titleDivS) {
- var tsS = titleDivS.style;
- tsS.position = "absolute";
- tsS.display = "none";
- tsS.backgroundColor = 'black';
- if (is.filter) {
- try { tsS.filter = "progid:DXImageTransform.Microsoft.Blur("+
- "PixelRadius=2,MakeShadow=true" +
- ",ShadowOpacity="+(titleAlphaS/100)+")"; }
- catch(e) {}
- }
- tsS.fontSize = "1px";
- tsS.lineHeight = "1px";
- }
- if (!titleDiv) {
- return false;
- }
- var t = titleDiv;
- t.align = "left";
- var s = t.style;
- s.position = 'absolute';
- s.width = "auto";
- s.color = "black";
- s.display = "none";
- s.border = "solid";
- s.borderColor = "black";
- s.borderWidth = "1px";
- s.backgroundColor = titleBgColor;
- s.cursor = 'default';
- titleHalfShowing = true;
- if (is.filter) {
- s.filter = (titleDivS ? "" : "progid:DXImageTransform.Microsoft" +
- ".dropShadow(OffX=5, OffY=5, Color='#3a5f5c',Positive='true')")
- + "alpha(opacity="+Math.floor(titleAlpha/2)+")";
- }
- s.MozOpacity = titleAlpha / 200;
- /*
- s.paddingTop = "2px";
- s.paddingLeft = "2px";
- s.paddingRight = "2px";
- s.paddingBottom = "1px";
- s.fontSize = "12px";
- */
- s.padding = "4px";
- s.fontSize = "12px";
- s.fontFamily = "Georgia, Tahoma, Verdana";
- s.lineHeight = "14px";
- }
- function titleDetection(o)
- {
- var e_parent;
- if (is.ie) e_parent = "parentElement";
- else if (is.def) e_parent = "parentNode";
- else return;
- var p = o;
- // search for title
- var title;
- for (var depth = 0;
- depth <= 3 && p && p.tagName;
- depth ++, p=p[e_parent]) {
- if (p.mytitle) {
- o.mytitle = p.mytitle;
- if (o.alt && is.ie) o.alt = '';
- if (o.title) o.title = '';
- break;
- }
- title = p.getAttribute('title')||p.getAttribute('alt');
- if (title && typeof title == 'string') {
- title = title.replace(/(\n|\\\\n)/g, "<br>");
- o.mytitle = title;
- if (o.alt && is.ie) o.alt = '';
- if (o.title) o.title = '';
- p.mytitle = title;
- if (p.alt && is.ie) p.alt = '';
- if (p.title) p.title = '';
- break;
- }
- }
- }
- function titleTrack(e) {
- if (!e) {
- e = window.event;
- if (!e) return;
- }
- if (titleShowing&&(e.shiftKey||e.ctrlKey||e.altKey)) return;
- var o = !is.ie ?
- e_getSrc(e) : document.elementFromPoint(e.clientX, e.clientY);
- if (titleCurObj == o) {
- return;
- }
- if (!o) return;
- if (e.type != "mouseout" && typeof o.mytitle == "undefined") {
- titleDetection(o);
- }
- if (!o.mytitle && !titleCurObj) return;
- var mytitle = o.mytitle
- if (e.type == "mouseout") mytitle = "";
- // overlap?
- if (o.id == "mytitle") {
- titleEvent = {clientX: e.clientX, clientY: e.clientY};
- titleShow(true);
- }
- else if (mytitle && mytitle != titleCurTitle) {
- titleCurTitle = String(mytitle);
- titleCurObj = o;
- titleEvent = {clientX: e.clientX, clientY: e.clientY};
- if (titlehide_tmr) { clearTimeout(titlehide_tmr); titlehide_tmr = 0}
- if (title_tmr) { clearTimeout(title_tmr); title_tmr = 0; }
- if (titleShowing) titleShow(); // update now
- else title_tmr = setTimeout(titleShow, titleShowDelay*.7);
- }
- else if (!mytitle && titleCurTitle) {
- titleCurTitle = null;
- titleCurObj = null;
- if (titlehide_tmr) clearTimeout(titlehide_tmr);
- titlehide_tmr = setTimeout(titleHide, titleHideDelay*.7);
- if (title_tmr) clearTimeout(title_tmr);
- title_tmr = setTimeout('titleShowing = false;', titleShowDelay);
- }
- }
- function titleHide(hide)
- {
- if (!titleDiv) { return }
- if (hide === true) {
- if (titleDiv) {titleDiv.style.display = "none";}
- if (titleDiv1)titleDiv1.style.display = "none";
- }
- else {
- if (titleDivS)titleDivS.style.display = "none";
- titlehide_tmr = setTimeout("titleHide(true)", titleHideDelay*.3);
- titleHalfShowing = true;
- titleDiv.style.MozOpacity = titleAlpha / 200;
- if (is.filter) {
- try{titleDiv.filters.item("alpha").opacity = Math.floor(titleAlpha/2);}
- catch(e){}
- }
- }
- if (document.onmouseout == titleTrack) {
- document.onmouseout = null;
- }
- }
- function titleShow(updnow)
- {
- if (!titleDiv) {
- if (!SS.loaded || insertTitle() === false) {
- return setTimeout(function(){titleShow(updnow)},1000);
- }
- }
- var e = titleEvent;
- if (!titleDiv||!titleCurTitle) return;
- var b = SS.getBody();
- var t = titleDiv, ts = titleDiv.style;
- var sclLeft = b.scrollLeft;
- var sclTop = b.scrollTop;
- // where we place
- var x = e.clientX + sclLeft;
- var y = e.clientY + sclTop ;
- var docWidth = is.ie? b.clientWidth : window.innerWidth;
- var docHeight = is.ie? b.clientHeight : window.innerHeight;
- t.innerHTML = "<nobr>"+titleCurTitle+"</nobr>";
- ts.position = 'absolute';
- ts.display = 'block';
- var divWidth = t.offsetWidth ||t.scrollWidth;
- var divHeight = t.offsetHeight||t.scrollHeight;
- ts.display = 'none';
- var maxX = sclLeft + docWidth - divWidth - 30;
- var maxY = sclTop + docHeight - divHeight - 30;
- if (divWidth) x = Math.max(5, Math.min(x, maxX));
- if (divHeight && y>maxY) y = Math.max(5, maxY - divHeight*2);
- ts.left = (x - 5) + 'px';
- ts.top = (y + 24) + 'px';
- ts.display = 'block';
- titleShowing = true;
- if (titleHalfShowing) {
- title_tmr = setTimeout(function(){
- titleHalfShowing = false;
- titleDiv.style.MozOpacity = titleAlpha/100;
- if (is.filter) {
- try{titleDiv.filters.item("alpha").opacity = titleAlpha;}
- catch(e){}
- }
- if (titleDivS) {
- titleDivS.style.display = 'block';
- titleDivS.style.position = 'absolute';
- }
- }, titleShowDelay*.3);
- }
- if (titleDiv1) {
- var ts1 = titleDiv1.style;
- ts1.position = 'absolute';
- ts1.display = 'block';
- ts1.width = divWidth + "px";
- ts1.height = divHeight + "px";
- ts1.left = ts.left;
- ts1.top = ts.top;
- }
- if (titleDivS) {
- var tsS = titleDivS.style;
- tsS.width = (divWidth - 5) + "px";
- tsS.height = (divHeight - 2) + "px";
- tsS.left = x + 'px';
- tsS.top = (y + 24 + 2) + 'px';
- }
- }
- if (is.ie && is.v >= 5.5 || is.gecko) {
- SS.listen(document, 'mousemove', titleTrack);
- }
- // }}}
- // {{{ functions for event
- function e_getSrc(e)
- {
- var o = e.srcElement||e.target;
- if (!o) return null;
- if (o.nodeName=="#text") o=o.parentNode;
- return o;
- }
- // }}}
- //
- function ctlent(obj) {
- if((event.ctrlKey && window.event.keyCode == 13) || (event.altKey && window.event.keyCode == 83)) {
- //if(validate(this.document.input))
- this.document.input.submit();
- }
- }
- function checkall(form) {
- for(var i = 0;i < form.elements.length; i++) {
- var e = form.elements[i];
- if (e.name != 'chkall') {
- e.checked = form.chkall.checked;
- }
- }
- }
- function findobj(n, d) {
- var p,i,x; if(!d) d=document;
- if((p=n.indexOf("?"))>0 && parent.frames.length) {
- d=parent.frames[n.substring(p+1)].document;
- n=n.substring(0,p);
- }
- if(!(x=d[n])&&d.all) {
- x=d.all[n];
- }
- for(i=0;!x && i<d.forms.length;i++) {
- x=d.forms[i][n];
- }
- for(i=0;!x && d.layers&&i>d.layers.length;i++) {
- x=MM_findObj(n,d.layers[i].document);
- }
- return x;
- }
- function copycode(obj) {
- var rng = document.body.createTextRange();
- rng.moveToElementText(obj);
- rng.scrollIntoView();
- rng.select();
- rng.execCommand("Copy");
- rng.collapse(false);
- }
- //HTML test windows by Niceweb
- /*
- function runHtml(id) {
- var code=id.value;
- var newwin=window.open('', '', 'width=600, height=400, status=yes, menubar=yes, toolbar=no, directies=yes, resizable=yes, scrollbars=yes');
- newwin.opener = null ;
- newwin.document.write(code);
- newwin.document.close();
- }
- function saveCode(id) {
- var code=id.value;
- var pop=window.open('','_blank','top=10000');
- pop.document.writeln(code);
- pop.document.execCommand('saveas','','code.html');
- pop.close();
- }
- */
- function runHtml(obj) {
- var winname = window.open('', "_blank", '');
- winname.document.open('text/html', 'replace');
- winname.document.writeln(obj.value);
- winname.document.close();
- }
- function saveCode(obj) {
- var winname = window.open('', '_blank', 'top=10000');
- winname.document.open('text/html', 'replace');
- winname.document.writeln(obj.value);
- winname.document.execCommand('saveas','','code.htm');
- winname.close();
- }
- function reverse(id) {
- text = "";
- str=id.value;
- for (i = 0; i <= str.length; i++)
- {
- text = str.substring(i, i+1) + text;
- }
- id.value=text;
- }
- function htmlresize(id)
- {
- var o=id;
- var docheight = document.body.clientHeight;
- o.style.height = o.expandstatus ? 200 : 0;
- o.expandstatus = !o.expandstatus;
- }
- //HTML test windows End Enhenced by DyNE
- function multiresize(id)
- {
- var o=id;
- var docheight = document.body.clientHeight;
- o.style.height = o.expandstatus ? 0 : 200;
- o.expandstatus = !o.expandstatus;
- }
- nereidFadeObjects = new Object();
- nereidFadeTimers = new Object();
- function nereidFade(object, destOp, rate, delta){
- if (!document.all)
- return
- if (object != "[object]"){ //do this so I can take a string too
- setTimeout("nereidFade("+object+", "+destOp+", "+rate+", "+delta+")", 0);
- return;
- }
- clearTimeout(nereidFadeTimers[object.sourceIndex]);
- diff = destOp-object.filters.alpha.opacity;
- direction = 1;
- if (object.filters.alpha.opacity > destOp){
- direction = -1;
- }
- delta=Math.min(direction*diff,delta);
- object.filters.alpha.opacity+=direction*delta;
- if (object.filters.alpha.opacity != destOp){
- nereidFadeObjects[object.sourceIndex]=object;
- nereidFadeTimers[object.sourceIndex] = setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"], "+destOp+", "+rate+","+delta+")", rate);
- }
- }
- <!--
- var menuOffX=0 //菜单距连接文字最左端距离
- var menuOffY=18 //菜单距连接文字顶端距离
- var fo_shadows=new Array()
- var linkset=new Array()
- var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
- var ns6=document.getElementById&&!document.all
- var ns4=document.layers
- function openScript(url, width, height){
- var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
- }
- function showmenu(e,vmenu,mod){
- if (!document.all&&!document.getElementById&&!document.layers)
- return
- which=vmenu
- clearhidemenu()
- ie_clearshadow()
- menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
- menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
-
- if (ie4||ns6)
- menuobj.innerHTML=which
- else{
- menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
- menuobj.document.close()
- }
- menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
- menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
-
- eventX=ie4? event.clientX : ns6? e.clientX : e.x
- eventY=ie4? event.clientY : ns6? e.clientY : e.y
-
- var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
- var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY
- if (rightedge<menuobj.contentwidth)
- menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
- else
- menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX : ns6? window.pageXOffset+eventX : eventX
-
- if (bottomedge<menuobj.contentheight&&mod!=0)
- menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY
- else
- menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY
- menuobj.thestyle.visibility="visible"
- ie_dropshadow(menuobj,"#999999",3)
- return false
- }
- function ie_y(e){
- var t=e.offsetTop;
- while(e=e.offsetParent){
- t+=e.offsetTop;
- }
- return t;
- }
- function ie_x(e){
- var l=e.offsetLeft;
- while(e=e.offsetParent){
- l+=e.offsetLeft;
- }
- return l;
- }
- function ie_dropshadow(el, color, size)
- {
- var i;
- for (i=size; i>0; i--)
- {
- var rect = document.createElement('div');
- var rs = rect.style
- rs.position = 'absolute';
- rs.left = (el.style.posLeft + i) + 'px';
- rs.top = (el.style.posTop + i) + 'px';
- rs.width = el.offsetWidth + 'px';
- rs.height = el.offsetHeight + 'px';
- rs.zIndex = el.style.zIndex - i;
- rs.backgroundColor = color;
- var opacity = 1 - i / (i + 1);
- rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
- //el.insertAdjacentElement('afterEnd', rect);
- fo_shadows[fo_shadows.length] = rect;
- }
- }
- function ie_clearshadow()
- {
- for(var i=0;i<fo_shadows.length;i++)
- {
- if (fo_shadows[i])
- fo_shadows[i].style.display="none"
- }
- fo_shadows=new Array();
- }
- function contains_ns6(a, b) {
- while (b.parentNode)
- if ((b = b.parentNode) == a)
- return true;
- return false;
- }
- function hidemenu(){
- if (window.menuobj)
- menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
- ie_clearshadow()
- }
- function dynamichide(e){
- if (ie4&&!menuobj.contains(e.toElement))
- hidemenu()
- else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
- hidemenu()
- }
- function delayhidemenu(){
- if (ie4||ns6||ns4)
- delayhide=setTimeout("hidemenu()",500)
- }
- function clearhidemenu(){
- if (window.delayhide)
- clearTimeout(delayhide)
- }
- function highlightmenu(e,state){
- if (document.all)
- source_el=event.srcElement
- else if (document.getElementById)
- source_el=e.target
- if (source_el.className=="menuitems"){
- source_el.id=(state=="on")? "mouseoverstyle" : ""
- }
- else{
- while(source_el.id!="popmenu"){
- source_el=document.getElementById? source_el.parentNode : source_el.parentElement
- if (source_el.className=="menuitems"){
- source_el.id=(state=="on")? "mouseoverstyle" : ""
- }
- }
- }
- }
- //-->
复制代码
common.js
- /******************************************************************************
- Crossday Discuz! Board - Common Modules for Discuz!
- Modified by: Crossday Studio (http://crossday.com)
- Based upon: http://www.cnzzz.com
- *******************************************************************************/
- var sPop = null;
- var postSubmited = false;
- function ctlent(obj) {
- if(postSubmited == false && (event.ctrlKey && window.event.keyCode == 13) || (event.altKey && window.event.keyCode == 83)) {
- if(this.document.input.pmsubmit) {
- postSubmited = true;
- this.document.input.pmsubmit.disabled = true;
- this.document.input.submit();
- } else if(validate(this.document.input)) {
- postSubmited = true;
- if(this.document.input.topicsubmit) this.document.input.topicsubmit.disabled = true;
- if(this.document.input.replysubmit) this.document.input.replysubmit.disabled = true;
- if(this.document.input.editsubmit) this.document.input.editsubmit.disabled = true;
- this.document.input.submit();
- }
- }
- }
- function checkall(form, prefix) {
- for(var i = 0; i < form.elements.length; i++) {
- var e = form.elements[i];
- if(e.name != 'chkall' && (!prefix || (prefix && e.name.match(prefix)))) {
- e.checked = form.chkall.checked;
- }
- }
- }
- function findobj(n, d) {
- var p,i,x; if(!d) d=document;
- if((p=n.indexOf("?"))>0 && parent.frames.length) {
- d=parent.frames[n.substring(p+1)].document;
- n=n.substring(0,p);
- }
- if(!(x=d[n])&&d.all) x=d.all[n];
- for(i=0;!x && i<d.forms.length;i++) x=d.forms[i][n];
- for(i=0;!x && d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
- return x;
- }
- function copycode(obj) {
- var rng = document.body.createTextRange();
- rng.moveToElementText(obj);
- rng.scrollIntoView();
- rng.select();
- rng.execCommand("Copy");
- rng.collapse(false);
- }
- function dzconfirm(theURL, ConfirmMsg) {
- if (confirm( ConfirmMsg )) {
- window.location.href=theURL;
- } else {
- return;
- }
- }
- <!--
- var menuOffX=0 //菜单距连接文字最左端距离
- var menuOffY=18 //菜单距连接文字顶端距离
- var fo_shadows=new Array()
- var linkset=new Array()
- var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
- var ns6=document.getElementById&&!document.all
- var ns4=document.layers
- function openScript(url, width, height){
- var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
- }
- function showmenu(e,vmenu,mod){
- if (!document.all&&!document.getElementById&&!document.layers)
- return
- which=vmenu
- clearhidemenu()
- ie_clearshadow()
- menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
- menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
-
- if (ie4||ns6)
- menuobj.innerHTML=which
- else{
- menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
- menuobj.document.close()
- }
- menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
- menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
-
- eventX=ie4? event.clientX : ns6? e.clientX : e.x
- eventY=ie4? event.clientY : ns6? e.clientY : e.y
-
- var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
- var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY
- if (rightedge<menuobj.contentwidth)
- menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
- else
- menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX : ns6? window.pageXOffset+eventX : eventX
-
- if (bottomedge<menuobj.contentheight&&mod!=0)
- menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY
- else
- menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY
- menuobj.thestyle.visibility="visible"
- ie_dropshadow(menuobj,"#999999",3)
- return false
- }
- function ie_y(e){
- var t=e.offsetTop;
- while(e=e.offsetParent){
- t+=e.offsetTop;
- }
- return t;
- }
- function ie_x(e){
- var l=e.offsetLeft;
- while(e=e.offsetParent){
- l+=e.offsetLeft;
- }
- return l;
- }
- function ie_dropshadow(el, color, size)
- {
- var i;
- for (i=size; i>0; i--)
- {
- var rect = document.createElement('div');
- var rs = rect.style
- rs.position = 'absolute';
- rs.left = (el.style.posLeft + i) + 'px';
- rs.top = (el.style.posTop + i) + 'px';
- rs.width = el.offsetWidth + 'px';
- rs.height = el.offsetHeight + 'px';
- rs.zIndex = el.style.zIndex - i;
- rs.backgroundColor = color;
- var opacity = 1 - i / (i + 1);
- rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
- //el.insertAdjacentElement('afterEnd', rect);
- fo_shadows[fo_shadows.length] = rect;
- }
- }
- function ie_clearshadow()
- {
- for(var i=0;i<fo_shadows.length;i++)
- {
- if (fo_shadows[i])
- fo_shadows[i].style.display="none"
- }
- fo_shadows=new Array();
- }
- function contains_ns6(a, b) {
- while (b.parentNode)
- if ((b = b.parentNode) == a)
- return true;
- return false;
- }
- function hidemenu(){
- if (window.menuobj)
- menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
- ie_clearshadow()
- }
- function dynamichide(e){
- if (ie4&&!menuobj.contains(e.toElement))
- hidemenu()
- else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
- hidemenu()
- }
- function delayhidemenu(){
- if (ie4||ns6||ns4)
- delayhide=setTimeout("hidemenu()",500)
- }
- function clearhidemenu(){
- if (window.delayhide)
- clearTimeout(delayhide)
- }
- function highlightmenu(e,state){
- if (document.all)
- source_el=event.srcElement
- else if (document.getElementById)
- source_el=e.target
- if (source_el.className=="menuitems"){
- source_el.id=(state=="on")? "mouseoverstyle" : ""
- }
- else{
- while(source_el.id!="popmenu"){
- source_el=document.getElementById? source_el.parentNode : source_el.parentElement
- if (source_el.className=="menuitems"){
- source_el.id=(state=="on")? "mouseoverstyle" : ""
- }
- }
- }
- }
- //-->
- document.write("<style type='text/css'id='defaultPopStyle'>");
- document.write(".cPopText { font-family: Verdana, Tahoma; background-color: #FFFFFF; border: 1px #999999 dashed; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80)}");
- document.write("</style>");
- document.write("<div id='popLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
- function showPopupText() {
- var o=event.srcElement;
- MouseX=event.x;
- MouseY=event.y;
- if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
- if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
- if(o.pop!=sPop) {
- sPop=o.pop;
- if(sPop==null || sPop=="") {
- popLayer.style.visibility="hidden";
- } else {
- if(o.dyclass!=null) popStyle=o.dyclass
- else popStyle="cPopText";
- popLayer.style.visibility="visible";
- showIt();
- }
- }
- }
- function showIt() {
- popLayer.className=popStyle;
- popLayer.innerHTML=sPop;
-
- //popLayer.innerHTML=sPop.replace(/<(.*)>/g,"<$1>").replace(/\n/g,"<br>");;
- popWidth=popLayer.clientWidth;
- popHeight=popLayer.clientHeight;
- if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
- else popLeftAdjust=0;
- if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
- else popTopAdjust=0;
- popLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
- popLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
- }
- document.onmouseover=showPopupText;
复制代码 |