
// Global variables
// ****************
ItemList = new Array
MovieItemCount = 0
// Definition of class Folder
// *****************************************************************
// addItem(new MovieItem("1001","职业杀手","刘的话","吴晓勇","http://10.10.224.66/vodbase/1.html","http://10.10.224.158/movie/1.jpg","","华纳兄弟","-1000","故事片","印度"));
function MovieItem(MediaId,Title,MediaType,Actors,Directors,DescURL,Post1URL,Post2URL,Company,RemarkId,TypeCaption,HometownCaption,MediaCost,MediaVisitors) //constructor
{
  //constant data
  this.MediaId=MediaId;
  this.Actors = Actors;
  this.MediaType = MediaType;
  this.Directors = Directors;
  this.DescURL = DescURL;
  this.Post1URL = Post1URL
  this.Post2URL = Post2URL;
  this.Title = Title;
  this.Company = Company;
  this.RemarkId = RemarkId;
  this.TypeCaption = TypeCaption;
  this.HometownCaption = HometownCaption;
  this.MediaCost = MediaCost;
  this.MediaVisitors = MediaVisitors;
}
function addMovie(node)
{
  	ItemList[MovieItemCount] = node
  	MovieItemCount++
}
function addItem(MovieTitle,MovieURL,Hints){
	addMovie(new MovieItem("0",MovieTitle,"N/A","N/A","N/A",MovieURL,"N/A","N/A","N/A","N/A","N/A","N/A","N/A",Hints));
}
function GetItemCount()
{
	return MovieItemCount;
}
function GetItem(ItemId)
{
	if(ItemId >=0 &&ItemId < MovieItemCount)
	{
		return ItemList[ItemId];
	}
	else
	{
		return null;
	}
}
function OpenNewWindow(newURL)
{
	var winDesc = window.open("DescWindow.htm","surveywin","width=400,height=300,fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0");
	winDesc.resizeTo(400, 300);
	winDesc.moveTo((window.screen.width-400)/2 ,(window.screen.height-300)/2);
	winDesc.nowDesc = newURL;
}

function PrintDesc(ItemId)
{
	var Result="";
	if(ItemId <0 || ItemId >= MovieItemCount)
	{
		return Result;
	}
	Result = "<br><br><table  align=center cellspacing=0 cellpadding=0 width=155 border=\"1\" bordercolorlight=\"#000080\" bordercolordark=\"#FFFFFF\"><tr><td><table align=center cellspacing=0 cellpadding=0 width=155>";
	Result = Result + "<tr><td height=35 width=40 bgcolor=#01CFFF>片名：</td><td height=35 width=80 bgcolor=#01CFFF><font class=myfont2>"+ItemList[ItemId].Title+"</td></tr>";
	Result = Result + "<tr><td height=35 width=40 bgcolor=#01CFFF>主演：</td><td height=35 width=80 bgcolor=#01CFFF><font class=myfont2>"+ItemList[ItemId].Actors+"</td></tr>";
	Result = Result + "<tr><td height=35 width=40 bgcolor=#01CFFF>导演：</td><td height=35 width=80 bgcolor=#01CFFF><font class=myfont2>"+ItemList[ItemId].Directors+"</td></tr>";
	Result = Result + "<tr><td height=35 width=40 bgcolor=#01CFFF>类型：</td><td height=35 width=80 bgcolor=#01CFFF><font class=myfont2>"+ItemList[ItemId].TypeCaption+"</td></tr>";
	Result = Result + "<tr><td height=35 width=40 bgcolor=#01CFFF>产地：</td><td height=35 width=80 bgcolor=#01CFFF><font class=myfont2>"+ItemList[ItemId].HometownCaption+"</td></tr>";
	Result = Result + "<tr><td height=35 width=40 bgcolor=#01CFFF>公司：</td><td height=35 width=80 bgcolor=#01CFFF><font class=myfont2>"+ItemList[ItemId].Company+"</td></tr>";
	if(ItemList[ItemId].DescURL != null)
	{
		if(ItemList[ItemId].DescURL != ""||ItemList[ItemId].length>0)
		{
/*
			Result = Result +"<tr><td colspan=2 width=100%><table bgcolor=#01CFFF width=100%>"+
			         "<tr><td width=50%><a href='#' onClick='fnLinkBBS()' ><font color=blue>&gt;&gt;影片评论</font>"+
			         "</a></td><td width=50% align=right><a href='#' onclick='window.open(\""+
			         ItemList[ItemId].DescURL+
			         "\",\"NewWIndow\",\"toolbar=false,width=780,height=590,top=10,left=10\")'"+
			         "><font color=blue>&gt;&gt;影片简介</font></a></td></tr></table></tr>";
*/
			Result = Result +"<tr><td colspan=2 width=100%><table bgcolor=#01CFFF width=100%>"+
			         "<tr><td width=50%><a href='#' onClick='fnLinkBBS()' ><font color=blue>【影片评论】</font>"+
			         "</a></td><td width=50% align=right><a href='#' onclick='OpenNewWindow(\""+
			         ItemList[ItemId].DescURL+
			         "\")'"+
			         "><font color=blue>【影片简介】</font></a></td></tr></table></tr>";
		}
		else
		{
			Result = Result + "<tr><td colspan=2 width=100% bgcolor=#01CFFF><a href='#' onClick='fnLinkBBS()' ><font color=blue>【影片评论】</td></tr>";
		}
	}
	Result = Result + "</table></td></tr></table>";
	return Result;
}
function SetParentSelectedMovieId(MovieId)
{
	if(parent!=null)
	{
				parent.SelectedMovieId = MovieId;
	}
}
function OutList()
{
var i,j;
var TempHTML="<table bordercolordark='#FFFFFF' bordercolorlight='#FFFFFF' width='152' bordercolor='#111111' style='border-collapse: collapse' cellspacing='0' cellpadding='0' border='0'>";
for(i=1;i<=MovieItemCount;i++)
{
	 j=i-1;
	 //if(j%2==0)
	 {
	    TempHTML = TempHTML + '<tr>';
	 }
	 var linkedTitle = "影片名:"+ItemList[j].Title
	 	    +"\n点击数:"+ItemList[j].MediaVisitors;
	 var aText  = ItemList[j].Title;//'('+ItemList[j].MediaVisitors+')';

	 aText = aText.substring(0,7);
         if (i>9)
	 	TempHTML = TempHTML +
	 		'<td width="100%" height="20">&nbsp;' +
			'<font color="#FFCC00" align="left">'+i+
                        '</font>&nbsp;&nbsp;<font color="#CEC794" align="middle"><a title="'+
			linkedTitle+'" href="/121/121/'+ ItemList[j].DescURL+'">'+
			aText+'</a></font></td>';
         else
		TempHTML = TempHTML +
	 		'<td width="152" height="20">&nbsp;' +
			'<font color="#FFCC00" align="left">0'+i+
                        '</font>&nbsp;&nbsp;<font color="#CEC794" align="middle"><a title="'+
			linkedTitle+'" href="/121/121/'+ ItemList[j].DescURL+'">'+
			aText+'</a></font></td>';
        
	 //if(j%2==1)
	 {
	    TempHTML = TempHTML + '</tr>';
	 }

}
TempHTML=TempHTML+"</table>";
window.top10Div.innerHTML = TempHTML;
//window.Test.innerHTML = TempHTML;
}
function OutList_2()
{
var i,j;
var TempHTML='<table width="168" border="0" cellspacing="0" cellpadding="0">';
    TempHTML+='<tr><td width="26"><img src="../images/1.gif" width="16" height="13" /></td>';
    TempHTML+='<td width="145" height="20" align="left" class="dm_list">';
    if(MovieItemCount>=1){
       TempHTML+=ItemList[0].Title;
    }
    TempHTML+='</td></tr><tr><td height="88" colspan="2"><table width="168" border="0" cellspacing="0" cellpadding="0">';
    TempHTML+='<tr><td width="86" height="59"><table class="bt" height="60" cellspacing="1"';
    TempHTML+=' cellpadding="3" width="78" align="center" bgcolor="#cccccc" border="0">';
    TempHTML+='<tr><td valign="top" align="left" width="63" bgcolor="#ffffff">';
    if(MovieItemCount>=1){
       TempHTML+='<img src="../images/1.jpg" width="70" height="70" />';
    }
    TempHTML+='</td></tr></table>';
    TempHTML+='	</td><td width="82"><table width="93%" height="59" border="0" cellpadding="0" cellspacing="0">';
    TempHTML+='<tr><td height="41">';
    if(MovieItemCount>=1){
       TempHTML+=ItemList[0].Title;
    }
    TempHTML+='</td></tr><tr><td>点击:<span class="click">';
    if(MovieItemCount>=1){
       TempHTML+=""+ItemList[0].MediaVisitors;
    }
    //1000
    TempHTML+='</span></td></tr></table></td></tr></table></td></tr><tr><td colspan="2">';
    TempHTML+='<img src="../images/dm_r_line.gif" width="171" height="1" /></td></tr>';
    TempHTML+='';
    for(i=2;i<=MovieItemCount;i++){
	 j=i-1;
	 //if(j%2==0)
	 {
	    TempHTML = TempHTML + '<tr>';
	 }
	 var linkedTitle = "影片名:"+ItemList[j].Title
	 	    +"\n点击数:"+ItemList[j].MediaVisitors;
	 var aText  = ItemList[j].Title;//'('+ItemList[j].MediaVisitors+')';

	 aText = aText.substring(0,7);
	 TempHTML = TempHTML +'<td><img src="../images/'+i+'.gif" width="16" height="13" /></td><td height="20" align="left" class="dm_list"><a title="'+
			linkedTitle+'" href="../'+ ItemList[j].DescURL+'">'+
			aText+'</a></td>';
	 //if(j%2==1)
	 {
	    TempHTML = TempHTML + '</tr>';
	 }

   }
   TempHTML=TempHTML+"</table>";
   window.top10Div.innerHTML = TempHTML;
   //window.Test.innerHTML = TempHTML;
}