// JavaScript Document
// JavaScript Document
	  var st="border:1px solid #208EAA; background:#FFF";
	  var Ok="border:#090 1px solid; background:#E8FFE8";
      var No="border:#FF4800 1px solid;background:#FFDACC";	
	  var Noo="border:#F42114 1px solid;background:#FBE504";
	  var win="width:180px;";
	  var name,emain,website,htmlstr;
	  
//---------------------------------------------------------------------------------------------数据验证	  
function user_str(lx,Divid){
	infoBoard=document.getElementById(Divid); 
	url=location.protocol+"//"+location.hostname+"/"; 
	infoBoard.innerHTML='<img src='+url+'images/loading.gif>';; 
	bmt=document.getElementById("RSubmitrz"); 
	if(lx==1){ value=document.getElementById('Username').value; }
	if(lx==2){ value=document.getElementById('Eemail').value; }
	if(value==""){infoBoard.innerHTML="<font size=\"+1\" color=#FF0000>&times;</font>";return;	}
	
 myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=usershow&lx="+lx+"&value="+value; 
 retCode=openUrl(myurl); 
 if(retCode==-2){ infoBoard.innerHTML="<font size=\"+1\" color=#FF0000>&times;</font>";document.form1.Username.style.cssText=No;return;}//链接不上 超时
 if(retCode==0){ infoBoard.innerHTML="<font  size=\"+1\" color=#FF0000>&times;</font>";document.form1.Username.style.cssText=No;bmt.disabled=true;return }//当前帐号已经被注册，请换一个!
 if(retCode==1){ infoBoard.innerHTML="<font  size=\"+1\" color=#336600>&radic;</font>";bmt.disabled=false;return }//恭喜您，当前帐号可以使用!
 
 return; 
}
//---------------------------------------------------------------------------------------------注册
function reg_from(){
	
 if(document.form1.Username.value==""){
    document.form1.Username.style.cssText=No; 
    document.form1.Username.focus();
  return false;
  } else{document.form1.Username.style.cssText=Ok;}
 if(document.form1.Password.value==""){
    document.form1.Password.style.cssText=No; 
    document.form1.Password.focus();
  return false;
  } else{document.form1.Password.style.cssText=Ok;}
 if(document.form1.Password0.value==""){
    document.form1.Password0.style.cssText=No; 
    document.form1.Password0.focus();
  return false;
  } else{document.form1.Password0.style.cssText=Ok;}
if(document.form1.Password.value!=document.form1.Password0.value){
    document.getElementById("Password0").style.cssText=No; 
    document.form1.Password0.focus();
  return false;
	} else{document.getElementById("Password0").style.cssText=Ok;}
  if(document.form1.Eemail.value == ""){
    document.form1.Eemail.style.cssText=No; 
    document.form1.Eemail.focus();
  return false;
  } else{
	var temp = document.form1.Eemail.value;
	var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
	if(temp!=""){
	   if(!myreg.test(temp)){
		  document.form1.Eemail.style.cssText=No; 
		 return false;
	   }else{
		  document.form1.Eemail.style.cssText=Ok; 
	   }
    }
	
  }
 
Username=document.form1.Username.value;
Password=document.form1.Password.value;
Useremail=document.form1.Eemail.value;
Hpost ="&member_name="+Username;
Hpost +="&member_password="+Password;
Hpost +="&member_email="+Useremail;
myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=user_reg"+Hpost;  
retCode=openUrl(myurl); 
 if(retCode==-2){ alert("Error(code:001)");return;}//链接不上
 if(retCode==0){ alert("Error(code:002)"); return }//数据为空
 if(retCode==2){ alert("Users already exists.");document.getElementById("Username").style.cssText=No;document.form1.Username.focus(); return; }//添加失败，该用户已经存在。
 if(retCode==1){ 
infoBoard=document.getElementById("reg_box");
infoBoard.innerHTML='<img src=images/loading.gif>&nbsp;Submitting...'; 
httmtxt ="<h1 align=\"center\">Thank You for Your Registration</h1>"
	httmtxt +="<div class=reg_username>Username <input disabled class=reg_text name=Username type=text value="+Username+" /></div>"
	httmtxt +="<div class=reg_username>Password <input disabled class=reg_text name=Password type=password value="+Password+"/></div>"
	httmtxt +="<div class=reg_username>Email <input disabled class=reg_text name=Email type=text value="+Useremail+" /></div>"
	httmtxt +="<div class=box_bot style='font-size:12px; font-family:Verdana, Geneva, sans-serif;'>Please login "+Useremail+" to activate your account</div>"
	infoBoard.innerHTML=httmtxt;
	}
return;  
//
}
 
 //找回密码
function mail_pass(){
			var temp = document.getElementById("fmail")
			var fpaw = document.getElementById("fpaw");
			if(temp.value==""){ alert("Please enter a valid email address!");return; }
			if(fpaw.value==""){ alert("Please enter a new password!");return; }
			var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
			if(temp.value!=""){
			   if(!myreg.test(temp.value)){
				 alert("Mailbox format is wrong, please enter again!");return;
				 return false;
			   }
			}
	document.getElementById("fbut").disabled=true;
	infoBoard=document.getElementById("email_ts"); 
	url=location.protocol+"//"+location.hostname+"/";
	infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>'; 
    myurl=location.protocol+"//"+location.hostname+"/do.php?Action=pass&mail="+temp.value+"&fpaw="+fpaw.value; 
 
    retCode=openUrl(myurl); 
	if(retCode==-2){ alert("Error(code:001)");document.getElementById("fbut").disabled=false;return;}//链接不上
	if(retCode==0){ 
	document.getElementById("fbut").disabled=false; 
	document.getElementById("fmail_tishi").innerHTML="";
	alert("Mailbox error!");
	return }//数据为空
    if(retCode==1){
	document.getElementById("fbut").disabled=true;	
	document.getElementById("fmail_tishi").innerHTML="<div class=box_login>password:"+fpaw.value+"</div>";
	document.getElementById("es").innerHTML="Setting success.";
	}
return; 
} 
//自动加访问量
function Ajax_click(movie_id){
	infoBoard=document.getElementById("click_"+parseInt(movie_id));
	url=location.protocol+"//"+location.hostname+"/"; 
	infoBoard.innerHTML='<img src='+url+'images/loading.gif>';
    myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=click&movie_id="+movie_id; 
	retCode=openUrl(myurl); 
    infoBoard.innerHTML=retCode;
	
return; 
} 
//自动加评论数量
function Ajax_comment(movie_id){
	infoBoard=document.getElementById("comment_"+parseInt(movie_id));
	url=location.protocol+"//"+location.hostname+"/"; 
	infoBoard.innerHTML='<img src='+url+'images/loading.gif>';
    myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=comment&movie_id="+movie_id; 
	retCode=openUrl(myurl); 
    infoBoard.innerHTML=retCode;
return; 
} 
//自动加载链接地址评分
function Ajax_onload(movie_id){
myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=all&movie_id="+movie_id; 
retCode=openUrl(myurl); 
 if(retCode==-2){ alert("Error(code:001)");return;}//链接不上
 if(retCode==0){  return; }//数据为空
 array_p(retCode);
 admin_edit(movie_id);
return; 
} 
function admin_edit(movie_id){
	var grade=document.getElementById("grade").value;
	var admin_objet=document.getElementById("ueidt_"+movie_id);
	var login_value=document.getElementById("login").innerHTML;
	var myurl=location.protocol+"//"+location.hostname;
	if(grade>0){
	 if(login_value.indexOf("Hi:")!=-1){
	  admin_objet.innerHTML="<a href='"+myurl+"/Useradmin/movie/movie_mod.php?movie_id="+movie_id+"' target='_blank'>&nbsp;<font color=\"#FD0100\">(Edit)</font></a>";
	 }else{
		 admin_objet.innerHTML="";
	 }
	}
}
 /*--------------------------------------------------------------------------------会员登录判断*/
 function check_login(){
//-----------
 if(document.form1.Username.value==""){
	document.form1.Username.style.cssText=No; 
	//alert("null！");return;
    document.form1.Username.focus();
  return false;
  } else{
	document.form1.Username.style.cssText=Ok;   
  }
 
//-----------
 if(document.form1.Password.value==""){
    document.form1.Password.style.cssText=No;  
    document.form1.Password.focus();
  return false;
  }else{
	document.form1.Password.style.cssText=Ok;   
  }
member_name=document.form1.Username.value;  
member_password=document.form1.Password.value;  
//-----AJAX------登录
 Login(member_name,member_password);
return false;
 }
 
 //---------------------------------------------------------------------------------AJAX----Login--登录	
 
function Login(member_name,member_password){
var infoBoard=document.getElementById("login_ts"); 
url=location.protocol+"//"+location.hostname+"/";
infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>';  
Hpost="&member_name="+member_name;
Hpost +="&member_password="+member_password;
myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=Login"+Hpost;
retCode=openUrl(myurl);
if(retCode ==-2){
infoBoard.innerHTML='× Program overflow (001), please contact with administrator.'; return; //程序溢出(001),请联系管理员
}
if(retCode ==2){
infoBoard.innerHTML='<font color=#FF0000><B>× Account inactive.</B></font>'; return; //帐号审核未激活
}
if(retCode ==1){
//document.getElementById("user_txt").innerHTML="<center><h1><font color=#017819><B>√ Login successfully.</B></font></h1></center><center><input class=bott_exit type='button' name='button' value='Exit' onClick=\"showexit();\"></center>";
Ajax_user(0);
showexit(); 
return; //登录成功 showexit(); alert("Login successfully.");
}
if(retCode ==0){
infoBoard.innerHTML='User name and password is not correct.'; //用户名不存在或密码错误
}
 
return; 
} 
 //---------------------------------------------------------------------------------AJAX---数去年	
function Ajax_Syear(year){
 	var gdCurDate=new Date();
	
	var giMonth=gdCurDate.getMonth();
 
	for(i=0;i<4;i++ ){
	    var giYear=gdCurDate.getFullYear()-i;
		document.getElementById("Syear").innerHTML +="<a href="+location.protocol+"//"+location.hostname+"/"+"search.php?year="+giYear+">"+giYear+"</a>";
	}	
	 
}
 //---------------------------------------------------------------------------------AJAX----Login--zhuang tai	
function Ajax_loginout(){
	 outurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=loginout"; 
	 Userstr=openUrl(outurl); 
	 document.getElementById("log").innerHTML="<a href=\"Javascript:\" onclick=\"alertWin('Login to Movie25.com','login',300,180);\">log in</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"Javascript:\" onclick=\"alertWin('Welcome to Movie25.com','reg',400,260);\">Sign Up</a><input type=\"hidden\"  id=\"yhzt\" value=0 /></div>"; 
	 
	 alert("You are now logged out.");
	 
}
 
function Ajax_user(movie_id){
 myurl=location.protocol+"//"+location.hostname+"/Ajax_user.php"; 
 Userstr=openUrl(myurl); 
  array_srt=Userstr.split("|-|");
  member_id=array_srt[0];
  member_name=array_srt[1];
  member_email=array_srt[2];
  member_grade=array_srt[3];
 if(Userstr==-2){ alert("Error(code:001)");return;}//链接不上
 
if(member_id<=0 || Userstr==0){
	return;
}else{
	  document.getElementById("log").innerHTML="<input type=\"hidden\"  id=\"grade\" value=\""+member_grade+"\" /><input type=\"hidden\"  id=\"yhzt\" value=\"1\" /><font color=#ffffff><B>Hi: "+member_name+"</B>  | <a href='Javascript:' onclick='Ajax_loginout();'>Log Out</a></font>"; 
		 if(movie_id>0){
			document.suggest.name.value=member_name; 
			document.suggest.emain.value=member_email; 
		  }	
   return; 	
 }
}
//-------------------------------------------------------------------------------------------------提交链接地址评分
function array_p(htmlstr){
 var array_str,bfb,count,good,bad;
	if(htmlstr.indexOf("|-|")!=-1){
		array_str=htmlstr.split("|-|");
		array_id=array_str[0].split("##");//信息IP
		array_count=array_str[1].split("##");//总
		array_good=array_str[2].split("##");//好评
		array_bad=array_str[3].split("##");//差评
		  
		 for(i=0;i<array_id.length-1;i++){
              count=array_count[i];
			  good=array_good[i];
			  bad=array_bad[i];
			  document.getElementById("count_"+parseInt(array_id[i])).innerHTML=count;   //投票总数
			  document.getElementById("good_"+parseInt(array_id[i])).innerHTML=good;   //好评
			  document.getElementById("bad_"+parseInt(array_id[i])).innerHTML=bad;   //差评
			  bfb=Math.round((good/count)*100); 
			if(bfb>1){
			document.getElementById("bfb_"+parseInt(array_id[i])).innerHTML=bfb;   //投票总数
			}else{
				if(bad==0){
					document.getElementById("bfb_"+parseInt(array_id[i])).innerHTML="100";   //投票总数	
				}else{
				    document.getElementById("bfb_"+parseInt(array_id[i])).innerHTML="0";   //投票总数		
				}
			
			}
 
		 }
 
	}else{
	alert("Error(not array)");	
	}
return; 	
}
//-------------------------------------------------------------------------------------------------手动评分
function p(nub,movie_id,movieto_id){
var	 cookie_name="myurl"+movieto_id;
var cookie_size=getCookie(cookie_name); 	
 
if(cookie_size != null){
	alert("You have already rated this link!");
	return;
}else{	
 myurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=tp&movieto_id="+movieto_id+"&lx="+nub; 
 retCode=openUrl(myurl); 
 if(retCode==-2){ alert("Error(code:001)");return;}//链接不上
 if(retCode==0){ alert("Error(code:002)"); return }//数据为空
 SetCookie (cookie_name, myurl) //设置URL Cookie
 Ajax_onload(movie_id);
}
return; 
}
//-------------------------------------------------------------------------------------------------取消嵌套
function Ajax_qxqt(movie_id,Rid){
 	document.getElementById("R_"+Rid).innerHTML="";
	Ajax_comment_reply(movie_id,0);
}
//-------------------------------------------------------------------------------------------------嵌套评论
function Ajax_Rqt(movie_id,Rid){
	ord=document.getElementById("comment_order").value;
	if(ord>0){document.getElementById("R_"+ord).innerHTML="";}
	document.getElementById("comment_reply").innerHTML="";
	
    Ajax_comment_reply(movie_id,Rid);
	
}
//-------------------------------------------------------------------------------------------------评论提交表单
function Ajax_comment_reply(movie_id,Rid){
 if(Rid>0){
	 infoBoard=document.getElementById("R_"+Rid); 
 }else{
     infoBoard=document.getElementById("comment_reply"); 
 }
 url=location.protocol+"//"+location.hostname+"/";
 infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>'; 
 commenturl=location.protocol+"//"+location.hostname+"/comment_reply.php?movie_id="+movie_id;
 reply_str=openUrl(commenturl); 
 if(reply_str==-2){infoBoard.innerHTML="Error(code:001)";return;}//链接不上
 if(reply_str== 0){infoBoard.innerHTML="Error(code:002)";return }//数据为空
 if(reply_str== 1){infoBoard.innerHTML=""; return }//评论关闭
 infoBoard.innerHTML=reply_str;
 document.getElementById("comment_order").value=Rid;
 if(Rid>0){
 document.getElementById("Freply").innerHTML="&nbsp;<a href=\"Javascript:Ajax_qxqt("+movie_id+","+Rid+")\" style=\"color:#F00\"> Click to cancel reply</a>";
 }
return false; 
}
//-------------------------------------------------------------------------------------------------评论列表
function Ajax_comment_list(movie_id,page){
infoBoard=document.getElementById("comment_list"); 
 url=location.protocol+"//"+location.hostname+"/";
 infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>'; 
 commenturl=location.protocol+"//"+location.hostname+"/comment.php?movie_id="+movie_id+"&page="+page;
 list_str=openUrl(commenturl); 
 
 if(list_str== -2){ alert("Error(code:001)");return;}//链接不上
 if(list_str== 0){ alert("Error(code:002)"); return }//数据为空
 if(list_str== 1){document.getElementById("comment_list").innerHTML=""; return }//评论关闭
 document.getElementById("comment_list").innerHTML=list_str;
return; 
}
//-------------------------------------------------------------------------------------------------添加评论
function Ajax_comment_add(movie_id){
  
 if(document.suggest.name.value==""){
    document.getElementById("name").style.cssText=No; 
    document.suggest.name.focus();
  return false;
  } else{
	
	document.getElementById("name").style.cssText=Ok;   
  }
  
 if(document.suggest.code.value==""){
    document.getElementById("code").style.cssText=No; 
    document.suggest.code.focus();
  return false;
  } else{
	
	document.getElementById("code").style.cssText=Ok;   
  }
 if(document.suggest.htmlstr.value==""){
    document.getElementById("htmlstr").style.cssText=No; 
    document.suggest.htmlstr.focus();
  return false;
  } else{
	
	document.getElementById("htmlstr").style.cssText=Ok;   
  }
    code=document.suggest.code.value;  
	name=document.suggest.name.value;    
	emain=document.suggest.emain.value;   
	order =document.suggest.comment_order.value;   
	website="null"; 
	content=document.suggest.htmlstr.value;  
	htmlstr = content.replace(/\r\n/g,"<Br>");
//------------------------------------------------------------
 infoBoard=document.getElementById("comment_add_loading"); 
 url=location.protocol+"//"+location.hostname+"/";
 infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>'; 
 commentadd=location.protocol+"//"+location.hostname+"/comment_add.php?movie_id="+movie_id+"&order="+order+"&name="+name+"&emain="+emain+"&website="+website+"&htmlstr="+htmlstr+"&code="+code;
 httmsstr=openUrl(commentadd); 
 //infoBoard.innerHTML=httmsstr;
 if(httmsstr==4){
	 infoBoard.innerHTML='';
	 codeurl=location.protocol+"//"+location.hostname+"/ajax.php?Action=code";
	 codehtml=openUrl(codeurl);
	 document.getElementById("strcode").innerHTML=codehtml;
	 alert("Invalid Verification code ");
	 return;}//链接不上
 
 if(httmsstr==-2){infoBoard.innerHTML='Error(code:001)';return;}//链接不上
 if(httmsstr== 0){ infoBoard.innerHTML='Error(code:002)'; return }//入库出错
 if(httmsstr== 1){ infoBoard.innerHTML='Please post after two minutes'; return }//您发布太快了，请等待2分。
 if(httmsstr== 2){ infoBoard.innerHTML=' '; }
 if(httmsstr== 3){ infoBoard.innerHTML='Please waiting for approval'; }
 Ajax_comment_reply(movie_id,0);
 Ajax_comment_list(movie_id);//刷新评论列表
  document.suggest.htmlstr.value="";
  document.getElementById("name").style.cssText=st;
  document.getElementById("code").style.cssText=st; 
  document.getElementById("htmlstr").style.cssText=st;
  
return;
}
//-------------------------------------------------------------------------------------------------删除评论
  function Del_comment(comment_id,movie_id){
 	 infoBoard=document.getElementById("Comment_tishi_"+comment_id); 
	 url=location.protocol+"//"+location.hostname+"/";
	 infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>'; 
 	 DelC_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=DEL_Comment&comment_id="+comment_id;
 	 DelC_str=openUrl(DelC_url); 
 if(DelC_str==-2){ infoBoard.innerHTML='Error(code:001)';return;}//链接不上
 if(DelC_str==0){infoBoard.innerHTML='Error(Without authority.)';return; }
 if(DelC_str==1){Ajax_comment_list(movie_id);return; }
 
}
//-------------------------------------------------------------------------------------------------主题投票
function rate(id,j){
var	 cookie_name="rate_url"+id;
var  cookie_size=getCookie(cookie_name); 	
if(cookie_size != null){
	alert("You have already rated this movie!");
	return;
}else{	
 rate_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=rate&movie_id="+id+"&nuber="+j; 
 rate_str=openUrl(rate_url); 
 if(rate_str==-2){ alert("Error(code:001)");return;}//链接不上
 if(rate_str==0){ alert("Error(code:002)"); return }//数据为空
 SetCookie (cookie_name,rate_url) //设置URL Cookie
 Ajax_rate(id)
 alert("Thank you for your vote!");
}
return; 
}
//-------------------------------------------------------------------------------------------------主题数据
function Ajax_rate(id){	
       
		$(document).ready(function(){
			$('#news').addClass('loading');
			$.getJSON(location.protocol+"//"+location.hostname+"/ajax.php?Action=rateshow&movie_id="+id+"&r="+ Math.random(),
				function(data){
				  $.each(data, function(i,k){
					$("#"+i).html(k);
					if(i == 'Rate_'+id){
						width =1+Math.abs(k)*20;
						left = k>0 ? 1 : 1-width;
						if(k<0) $('.loading_'+id).css("background-position",'right bottom');
						$('.loading_'+id).width(width);
						$('.loading_'+id).css("left",left);
					}
				  });
				});		 
		});
 
 
}
//-------------------------------------------------------------------------------------------------增加当前影视地址
  function check_addlike(movie_id,movie_sid){
 
   var infoBoard=document.getElementById("link_tishi"); 
   var boxBoard=document.getElementById("box_link"); 
   var from = document.getElementsByName('movie_from[]');
   var FUrl = document.getElementsByName('movie_url[]');
   var yhzt = document.getElementById("yhzt").value;
   var from_str;
    if(yhzt<1){
		alert("No Permission."); //无权限
		return;	
	}else{
	 var grade = document.getElementById("grade").value;	
    if(grade<0){
		alert("No Permission."); //无权限
		return;	
	}
	}
   from_str="";
   furl_str="";
   for(var i=1; i<=from.length; i++){
   from_str += from[i-1].value+",";
   furl_str += FUrl[i-1].value+",";
   }
  if(furl_str.length<11){
	alert("Please check the movie links!");
    return;	
  }
  
  if(furl_str.indexOf("videobb") >= 0){
	  alert("videobb is not allowed!");
	  return;	
  }else{
	alert("Thank you for your submission! Please waiting for approval.");  
  } 
  
 url=location.protocol+"//"+location.hostname+"/";
 infoBoard.innerHTML='loading <img src='+url+'images/loading.gif>'; 
 link_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=Add_a_Link&movie_sid="+movie_sid+"&movie_id="+movie_id+"&movie_from="+from_str+"&movie_url="+furl_str;
 link_str=openUrl(link_url); 
 
 if(link_str==-2){infoBoard.innerHTML='Error(code:001)';return; setTimeout("out_tishi('link_tishi');",3000);}//链接不上
 if(link_str== 0){ infoBoard.innerHTML='Error(You without authority.)'; return; setTimeout("out_tishi('link_tishi');",3000); }//入库出错
 boxBoard.innerHTML='<BR><BR><BR><BR><BR><h1>Operating successfully, waiting for the administrator.</h1>';
 showexit();
return;
}
//-------------------------------------------------------------------------------------------------编辑当前影视地址1
  function Edit_url(movieto_id){
	 var Edit_url=""; 
	 infoBoard=document.getElementById("box_edit"); 
 	 Edit_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=Edit_url&movieto_id="+movieto_id;
 	 Edit_str=openUrl(Edit_url); 
 if(Edit_str==-2){ infoBoard.innerHTML='Error(code:001)';return;}//链接不上
 if(Edit_str== 0){ infoBoard.innerHTML='Error(You have no authority.)'; return }//入库出错
 infoBoard.innerHTML=Edit_str;
 return;
	  
}
//-------------------------------------------------------------------------------------------------编辑当前影视地址2
  function check_Editlike(movieto_id,movie_sort_id){
	 var Edit_url=""; 
	 var movie_from=document.getElementById("movie_from").value;
	 var movie_url=document.getElementById("movie_url").value;
	 infoBoard=document.getElementById("edit_tishi"); 
	 
 	 Edit1_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=Edit_url1&movie_sort_id="+movie_sort_id+"&movieto_id="+movieto_id+"&movie_from="+movie_from+"&movie_url="+movie_url;
 	 Edit1_str=openUrl(Edit1_url); 
 
 if(Edit1_str==-2){ infoBoard.innerHTML='Error(code:001)';return;}//链接不上
 if(Edit1_str== 0){ infoBoard.innerHTML='Error(You without authority.)'; return }//入库出错
  infoBoard.innerHTML='Edit success';
 
 return;
}
//-------------------------------------------------------------------------------------------------删除当前影视地址
  function check_DEltlike(movieto_id,movie_sort_id){
	 var Edit_url=""; 
	 var movie_from=document.getElementById("movie_from").value;
	 var movie_url=document.getElementById("movie_url").value;
	 infoBoard=document.getElementById("del_tishi"); 
 	 Delt_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=Del_url&movie_sort_id="+movie_sort_id+"&movieto_id="+movieto_id;
 	 Delt_str=openUrl(Delt_url); 
 
 if(Delt_str==-2){ infoBoard.innerHTML='Error(code:001)';return;}//链接不上
 if(Delt_str==0){infoBoard.innerHTML='Error(Without authority.)';return; }
 infoBoard.innerHTML='Delete success';
 return;
}
//-------------------------------------------------------------------------------------------------死链接报告
function check_dead(id){
	var inputCode = document.getElementById("jssecCode").innerHTML.toUpperCase();
	if(document.form_dead.movieto_deadlink.value==""){
	   alert("Wrong code, try again please" );
	    document.form_dead.movieto_deadlink.focus();
	   return false;

	}else{
		
	 if(inputCode != document.getElementById("movieto_deadlink").value){
		alert("Wrong code, try again please");
		return false; 
	 }
	//----------------------------------------------------------------		
	var	 cookie_name="check_dead"+id;
	var  cookie_size=getCookie(cookie_name); 	
	if(cookie_size != null){
		alert("Thank you for your support, this opinion we are processing.");
		return;
	}else{	
	//----------------------------------------------------------------	
	 content=document.form_dead.movieto_deadlink.value;  
	 content = content.replace(/\r\n/g,"<br>");
	 dead_url=location.protocol+"//"+location.hostname+"/ajax.php?Action=dead&movieto_id="+id+"&movieto_deadlink="+content; 
	 dead_str=openUrl(dead_url); 
	 if(dead_str==-2){ alert("Error(code:001)");return;}//链接不上
	 if(dead_str==1){ 
	//----------------------------------------------------------------	
	 SetCookie (cookie_name, dead_url) //设置URL Cookie	
	 document.getElementById("box_dead").innerHTML="<div style=\"line-height:20px; color:#C00; font-size:14px; font-weight:bold\">Operate successfully</div>";//操作成功
	 showexit();//退出
	 alert("Operation success, thank you for your support.");
	 return }
	}
	}
}
//-------------------------------------------------------------------------------------------------Microsoft.XMLHttp
//创建XMLHttpRequest对象
 var request = false;
 try {
 request = new XMLHttpRequest();
 } catch (trymicrosoft) {
 try {
 request = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (othermicrosoft) {
 try {
 request = new ActiveXObject("Microsoft.XMLHTTP");
 } catch (failed) {
 request = false;
 }
 }
}
if (!request)alert("Error initializing XMLHttpRequest!");
//获取信息
function openUrl(URL) {
 request.open("Post", URL, false);
  request.onreadystatechange = updatePage;
 request.send(null);
 
 return updatePage();;
}
//更新页面
function updatePage(comment_reply) {
 if (request.readyState == 4) {
 if (request.status == 200) {
 var response = request.responseText;
    return response;
 }else if(request.status == 404) {
    return -2; 
 } else if (request.status == 403) {
    return -2; ;
 } else
 alert("status is " + request.status);
 }
}
//-------------------------------------------------------------------------------------------------Cookie设置，24小时为计时
function SetCookie(name,value)//两个参数，一个是cookie的名子，一个是值
{
    var Days = 1; //此 cookie 将被保存 1 天
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;
}
function delCookie(name)//删除cookie
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
//-------------------------------------------------------------------------------------------------提示框消失
function out_tishi(div_ID){
	alert(out_tishi);
	//document.getElementById(div_ID).innerHTML="";
	
}
//-------------------------------------------------------------------------------------------------清除首位空
function Trim(str)
{
    return LTrim(RTrim(str));
}

