var sPop = null;
var postSubmited = false;
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { font-family: Tahoma, ËÎÌå;color:#613813;background-color: #eddecd; border: 1px #000000 solid; font-size: 11px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=75)}");

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) { o.pop=o.pop.replace("\n","<br>"); o.pop=o.pop.replace("\n","<br>"); }
	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;
	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;
}

function ctlent(obj) {
	if(postSubmited == false && (event.ctrlKey && window.event.keyCode == 13) || (event.altKey && window.event.keyCode == 83)) {
			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;
			postSubmited = true;
			this.document.input.submit();
	}
}

var flag=false; 
function DrawImage(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width>=728){ 
			ImgD.width=728; 
			ImgD.height=(image.height*728)/image.width; 
		}else{ 
			ImgD.width=image.width; 
			ImgD.height=image.height; 
		}  
	} 
} 

function showIntro(objID)
{
	if (document.getElementById(objID).style.display == "none") {
		document.getElementById(objID).style.display = "";
	}else{
		document.getElementById(objID).style.display = "none";
	}
}

function winconfirm(confirmMSG,confirmURL){
	question = confirm(confirmMSG);
	if (question != "0"){
		window.location=confirmURL;
	}
}

function CopyText(obj) {
	ie = (document.all)? true:false
	if (ie){
		var rng = document.body.createTextRange();
		rng.moveToElementText(obj);
		rng.scrollIntoView();
		rng.select();
		rng.execCommand("Copy");
		rng.collapse(false);
	}
}
document.onmouseover=showPopupText;

function ubbShowObj(strType,strID,strURL,intWidth,intHeight)
{
	var varHeader="b";
	var tmpstr="";
	var bSwitch = false;
	bSwitch = document.getElementById(varHeader+strID).value;
	bSwitch	=~bSwitch;
	document.getElementById(varHeader+strID).value = bSwitch;
	if(bSwitch){
		document.getElementById(strID).innerHTML = "<A href='"+strURL+"' target='_blank' alt='"+strURL+"'>Source URL</a>";
	}else{
		switch(strType){
			case "swf":
				tmpstr="<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width="+intWidth+" height="+intHeight+"><param name=movie value='"+strURL+"'><param name=quality value=high><param name=AllowScriptAccess value=never><embed src="+strURL+" quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width="+intWidth+" height="+intHeight+">"+strURL+"</embed></OBJECT>";
				break;
			case "wma":
				tmpstr="<OBJECT classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' type='application/x-oleobject' standby='Loading...' width="+intWidth+" height="+intHeight+"><PARAM NAME='FileName' VALUE='"+strURL+"'><param name='ShowStatusBar' value='-1'><PARAM NAME='AutoStart' VALUE='true'><EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' SRC='"+strURL+"' AutoStart=true width="+intWidth+" height="+intHeight+"></EMBED></OBJECT>";
				break;
			case "wmv":
				tmpstr="<OBJECT classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' type='application/x-oleobject' standby='Loading...' width="+intWidth+" height="+intHeight+"><PARAM NAME='FileName' VALUE='"+strURL+"'><param name='ShowStatusBar' value='-1'><PARAM NAME='AutoStart' VALUE='true'><EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' SRC='"+strURL+"' AutoStart=true width="+intWidth+" height="+intHeight+"></EMBED></OBJECT>";
				break;
			case "mp3":
				tmpstr="<OBJECT classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' type='application/x-oleobject' standby='Loading...' width="+intWidth+" height="+intHeight+"><PARAM NAME='FileName' VALUE='"+strURL+"'><param name='ShowStatusBar' value='-1'><PARAM NAME='AutoStart' VALUE='true'><EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' SRC='"+strURL+"' AutoStart=true width="+intWidth+" height="+intHeight+"></EMBED></OBJECT>";
				break;
			case "mid":
				tmpstr="<OBJECT classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' type='application/x-oleobject' standby='Loading...' width="+intWidth+" height="+intHeight+"><PARAM NAME='FileName' VALUE='"+strURL+"'><param name='ShowStatusBar' value='-1'><PARAM NAME='AutoStart' VALUE='true'><EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' SRC='"+strURL+"' AutoStart=true width="+intWidth+" height="+intHeight+"></EMBED></OBJECT>";
				break;
			case "rm":
				tmpstr="<OBJECT CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH="+intWidth+" HEIGHT="+intHeight+"><PARAM NAME='SRC' VALUE='"+strURL+"'><PARAM NAME='CONTROLS' VALUE='ImageWindow'><PARAM NAME='CONSOLE' VALUE='one'><PARAM NAME=AUTOSTART VALUE=true><EMBED SRC='"+strURL+"' NOJAVA=true CONTROLS=ImageWindow CONSOLE=one WIDTH="+intWidth+" HEIGHT="+intHeight+"></OBJECT><br><OBJECT CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH="+intWidth+" HEIGHT=32><PARAM NAME='CONTROLS' VALUE='StatusBar'><PARAM NAME=AUTOSTART VALUE=true><PARAM NAME='CONSOLE' VALUE='one'><EMBED SRC='"+strURL+"' NOJAVA=true CONTROLS=StatusBar CONSOLE=one WIDTH="+intWidth+" HEIGHT=24></OBJECT><br><OBJECT CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH="+intWidth+" HEIGHT=32><PARAM NAME='CONTROLS' VALUE='ControlPanel'><PARAM NAME=AUTOSTART VALUE=true><PARAM NAME='CONSOLE' VALUE='one'><EMBED SRC='"+strURL+"' NOJAVA=true CONTROLS=ControlPanel CONSOLE=one WIDTH="+intWidth+" HEIGHT=24 AUTOSTART=true LOOP=false></OBJECT>";				
				break;
			case "ra":
				tmpstr="<object classid='clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA' id='RAOCX' width="+intWidth+" height="+intHeight+"><param name='_ExtentX' value='6694'><param name='_ExtentY' value='1588'><param name='AUTOSTART' value='0'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='SRC' value='"+strURL+"'><param name='CONTROLS' value='StatusBar,ControlPanel'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='0'><param name='BACKGROUNDCOLOR' value='#000000'><embed src='"+strURL+"' width="+intWidth+" autostart='true' height=60></embed></object>;"
				break;
			case "qt":
				tmpstr="<embed src='"+strURL+"' autoplay=true Loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>"
		}
		document.getElementById(strID).innerHTML = tmpstr;
	}
}
//ÏÔÊ¾Òþ²Ø×ó²àÐÅÏ¢
function displaypanel(obj,name)
{
 LeftDiv=eval("document.all."+name)
   if (LeftDiv.style.display=="none")
        {
        LeftDiv.style.display="";
        
        }
   else
	{
	 LeftDiv.style.display="none";
	 
	}
 }