
function ubbShowObj(strType,strID,strURL,intWidth,intHeight){
	var objPrefix="bShow";
	var tmpstr="";
	var bSwitch = false;

	bSwitch = document.getElementById(objPrefix+strID).value;
	bSwitch	=~bSwitch;


	document.getElementById(objPrefix+strID).value = bSwitch;
	if(bSwitch){
		document.getElementById(strID).innerHTML = "<a href=\""+strURL+'" target="_blank">'+strURL+"</a>";
	}else{
		switch(strType){
			case "swf":
			tmpstr=strURL+'<br /><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,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+'" /></object>';
			break;
			case "wmp":
			tmpstr=strURL+'<br /><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+'" /></object>';
			break;
			case "rm":
			tmpstr=strURL+'<br /><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 "qt":
			tmpstr=strURL+'<br /><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 fEvent(sType,oInput){
	switch (sType){
		case "focus" :
		oInput.isfocus = true;
		case "mouseover" :
		if(oInput.type=='textarea'){
			oInput.className='common_textarea_hover';
		}else{
			oInput.className='common_input_hover';
		}

		break;
		case "blur" :
		oInput.isfocus = false;
		case "mouseout" :
		if(!oInput.isfocus){
			if(oInput.type=='textarea'){
				if(oInput.value==''){
					oInput.className='common_textarea';
				}
			}else{
				oInput.className='common_input';
			}
		}
		break;
	}
}

//Ctrl+Enter to Post
function CtrlEnter() { 
	if(event.ctrlKey && window.event.keyCode==13) document.postform.submit.click();
}

function storeCaret(cursorPosition) {
	if (cursorPosition.createTextRange) cursorPosition.caretPos = document.selection.createRange().duplicate();
}

function insertSmilies(strCode) {
	var txtarea = document.postform.body;
	strCode = '[em]' + strCode + '[/em]';
	if (txtarea.createTextRange && txtarea.caretPos) {
	var caretPos = txtarea.caretPos;
	caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? strCode + ' ' : strCode;
	txtarea.focus();
	} else {
	txtarea.value  += strCode;
	txtarea.focus();
	}
}

function toDownUrl(id)
{
	if(id!=""){
	  window.open("http://www.tuola.net/soft/view-"+id+".html#download",'target');
	}else
	{
		alert("ÏµÍ³´íÎó,ÇëÉÔºóÔÙÊÔ£¡");
	}
}
