$(function(){
  $.fn.htmlimg=function()
  {
	var bigstr
	if($(this).html()=="")
	{
	  this.each(function()
	  { 
		bigstr='<a href="'+$(this).attr("href")+'" class="playlink" target="_blank" title="'+$(this).attr("title")+'">\
				  <img src="'+$(this).attr("src")+'" width="100" height="136" alt="'+$(this).attr("title")+'"/>\
				</a>\
				<p class="title">\
				  <a href="'+$(this).attr("link")+'" title="点击查看影片信息" class="movinfo" target="_blank"></a>\
				  <a href="'+$(this).attr("href")+'" title="'+$(this).attr("title")+'">'+$(this).attr("title")+'</a>\
				</p>\
				<span class="bg"></span>\
				<span class="txt">'+$(this).attr("state")+'</span>\
				<p class="note">'+$(this).attr("note")+'</p>'
		$(this).html(bigstr);
		$(this).show();
	  });
	}
	$(this).children(".playlink").each(function()
	{ 
	  $(this).html($(this).html());
	});
  }
  $(".box_tabbox .colum ul li").mouseover(function()
  {
	var i,j=0
	$(".box_tabbox .colum ul li").attr("class","")
	$(this).attr("class","on")
	i=$(this).attr("tab")
	$(".fouce2 .box_tabbox .rendielist").each(function()
	{
	  if(i==j)
	  {
		$(this).children("li").htmlimg()
		$(".fouce2 .box_tabbox .rendielist").hide()
		$(this).show()
	  }
	  j++
	});
  });
  $(".shangsheng li").mouseover(function()
  {
	var i,j=0
	$(".shangsheng li").attr("class","")
	$(this).attr("class","on")
	i=$(this).attr("lab");
	$(".box_con .ranklist_txt").each(function()
	{
	  if(i==j)
	  {
		$(".box_con .ranklist_txt").attr("class","ranklist_txt none")
		$(this).attr("class","ranklist_txt")
	  }
	  j++
	});
  });
  $(".fouce3 .box_tabbox h2 span a").click(function()
  {
	var str,bool=new Array(),j=0
	for(var k=0;k<29;k++){bool[k]=k;}
	for(var k=0;k<23;k++){bool[k]=bool.splice(Math.floor(Math.random()*bool.length),1);}
	$(".fouce3 .box_tabbox .rendielist li").each(function()
	{
	  if((j==bool[0])||(j==bool[1])||(j==bool[2])||(j==bool[3])||(j==bool[4])||(j==bool[5]))
	  {
		if($(this).html()=="")
		{
		  bigstr='<a href="'+$(this).attr("href")+'" class="playlink" target="_blank" title="'+$(this).attr("title")+'">\
					<img src="'+$(this).attr("src")+'" alt="'+$(this).attr("title")+'" width="100" height="136"/>\
				  </a>\
				  <p class="title">\
					<a href="'+$(this).attr("link")+'" title="点击查看影片信息" class="movinfo" target="_blank"></a>\
					<a href="'+$(this).attr("href")+'" title="'+$(this).attr("title")+'">'+$(this).attr("title")+'</a>\
				  </p>\
				  <span class="bg"></span>\
				  <span class="txt">'+$(this).attr("state")+'</span>\
				  <p class="note">'+$(this).attr("note")+'</p>'
		  $(this).html(bigstr);
		}
		$(this).show();
	  }else{$(this).hide();}
	  j++;
	});				
  });
});