function AJAXRequest() {
	var xmlObj = false;
	var CBfunc,ObjSelf;
	ObjSelf=this;
	try { xmlObj=new XMLHttpRequest; }
	catch(e) {
		try { xmlObj=new ActiveXObject("MSXML2.XMLHTTP"); }
		catch(e2) {
			try { xmlObj=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch(e3) { xmlObj=false; }
		}
	}
	if (!xmlObj) return false;
	this.method="POST";
	this.url;
	this.async=true;
	this.content="";
	this.callback=function(cbobj) {return;}
	this.send=function() {
		if(!this.method||!this.url||!this.async) return false;
		xmlObj.open (this.method, this.url, this.async);
		if(this.method=="POST") xmlObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		xmlObj.onreadystatechange=function() {
			if(xmlObj.readyState==4) {
				if(xmlObj.status==200) {
					ObjSelf.callback(xmlObj);
				}
			}
		}
		if(this.method=="POST") xmlObj.send(this.content);
		else xmlObj.send(null);
	}
}
function copyToClipboard(txt) {
     if(window.clipboardData) {
             window.clipboardData.clearData();
             window.clipboardData.setData("Text", txt);
     } else if(navigator.userAgent.indexOf("Opera") != -1) {
          window.location = txt;
     } else if (window.netscape) {
          try {
               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
          } catch (e) {
              
          }
          var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
          if (!clip)
               return;
          var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
          if (!trans)
               return;
          trans.addDataFlavor('text/unicode');
          var str = new Object();
          var len = new Object();
          var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
          var copytext = txt;
          str.data = copytext;
          trans.setTransferData("text/unicode",str,copytext.length*2);
          var clipid = Components.interfaces.nsIClipboard;
          if (!clip)
               return false;
          clip.setData(trans,null,clipid.kGlobalClipboard);
     }
}
function myselectaddr(kuang)
{
	getObject("xianshi").value=getObject(kuang).value;
	getObject("xianshi").select();
	copyToClipboard(getObject(kuang).value+"\r\nLeechVideo");
	//window.clipboardData.setData("text",getObject(kuang).value+"\r\nLeechVideo");
}
function PostComment()
{
	var postcontent,url;
	postcontent	= getObject("content").value;
	if(postcontent!="")
	{
		
		//客户端数据显示
		var adddate,content;
		adddate=new Date().toLocaleString();
		content='<div class="plti">Post at '+adddate+'</div>';
		content=content+'<div class="plnr">'+postcontent+'</div>';
		content=content.replace(/\[(face\d*)\]/g,"<img src=\"/img/face/\$1.gif\">");
		getObject("commenddiv").innerHTML=content+getObject("commenddiv").innerHTML;
		
		//发送数据
		p='id='+id+'&content='+postcontent;
		var ajaxobj=new AJAXRequest;
		url= "/work/postcomment.php";
		ajaxobj.method="POST";
		ajaxobj.url=url;
		ajaxobj.content=p;
		ajaxobj.callback=function(xmlobj) {
			//alert(xmlobj.responseText);
			getObject("content").value="";
		}
		ajaxobj.send();
	}else{
		alert('Sorry,Please enter your comment!');
	}
}
function LoadGif(GifNum)
{
	getObject("content").value = getObject("content").value+"[face"+GifNum+"]";
}
//getObject("videoflv").focus();
document.write('\
<div class="hfbody">\
<div class="rectitle1">Post a comment</div>\
<div class="hfimg"><input type="image" onclick="LoadGif(1)" src="/img/face/face1.gif" />&nbsp;<input type="image" onclick="LoadGif(2)" src="/img/face/face2.gif" />&nbsp;<input type="image" onclick="LoadGif(3)" src="/img/face/face3.gif" />&nbsp;<input type="image" onclick="LoadGif(4)" src="/img/face/face4.gif" />&nbsp;<input  type="image" onclick="LoadGif(5)" src="/img/face/face5.gif" />&nbsp;<input type="image" onclick="LoadGif(6)" src="/img/face/face6.gif" />&nbsp;<input type="image" onclick="LoadGif(7)" src="/img/face/face7.gif" />&nbsp;<input  type="image" onclick="LoadGif(8)" src="/img/face/face8.gif" />&nbsp;<input type="image" onclick="LoadGif(9)" src="/img/face/face9.gif" />&nbsp;<input type="image" onclick="LoadGif(10)" src="/img/face/face10.gif" />&nbsp;<input type="image" onclick="LoadGif(11)" src="/img/face/face11.gif" />&nbsp;<input type="image" onclick="LoadGif(12)" src="/img/face/face12.gif" />&nbsp;<input type="image" onclick="LoadGif(13)" src="/img/face/face13.gif" /></div>\
<textarea rows="5" class="hftxt" name="content" id="content"></textarea><br/>\
<input type="image" src="/img/post.gif" onclick="PostComment()" />\
</div>\
');
window.onload=function(){
	
	try{
		getObject("gg_468_60").innerHTML='<iframe scrolling="no" width="468px" height="60px" frameborder="0" src="/600/google_468_60.html">';
		getObject("gg_125_370").innerHTML='<iframe scrolling="no" width="125px" height="370px" frameborder="0" src="/600/google_125_370.html">';
	}catch(e){}

	var ajaxobj=new AJAXRequest;
	url= "/work/getcomment.php?id="+id+"&cateid="+cateid+"&temp="+Math.random();
	ajaxobj.method="GET";
	ajaxobj.url=url;
	ajaxobj.callback=function(xmlobj) {
		getObject("commenddiv").innerHTML=xmlobj.responseText;
	}
	ajaxobj.send();
}