var navid=0;
var navnum=2;
var navp=0;

function showMpvienav()
{
	for(var i=0;i<navnum;i++)
	{
		navid=navid%movienav.length;
		$('#movienav'+i).html("<a href='"+movienav[navid]['link']+"' target='_blank' title='"+movienav[navid]['title']+"'><img src='"+movienav[navid]['url']+"' width=80 height=120></a>");

		navid++;
	}
    var x=33-navp*15;
    navp++;
    if(navp>=3)
        navp=0;
	$("#movienavdot").css("background","url(/img/dot.gif) no-repeat -"+x+"px 0px");
    setTimeout("showMpvienav()",7000);

}


var newsid=0;
var newsnum=5;
var newsmsg="<dl>暂无内容</dl>";

function showInnerBox()
{
    $('#boxC_innerlist').html($(newsmsg).children().slice(newsid ,newsid+newsnum));
    newsid=newsid+newsnum;
    if(newsid>$(newsmsg).children().size())
    {
        newsid=newsid-$(newsmsg).children().size();
        $("#boxC_innerlist").append($(newsmsg).children().slice(0,newsid));
    }
    setTimeout("showInnerBox()",7000);

}

function onPageView(){
$.ajax({
   type: "POST",
   url: "boxb_inner.php",
   data: "x=movieinfo&i="+Math.random()+"&preview="+preview+"&magid="+magid,
   success: function(msg){
    newsmsg=msg;
    showInnerBox();
   }
});


}


$(document).ready(function(){onPageView();

});
function getPageSize(){
  var xScroll, yScroll;
  if (window.innerHeight && window.scrollMaxY) {
    xScroll = document.body.scrollWidth;
    yScroll = window.innerHeight + window.scrollMaxY;
  } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
  } else { // Explorer Macwould also work in Explorer 6 Strict, Mozilla and Safari
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
  }

  var windowWidth, windowHeight;
  if (self.innerHeight) {  // all except Explorer
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
  } else if (document.body) { // other Explorers
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
  }

  // for small pages with total height less then height of the viewport
  if(yScroll < windowHeight){
    pageHeight = windowHeight;
  } else {
    pageHeight = yScroll;
  }

  if(xScroll < windowWidth){
    pageWidth = windowWidth;
  } else {
    pageWidth = xScroll;
  }

  arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
  return arrayPageSize;

}

