function ShowDialog(url, width, height, optValidate) {
	
	
var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
	//alert(document.all.content.value)
	//document.all.content.value=document.all.content.value+arr;
	                 Pos.pasteHTML(arr); //在光标位置插入html代码，可不是text文本了
                     Pos.collapse(true);
                     Pos.select();
                     //document.all.content.value=divedit.innerHTML; 
		
}
var timenumber=0
function submit1(){    
         if(document.all.nickname.value=='' ){
		 alert("请填写昵称!");
		 return;
		 }
		   if(document.all.password.value==''  ){
		 alert("请填写密码!");
		 return;
		 }
		   if(document.all.divedit.innerHTML=='' ){
		 alert("请填写评论内容!");
		 return;
		 }
         popmsg("留言已成功提交，感谢您的支持！"); 
		 timenumber= setTimeout("formsubmit()",2)		 		 
}
function formsubmit(){
document.all.content.value=document.getElementById('divedit').innerHTML;
 document.all.form.submit();
}
  
    
  var   oPopup   =   window.createPopup();   
    
  var   popTop=150;   
    
  function   popmsg(msgstr){   
    
  var   winstr="<table   style=\"border:   1   solid   #FFA6CA\"   width=\"141\"   height=\"72\"   border=\"0\"   cellpadding=\"0\"   cellspacing=\"0\"     >";   
    
  winstr+="<tr><td   height=\"30\">   </td></tr><tr><td   align=\"center\"><table   width=\"90%\"   height=\"50\"   border=\"0\"   cellpadding=\"0\"   cellspacing=\"0\">";   
    
  winstr+="<tr><td   valign=\"top\"   style=\"font-size:14px;   color:   red;   face:   Tahoma\">"+msgstr+"</td></tr></table></td></tr></table>";   
    
  oPopup.document.body.innerHTML   =   winstr;   
    
  popshow();   
    
  }   
    
  function   popshow(){   
    
  window.status=popTop;   
    
  if(popTop>1720){   
    
  clearTimeout(mytime);   
    
  oPopup.hide();   
    
  return;   
    
  }else  {
   oPopup.show(300,300,150,100);   
  }
   /*
  if(popTop>1520&&popTop<1720){   
    
  oPopup.show(screen.width-150,screen.height,200,1720-popTop);   
    
  }else  
   if(popTop>1500&&popTop<1520){   
    
  oPopup.show(screen.width-150,screen.height+(popTop-1720),200,172);   
    
  }else   if(popTop<180){   
    
  oPopup.show(screen.width-150,screen.height,200,popTop);   
    
  }else   if(popTop<220){   
    
  oPopup.show(screen.width-150,screen.height-popTop,200,172);   
    
  }   */
    
  popTop+=10;   
    
  var   mytime=setTimeout("popshow();",3);   
    
  }   

  
  //获得光标所在位置的方法,Pos变量将得到光标所在位置的信息 (div_edit()函数中div层和text_edit()函数中<textarea>中onclick和onkeyup触发的命令即是此函数)
 var Pos
function pos()
       {
     Pos=document.selection.createRange();
       }
//实现字符替换,使得行间距没那么大
	   document.onkeypress   =   function   (){   
  if(window.event.keyCode==13   ){   
  tst();   
  window.event.keycode   =   0;   
  window.event.returnValue   =   false;   
  }   
  }   
    
  function   tst(){   
  var   bak   =   clipboardData.getData('Text');   
  clipboardData.setData('Text','\n');
  ssobj   =   document.getElementById('divedit');      
  ssobj.focus();   
  document.execCommand('Paste');   
  clipboardData.setData('Text',bak); 
  //alert(ssobj.innerHTML);
  }   
 //判断登录用户名和密码
 function login(){
	var str= send_post("model.asp?action=login&username="+document.all.AdminUID.value+"&password="+document.all.AdminPWD.value)
	
	if(str=='0')
	alert("用户名和密码不对!")
	if(str=='1')
	window.location="cmment-manage1.asp"
	 }
	 
//删除评论	 
function deleteReview(id,object){
	var str= send_post("model.asp?action=deletereview&id="+id)
     
	if(str=='1'){
	window.location="cmment-manage1.asp"
	object.parentNode.parentNode.parentNode.style.display='none'
	}
	}
