﻿// JavaScript Document

//set focus to a div,here is "middle"
document.getElementById("middle").focus();

//set Client Height
((document.documentElement.clientHeight==0)?document.body.clientHeight:document.documentElement.clientHeight)
var strClientHeight=document.documentElement.clientHeight;
if(strClientHeight>488){
	document.getElementById('middle').style.height = (strClientHeight-75)+"px";
	document.getElementById('secondcode').style.height = (strClientHeight-75)+"px";
}

<!-- xml function
function jb(){
	var A=null;
	try{
		A=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e){
		try{
			A=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc){
			A=null;
		}
	}

	if(!A && typeof XMLHttpRequest!="undefined"){
		A=new XMLHttpRequest();
	}
	return A;
}

function getXMLFileName(){
	var strHref=document.URL.toLowerCase();
	var XMLFileName=strHref.replace(/(.*tvpad\.cn)(.*)([a-z]\.html.*)/g,'$1'+'/xml'+'$2'+'.xml');
	return XMLFileName;
}

//使FIREFOX支持selectNodes()、selectSingleNode()
//代码出处：http://km0ti0n.blunted.co.uk/mozXPath.xap
// check for XPath implementation
if(document.implementation.hasFeature("XPath","3.0")){
// prototying the XMLDocument
	XMLDocument.prototype.selectNodes=function(cXPathString, xNode){
		if(!xNode){xNode=this;}
		var oNSResolver=this.createNSResolver(this.documentElement)
		var aItems=this.evaluate(cXPathString,xNode,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)
		var aResult=[];
		for(var i=0;i<aItems.snapshotLength;i++){
			aResult[i]=aItems.snapshotItem(i);
		}
		return aResult;
	}

//prototying the Element
	Element.prototype.selectNodes=function(cXPathString){
		if(this.ownerDocument.selectNodes){
			return this.ownerDocument.selectNodes(cXPathString,this);
		}
		else{throw "For XML Elements Only";}
	}
}

//check for XPath implementation
if(document.implementation.hasFeature("XPath","3.0")){
//prototying the XMLDocument
	XMLDocument.prototype.selectSingleNode=function(cXPathString,xNode){
		if(!xNode){xNode=this;}
		var xItems=this.selectNodes(cXPathString,xNode);
		if(xItems.length>0){
			return xItems[0];
		}
		else{
			return null;
		}
	}

//prototying the Element
	Element.prototype.selectSingleNode=function(cXPathString){
		if(this.ownerDocument.selectSingleNode){
			return this.ownerDocument.selectSingleNode(cXPathString,this);
		}
		else{throw "For XML Elements Only";}
	}
}

function showTopADBar(){
	var xmlHttp=jb();
	try{
		xmlHttp.open("GET",getXMLFileName(),false);
		xmlHttp.send(null);
	}
	catch(e){}
	
	if(xmlHttp.readyState==4){
		if(xmlHttp.status==200 || xmlHttp.status==0){
			var xmlDom=xmlHttp.responseXML;
			try{showTopADBarMenu(xmlDom);}
			catch(e){}
		}
		else{}
	}
}

var strTopADBar="";

function showTopADBarMenu(xmlDom){
	showTopADBar_Video(xmlDom);
	showTopADBar_eZhun(xmlDom);
}

var xmlVideoSrc="";
var xmlVideoEP="";
var xmlVideoURL="";
function showTopADBar_Video(xmlDom){
	xmlVideoSrc=xmlDom.selectNodes("//video/vSrc/text()");
	xmlVideoEP=xmlDom.selectNodes("//video/vEP/text()");
	xmlVideoURL=xmlDom.selectNodes("//video/vURL/text()");
	if(xmlVideoSrc.length>0){
		document.write("<div id=\"floatplay_end\"><a href=\"javascript:void(null)\" onclick=\"javascript:showEnd()\"><img src=\"..\/images\/play.gif\" \/><\/a><\/div>");
		document.getElementById("floatplay_end").style.display="block";
		document.write("<div id=\"floatvideo\"><\/div>");
		document.write("<div id=\"floatsection\"><\/div>");
	}
}

function showEnd(){
	document.getElementById("floatplay_end").innerHTML="<a href=\"javascript:void(null)\" onclick=\"javascript:showPlay()\"><img src=\"..\/images\/stop.gif\" \/><\/a>";
	document.getElementById("floatsection").style.display="block";
	document.getElementById("floatvideo").style.display="block";
	var strVideoEP="";
	for(var i=0;i<xmlVideoEP.length;i++){
		strVideoEP=strVideoEP+"<li><a href=\"javascript:void(null)\" onclick=\"javascript:playVideo("+i+")\">第"+xmlVideoEP[i].nodeValue+"集<\/a></li>";
	}
	document.getElementById("floatsection").innerHTML="<ul>"+strVideoEP+"</ul>";
}

function playVideo(i){
	var strSrc=xmlVideoSrc[0].nodeValue;
	var strVideoPlayer="";
	switch(strSrc){
		case "youku":
			strVideoPlayer='<embed type="application/x-shockwave-flash" src="http://static.youku.com/v1.0.0182/v/swf/qplayer.swf" id="movie_player" name="movie_player" bgcolor="#FFFFFF" quality="high" allowfullscreen="true" flashvars="isShowRelatedVideo=false&showAd=0&show_pre=1&show_next=1&VideoIDS='+xmlVideoURL[i].nodeValue+'&isAutoPlay=true&isDebug=false&UserID=&winType=interior&playMovie=true&MMControl=false&MMout=false&RecordCode=1001,1002,1003,1004,1005,1006,2001,3001,3002,3003,3004,3005,3007,3008,9999" pluginspage="http://www.macromedia.com/go/getflashplayer" width="568" height="468"></embed>';
			break;
		case "6cn":
			strVideoPlayer='<embed allowfullscreen="true" src="http://6.cn/player.swf?vid='+xmlVideoURL[i].nodeValue+'&flag=1" quality="high" bgcolor="#000" width="568" height="468" name="playerr" id="playerr" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
			break;
	}
	document.getElementById("floatvideo").innerHTML=strVideoPlayer;
}

function showPlay(){
	document.getElementById("floatplay_end").innerHTML="<a href=\"javascript:void(null)\" onclick=\"javascript:showEnd()\"><img src=\"..\/images\/play.gif\" \/><\/a>";
	document.getElementById("floatsection").style.display="none";
	document.getElementById("floatvideo").style.display="none";
	document.getElementById("floatsection").innerHTML="";
	document.getElementById("floatvideo").innerHTML="";
}


var ezhunScheduleDetail="";
function showTopADBar_eZhun(xmlDom){
	var xmlezhunSchedulePid=xmlDom.selectNodes("//ezhunschedule/pid/text()");
	for(var i=0;i<xmlezhunSchedulePid.length;i++){
		ezhunScheduleDetail+="<a href='http://www.ezhun.com/p/"+xmlezhunSchedulePid[i].nodeValue+".htm' target='_blank' onfocus='this.blur();'><img src='http://www.ezhun.com/Tools/ScheduleImage.ashx?width=270&pid="+xmlezhunSchedulePid[i].nodeValue+"' /></a>"
	}

	strTopADBar+=ezhunScheduleDetail;
}

showTopADBar();
var strDirectors=document.getElementById("directors").innerHTML;
document.getElementById("directors").innerHTML=strDirectors+strTopADBar;
//-->

//51.la
document.writeln("<script language=\"javascript\" src=\"http://count26.51yes.com/click.aspx?id=265538197&logo=12\" charset=\"gb2312\"></script>");