// JavaScript Document
function checkAjaxFailure() {
	alert("ajax\u8bf7\u6c42\u53d1\u9001\u5931\u8d25");
	return;
}
function checkHot() {
	//alert('ajax请求完毕');
	return;
}
function checkDy(strUrl, mid, lid, flid, filename, isfree) {
	var url = "/imgValidate/movie_hit.jsp";
	var pars = "unid=" + mid;
	//var ajax = new Ajax.Request(url, {method: 'post', parameters: pars,onFailure:checkAjaxFailure,onComplete:checkHot});
	checkClient(strUrl, mid, lid, flid, filename);
}
function $parameter(_parameter)
{
		var sValue=window.location.search.match(new RegExp("[\?\&]"+_parameter+"=([^\&]*)(\&?)","i"));
		return sValue?sValue[1]:sValue;
}
function checkClient(strUrl, mid, lid, flid, filename) {
	var sUrl = strUrl;
	var _p=$parameter('p') || ""; 
	var issetup =_p || ShowCookie("ppfilmsetup");
	sUrl = strUrl;
	var _temp = sUrl.split("|");
	var _t = [];
	_t.push(_temp[0]);
	_t.push("for/chromebug");
	/*if (wnd != null) {
		_t.push("wnd=" + wnd);
	}*/
	_t.push(_temp[1]);
	sUrl = _t.join("|");
	if (issetup != "") 
	{	
		//jse.popwin.show('winForm',15,760,575);
		//showClientPlay(isWebPlay);
		SetCookie("ppfilmsetup", "1", 60 * 60 * 24 * 365, "/", "" + document.domain);
		document.location = sUrl;
	} else
		{
		if (!flag) {
			if (confirm("尊敬的用户，您需要安装皮皮播放器后才能正常的观看本网站的电影、电视剧，您是否确定下载并安装皮皮播放器？")) {
				SetCookie("url_ppfilm", sUrl, 60 * 20, "/", document.domain);
				document.location = "http://dl.pipi.cn/pipi.exe";
			} else 
				{
				 if (!confirm("对不起，假如您没有安装皮皮播放器，就无法观看本网站提供的影片。\n如果您确认已经安装了皮皮播放器，请点击“取消”按钮。")) {
					if (confirm("你确定本机已经安装了皮皮播放器了吗？点击“确认”将不再提示安装信息。")) {						
						//showClientPlay(isWebPlay);
						SetCookie("ppfilmsetup", "1", 60 * 60 * 24 * 365, "/", "" + document.domain);
						document.location = sUrl;
					}
				}
			}
		} else 
		{				
			//showClientPlay(isWebPlay);
			document.location = sUrl;
		}
	}
}
/*function checkClient(strUrl, mid, lid, flid, filename) {
	sUrl = strUrl;
	issetup = ShowCookie("ppfilmsetup");
	if (issetup == null || issetup == "") {
		var _domain = ["www.ppfilm.cn", "ppfilm.cn"];
		var _curDomain = document.domain;
		var _nextDomain = (_curDomain == _domain[0]) ? _domain[1] : _domain[0];
		try {
			document.domain = _nextDomain;
			issetup = ShowCookie("ppfilmsetup");
		}
		catch (e) {
		}
		document.domain = _curDomain;
	}
	setcookie("url_ppfilm", sUrl, 1000 * 60 * 20);
	sUrl = strUrl;
	if (issetup != "") {
	   //alert("有cookie");
		document.location = sUrl;
	} else {
		if (!flag) {
			if (confirm("\u5c0a\u656c\u7684\u7528\u6237\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u76ae\u76ae\u64ad\u653e\u5668\u540e\u624d\u80fd\u6b63\u5e38\u7684\u89c2\u770b\u672c\u7f51\u7ad9\u7684\u7535\u5f71\u3001\u7535\u89c6\u5267\uff0c\u60a8\u662f\u5426\u786e\u5b9a\u4e0b\u8f7d\u5e76\u5b89\u88c5\u76ae\u76ae\u64ad\u653e\u5668\uff1f")) {
				document.location = "http://dl.ppfilm.cn/pipi.exe";
			} else {
				alert("\u5bf9\u4e0d\u8d77\uff0c\u5047\u5982\u60a8\u6ca1\u6709\u5b89\u88c5\u76ae\u76ae\u64ad\u653e\u5668\uff0c\u5c31\u65e0\u6cd5\u89c2\u770b\u672c\u7f51\u7ad9\u63d0\u4f9b\u7684\u5f71\u7247");
			}
		} else {
			//alert("flag=true;没有cookie");
			document.location = sUrl;
		}
	}
}*/

function showPrompt() {
	if (!flag) {
		document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		document.write("<tr><td height=\"15\">&nbsp;</td></tr>");
		document.write("<tr><td height=\"1\" bgcolor=\"#666666\"></td></tr>");
		document.write("<tr><td height=\"30\" bgcolor=\"#F4F4F4\" class=\"font_14black\">&nbsp;&nbsp;<strong><img src=\"/images/icon_tishi.gif\" width=\"12\" height=\"12\">&nbsp;<font color=\"#FF0000\">\u6e29\u99a8\u63d0\u793a\uff1a</font></strong>\u9996\u6b21\u4f7f\u7528\u8bf7\u5b89\u88c5\u201c<A HREF=\"http://dl.ppfilm.cn/pipi.exe\"><strong><font color=\"#FF0000\">\u76ae\u76ae\u64ad\u653e\u5668</font></strong></A>\u201d\uff0c\u7136\u540e\u91cd\u65b0\u201c<strong><font color=\"#FF0000\">\u70b9\u64ad</font></strong>\u201d\uff0c\u7f13\u51b2\u540e\u5373\u53ef\u64ad\u6620\u3002</td></tr>");
		document.write("</table>");
	}
}
function cdy() {
	if (!flag) {
		document.all.dcount.src = "";
		cdy = "/cdy.html";
		document.all.dcount.src = cdy;
	}
}
function showmap() {
	var ord = ShowCookie("ord_map");
	var ordpage = "";
	if (ord == "U_DATE") {
		ordpage = "\u60a8\u7684\u4f4d\u7f6e\uff1a<a href='/pagelist/0/newupdate/1.html'><u><font size='3'><strong>\u6700\u8fd1\u66f4\u65b0</strong></font></u></a>";
	} else {
		if (ord == "U_HITS") {
			ordpage = "\u60a8\u7684\u4f4d\u7f6e\uff1a<a href='/pagelist/0/hot/1.html'><u><font size='3'><strong>\u4eba\u6c14\u6700\u65fa</strong></font></u></a>";
		} else {
			if (ord == "U_LEVEL") {
				ordpage = "\u60a8\u7684\u4f4d\u7f6e\uff1a<a href='/pagelist/0/top/1.html'><u><font size='3'><strong>\u6253\u5206\u6700\u9ad8</strong></font></u></a>";
			} else {
				if (ord == "U_PL_COUNT") {
					ordpage = "\u60a8\u7684\u4f4d\u7f6e\uff1a<a href='/pagelist/0/comment/1.html'><u><font size='3'><strong>\u8bc4\u8bba\u6700\u591a</strong></font></u></a>";
				} else {
					ordpage = "\u60a8\u7684\u4f4d\u7f6e\uff1a<a href='/index.html'><u><font size='3'><strong>\u9996\u9875</strong></font></u></a>";
				}
			}
		}
	}
	return ordpage;
}
