﻿var cacheHost="http://www.pipi.cn";
var webHost="http://v.pipi.cn";

/*
 * 随机数生成
 * 
 */
function rnd() { 
	rnd.today=new Date(); 	
	rnd.seed=rnd.today.getTime();
	rnd.seed = (rnd.seed*9301+49297) % 233280; 
	return rnd.seed/(233280.0); 
} 
function rand(number) { 
	return Math.ceil(rnd()*number); 
}
/*
 * 设置Cookie
 * 
 */
function SetCookie(name, value)
//set Cookie value
{
	var expdate = new Date();
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
	/*document.cookie = name + "=" + encodeURIComponent (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
	+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
	+((secure == true) ? "; secure" : "");*/
	document.cookie = name + "=" + encodeURIComponent (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
	+(";path =/") +(";domain=pipi.cn")
	+((secure == true) ? "; secure" : "");
}

function GetCookieVal(offset)
//get Cookie value by encode 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return decodeURIComponent(document.cookie.substring(offset, endstr));
}

/*
 * del Cookie
 * 删除指定的cookie
 */
function DelCookie(name)
{
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}
/*
 * get oragin Cookie value
 * 得到指定的cookie值
 */
function GetCookie(name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return GetCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}
/*
 * 验证用户提交信息
 *
 */
function validateUserWords(str){
	var re=/[\u4E00-\u9FA5]/;
	if(re.test(str)){return true;}  

	return false;
}

/*
 * 显示用户登录信息
 *
 */
function showUserInfo(){
	var nick = GetCookie('usernickname');
	if(nick!=null){
		document.getElementById("userinfolabel").innerHTML=""+nick;
		document.getElementById("useractionlabel").innerHTML="退出";
		document.getElementById("useractionlabel").title="退出";
		document.getElementById("userspacelabel").parentNode.innerHTML="";
		document.getElementById("usershare").innerHTML="<a href=\"http:\/\/v.pipi.cn\/moviemanage\/publish1.jsp\" title=\"上传视频\"><img src=\"\/images\/icon_update.gif\" alt=\"上传视频\" \/><\/a>"		
	}
}
/*
 *  判断用户是否登录
 *
 */
function isUserLogined(){
	var nick = GetCookie('usernickname');
	return nick!=null;
}
/*
 * 复制剪贴榜;负责分享功能使用
 *
 */
function copyToClipBoard(){
   var clipBoardContent='';
   clipBoardContent+=document.getElementById("sharecopytxt").value;
   window.clipboardData.setData("Text",clipBoardContent);
   alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友   ");
}

/*
 * get浏览器xmlhttp对象
 *
 */
function getXMLHTTPRequest(){
	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;
		}
	  }
	}
	return request;
}

/*
 * 复制剪贴榜;负责分享功能使用
 * htmlpath 静态评论第一页路径
 */
function loadFirstReview(htmlpath){
	var request = getXMLHTTPRequest();
	if(!request){
		return ;
	}
	try{
		request.open("GET", htmlpath, true);
		request.onreadystatechange = 
			function(){
				if(request.readyState==4 && request.status==200 ){
					loadReviewCallback(request.responseText);
				}
			};
		request.send();
	}catch(e){

	}
}
/*
 * 将读取的评论内容显示在页面上
 *
 */
function loadReviewCallback(text){
	document.getElementById("reviewlist").innerHTML=text;
}

/*
 * 显示影片指定的动态评论页面
 * movid 影片id
 * pageno 显示页号
 */
function goMovReviewPage(movid,pageno){
	var page=document.getElementById('pageproxy');
	var proxy = page.contentWindow;
	var url = webHost+"/web/MovReviewPage.action?movId="+movid+"&pageno="+pageno+"&dd="+new Date().getTime();
	proxy.loadWebPageText(url,loadReviewCallback);
}
/*
 * 用户对指定影片评分操作
 * movid 影片id
 * 
 */
function doMovieMark(movid){
	var list = document.getElementsByName("MovieMarkSelect");
	var score=0;
	for(var i=0;i<list.length;i++){
		if(list[i].checked){
			score=list[i].value;
		}
	}
	if(score==0){
		alert('请选择该影片的评分值!');
		return ;
	}
	var page=document.getElementById('pageproxy');
	var proxy = page.contentWindow;
	var url = webHost+"/web/MovMark.action";
	var params={movId:movid,score:score};
	if(proxy.postDataWithJsonResult==null){
		window.status="网站动态功能错误";
		return;
	}
	proxy.postDataWithJsonResult(url,params,doMovieMarkCallBack);
}
/*
 * 用户对指定影片评分操作返回处理
 * jsontxt Json格式返回结果
 * 
 */
function doMovieMarkCallBack(jsontxt){
	var jrt = eval('('+jsontxt+')');

	if("false"==jrt['success']){
		alert("错误："+jrt['message']);
	}else{
		alert("评分完成,谢谢您的参与!");
	}
}

/*
 * 用户对指定影片评分操作
 * movid 影片id
 * 
 */
function commentPost(movid,content){
	
	if(""==content){
		alert("请填写评论内容");
		return ;
	}
	var page=document.getElementById('pageproxy');
	var proxy = page.contentWindow;
	var url = webHost+"/web/MovReview.action";
	var params={movId:movid,content:(content)};
	if(proxy.postDataWithJsonResult==null){
		window.status="网站动态功能错误";
		return ;
	}
	proxy.postDataWithJsonResult(url,params,commentPostCallBack);
}
/*
 * 用户发评论操作返回处理
 * jsontxt Json格式返回结果
 * 
 */
function commentPostCallBack(jsontxt,params){
	var jrt = eval('('+jsontxt+')');
	
	if("false"==jrt['success']){
		alert(jrt['message']);
	}else{
		alert("评论完成,谢谢您的参与!");
		document.getElementById("comment_txt").value="";
		goMovReviewPage(params['movId'],1);
	}
}

// Check is empty or null
function isEmpty(str) {
	if(str == null || str == "") return true;
	return false;
}

// radio is checked
function checkRadio(id){
	var obj = document.getElementsByTagName("input");
	for(var i = 0; i < obj.length; i++){
		if(obj[i].type == "radio" && obj[i].id == id){
			if(obj[i].checked == true)
				return true;
		}
	}
	return false;
}


/*
 * 载入用户求片分页
 * pageno分页号
 * 
 */
function goMovRequestPage(pageno){
	var htmlpath = cacheHost+"/request/new/"+pageno+".html";
	var request = getXMLHTTPRequest();
	if(!request){
		return ;
	}
	try{
		request.open("GET", htmlpath, true);
		request.onreadystatechange = 
			function(){
				if(request.readyState==4 && request.status==200 ){
					loadMovRequestPageCallback(request.responseText);
				}
			};
		request.send();
	}catch(e){

	}
}
/*
 * 载入用户求片分页回调函数
 * text 取得的页面内容
 * 
 */
function loadMovRequestPageCallback(text){
	document.getElementById("movrequestlist").innerHTML=text;
}
/*
 * 载入求片第一个分页
 * 
 */
function loadFirstRequestPage(){
	goMovRequestPage(1);
}
/*
 * 载入用户求片排行分页
 * pageno分页号
 * 
 */
function goMovRequestTopPage(pageno){
	var htmlpath = cacheHost+"/request/top/"+pageno+".html";
	var request = getXMLHTTPRequest();
	if(!request){
		return ;
	}
	try{
		request.open("GET", htmlpath, true);
		request.onreadystatechange = 
			function(){
				if(request.readyState==4 && request.status==200 ){
					loadMovRequestTopPageCallback(request.responseText);
				}
			};
		request.send();
	}catch(e){

	}
}
/*
 * 载入用户求片排行分页回调函数
 * text 取得的页面内容
 * 
 */
function loadMovRequestTopPageCallback(text){
	document.getElementById("toprequestlist").innerHTML=text;
}
/*
 * 载入求片排行第一个分页
 * 
 */
function loadFirstTopRequestPage(){
	goMovRequestTopPage(1);
}
/*
 * 用户求片同求操作
 * 
 */
function requestFollow(id) {
	if(isRequestVoted(id)){
		alert("不能重复投票!");
		return ;
	}
	var page=document.getElementById('pageproxy');
	var proxy = page.contentWindow;
	var url = webHost+"/web/RequestFollow.action";
	var params={id:id};
	proxy.postDataWithJsonResult(url,params,requestFollowCallBack);
}
/*
 * 用户求片同求操作回调
 * 
 */
function requestFollowCallBack(jsontxt,params){
	var jrt = eval('('+jsontxt+')');
	
	if("false"==jrt['success']){
		alert(jrt['message']);
	}else{
		document.getElementById('movrequest_'+params['id']).innerHTML=jrt['message'];
		alert("同求完成,谢谢您的参与!");
		logRequestVote(params['id']);
	}
}
function isRequestVoted(id){
	var idstr=GetCookie("request_voted_tracker");
	if(idstr==null||idstr==""){
		return false
	}else{
		var ids = idstr.split(",");
		for(var i=0;i<ids.length;i++){
			if(id==ids[i]){
				return true;
			}
		}
	}
	return false;
}
function logRequestVote(id){
	var idstr=GetCookie("request_voted_tracker");
	if(idstr==null||idstr==""){
		idstr=id;
	}else{
		idstr+=","+id;
	}
	SetCookie("request_voted_tracker",idstr);
}

/*
 * 用户求片发布
 * 
 */
function requestPost(){
	if(!isUserLogined()){
		if(!confirm("你需要在登录(注册)之后才能发表求片信息!")){
			return;
		}else{
			parent.document.location=webHost+'/usermanage/login.jsp';
			return;
		}
	}
	var movname = document.getElementById('reqmovname');
	var reqreason = document.getElementById('reqreason');
	if(movname.value==""||reqreason.value==""){
		alert('请完整填写求片信息');
		return ;
	}
	if(!validateUserWords(reqreason.value)){
		alert('填写信息过于简单');
		return ;
	}

	var page=document.getElementById('pageproxy');
	var proxy = page.contentWindow;
	var url = webHost+"/web/UserRequest.action";
	var params={movName:(movname.value),reason:(reqreason.value)};
	if(proxy.postDataWithJsonResult==null){
		window.status="网站动态功能错误";
		return ;
	}
	proxy.postDataWithJsonResult(url,params,requestPostCallBack);

}
/*
 * 用户求片发布回调
 * 
 */
function requestPostCallBack(jsontxt){
	var jrt = eval('('+jsontxt+')');
	var movname = document.getElementById('reqmovname');
	var reqreason = document.getElementById('reqreason');
	movname.value="";
	reqreason.value="";
	alert(jrt['message']);
}

/*
 * 用户浏览视频记录
 * 
 */

 function trackerMov(trackername,id){
	if(!isUserLogined()){
		return;
	}
	var idstr=GetCookie(trackername);
	if(idstr==null||idstr==""){
		idstr=id;
	}else{
		var ids = idstr.split(",");
		idstr=id;
		for(var i=0;i<ids.length;i++){
			if(id!=ids[i]){
				idstr=idstr+","+ids[i];
			}
			if(i>=100)
				break;
		}
	}
	SetCookie(trackername,idstr,2000000,'/',document.domain);
 }
 /*
 * 删除用户浏览视频记录
 * 
 */
 function delTracker(name,id){
	var idstr=GetCookie(name);
	if(idstr!=null&&idstr!=""){
		var ids = idstr.split(",");
		idstr="";
		var b=true;
		for(var i=0;i<ids.length;i++){
			if(id!=ids[i]){
				if(b){
					idstr=ids[i];
					b=false;
				}else{
					idstr=idstr+","+ids[i];
				}
			}
		}
	}
	SetCookie(name,idstr,2000000,'/',document.domain);
 }
 /*
 * 删除用户视频记录
 * 
 */
 function toDelTracker(name,id){
	if(confirm('确认删除?')){
		delTracker(name,id);
		window.location.reload();
	}
 }
 /*
 * 删除用户视频
 * 
 */
 function toDelUserMov(id){
	if(!confirm('确认删除?')){
		return;
	}
	var request = getXMLHTTPRequest();
	if(!request){
		return ;
	}
	try{
		request.open("GET", webHost+"/web/delUserMov.action?movId="+id, true);
		request.onreadystatechange = 
			function(){
				if(request.readyState==4 && request.status==200 ){
					DelUserMovCallback(request.responseText);
				}
			};
		request.send();
	}catch(e){

	}
 }
 function DelUserMovCallback(text){
	window.location.reload();
 }
 
 /*
 * load movie list callback function;
 *
 */
function loadHomePageListCallback(listhtml){
	var listdiv = document.getElementById('homemovielist');
	if(listdiv){
		listdiv.innerHTML=listhtml;
	}
}

/*
 * load movie list to homepage;
 *
 */
function loadHomePageList(listurl){
	var request = getXMLHTTPRequest();
	if(!request){
		return ;
	}
	try{
		request.open("GET", listurl, true);
		request.onreadystatechange = 
			function(){
				if(request.readyState==4 && request.status==200 ){
					loadHomePageListCallback(request.responseText);
				}
			};
		request.send();
	}catch(e){

	}
}
/*
 * 评论回复
 * 
 */
function doreviewreply(reviewid){
	var reviewtag = document.getElementById('reviewContent_'+reviewid);
	var commentbox = document.getElementById('comment_txt');
	if(reviewtag==null||commentbox==null){ return ; }
	commentbox.value="〖引用:"+reviewtag.innerHTML+"〗";
	commentbox.focus();
	document.getElementById('comment_tip_div').style.display='none';
}

function showTab_header(id){
	for(var i=1;i<4;i++){
		if(i==id){
			document.getElementById("tabs_header_"+id).className="active";
			document.getElementById("content_"+id).style.display="block";
		}
		else{
			document.getElementById("tabs_header_"+i).className="";
			document.getElementById("content_"+i).style.display="none";
		}
	}
	
}

function showTab_movie(id){
	for(var i=1;i<5;i++){
		if(i==id){
			document.getElementById("tab_"+id).className="active";
			document.getElementById("movie_tab_"+id).style.display="block";
		}
		else{
			document.getElementById("tab_"+i).className="";
			document.getElementById("movie_tab_"+i).style.display="none";
		}
	}
	
}

function showHot_movie(id){
	for(var i=1;i<5;i++){
		if(i==id){
			document.getElementById("nhot_"+id).className="active";
			document.getElementById("newHot_"+id).style.display="block";
		}
		else{
			document.getElementById("nhot_"+i).className="";
			document.getElementById("newHot_"+i).style.display="none";
		}
	}
}

function showPipi_yx(id){
	for(var i=1;i<5;i++){
		if(i==id){
			document.getElementById("tyx_"+id).className="active";
			document.getElementById("yx_"+id).style.display="block";
		}
		else{
			document.getElementById("tyx_"+i).className="";
			document.getElementById("yx_"+i).style.display="none";
		}
	}
}

function showPipiDown() {
	document.writeln("                            <dt><a href=\"http://www.pipi.cn/down/\" title=\"皮皮播放器下载\" target=\"_blank\"><img src=\"/images/icon_download2.gif\" alt=\"皮皮播放器下载\" /></a></dt>");
	document.writeln("                            <dd><a href=\"http://dl.pipi.cn/pipi.exe\" title=\"本地\" target=\"_blank\">本地</a></dd>");
	document.writeln("                            <dd>|</dd>");
	document.writeln("                            <dd><a href=\"http://download.tech.qq.com/soft/62/63/59448/index.shtml\" title=\"腾讯\" target=\"_blank\">腾讯</a></dd>");
	document.writeln("                            <dd>|</dd>");
	document.writeln("                            <dd><a href=\"http://rd.qihoo.com/qd.html?u=http%253A%252F%252Fdl.pipi.cn%252Fpipi_safe_36.exe&amp;t=1226293715&amp;c=1&amp;a=9&amp;p=6003&amp;s=0db95951b312b0e8b82a615f8d749013\" title=\"360安全卫士版\" target=\"_blank\">360安全卫士版</a></dd>");
	document.writeln("                            <dd>|</dd>");
	document.writeln("                            <dd><a href=\"http://www.crsky.com/soft/11320.html\" title=\"霏凡\" target=\"_blank\">霏凡</a></dd>");
	document.writeln("                            <dd>|</dd>");
	document.writeln("                            <dd><a href=\"http://dl.pconline.com.cn/html_2/1/109/id=50157&pn=0.html\" title=\"太平洋\" target=\"_blank\">太平洋</a></dd>");
	document.writeln("                            <dd>|</dd>");
	document.writeln("                            <dd><a href=\"http://www.newhua.com/soft/71710.htm\" title=\"华军\" target=\"_blank\">华军</a></dd>");
	document.writeln("                            <dd>|</dd>");
	document.writeln("                            <dd><a href=\"http://download.it168.com/179/185/107116/index.shtml\" title=\"IT168\" target=\"_blank\">IT168</a></dd>");
}

function showNewPipiDown() {
	document.writeln("  <div class=\"download\">");
	document.writeln("  	<a href=\"http://www.pipi.cn/down/\" class=\"down_btn\"><span id='downnum'>3,3534,2314</span>次下载</a>");
	document.writeln("  	<p>");
	document.writeln("  		安全可靠、绿色免费的影视点播平台。");
	document.writeln("  	</p>");
	document.writeln("  	<p class=\"downlnk\">");
	document.writeln("  		<a href=\"http://download.tech.qq.com/soft/62/63/59448/index.shtml\" target=\"_blank\">腾讯</a> |");
	document.writeln("  		<a href=\"http://rd.qihoo.com/qd.html?u=http%253A%252F%252Fdl.pipi.cn%252Fpipi_safe_36.exe&amp;t=1226293715&amp;c=1&amp;a=9&amp;p=6003&amp;s=0db95951b312b0e8b82a615f8d749013\" target=\"_blank\">360安全卫士版</a> |");
	document.writeln("  		<a href=\"http://www.crsky.com/soft/11320.html\" target=\"_blank\">霏凡</a> |");
	document.writeln("  		<a href=\"http://dl.pconline.com.cn/html_2/1/109/id=50157&pn=0.html\" target=\"_blank\">太平洋</a> |");
	document.writeln("  		<a href=\"http://www.newhua.com/soft/71710.htm\" target=\"_blank\">华军</a> |");
	document.writeln("  		<a href=\"http://download.it168.com/179/185/107116/index.shtml\" target=\"_blank\">IT168</a>");
	document.writeln("  	</p>");
	document.writeln("  </div>"); 
	_dl._run();
}

function showNew3PipiDown() {
	document.writeln('<div class="pipi_down">');
	document.writeln('	<p><a href="/down/" target="_blank" id="downnumindex"></a></p>');	
	document.writeln('</div>');	
	_dl._run();
}

function showNew2PipiDown() {
	//var movTotal=11111111;
	document.writeln('<div class="pipi_down">');
	document.writeln('	<p><a href="/down/" target="_blank" id="downnumindex"></a></p>');
	document.writeln('	<p class="vtotal">本站共收录 '+movTotal+' 个视频</p>');
	document.writeln('</div>');	
	_dl._run();
}

function pipiDown() {
	document.writeln('	<p class="count" id="down"></p>');
	_dl._run();
}

function rightBottomAd(){
	var abc = document.getElementById("msn2");
	abc.style.top = document.documentElement.scrollTop+document.documentElement.clientHeight-200+"px"; 
	setTimeout(function(){rightBottomAd();},80);
}


function showFooter() {
	document.writeln("<div class=\"clearbar\"></div>");
	document.writeln("<div id=\"footer\">");	
    document.writeln("		<p class=\"beihao\">");
	document.writeln("			<a href=\"http://www.pipi.cn/about.html\" title=\"网站简介\" target=\"_blank\">网站简介</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"http://www.pipi.cn/cooperate.html\" title=\"商务合作\" target=\"_blank\">商务合作</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"http://www.pipi.cn/statement.html\" title=\"版权声明\" target=\"_blank\">版权声明</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"http://www.pipi.cn/contact.html\" title=\"联系我们\" target=\"_blank\">联系我们</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"http://www.pipi.cn/hr.html\" title=\"诚聘英才\" target=\"_blank\">诚聘英才</a>");
	document.writeln("		</p>");
	document.writeln("		<p>");
	document.writeln("			<a href=\"http://www.pipi.cn/licence.html\" style=\"color:red\" target=\"_blank\">信息网络传播视听节目许可证1109373号</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://www.miibeian.gov.cn/\">浙ICP备06002860</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://www.chinasarft.gov.cn/articles/2008/03/08/20080710153334610592.html\">互联网视听节目服务自律公约</a><br/>广播电视节目制作经营许可证（浙）字第548号&nbsp;&nbsp;&nbsp;&nbsp;网络文化经营许可证文网文[2007]020号");
	document.writeln("		</p>");
	document.writeln("		<p>");
	document.writeln("			Copyright © 2006-2009 <a href=\"http://www.pipi.cn/\" title=\"皮皮网\">皮皮网</a> All Rights Reserved.<br />");
	document.writeln("			<a href=\"http://validator.w3.org/check?uri=referer\" title=\"Valid XHTML 1.0 Strict\"><span class=\"italic\">Valid XHTML 1.0 Strict</span></a> - <a href=\"http://jigsaw.w3.org/css-validator/\" title=\"Valid CSS!\"><span class=\"italic\">Valid CSS!</span></a><br />");
	document.writeln("			<a href=\"http://www.pingpinganan.gov.cn/web/index.aspx\" target=\"_blank\"><img src=\"http://www.pipi.cn/images/ping_anan.jpg\" border=\"0\" ></a>");
	document.writeln("			<a href=\"http://ulic.baidu.com/client/clientDetailCerInfo.do?id=1809\" target=\"_blank\"><img src=\"http://www.pipi.cn/images/gold.gif\" border=\"0\" alt=\"百度大联盟认证绿色会员\" ></a>");
	document.writeln("		</p>");
	document.writeln("	</div>");
	document.writeln("<div style=\"display:none;\"><scr"+"ipt src=' http://w.cnzz.com/c.php?id=30026790' language='JavaScript' charset='gb2312'></scri"+"pt></div>");
}


function showIndexFooter() {
	document.writeln("<div class=\"clearbar\"></div>");
	document.writeln("<div id=\"footer\">");
	document.writeln("		<div class=\"frdlink\">");
	document.writeln("			<strong>友情链接</strong>：");
	document.writeln("                            <a href=\"http://www.88488.com\" title=\"88488网址导航\" target=\"_blank\">88488网址导航</a>");
	document.writeln("                            <a href=\"http://www.nimatour.com \" title=\"尼玛旅游\" target=\"_blank\">尼玛旅游</a>");
	document.writeln("                            <a href=\"http://www.hy960.com\" title=\"华语之声\" target=\"_blank\">华语之声</a>");
	document.writeln("                            <a href=\"http://dl.pconline.com.cn\" title=\"太平洋下载\" target=\"_blank\">太平洋下载</a>");
	document.writeln("                            <a href=\"http://download.pcpop.com\?pi \" title=\"泡泡网下载\" target=\"_blank\">泡泡网下载</a>");
	document.writeln("                            <a href=\"http://download.tech.qq.com\" title=\"腾讯QQ\" target=\"_blank\">腾讯QQ</a>");
	document.writeln("                            <a href=\"http://www.itxiazai.com\" title=\"IT世界\" target=\"_blank\">IT世界</a>");
	document.writeln("                            <a href=\"http://www.morequick.com/indexgb.htm\" title=\"绿色浏览器\" target=\"_blank\">绿色浏览器</a>");
	document.writeln("                            <a href=\"http://hao.360.cn\" title=\"360网址导航\" target=\"_blank\">360网址导航</a>");
	document.writeln("                            <a href=\"http://www.zhijizhibi.com\" title=\"知己知彼网\" target=\"_blank\">知己知彼网</a>");
	document.writeln("                            <a href=\"http://www.zwuqi.com\" title=\"硬件检测\" target=\"_blank\">硬件检测</a>");
	document.writeln("                            <a href=\"http://kb.pipi.cn\" title=\"皮皮口碑推广\" target=\"_blank\">皮皮口碑推广</a>");
	document.writeln("                            <a href=\"http://zt.pipi.cn\" title=\"皮皮专题\" target=\"_blank\">皮皮专题</a>");
	document.writeln("                            <a href=\"http://game.pipi.cn\" title=\"皮皮游戏\" target=\"_blank\">皮皮游戏</a>");
	document.writeln("                            <a href=\"http://ent.pipi.cn\" title=\"皮皮娱乐\" target=\"_blank\">皮皮娱乐</a>");
	document.writeln("                            <a href=\"http://find.pipi.cn\" title=\"皮皮搜索\" target=\"_blank\">皮皮搜索</a>");
	document.writeln("                            <a href=\"http://www.m20080808.cn\" title=\"皮皮连续剧\" target=\"_blank\">皮皮连续剧</a>");
	document.writeln("                            <a href=\"http://www.ppmovie.com\" title=\"皮皮电影\" target=\"_blank\">皮皮电影</a>");
	document.writeln("                            <a href=\"http://www.58daohang.com\" title=\"网吧导航\" target=\"_blank\">网吧导航</a>");
	document.writeln("                            <a href=\"http://www.xingshow.com\" title=\"型秀网\" target=\"_blank\">型秀网</a>");
    document.writeln("                            <a href=\"http://www.hcrt.cn \" title=\"杭州文广网\" target=\"_blank\">杭州文广网</a>");
	document.writeln("                            <a href=\"http://www.syccms.com \" title=\"电影程序\" target=\"_blank\">电影程序</a>");
    document.writeln(" </div>");
    document.writeln("		<p class=\"beihao\">");
	document.writeln("			<a href=\"/about.html\" title=\"网站简介\" target=\"_blank\">网站简介</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"/cooperate.html\" title=\"商务合作\" target=\"_blank\">商务合作</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"/statement.html\" title=\"版权声明\" target=\"_blank\">版权声明</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"/contact.html\" title=\"联系我们\" target=\"_blank\">联系我们</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.writeln("			<a href=\"/hr.html\" title=\"诚聘英才\" target=\"_blank\">诚聘英才</a>");
	document.writeln("		</p>");
	document.writeln("		<p>");
	document.writeln("			<a href=\"/licence.html\" style=\"color:red\" target=\"_blank\">信息网络传播视听节目许可证1109373号</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://www.miibeian.gov.cn/\">浙ICP备06002860</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://www.chinasarft.gov.cn/articles/2008/03/08/20080710153334610592.html\">互联网视听节目服务自律公约</a><br/>广播电视节目制作经营许可证（浙）字第548号&nbsp;&nbsp;&nbsp;&nbsp;网络文化经营许可证文网文[2007]020号");
	document.writeln("		</p>");
	document.writeln("		<p>");
	document.writeln("			Copyright © 2006-2009 <a href=\"http://www.pipi.cn/\" title=\"皮皮网\">皮皮网</a> All Rights Reserved.<br />");
	document.writeln("			<a href=\"http://validator.w3.org/check?uri=referer\" title=\"Valid XHTML 1.0 Strict\"><span class=\"italic\">Valid XHTML 1.0 Strict</span></a> - <a href=\"http://jigsaw.w3.org/css-validator/\" title=\"Valid CSS!\"><span class=\"italic\">Valid CSS!</span></a><br />");
	document.writeln("			<a href=\"http://www.pingpinganan.gov.cn/web/index.aspx\" target=\"_blank\"><img src=\"http://www.pipi.cn/images/ping_anan.jpg\" border=\"0\" ></a>");
	document.writeln("			<a href=\"http://ulic.baidu.com/client/clientDetailCerInfo.do?id=1809\" target=\"_blank\"><img src=\"http://www.pipi.cn/images/gold.gif\" border=\"0\" alt=\"百度大联盟认证绿色会员\" ></a>");
	document.writeln("		</p>");
	document.writeln("	</div>");	
	document.writeln("<div style=\"display:none;\"><scr"+"ipt src=' http://w.cnzz.com/c.php?id=30026790' language='JavaScript' charset='gb2312'></scri"+"pt></div>");
}


function showHeader() {		
document.writeln('<div id="header">');

document.writeln('<div class="topper" style="margin-top:13px;">');
document.writeln('  	<h1 class="logo"><a href="http://www.pipi.cn/" title="皮皮网"><img src="http://www.pipi.cn/images/logo.gif" width="150" height="52" alt="皮皮网" /></a><img src="http://www.pipi.cn/images/kouhao.gif" width="179" height="18" alt="中国最高请的在线影视" /></h1>');
document.writeln('    <div class="tui"></div>');
document.writeln('    <div class="topnav">');
document.writeln('    <span class="userlink" id="topspan">&nbsp;</span><span class="qlink"> </span>');
document.writeln('    </div>');
document.writeln('</div>');
 // <!--#topnav-->
    
     
document.writeln('  <div class="navbar">');
document.writeln('  <div class="navbar_l"></div>');
    
document.writeln('    <ul class="nav">');
document.writeln('    <li><a href="http://www.pipi.cn/"><strong>首页</strong></a></li>');
//document.writeln('    <li><a href="http://home.pipi.cn/mymv_myMovs.php"><strong>我的影视</strong></a></li>');
document.writeln('    <li><a href="http://www.pipi.cn/search/list/films/new/1.html"><strong>电影</strong></a></li>');
document.writeln('    <li><a href="http://www.pipi.cn/list/111/new/1.html"><strong>电视剧</strong></a></li>');
document.writeln('    <li><a href="http://www.pipi.cn/search/list/dm/new/1.html"><strong>动漫</strong></a></li>');
document.writeln('    <li><a href="http://www.pipi.cn/search/list/zy/new/1.html"><strong>综艺</strong></a></li>');
document.writeln('    <li><a href="http://www.pipi.cn/list/96/new/1.html"><strong>超高清</strong></a></li>');
document.writeln('    </ul>');
        
document.writeln('    <ul class="toolslnk">');
document.writeln('    <li><a href="http://www.pipi.cn/list/99/new/1.html">焦点视频</a></li>');
document.writeln('    <li><a href="http://www.pipi.cn/top10.html">热门排行</a></li>');
document.writeln('    <li><a href="http://zt.pipi.cn/">精彩专题</a></li>');
document.writeln('    <li><a href="http://ent.pipi.cn/">娱乐资讯</a></li>');
document.writeln('    </ul>');
document.writeln('    <div class="navbar_r"></div>');
document.writeln('    </div>');//<!--.navbar-->     

document.writeln('</div>');//<!--#header-->	
}

function showHeaderIncludeSearch(){
	document.writeln('<div class="qu_search">');
	document.writeln('<div class="search_hot"><strong>热门搜索：</strong><script src="http://www.pipi.cn/hotmovs.js"></script></div>');
    document.writeln('<div class="srchform">');
    document.writeln('<form id="search_form" name="search_form" action="http://find.pipi.cn/search" method="get"  target="_blank">');
    document.writeln('<input type="hidden" id="cl" name="cl" value="4" />');
    document.writeln('<input name="ie" type="hidden" value="UTF-8" />');
    document.writeln('<input name="ps" type="hidden" value="10" />');
    document.writeln('<input name="np" type="hidden" value="1" />');
    document.writeln('<input name="fm" type="hidden" value="off" />');
    document.writeln('<span class="qsrch_text"><input type="text" id="search_keywords" name="q" type="text" value="" title="片名、主演、导演" /></span>');
    document.writeln('<div class="qsrch_butt">');
    document.writeln('    <input type="submit" name="button" id="button" value="搜 索" class="qsrch_submit" />');
    document.writeln('    <a href="" class="arrow_dwn" onmouseover="showSub();return false;"><img src="/images/qsrch_arrow_dwn.gif" width="23" height="25" alt="" /></a>'); 
    document.writeln('</div>');
    document.writeln('    <div class="hidsub" id="_hidsub" style="display:none;"> <a href="#" onclick="checkcl(0);">片名</a><a href="#" onclick="checkcl(1);">主演</a><a href="#" onclick="checkcl(2);">导演</a><a href="#" onclick="checkcl(4);">全部</a></div>');
    document.writeln('</form>');
    document.writeln('</div>');
	document.writeln('</div>');
}

function showHeaderIndex() {
document.writeln('<div id="header">');
document.writeln('  <div class="topnav">');
document.writeln('    <ul>');
document.writeln('      <li> <span class="userlink" id="topspan">');
document.writeln('       &nbsp;');
document.writeln('       </span> ');
document.writeln('		<span class="qlink">| <a href="http://www.pipi.cn/down/">播放器下载</a></span> </li>');
document.writeln('    </ul>');
document.writeln('  </div>');
 // <!--#topnav-->
    
document.writeln('  <div class="topper">');
document.writeln('    <h1 class="logo"><a href="#3" title="皮皮网"> <img src="/images/logo.gif" width="150" height="52" alt="皮皮网" /></a></h1>');
document.writeln('    <div class="tui"><a href="#3"></a></div>');
document.writeln('    </div>');//<!--#topper--><img src="" width="346" height="65" alt="" />
    
     
document.writeln('  <div class="navbar">');
document.writeln('  <div class="navbar_l"></div>');
    
document.writeln('    <ul class="nav">');
document.writeln('    <li><a href="/"><strong>首页</strong></a></li>');
//document.writeln('    <li><a href="http://home.pipi.cn/mymv_myMovs.php"><strong>我的影视</strong></a></li>');
document.writeln('    <li><a href="/search/list/films/new/1.html"><strong>电影</strong></a></li>');
document.writeln('    <li><a href="/list/111/new/1.html"><strong>电视剧</strong></a></li>');
document.writeln('    <li><a href="/search/list/dm/new/1.html"><strong>动漫</strong></a></li>');
document.writeln('    <li><a href="/search/list/zy/new/1.html"><strong>综艺</strong></a></li>');
document.writeln('    <li><a href="/list/96/new/1.html"><strong>高清</strong></a></li>');
document.writeln('    </ul>');
        
document.writeln('    <ul class="toolslnk">');
document.writeln('    <li><a href="/list/99/new/1.html">焦点视频</a></li>');
document.writeln('    <li><a href="/top10.html">热门排行</a></li>');
document.writeln('    <li><a href="http://zt.pipi.cn/">精彩专题</a></li>');
document.writeln('    <li><a href="http://ent.pipi.cn/">娱乐资讯</a></li>');
document.writeln('    </ul>');
document.writeln('    <div class="navbar_r"></div>');
document.writeln('    </div>');//<!--.navbar-->     

document.writeln('</div>');//<!--#header-->	
}

function showSearchCl(id){
	for(var i=0;i<5;i++){
		if(i!=3){
			if(id==i){
				document.getElementById("cr_tab_"+id).className="cr_tab";
				document.getElementById("cl").value=id;
			}
			else{
				document.getElementById("cr_tab_"+i).className="";
			}
		}		
	}
}

function showInfo(userinfo,_error){
	if(userinfo!=null){
		if(document.getElementById("span_username_1")!=null){
			document.getElementById("userName_1").value=userinfo.username;
			document.getElementById("userName_1").readOnly="readOnly";
			if(document.getElementById("userName_2")!=null){
				document.getElementById("userName_2").value=userinfo.username;
				document.getElementById("userName_2").readOnly="readOnly";
			}
		}
		this.SetCookie("username",userinfo.username);
		if(userinfo.realname==null || userinfo.realname==""){
			this.SetCookie("usernickname",userinfo.username);
		}else{
			this.SetCookie("usernickname",userinfo.realname);
		}
		this.SetCookie("uid",userinfo.uid);
		this.SetCookie("useravatar",userinfo.avatar?"":"http://www.pipi.cn/images/nophoto.jpg");
		document.getElementById("topspan").innerHTML='<a href="http://home.pipi.cn/space.php?do=home">'+userinfo.username+'</a>, <a href="http://home.pipi.cn/api-userlogin/index.php?op=logout" class="signout" id="toplogout" target="xx">退出</a> | <a href="http://home.pipi.cn/mymv_myMovs.php">影片收藏</a>';
		/*if(document.getElementById("signform")!="undefind" && document.getElementById("signform")!=null){
			document.getElementById("myspace").href="http://home.pipi.cn/space.php?uid="+userinfo.uid;
			document.getElementById("mylogout").href="http://home.pipi.cn/api-userlogin/index.php?op=logout";
			//document.getElementById("signform").style.display="none";
			//document.getElementById("signinok").style.display="block";
			if(userinfo.avatar=="" || userinfo.avatar==null){
				document.getElementById("login_avator").src="/images/nophoto.jpg";
			}else{
			document.getElementById("login_avator").src=userinfo.avatar;
			}
			//document.getElementById("avator_href").href="http://home.pipi.cn/space.php?uid="+userinfo.uid;
			
			//document.getElementById("login_username").innerHTML=userinfo.username;
			//document.getElementById("login_href").href="http://home.pipi.cn/space.php?uid="+userinfo.uid;
			
			//document.getElementById("grouptitle").innerHTML=userinfo.grouptitle;
			//document.getElementById("experience").innerHTML=userinfo.experience;
			//document.getElementById("credit").innerHTML=userinfo.credit;			
		}*/
		if(document.getElementById("scspan")!=null){
			document.getElementById("scspan").style.display="block";
		}		
	}
	else{
		if(_error==0){
			alert("用户名或者密码错误，请重新输入！");
			return false;
		}
		if(document.getElementById("span_username_1")!=null){
			document.getElementById("userName_1").value="匿名游客";
			document.getElementById("userName_1").readOnly=false;
			if(document.getElementById("userName_2")!=null){
				document.getElementById("userName_2").value="匿名游客";;
				document.getElementById("userName_2").readOnly="readOnly";
			}
			document.getElementById("span_username_1").innerHTML='已注册会员，请 <a href="http://home.pipi.cn/do.php?ac=login">登录</a> 后发表影评。';
			if(document.getElementById("span_username_2")!=null){
				document.getElementById("span_username_2").innerHTML='已注册会员，请 <a href="http://home.pipi.cn/do.php?ac=login">登录</a> 后发表影评。';
			}
			
		}
		/*if(document.getElementById("signform")!=null){
			document.getElementById("password").value="";
			document.getElementById("username").value="";
			chkInputValue(document.getElementById("username"),false);
			document.getElementById("signform").style.display="block";
			document.getElementById("signinok").style.display="none";
		}*/
		document.getElementById("topspan").innerHTML='<span class="qlink"><a href="http://home.pipi.cn/do.php?ac=login" id=>登录</a></span> <span class="qlink">| <a href="http://home.pipi.cn/do.php?ac=reg">注册</a></span>';
		if(document.getElementById("review_5")!=null){
			if(document.getElementById("review_5").style.display=="block"){
				var _iframe=document.getElementById("iframecomdetail");
				var _src = _iframe.src;
				_iframe.src=_src;
				//document.iframecomdetail.document.getElementById("nickname").value="匿名游客";		
				//document.iframecomdetail.document.getElementById("_iflogin").innerHTML='已注册会员，请 <a href="http://home.pipi.cn/do.php?ac=login">登录</a> 后发表影评。';
			}
		}
		if(document.getElementById("iframecomment")!=null){
			var _iframe=document.getElementById("iframecomment");
			var _src = _iframe.src;
			_iframe.src=_src;
		}
		if(document.getElementById("scspan")!=null){
			document.getElementById("scspan").style.display="none";
		}
		if(document.getElementById("_iframeup")!=null){
			var _iframe=document.getElementById("_iframeup");
			var _src = _iframe.src;
			_iframe.src=_src;
		}
	}
}

function playfsover(id,order){
	var showdiv = document.getElementById("showdiv_id").value;
	var _divid = 'channel_'+id+'_'+order;
	if(showdiv!=""){
		if(showdiv!=_divid){
			document.getElementById(showdiv).style.display="none";
			document.getElementById(_divid).style.display='block';			
		}else{
			document.getElementById(_divid).style.display='block';		
		}
			
	}else{
		document.getElementById(_divid).style.display='block';
	}
	document.getElementById("showdiv_id").value = _divid;
}
function playfsout(id,order){
	document.getElementById('channel_'+id+'_'+order).style.display='none';
}
function showreview(){

}
function editreview(){
	var u =window.location.href.split("=");
	if(u.length>2){
		var _s= '<scri'+'pt'+' type="text/javascript" src="http://user.pipi.cn/common/comments/js/'+Math.floor(u[2]/1000)+'/'+u[2]+'.js"></script>';
		document.write(_s);
	}
}


function geturl(){
	var u =window.location.href.split("=");
	if(u.length>2){
		var _u=u[1].split("&");
		if(_u[0]==6){
		  document.getElementById("review_6").style.display="block";
		  comment.edit._revId=u[2];		
		  comment.edit._movId=_movId;
		  //alert(comment.edit.showInfo());
		  comment.edit.showInfo();
		}
		else{
			var _iframe=document.getElementById("iframecomdetail");		
			_iframe.src="http://user.pipi.cn/common/comments/list/"+Math.floor(u[2]/1000)+"/"+u[2]+"_1.html";
			setTimeout(function(){(document.title=document.frames["iframecomdetail"].document.getElementsByTagName("h3")[0].innerHTML+" "+_movName);},500);
			//setInterval()
			document.getElementById("review_5").style.display="block";
		}
		
		
	}else{
		document.getElementById("comment_title").size=50;
		document.getElementById("review_5").style.display="none";
		document.getElementById("review_6").style.display="none";
		for(var i=1;i<5;i++){
			if(u[1]==i){
				document.getElementById("review_"+i).style.display="block";
				if(i==1){
					document.getElementById("jpspan").innerHTML="查看全部简评";
				
				}
				if(i==4){
					document.getElementById("ypspan").innerHTML="查看全部影评";
				}
			}
			else{
				document.getElementById("review_"+i).style.display="none";
			}
		}
	}
	
}
function showstar(_star,_review,_isreview,id){
	var _s="";
	if(_star<5){
		_star=5;
	}
	if(_star>9 || _star==9){
		_s = "<img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/> ";
	}
	if(_star>8 && _star<9 || _star==8){		
		_s = "<img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt0.5.gif\" width=\"9\" height=\"8\"/> ";
	}
	if(_star>7 && _star<8 || _star==7){
		_s = "<img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt0.gif\" width=\"9\" height=\"8\"/> ";
	}
	if(_star>6 && _star<7 || _star==6){
		_s = "<img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt0.5.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt0.gif\" width=\"9\" height=\"8\"/> ";
	}
	if(_star>=5 && _star<6){
		_s = "<img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt1.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt0.gif\" width=\"9\" height=\"8\"/><img src=\"/images/srt0.gif\" width=\"9\" height=\"8\"/> ";
	}
	if(_isreview){
		_s=_s+_star+" <span>("+_review+"条评论)</span>";
	}
	else{
		_s=_s+_star;
	}
	document.getElementById(id).innerHTML=_s;
}

var _dl={
 _od:new Date(2010,2,23,0,0,0),
 _orig:344342314,
 _c:452638,
 _p:5.24,
 _f:0,
 _mi:[1,2,3,4,5,6],
 _run:function() {
var _d=new Date();
var _day=Math.floor((_d.getTime()-this._od.getTime())/(1000*3600*24));
var _s=_d.getHours()*3600+_d.getMinutes()*60+_d.getSeconds();
this._f=this._orig+_day*this._c+Math.floor(_s*this._p);
var _t=_dl._mi[Math.floor(Math.random()*_dl._mi.length)];
this._change(_t);
 },
 _once:function() {
var _t=_dl._mi[Math.floor(Math.random()*_dl._mi.length)];
window.setTimeout(function(){_dl._change(_t)},_t*1000);
 },
 _change:function(_n) {
_dl._f+=Math.floor(_n*_dl._p);
if(document.getElementById("downnumindex")!=null){
document.getElementById("downnumindex").innerHTML=_dl._format(_dl._f)+"次下载";
}
if(document.getElementById("downnum")!=null){
document.getElementById("downnum").innerHTML=_dl._format(_dl._f);
}
if(document.getElementById("down")!=null){
document.getElementById("down").innerHTML="累计下载 "+_dl._format(_dl._f)+" 次";
}
_dl._once();
 },
_format:function(_n) {
var _a=[];
var _temp;
while (_n!=0) {
_temp=_n % 10000; 
_n=(_n-_temp)/10000;
if (_temp<1000) {
var _l=(""+_temp).length;
for (var i=_l;i<4;i++) {
_temp="0"+_temp;
}
} 
_a.push(_temp);
}
_a.reverse();
var _s=_a.join(",");
while (_s.indexOf("0")==0) {
_s=_s.substr(1);
}
return _s;
 }
}


function showResult(pageInfo,searchInfo,movListResult){
	//var q = escape(searchInfo.esearchkeyword);
	var q = searchInfo.searchkeyword;
	var totalRecord = pageInfo.totalRecord;
	var totalRecordMov = pageInfo.totalRecordMov;	
	var totalRecordTv = pageInfo.totalRecordTv;
	var totalRecordDm = pageInfo.totalRecordDm;
	var totalRecordOther = pageInfo.totalRecordOther;
	var pageCurrent = pageInfo.pageCurrent;
	var totalRecordZy = pageInfo.totalRecordZy;
	
	var ps =18;
	//"+cl+","+ps+","+tp+","+stp+","+ft+","+ar+","+la+","+pa+","+dr+","+sb+","+st+"
	//var cl=searchInfo.searchCl;
	var cl=searchInfo.searchCl;	
	var ar=searchInfo.searchArea;
	var la=searchInfo.searchYz;
	var sb=searchInfo.searchSb;
	var st=searchInfo.searchSt;
	var pa=searchInfo.searchPa;
	var dr=searchInfo.searchDr;
	var tp=searchInfo.searchTp;
	var stp=searchInfo.searchStp;
	var ft=searchInfo.searchYear;
	var _s="";
	var _class_1="";
	var _class_2="";
	var _class_3="";
	var _class_4="";
	var outstr = "";
	if(st==1){
		_s+='<div class="titbar">';
		_s+='<h3>排序:</h3>';
		_s+='<ul class="subtab">';
		if(sb!=null){
			if(sb==4){
				_s+='<li id="tab_1" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',1,1)">最近更新</a></li>';
				_s+='<li id="tab_2" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',2,1)">人气最旺</a></li>';
				_s+='<li id="tab_3" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',3,1)">打分最高</a></li>';
				_s+='<li id="tab_4" class="curtab"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',4,1)">评论最多</a></li>';
			}
			else if(sb==3){
				_s+='<li id="tab_1" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',1,1)">最近更新</a></li>';
				_s+='<li id="tab_2" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',2,1)">人气最旺</a></li>';
				_s+='<li id="tab_3" class="curtab"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',3,1)">打分最高</a></li>';
				_s+='<li id="tab_4" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',4,1)">评论最多</a></li>';
			}
			else if(sb==2){
				_s+='<li id="tab_1" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',1,1)">最近更新</a></li>';
				_s+='<li id="tab_2" class="curtab"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',2,1)">人气最旺</a></li>';
				_s+='<li id="tab_3" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',3,1)">打分最高</a></li>';
				_s+='<li id="tab_4" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',4,1)">评论最多</a></li>';
			}
			else{
				_s+='<li id="tab_1" class="curtab"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',1,1)">最近更新</a></li>';
				_s+='<li id="tab_2" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',2,1)">人气最旺</a></li>';
				_s+='<li id="tab_3" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',3,1)">打分最高</a></li>';
				_s+='<li id="tab_4" onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\'"><a href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\''+tp+'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\',4,1)">评论最多</a></li>';
			}
		}
		_s+='</ul>';
		_s+='</div>';
	}
	else{
		var _searchTop="";
		//alert(q);
		if(q==""){
			alert("搜索关键字不能为空！");
			windows.close();
		}else{
			var _oq=document.getElementById("search_keywords").value;
			if(_oq!=q){
				document.getElementById("search_keywords").value=q;		
				for(var i=0;i<5;i++){
					if(i!=3){
						if(cl==i){
							document.getElementById("cr_tab_"+cl).className="cur";
							document.getElementById("cl").value=cl;
						}
						else{
							document.getElementById("cr_tab_"+i).className="";
						}
					}		
				}
				_searchTop+='<p class="re_so" id="s"><strong>搜索结果</strong> 共找到 <em>'+totalRecord+'</em> 条与“<em>'+q+'</em>”相关的结果。</p>';	
				_searchTop+='<ul>';
				_searchTop+='<li><a id="search_all" class="checked" href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\'\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\','+sb+','+st+')">全部('+totalRecord+')</a> <a id="search_mov" href="javascript:void(0)" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\'电影\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\','+sb+','+st+')">电影('+totalRecordMov+')</a> <a href="#3" id="search_tv" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\'电视剧\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\','+sb+','+st+')">电视剧('+totalRecordTv+')</a> <a href="#3" id="search_dm" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\'动漫\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\','+sb+','+st+')">动漫('+totalRecordDm+')</a> <a href="#3" id="search_ot" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\'其他\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\','+sb+','+st+')">其它('+totalRecordOther+')</a> <a href="#3" id="search_zy" onclick="gotopage(1,\''+q+'\',\''+cl+'\',18,\'综艺\',\''+stp+'\',\''+ft+'\',\''+ar+'\',\''+la+'\',\''+pa+'\',\''+dr+'\','+sb+','+st+')">综艺('+totalRecordZy+')</a></li>';
				_searchTop+='</ul>';		
				document.getElementById("search_top").innerHTML=_searchTop;
				_searchTop="";
			}
			else{
				if(tp==""){
					document.getElementById("search_all").className="checked";
					document.getElementById("search_mov").className="";
					document.getElementById("search_tv").className="";
					document.getElementById("search_dm").className="";
					document.getElementById("search_ot").className="";
					document.getElementById("search_zy").className="";
				}else if(tp=="电影"){
					document.getElementById("search_mov").className="checked";
					document.getElementById("search_all").className="";
					document.getElementById("search_tv").className="";
					document.getElementById("search_dm").className="";
					document.getElementById("search_ot").className="";
					document.getElementById("search_zy").className="";
				}
				else if(tp=="电视剧"){
					document.getElementById("search_tv").className="checked";
					document.getElementById("search_all").className="";
					document.getElementById("search_mov").className="";
					document.getElementById("search_dm").className="";
					document.getElementById("search_ot").className="";
					document.getElementById("search_zy").className="";
				}
				else if(tp=="动漫"){
					document.getElementById("search_dm").className="checked";
					document.getElementById("search_all").className="";
					document.getElementById("search_mov").className="";
					document.getElementById("search_tv").className="";
					document.getElementById("search_ot").className="";
					document.getElementById("search_zy").className="";
				}
				else if(tp=="其他"){
					document.getElementById("search_ot").className="checked";
					document.getElementById("search_all").className="";
					document.getElementById("search_mov").className="";
					document.getElementById("search_tv").className="";
					document.getElementById("search_dm").className="";
					document.getElementById("search_zy").className="";
				}else{
					document.getElementById("search_zy").className="checked";
					document.getElementById("search_all").className="";
					document.getElementById("search_mov").className="";
					document.getElementById("search_tv").className="";
					document.getElementById("search_ot").className="";
					document.getElementById("search_dm").className="";
				}
			}
		}
	}
	if(movListResult.length>0){
		for(var i=0;i<movListResult.length;i++){
			_s+='<div class="rcrow clearfix">';
			_s+='	<div class="mposter v_shdow">';
			_s+='	<a href="'+movListResult[i].url+'" title="'+movListResult[i].name+'" target="_blank"><img name="_imgUrl" src="'+movListResult[i].img+'" width="112" height="150" alt="'+movListResult[i].name+'" /></a>';
			_s+='	</div>';
			_s+='	<div class="intro w483 ml12">';
			_s+='	<h4><a href="'+movListResult[i].url+'" title="'+movListResult[i].name+'" target="_blank">'+movListResult[i].name+'</a></h4>';

			_s+='	<ul class="meta clearfix">';
			_s+='	<li>';
			_s+='	<span class="player">演员: '+movListResult[i].playactor+'</span>';
			_s+='	<span class="time">年代: '+movListResult[i].first_time+'</span>';
			_s+='	</li>';
			_s+='	<li>';
			_s+='	<span class="director">导演: '+movListResult[i].director+'</span>';
			_s+='	<span class="area">国家/地区: '+movListResult[i].area+'</span>';
			_s+='	<span class="type">类型: '+movListResult[i].sub_type+'</span>';
			_s+='	</li>';
			_s+='	</ul>';
			_s+='	<p class="jq">'+movListResult[i].desc+'</p>';
			_s+='	<div class="clearfix">';
			_s+=movListResult[i].playlist;			
			_s+='	<a class="binfo" href="'+movListResult[i].url+'" title="'+movListResult[i].name+'" target="_blank">详情</a>';
			_s+='	<span class="pf">评分: <strong>'+movListResult[i].dafen_num.toFixed(2)*2+'</strong> 分 ('+movListResult[i].pingfenren_num+' 次)</span>';
			_s+='	<span class="pl">评论: <strong>'+movListResult[i].pinglun_num+'</strong> 条</span>';
			_s+='	</div>';
			_s+='	</div>';
			_s+='</div>';
			if(i==2){
				_s+='<iframe marginWidth="0" marginHeight="0" frameBorder="0" width="645" scrolling="no" height="90" id="new_list_show_list" src="/new_list_show_list.html"></iframe>';				
			}
			var _t ="";
			/*try {
				_t=pp.siteConfig.action.getRefferInfo(movListResult[i].id);									
				document.getElementById("_play_"+movListResult[i].id+"_1").href=_t[1]+"#play";
			} catch(e) {}*/
		}
		outstr+='<div class="pages clearfix">';
		if(pageInfo.pageCount<=10){       //总页数小于十页   
			if(cpage>1){
				outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage-1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='上一页'>上一页</a>";
			}
	        for (count=1;count<=pageInfo.pageCount;count++)   
	        {    if(count!=cpage)   
	            {   
	                outstr= outstr + "<a href='javascript:void(0)' onclick='gotopage("+count+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")'>"+count+"</a>";   
	            }else{
	                outstr = outstr + "<strong>"+count+"</strong>";   
	            }   
	        }
	        if(cpage<pageInfo.pageCount){
	        	outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage+1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";
	        }
	    }   
	    if(pageInfo.pageCount>10){        //总页数大于十页   
	    	if(cpage>1){
				outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage(1,\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' title='第一页' class='pgctrl'>&laquo; ...</a>";
				outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage-1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='上一页'>上一页</a>";
			}	
	        if(parseInt((cpage-1)/10) == 0)   
	        {
	        	        	
	            for (count=1;count<=10;count++)   
	            {
	            	if(count!=cpage)   
	                {
	                    outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+count+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")'>"+count+"</a>";   
	                }else{
	                    outstr = outstr + "<strong>"+count+"</strong>";   
	                }
	            }
	            //outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+count+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";
	           // outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage+1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";
	        }
	        else if(parseInt((cpage-1)/10) == parseInt(pageInfo.pageCount/10))   
	        {
	            //outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt((cpage-1)/10)*10)+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='上一页'>上一页</a>";   
	        	//outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage-1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='上一页'>上一页</a>";
	            for (count=parseInt(pageInfo.pageCount/10)*10+1;count<=pageInfo.pageCount;count++)   
	            {
	            	if(count!=cpage)   
	                {
	                    outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+count+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")'>"+count+"</a>";   
	                }else{
	                    outstr = outstr + "<strong>"+count+"</strong>";   
	                }
	            }
	            //outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage+1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";
	        }
	        else  
	        {
	            //outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt((cpage-1)/10)*10)+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='上一页'>上一页</a>";
	        	//outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage-1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='上一页'>上一页</a>";
	            for (count=parseInt((cpage-1)/10)*10+1;count<=parseInt((cpage-1)/10)*10+10;count++)
	            {
	                if(count!=cpage)   
	                {
	                    outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+count+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")'>"+count+"</a>";   
	                }else{   
	                    outstr = outstr + "<strong>"+count+"</strong>";   
	                }
	            }
	            //outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+count+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";   
	            //outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage+1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";
	        }
	        if(cpage<pageInfo.pageCount){
	        	outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+(parseInt(cpage+1))+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='下一页'>下一页</a>";
	        	outstr = outstr + "<a href='javascript:void(0)' onclick='gotopage("+parseInt(pageInfo.pageCount)+",\""+q+"\",\""+cl+"\","+ps+",\""+tp+"\",\""+stp+"\",\""+ft+"\",\""+ar+"\",\""+la+"\",\""+pa+"\",\""+dr+"\",\""+sb+"\","+st+")' class='pgctrl' title='最后一页'>... &raquo;</a>";
	        }
	    }
	    outstr+='</div>';
	    _s+=outstr;
	}else{
		_s+='<div class="pages clearfix">';
		_s+='对不起！您当前选择条件不能找到任何影片信息！请重新选择！';
		_s+='</div>';		
	}	
    document.getElementById("showsearch").innerHTML = _s;				
	//document.writeln(_s);
	_s = "";				
}

function GetUrlParms()    
{
     var args=new Object();   
     var query=location.search.substring(1);//获取查询串   
     var pairs=query.split("&");//在逗号处断开   
     for(var i=0;i<pairs.length;i++)   
     {   
        var pos=pairs[i].indexOf('=');//查找name=value   
        if(pos==-1)   continue;//如果没有找到就跳过   
        var argname=pairs[i].substring(0,pos);//提取name   
        var value=pairs[i].substring(pos+1);//提取value   
        args[argname]=decodeURI(value);//存为属性
    }
   if(args["q"]==""){
    var searchtype="";
    var _url ="";
    if(args["tp"]=="电影"){
    	_url="http://www.pipi.cn/movlist.html";
    }else if(args["tp"]=="电视剧"){
    	_url="http://www.pipi.cn/tvlist.html";
    }else if(args["tp"]=="综艺"){
    	_url="http://www.pipi.cn/zylist.html";
    }else if(args["tp"]=="动漫"){
    	_url="http://www.pipi.cn/dmlist.html";
    }else if(args["tp"]=="其他"){
    	_url="http://www.pipi.cn/otlist.html";
    }else if(args["tp"]=="高清"){
    	_url="http://www.pipi.cn/hdlist.html";
    }else{
    	_url="";
    }
    
    var _s='';
    if(args["tp"]==""){
    	if(args["stp"]=="高清" || args["stp"]=="电影高清" || args["stp"]=="电视剧高清"){
    		_s+='<span class="key_htit">高清</span>';
    		_s+='<span class="key_label">当前选择:</span>';   
		    
		    if(args["stp"]=="高清"){
		    	_s+='<span class="key">全部</span>';
		    }else{
		    	searchtype="stp";
	    		_s+='<span class="key">'+args["stp"]+'</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\'http://www.pipi.cn/hdlist.html\')"></a>';
		    }
    	}
    }else{
    	_s+='<span class="key_htit">'+args["tp"]+'</span>';
    	 _s+='<span class="key_label">当前选择:</span>';
	    if(args["stp"]!=""){
	    	searchtype="stp";
	    	if(args["stp"]=="伦理"){
	    		_s+='<span class="key">情感</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';
	    	}else if(args["stp"]=="恐怖" || args["stp"]=="惊悚"){
	    		_s+='<span class="key">悬疑</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';	    	
	    	}
	    	else{
	    		_s+='<span class="key">'+args["stp"]+'</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';
	    	}
	    	
	    }
	    else{
	    	_s+='<span class="key">全部</span>';
	    }
    }   
    if(args["ar"]!=""){
    	searchtype="ar";
    	_s+='<em class="key_add">+</em>';
    	_s+='<span class="key">'+args["ar"]+'</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';
    }
    if(args["la"]!=""){
    	searchtype="la";
     	_s+='<em class="key_add">+</em>';
    	_s+='<span class="key">'+args["la"]+'</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';
    }
    if(args["year"]!=""){
    	searchtype="year";
    	_s+='<em class="key_add">+</em>';
    	if(args["year"].indexOf("2001")>-1){
    		_s+='<span class="key">更早</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';
    	}else{
    		_s+='<span class="key">'+args["year"]+'</span><a class="key_del" hidefocus="true" href="#" onclick="delsearchType(\''+searchtype+'\',\''+_url+'\')"></a>';
    	}
    }    
    document.getElementById("searchtype").innerHTML=_s;
    _s="";
    if(args["tp"]=="电影"){
	    if(args["stp"]!=""){		
	    	if(args["stp"]=="动作"){
	    		document.getElementById("mov_dz").className="checked";
	    	}
	    	if(args["stp"]=="科幻"){
	    		document.getElementById("mov_kh").className="checked";
	    	}
	    	if(args["stp"]=="战争"){
	    		document.getElementById("mov_zz").className="checked";
	    	}
	    	if(args["stp"]=="爱情"){
	    		document.getElementById("mov_aq").className="checked";
	    	}
	    	if(args["stp"]=="喜剧"){
	    		document.getElementById("mov_xj").className="checked";
	    	}
	    	if(args["stp"]=="剧情"){
	    		document.getElementById("mov_jq").className="checked";
	    	}
	    	if(args["stp"]=="恐怖"){
	    		document.getElementById("mov_xy").className="checked";
	    	}
	    	if(args["stp"]=="情感"){
	    		document.getElementById("mov_qg").className="checked";
	    	}
	    	if(args["stp"]=="幼儿"){
	    		document.getElementById("mov_ye").className="checked";
	    	}
	    	if(args["stp"]=="预告"){
	    		document.getElementById("mov_yg").className="checked";
	    	}
	    	if(args["stp"]=="高清"){
	    		document.getElementById("mov_gq").className="checked";
	    	}
	    }
	    else{
	    	document.getElementById("mov_all").className="checked";    
	    }
    }else if(args["tp"]=="电视剧"){
    	 if(args["stp"]!=""){
    	 	if(args["stp"]=="古装"){
	    		document.getElementById("tv_gz").className="checked";
	    	}
	    	if(args["stp"]=="武侠"){
	    		document.getElementById("tv_wx").className="checked";
	    	}
	    	if(args["stp"]=="战争"){
	    		document.getElementById("tv_zz").className="checked";
	    	}
	    	if(args["stp"]=="都市"){
	    		document.getElementById("tv_ds").className="checked";
	    	}
	    	if(args["stp"]=="喜剧"){
	    		document.getElementById("tv_xj").className="checked";
	    	}
	    	if(args["stp"]=="偶像"){
	    		document.getElementById("tv_ox").className="checked";
	    	}
	    	if(args["stp"]=="伦理"){
	    		document.getElementById("tv_qg").className="checked";
	    	}
	    	if(args["stp"]=="刑侦"){
	    		document.getElementById("tv_xz").className="checked";
	    	}
	    	if(args["stp"]=="幼儿"){
	    		document.getElementById("tv_ye").className="checked";
	    	}
	    	if(args["stp"]=="高清"){
	    		document.getElementById("tv_gq").className="checked";
	    	}
	    	if(args["stp"]=="科幻"){
	    		document.getElementById("tv_kh").className="checked";
	    	}
    	 	if(args["stp"]=="惊悚"){
	    		document.getElementById("tv_xy").className="checked";
	    	}
    	 }else{
    	 	document.getElementById("tv_all").className="checked"; 
    	 }
    }else if(args["tp"]=="其他"){
    	 if(args["stp"]!=""){    	 	
	    	if(args["stp"]=="游戏"){
	    		document.getElementById("ot_yx").className="checked";
	    	}
	    	if(args["stp"]=="时事"){
	    		document.getElementById("ot_jd").className="checked";
	    	}
	    	if(args["stp"]=="MTV"){
	    		document.getElementById("ot_yy").className="checked";
	    	}
	    	if(args["stp"]=="动物"){
	    		document.getElementById("ot_dw").className="checked";
	    	}
	    	if(args["stp"]=="军事"){
	    		document.getElementById("ot_js").className="checked";
	    	}
	    	if(args["stp"]=="文化"){
	    		document.getElementById("ot_wh").className="checked";
	    	}
	    	if(args["stp"]=="体育"){
	    		document.getElementById("ot_ty").className="checked";
	    	}
	    	if(args["stp"]=="纪实"){
	    		document.getElementById("ot_jishi").className="checked";
	    	}
    	 	if(args["stp"]=="旅行"){
	    		document.getElementById("ot_lx").className="checked";
	    	}
    	 }else{
    	 	document.getElementById("ot_all").className="checked"; 
    	 }
    }else if(args["tp"]=="动漫"){
    	 if(args["stp"]!=""){    	 	
	    	if(args["stp"]=="电影"){
	    		document.getElementById("dm_mov").className="checked";
	    	}
	    	if(args["stp"]=="电视剧"){
	    		document.getElementById("dm_tv").className="checked";
	    	}
    	 }else{
    	 	document.getElementById("dm_all").className="checked"; 
    	 }
    }else if(args["tp"]=="综艺"){
    	 if(args["stp"]!=""){    	 	
	    	if(args["stp"]=="综艺"){
	    		document.getElementById("zy_all").className="checked";
	    	}
	    	if(args["stp"]=="运动酷游"){
	    		document.getElementById("zy_ky").className="checked";
	    	}
	    	if(args["stp"]=="MTV精粹"){
	    		document.getElementById("zy_jc").className="checked";
	    	}
	    	if(args["stp"]=="精彩花絮"){
	    		document.getElementById("zy_hx").className="checked";
	    	}
	    	if(args["stp"]=="美女大观园"){
	    		document.getElementById("zy_dgy").className="checked";
	    	}
	    	if(args["stp"]=="创意广告"){
	    		document.getElementById("zy_gg").className="checked";
	    	}
    	 	if(args["stp"]=="综艺旗舰"){
	    		document.getElementById("zy_qj").className="checked";
	    	}
	    	if(args["stp"]=="自拍超级秀"){
	    		document.getElementById("zy_cjx").className="checked";
	    	}
    	 }else{
    	 	document.getElementById("zy_all").className="checked"; 
    	 }
    }else {
    	var url=window.location.href;
	    if(url.indexOf("hdlist.html")>-1){
	    	if(args["stp"]!=""){    	 	
		    	if(args["stp"]=="电影高清"){		    		
		    		document.getElementById("hd_mov").className="checked";
		    	}
		    	if(args["stp"]=="电视剧高清"){
		    		document.getElementById("hd_tv").className="checked";
		    	}
		    	if(args["stp"]=="高清"){
		    		document.getElementById("hd_all").className="checked";
		    	}
	    	 }
    	}
    }
    if(args["ar"]!=""){
    	if(args["ar"]=="大陆"){
    		document.getElementById("mov_cn").className="checked";
    	}
    	if(args["ar"]=="欧美"){
    		document.getElementById("mov_oa").className="checked";
    	}
    	if(args["ar"]=="日韩"){
    		document.getElementById("mov_hj").className="checked";
    	}
    	if(args["ar"]=="港台"){
    		document.getElementById("mov_ht").className="checked";
    	}
    	if(args["ar"]=="其他"){
    		document.getElementById("mov_ot").className="checked";
    	}
    }
     if(args["la"]!=""){
    	if(args["la"]=="国语"){
    		document.getElementById("mov_hanyu").className="checked";
    	}
    	if(args["la"]=="英语"){
    		document.getElementById("mov_yingyu").className="checked";
    	}
    	if(args["la"]=="日语"){
    		document.getElementById("mov_riyu").className="checked";
    	}
    	if(args["la"]=="粤语"){
    		document.getElementById("mov_yueyu").className="checked";
    	}
    	if(args["la"]=="韩语"){
    		document.getElementById("mov_hayu").className="checked";
    	}
    	if(args["la"]=="法语"){
    		document.getElementById("mov_fayu").className="checked";
    	}
    }
	if(args["year"]!=""){
		if(args["year"].indexOf("not")>-1 || args["year"].indexOf("or")>-1){
			document.getElementById("mov_2001").className="checked";
		}else{
    		document.getElementById("mov_"+args["year"]).className="checked";
		}
    }
   	
   }
     return args;
     //http://www.pipi.cn/slist.html?q=&tp==电影&stp=动作&ar=欧美&year=2009
}

function delsearchType(stype,_url){
	var args = new Object();
	args = GetUrlParms();
	if(stype=="tp"){
		document.location.href=_url+"?q=&tp=&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+args['sb']+"";
	}
	if(stype=="stp"){
		if(_url.indexOf("hdlist")>-1){
			document.location.href=_url+"?q=&tp="+encodeURI(args['tp'])+"&stp="+encodeURI('高清')+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+args['sb']+"";
		}else{
			document.location.href=_url+"?q=&tp="+encodeURI(args['tp'])+"&stp=&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+args['sb']+"";
		}
	}
	if(stype=="ar"){
		document.location.href=_url+"?q=&tp="+encodeURI(args['tp'])+"&stp="+encodeURI(args['stp'])+"&ar=&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+args['sb']+"";
	}
	if(stype=="la"){
		document.location.href=_url+"?q=&tp="+encodeURI(args['tp'])+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la=&sb="+args['sb']+"";
	}
	if(stype=="year"){
		document.location.href=_url+"?q=&tp="+encodeURI(args['tp'])+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year=&la="+encodeURI(args['la'])+"&sb="+args['sb']+"";
	}
}

function gotourl(_url,tp,stp,ar,la,year,sb){
	var args = new Object();
	args = GetUrlParms();
	if(args["tp"]==tp){
		if(stp!=""){
			if(stp=="全部"){
				document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp=&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+sb+"";
			}
			else{
				document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(stp)+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+sb+"";
			}
		}		
		else if(ar!=""){
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(ar)+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+sb+"";
		}
		else if(la!=""){
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(la)+"&sb="+sb+"";
		}
		else if(year!=""){
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year="+year+"&la="+encodeURI(args['la'])+"&sb="+sb+"";
		}
		else{
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+sb+"";
		}
	}else{
		if(stp!=""){
			if(stp=="全部"){
				document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp=&ar=&year=&la=&sb="+sb+"";
			}
			else{
				document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(stp)+"&ar=&year=&la=&sb="+sb+"";
			}
		}		
		else if(ar!=""){
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp=&ar="+encodeURI(ar)+"&year=&la=&sb="+sb+"";
		}
		else if(la!=""){
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp=&ar=&year=&la="+encodeURI(la)+"&sb="+sb+"";
		}
		else if(year!=""){
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp=&ar=&year="+year+"&la=&sb="+sb+"";
		}
		else{
			document.location.href=_url+"?q=&tp="+encodeURI(tp)+"&stp="+encodeURI(args['stp'])+"&ar="+encodeURI(args['ar'])+"&year="+args['year']+"&la="+encodeURI(args['la'])+"&sb="+sb+"";
		}
	}
}
