/******************************************************************************
  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 h;
var l;
var t;
var isvisible;
function HideMenu() 
{
var mX;
var mY;
var vDiv;
    if (isvisible == true)
{
        vDiv = document.all("menuDiv");
        mX = window.event.clientX + document.body.scrollLeft;
        mY = window.event.clientY + document.body.scrollTop;
        if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
            vDiv.style.visibility = "hidden";
            isvisible = false;
        }
    }
}

function ShowMenu(vMnuCode) {
    vSrc = window.event.srcElement;
    vMnuCode = "<DIV style='PADDING-RIGHT: 6px; FILTER: shadow(color=#5F5F5F,direction=120); PADDING-BOTTOM: 6px;width:98px'><table border=0 cellspacing=1 cellpadding=4 bgcolor=#DDE3EC style='line-height:18px' width='98' align='left'><tr bgcolor='#FFFFFF'><td width=14 background=images/pet/menubg.gif>&nbsp;</td><td>" + vMnuCode + "</td></tr></table></div>";
    h = vSrc.offsetHeight + 0;
    l = vSrc.offsetLeft + 0;
    t = vSrc.offsetTop + h;
    vParent = vSrc.offsetParent;
    while (vParent.tagName.toUpperCase() != "BODY")
    {
        l += vParent.offsetLeft;
        t += vParent.offsetTop;
        vParent = vParent.offsetParent;
    }

    menuDiv.innerHTML = vMnuCode;
    menuDiv.style.top = t;
    menuDiv.style.left = l;
    menuDiv.style.visibility = "visible";
    isvisible = true;
    
}
//-->
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { font-family: Verdana, Tahoma; background-color: #DDEEFF; border: 1px #8899AA 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.replace(/<(.*)>/g,"&lt;$1&gt;").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;
function imgzoom(o){var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';return false;}
function Download(ForumNo,TopicNo,ReplyNo){
document.Download.forum.value=ForumNo;
document.Download.topic.value=TopicNo;
document.Download.reply.value=ReplyNo;
document.Download.submit();
}

