//切换全屏
var fullBody = function(){
	if (!$("alpha")) {
		var maxWidth, maxHeight, oLeft, pLeft, rs, drag, alphaWidth;
		maxWidth = document.documentElement.clientWidth;
		maxHeight = document.documentElement.clientHeight;
		//maxWidth = browser['msie'] ? maxWidth : maxWidth - 20;
		oLeft = maxWidth > 980 ? (maxWidth - 980) / 2 + 189 : 189;
		pLeft = oLeft + 570;
		alphaWidth = maxWidth > 980 ? maxWidth : 980;
		
		var newElement = createElement('div', {
			Class: 'hidden',
			id: 'alpha'
		}, {
			cssText: 'width:' + alphaWidth + 'px;height:' + document.body.offsetHeight + 'px;position:absolute;top:0;left:0;z-index:1010;background:#000;filter:alpha(opacity=75);-moz-opacity:0.75;opacity:0.75'
		
		});
		document.body.appendChild(newElement);
	}
}
/* 复制链接地址 */
var copyText = function(o){
	try {
		var cText = $(o).value;
		if (window.clipboardData) {
			window.clipboardData.setData("Text", cText)
			alert("网址已生成并为您复制好了，直按按Ctrl+V粘贴到目地的就可以了!");
		} else if (window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			} catch (e) {
				alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
				return false;
			}
			var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
			if (!clip) 
				return;
			var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
			if (!trans) 
				return;
			trans.addDataFlavor('text/unicode');
			var str = new Object();
			var len = new Object();
			var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
			
			str.data = cText;
			trans.setTransferData("text/unicode", str, cText.length * 2);
			var clipid = Components.interfaces.nsIClipboard;
			if (!clip) 
				return false;
			clip.setData(trans, null, clipid.kGlobalClipboard);
			alert("网址已生成并为您复制好了，直按按Ctrl+V粘贴到目地的就可以了!");
		}
	} catch (e) { }
}
/*关键字查询串*/
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/g, "");
}
/*加搜索链接*/
var keyHref = function(str, stype, ftype, sstr){
	try {
		var keys = typeof str == "string" ? (str.length>0)?str.split(";"):[] : str;
		
		var searchType = stype;
		var keyStr = "";
		var buffer = new stringBuffer();
		for (var i = 0; i < keys.length; i++) {
			trimStr = keys[i].trim();
			if (sstr) {
				trimStr2 = trimStr.substr(0, 3);
			} else {
				trimStr2 = trimStr;
			}
			buffer.append('<a href="javascript:void(0)" onclick="searchKey(\'' + trimStr + '\',' + searchType + ',\'' + ftype + '\')">' + trimStr2 + '</a>')
			if (i < keys.length - 1) {
				buffer.append('/');
			}
		}
		keyStr = buffer.toString();
		return keyStr;
	} catch (e) {}
}
/*关键字查询*/
var searchKey = function(str, stype,ftype){
	typeof str == "object" ? cstr = str.innerHTML : cstr = str;
	var typeurl = "mts?chl=tv.sohu.com";
    stype = stype ? parseInt(stype) : '';
    ftype = ftype ? ftype.toLowerCase() : '';
	switch (ftype) {
	case "tv":
		typeurl += "&c=2";
		break;
	case "movie":
		typeurl += "&c=1";
		break;
	case "doc":
		typeurl += "&c=8";
		break;
	case "comic":
		typeurl += "&c=16";
		break;
	}
	switch (stype) {
	case 4:// 区域
		typeurl += "&area=";
		break;
	case 7:// 类型
		typeurl += "&cat=";
		break;
	case 10://篇幅
		typeurl += "&cs=";
		break;
	case 11://年龄
		typeurl += "&age=";
		break;
	default:
		typeurl += "&wd=";
		break;
	}
	cstr = escape(cstr);
    window.open("http://so.tv.sohu.com/" + typeurl + cstr, "_blank");
}
/*TAG查询*/
var searchTag = function(str, ftype){
	try {
		var cstr = "";
		typeof str == "object" ? cstr = str.innerHTML : cstr = str;
		var typeurl = "";
		var tags = "";
		switch (ftype.toLowerCase()) {
			case "tv":
				typeurl = "tagsearch/";
				tags = "tags";
				break;
			case "movie":
				typeurl = "tagsearch/";
				tags = "tags";
				break;
			case "doc":
				typeurl = "tagreal/";
				tags = "tagreals";
				break;
			default:
				typeurl = "tagsearch/";
				tags = "tags";
				break;
		}
		writeCookies("sohu_tv_"+tags, escape(cstr));
		window.open("http://tv.sohu.com/" + typeurl, "_blank");
	} catch (e) {}
}
/*详细分类查询*/
var searchClass = function(str, ftype){
	try {
		var cstr = "";
		typeof str == "object" ? cstr = str.innerHTML : cstr = str;
		var typeurl = "";
		switch (ftype.toLowerCase()) {
			case "doc":
				typeurl = "realtag/";
				break;
			default:
				typeurl = "realtag/";
				break;
		}
		writeCookies("sohu_tv_class", escape(cstr));
		window.open("http://tv.sohu.com/" + typeurl, "_blank");
	} catch (e) {}
}
var jsonStr = function(str, p){
	try {
		var jStr = escape(str);
		var jType = "";
		var arrP = p.split(",");
		var jsonDataStr = "";
		return jsonDataStr = "video_f" + jType + "_o" + arrP[1] + "_c" + arrP[2] + "_s" + arrP[3] + "_n" + arrP[4] + "_p" + arrP[5] + "_chltv.sohu.com" + "_k" + jStr;
	} catch (e) {}
}
/*表单搜索*/
var searchForm = function(o, ftype){
	var ov = $(o).value;
	if (ov == "" || ov == "关键字") {
		alert("请输入要查询的关键字！");
		document.sForm.sKey.focus();
		return false;
	} else {
		//searchKey(ov, "0", ftype);
        var typeurl = "mts?wd=";
        window.open("http://so.tv.sohu.com/" + typeurl + escape(ov), "_blank");
		return false;
	}
}
/*排行榜链接*/
var topListStr = function(ftype, ltype){
	var vtype = "";
	switch (ftype.toLowerCase()) {
		case "tv":
			vtype = "tv";
			break;
		case "movie":
			vtype = "mv";
			break;
		case "doc":
			vtype = "doc";
			break;
	}
	var tljStr = ""
	switch (ltype) {
		case "day":
			return tljStr = "phb_" + vtype + "_day_10";
		case "week":
			return tljStr = "phb_" + vtype + "_week_10";
		case "month":
			return tljStr = "phb_" + vtype + "_month_10";
		case "total":
			return tljStr = "phb_" + vtype + "_total_50";
		case "comment":
			return tljStr = "phb_" + vtype + "_comment_day_10";
		default:
			return tljStr;
	}
}
//分项
var toQueryParams = function(pairString){
	var pairs = pairString.match(/^\??(.*)$/)[1].split('&');
	var params = {};
	if (pairs == null || pairs.length == 0) {
		return params;
	}
	for (var i = 0; i < pairs.length; i++) {
		var pair = pairs[i].split("=");
		params[pair[0]] = pair[1];
	}
	return params;
}
//截取名称
var _avsName = function(str, n, kh, ftype){
	var result = "";
	if(str.length>0 && typeof(str)=="string"){
		 tmp = str.split("/");
	}else{
		tmp = str;
	}
	if (tmp.length >= n) {
		for (var i = 0; i < n; i++) {
			result += tmp[i].substr(0, 3).replace(".", "") + "/";
		}
		str = result;
	}
	if (kh) {
		return keyHref(str, kh, ftype, 3);
	}
	return str.substr(0, 3).replace(".", "");
}
/* 参数说明:vid 视频ID, pid 专辑ID, newTime 当前播放的时间点 countTime 总时长
   返回值说明：success: 0 不需要提示 1 提示自动拖到的时长 2 提示跳转 3不提示直接定位到上次播放时长 5 站外断点续播
   order:当前播放集,lastTime:当前播放时长,title:编码后的中文名称,url:目标url，当需要跳转时使用
*/
function getVrsPlayerHistory(vid, pid, newTime, countTime, vtitle) {
    if($('_userHelp')) $('_userHelp').totalTime = countTime;
	var slength = vrsvideolist.videolist.length; // 总集数
	var order = 0, curl = "", nexturl = "", name = "", nextname = "", npid=0;
	if (vrsHitoryInfo != null) {
		order = vrsHitoryInfo.order;
		curl = vrsHitoryInfo.curl;
		nexturl = vrsHitoryInfo.nurl;
		name = vrsHitoryInfo.title;
		nextname = vrsHitoryInfo.nextname;
		npid = vrsHitoryInfo.relativeVideoId;
	}
	if (name == "" || name == null) {
		name = vtitle;
	}
	// 定义cookie的有效期
	var exp = new Date();
	exp.setTime(exp.getTime() + 7 * 24 * 60 * 60 * 1000); //此 cookie 将被保存 7 天
	var eee = exp.toGMTString();
	var ntime = new Date();
	var result = null; // 返回对象
	var aa = 3 * 60; // 阀值 可调整 用于控制什么时候直接切下一集
	var aCookie = document.cookie.split(";");
	var flag = 1;
	var history_data = "";
	if (aCookie != null && aCookie.length > 0) {
		for (var i = 0; i < aCookie.length; i++) {
			if (aCookie[i].split("=")[0] == " isJump" && parseInt(aCookie[i].split("=")[1]) == 1) {
				flag = 3;
			}
			if (aCookie[i].split("=")[0].indexOf("savehistory") != -1) {
				var arr = aCookie[i].split("=")[1];
				if (arr != null && arr != "") {
					history_data = arr.split("%2C");
				}
			}
		}
	}
	if (location.hash == "#true") {
		flag = 3;
	}
	if (typeof newTime == 'undefined') {
		newTime = 0;
	}
	if (typeof countTime == 'undefined' || newTime==0) {
		countTime = 0;
	}
	var rex_test = new RegExp("[-|\u7b2c|\u4e4b|:|\u2014|\uff1a]", "i");
	var rex_split = new RegExp("[\\^|\\*|\\&]", "i");
	var s_str = "";
	// 处理节目名称
	var newname = name;
	if (name.match(rex_test) != null) {
		var arr = new RegExp("(.*)([-|\u7b2c|:|\u2014|\uff1a|\u4e4b])", "i").exec(name);
		newname = arr[1];
		s_str = arr[2];
		while(newname.match(rex_test) != null) {
			var arr_1 = new RegExp("(.*)([-|\u7b2c|:|\u2014|\uff1a|\u4e4b])", "i").exec(newname);
			newname = arr_1[1];
			s_str = arr_1[2];
		}
	}

// 从历史记录上的链接跳转
	if(location.hash != "" && location.hash != null && location.hash != "#true"){
		if(result==null){
			var tt = location.hash;
			ocurrentTime = parseInt(tt.substring(1));
			result = {success:5, order:0, lastTime:ocurrentTime, title:'', url:u, nexturl:''};
		}
	}
	if(result==null && history_data != "" && location.hash != "" && location.hash != null && location.hash != "#true") {
		var u = location.href;
		var olastOrder = 0, ocurrentTime = 0, hname = "", curl = "", nurl = "";
		for (var i = 0; i < history_data.length; i++) {
			var tmp = history_data[i].split(history_data[i].match(rex_split));
			if (u.substring(0, u.indexOf("#")) == tmp[5].substring(0, tmp[5].indexOf("#"))) {
				olastOrder = tmp[2];
				ocurrentTime = parseInt(tmp[3]);
				hname = unescape(tmp[6]);
				curl = tmp[5];
				nurl = tmp[8];
				var f = 1;
				if (ocurrentTime < 30) {
					f = 3;
				}
				result = {success:f, order:olastOrder, lastTime:ocurrentTime, title:hname, url:curl.substring(0, curl.indexOf("#")), nexturl:nurl};
				break;
			}
		}
	}else if(result==null){
				if (history_data != null && history_data != "" && history_data.length > 0) {
				//	console.log('--------inner------'+newTime+"---"+countTime);
					for (var i = history_data.length - 1; i >= 0; i--) {
						var htmp = history_data[i].split(history_data[i].match(rex_split));
						var ohtmp = null;
						if (history_data[i - 1] != undefined && history_data[i - 1] != null) {
							ohtmp = history_data[i - 1].split(history_data[i].match(rex_split));
						}
						var oldname = unescape(htmp[6]);
						if (s_str != "" && oldname.indexOf(s_str) != -1) {
							oldname = oldname.substring(0, oldname.indexOf(s_str));
						}
						if (parseInt(htmp[0]) == pid && parseInt(htmp[3]) > 30 && slength > 1) {
							var olink = htmp[5];
							var m = 0;
							if (htmp[1] == vid) {
								var _order, _lastTime, _title, _url;
								if (ohtmp != null) {
									if (pid != ohtmp[0]) {
										m = flag;
										_order = htmp[2];
										_lastTime = Math.ceil(htmp[3]);
										_title = unescape(htmp[6]);
										_url = htmp[5];
									} else {
										if (order == parseInt(ohtmp[2]) + 1 && (parseInt(ohtmp[9]) - aa) <= parseInt(ohtmp[3])) {

										} else {
											m=2;
											if(vid==ohtmp[1] &&(location.href=='#true' || flag==3)) m=3;
											_order = ohtmp[2];
											_lastTime = Math.ceil(ohtmp[3]);
											_title = unescape(ohtmp[6]);
											_url = ohtmp[5];
										}
									}
								} else {
									m = flag;
									_order = htmp[2];
									_lastTime = Math.ceil(htmp[3]);
									_title = unescape(htmp[6]);
									_url = htmp[5];
								}
								if (m==2 && _url.indexOf("#") != -1) {
									_url = _url.substring(0, _url.indexOf("#")) + "#true";
								}
								result = {success:m, order:_order, lastTime:_lastTime, title:_title, url:_url};
							} else {
								if(oldname == newname) {
							//		console.log(order +"=="+ (parseInt(htmp[2]) + 1) +"&&"+ (parseInt(htmp[9]) - aa) +"<"+ parseInt(htmp[3]));
									if (order == parseInt(htmp[2]) + 1 && (parseInt(htmp[9]) - aa) <= parseInt(htmp[3])) {

									} else {
										m = 2;
									
								  	if(htmp[1] == vid) m=3;
										if (htmp[5].indexOf("#") != -1) {
											olink = htmp[5].substring(0, htmp[5].indexOf("#")) + "#true";
										}
										result = {success:m, order:htmp[2], lastTime:Math.ceil(htmp[3]), title:unescape(htmp[6]), url:olink};
									}
								} else if(pid==npid){
									if (order == parseInt(htmp[2]) + 1 && (parseInt(htmp[9]) - aa) <= parseInt(htmp[3])) {
									} else {
											m = 2;
											if (htmp[5].indexOf("#") != -1) {
												olink = htmp[5].substring(0, htmp[5].indexOf("#")) + "#true";
											}
											result = {success:m, order:htmp[2], lastTime:Math.ceil(htmp[3]), title:unescape(htmp[6]), url:olink};
									}
								}
							}
							if (m == 2) {
								document.cookie = "isJump=1; expires=" + eee + "; path=/; domain=tv.sohu.com;";
							}
							break;
						}else if (parseInt(htmp[0]) == pid && parseInt(htmp[3]) > 30 && slength == 1){
									var olink='';
									if (htmp[5].indexOf("#") != -1) {
												olink = htmp[5].substring(0, htmp[5].indexOf("#")) + "#true";
									}
									result = {success:1, order:htmp[2], lastTime:Math.ceil(htmp[3]), title:unescape(htmp[6]), url:olink};
						}
					}
				}
	}
	var l = 0;
	if (history_data != null && history_data != "") {
		l = history_data.length;
	}
	if (l > 6) {
		history_data.shift();
	}
	var nowTime = new Date().getTime();
	var ff = false;
	var newData = "", s = "", first = "";
	curl = curl.indexOf("#") != -1 ? curl.substring(0, curl.indexOf("#")) : curl;
	if (history_data != null && history_data.length > 0) {
		for (var i = 0; i < history_data.length; i++) {
			if (history_data[i] == null || history_data[i] == "") {
			} else {
				var tmp = history_data[i].split(history_data[i].match(rex_split));
				var ntitle = unescape(tmp[6]);
				if (s_str != "" && ntitle.indexOf(s_str) != -1) {
					ntitle = ntitle.substring(0, ntitle.indexOf(s_str));
				}
				if (tmp[0] == pid && newname == ntitle) {
					ff = true;
					var playTime = Math.ceil(tmp[3]);
					if (Math.ceil(newTime) > 30) {
						playTime = Math.ceil(newTime);
						first = pid + "^" + vid + "^" + order + "^" + playTime + "^0^" + curl + "#" + playTime + "^" + escape(name) + "^" + ntime.getTime() + "^" + nexturl + "^" + countTime;
						document.cookie = "isJump=0; expires=" + eee + "; path=/; domain=tv.sohu.com;";
					} else {
						var aurl = tmp[5].substring(0, tmp[5].indexOf("#")) + "#" + playTime;
						first = tmp[0] + "^" + tmp[1] + "^" + tmp[2] + "^" + Math.ceil(tmp[3]) + "^0^" + aurl + "^" + tmp[6] + "^" + ntime.getTime() + "^" + tmp[8] + "^" + tmp[9];
					}
				} else {
					var spaceTime = (nowTime - parseInt(tmp[7])) / 1000 < 1 ? 1 : Math.floor((nowTime - parseInt(tmp[7])) / 1000);
					var aurl = tmp[5].substring(0, tmp[5].indexOf("#")) + "#" + tmp[3];
					newData += s + tmp[0] + "^" + tmp[1] + "^" + tmp[2] + "^" + tmp[3] + "^" + spaceTime + "^" + aurl + "^" + tmp[6] + "^" + tmp[7] + "^" + tmp[8] + "^" + tmp[9];
					s = escape(",");
				}
			}
		}
	}
	if (!ff && Math.floor(newTime) > 30) {
		newData += s + pid + "^" + vid + "^" + order + "^" + Math.floor(newTime) + "^0^" + curl + "#" + Math.floor(newTime) + "^" + escape(name) + "^" + ntime.getTime() + "^" + nexturl + "^" + countTime;
		document.cookie = "isJump=0; expires=" + eee + "; path=/; domain=tv.sohu.com;";
	}
	newData = newData + (first != "" && newData != "" ? escape(",") : "") + first;
	if (newData != null && newData != "") {
		document.cookie = "savehistory=" + newData + "; expires=" + eee + "; path=/; domain=tv.sohu.com;";
	}
	//console.log(JSON.stringify(result));
	return result;
}
/* 显示最近播放记录 */
function getVrsHistory() {
	var aCookie = document.cookie.split(";");
	var rex_split = new RegExp("[\\^|\\*|\\&]", "i");
	if (typeof vrsHitoryInfo != 'undefined' && vrsHitoryInfo != null) {
		var rex_test = new RegExp("[-|\u7b2c|\u4e4b|:|\u2014|\uff1a]", "i");
		var newname = vrsHitoryInfo.title;
		var s_str = "";
				// 处理节目名称
		if (newname.match(rex_test) != null) {
			var arr = new RegExp("(.*)([-|\u7b2c|:|\u2014|\uff1a|\u4e4b])", "i").exec(newname);
			newname = arr[1];
			s_str = arr[2];
			if (newname.match(rex_test) != null) {
				var arr_1 = new RegExp("(.*)([-|\u7b2c|:|\u2014|\uff1a|\u4e4b])", "i").exec(newname);
				newname = arr_1[1];
				s_str = arr_1[2];
			}
		}
		for (var n = 0; n < aCookie.length; n++) {
			if (aCookie[n].split("=")[0].indexOf("savehistory") != -1 && aCookie[n].split("=")[1] != undefined && aCookie[n].split("=")[1] != null) {
				var re = aCookie[n].split("=")[1].split("%2C");
				var result = new Array();
				var bl = false;
				for (var j = 0; j < re.length; j++) {
					if (re[j] != null && re[j] != "") {
						var tmp = re[j].split(re[j].match(rex_split));
						var a = "", spaceTime = (new Date().getTime() - parseInt(tmp[7])) / 1000;
						if (spaceTime == 0) {
							a = "\u6b63\u5728\u64ad\u653e";
						} else {
							a = "\u79d2";
							if (spaceTime >= 60 * 60 * 24) {
								a = "\u5929";
								spaceTime = Math.floor(spaceTime / (24 * 60 * 60));
							} else {
								if (spaceTime >= 60 * 60) {
									a = "\u5c0f\u65f6";
									spaceTime = Math.floor(spaceTime / (60 * 60));
								} else {
									if (spaceTime >= 60) {
										a = "\u5206";
										spaceTime = Math.floor(spaceTime / 60);
									}
								}
							}
							a += "\u524d\u770b\u8fc7";
						}
						var ntitle = unescape(tmp[6]);
						if (s_str != "" && ntitle.indexOf(s_str) != -1) {
							ntitle = ntitle.substring(0, ntitle.indexOf(s_str));
						}
						var itme = null;
						if (tmp[0] == pid && newname == ntitle) {
							bl = true;
							item = {pid:vrsHitoryInfo.pid, vid:vrsHitoryInfo.vid, order:vrsHitoryInfo.order, newTime:0, timeSpace:"\u6b63\u5728\u64ad\u653e", url:vrsHitoryInfo.curl + "#0", playTime:new Date().getTime(), title:vrsHitoryInfo.title, nurl:vrsHitoryInfo.nurl};
						} else {
							item = {pid:tmp[0], vid:tmp[1], order:tmp[2], newTime:tmp[3], timeSpace:spaceTime == 0 ? "" + a : Math.floor(spaceTime) + a, url:tmp[5], playTime:parseInt(tmp[7]), title:tmp[6], nurl:tmp[8]};
						}
						result[j] = item;
					}
				}
				if (!bl || result == null || result.length < 1) {
					var item = {pid:vrsHitoryInfo.pid, vid:vrsHitoryInfo.vid, order:vrsHitoryInfo.order, newTime:0, timeSpace:"\u6b63\u5728\u64ad\u653e", url:vrsHitoryInfo.curl + "#0", playTime:new Date().getTime(), title:vrsHitoryInfo.title, nurl:vrsHitoryInfo.nurl};
					var c = 0;
					if (result.length > 0) {
						c = result.length;
					}
					result[c] = item;
				}
		//console.info(JSON.stringify(result.reverse()));
				return result.reverse();
			}
		}
		return [{pid:vrsHitoryInfo.pid, vid:vrsHitoryInfo.vid, order:vrsHitoryInfo.order, newTime:0, timeSpace:"\u6b63\u5728\u64ad\u653e", url:vrsHitoryInfo.curl + "#0", playTime:new Date().getTime(), title:vrsHitoryInfo.title, nurl:vrsHitoryInfo.nurl}];
	} else {
		for (var n = 0; n < aCookie.length; n++) {
			if (aCookie[n].split("=")[0].indexOf("savehistory") != -1 && aCookie[n].split("=")[1] != undefined && aCookie[n].split("=")[1] != null) {
				var re = aCookie[n].split("=")[1].split("%2C");
				var result = new Array();
				for (var j = 0; j < re.length; j++) {
					if (re[j] != null && re[j] != "") {
						var tmp = re[j].split(re[j].match(rex_split));
						var a = "", spaceTime = (new Date().getTime() - parseInt(tmp[7])) / 1000;  // parseInt(tmp[4])==0?1:parseInt(tmp[4]);
						if (spaceTime == 0) {
							a = "\u6b63\u5728\u64ad\u653e";
						} else {
							a = "\u79d2";
							if (spaceTime >= 60 * 60 * 24) {
								a = "\u5929";
								spaceTime = Math.floor(spaceTime / (24 * 60 * 60));
							} else {
								if (spaceTime >= 60 * 60) {
									a = "\u5c0f\u65f6";
									spaceTime = Math.floor(spaceTime / (60 * 60));
								} else {
									if (spaceTime >= 60) {
										a = "\u5206";
										spaceTime = Math.floor(spaceTime / 60);
									}
								}
							}
							a += "\u524d\u770b\u8fc7";
						}
						var item = {pid:tmp[0], vid:tmp[1], order:tmp[2], newTime:tmp[3], timeSpace:spaceTime == 0 ? "" + a : Math.floor(spaceTime) + a, url:tmp[5], playTime:parseInt(tmp[7]), title:tmp[6], nurl:tmp[8]};
						result[j] = item;
					}
				}
				return result.reverse();
			}
		}
		return null;
	}
}
/* 清除缓存 */
function clearVrsHistory() {
	var endtime = new Date();
	endtime.setTime(endtime.getTime() - 1000);
	document.cookie = "savehistory=a; expires=" + endtime.toGMTString() + "; path=/; domain=tv.sohu.com;";
}

