
/*
    rowthit:月份
    divFilm:点击最高的电影
    mark:评分最高的电影
    hope:最受期待的电影
*/
function pageh(id)
{   
	for(var i=1;i<=12;i++)
	{
		if(id == i)
		{
			document.getElementById('rowthit'+id.toString()).className= 'mova2522';
		    document.getElementById('divFilm'+id.toString()).style.display = '';
		    document.getElementById('mark'+id.toString()).style.display = '';	
		    document.getElementById('hope'+id.toString()).style.display='';		
		}
		else
		{
		    document.getElementById('rowthit'+i.toString()).className= 'mova2521';
	        document.getElementById('divFilm'+i.toString()).style.display = 'none';
	        document.getElementById('mark'+i.toString()).style.display = 'none';
	        document.getElementById('hope'+i.toString()).style.display='none';		   
		}
		
	}
	
}

/*
    menu:菜单：点击最高的电影、评分最高的电影、最受期待的电影
    film:相关菜单的DIV电影集
*/
function pageFilm(id)
{ 
    var month='';
    var type='';
    if(id==1)
        type='hit';
    if(id==2)
        type='mark';
    if(id==3)
        type='hope';
        
    for(var i=1;i<4;i++)
    {         
        if(id == i)
        { 
            if(i==2)
            {
                var j=i-1;
                document.getElementById('menu'+j.toString()).className='mova2411';
              //  document.getElementById('menu1').style.width='143px';   
                document.getElementById('mainMenu').className='mova2412';        
            }
            else if(i==3)
            {
                var j=i-1;
                document.getElementById('menu'+j.toString()).className='mova2411'; 
            //    document.getElementById('menu1').style.width='146px'; 
                document.getElementById('mainMenu').className='mova2413';
            }
            else
                document.getElementById('mainMenu').className='mova241';  
            document.getElementById('menu'+id.toString()).className= 'mova242';
       //     document.getElementById('film'+id.toString()).style.display='';  
                     
        }
        else
        {         
            document.getElementById('menu'+i.toString()).className= 'mova243';
            document.getElementById('menu3').className= 'mova244';
         //   document.getElementById('film'+i.toString()).style.display='none';           
        }
    }
    
    for(var i=1;i<13;i++)
    {
        if(document.getElementById('rowthit'+i.toString()).className=='mova2522')
        {
            month = i.toString();           
        }
    } 
    
    var CallBack = function callback(obj)
    {
        document.getElementById('film1').innerHTML="";
        document.getElementById('film1').innerHTML=obj.responseText;
    }
    Request.SendToPage('AjaxDataOperate/AjaxHttp.aspx?month=' + month.toString() + '&type=' + type + '&net4=' + Math.floor(Math.random()*10000000),'',CallBack,false,null);
}

//异部更新点击最高、评分最高、最受欢迎的十二个月，每个月的电影
function ajaxHttp(month,monthTrue)
{
    for(var i=1;i<=12;i++)
	{
		if(month == i)
		{
			document.getElementById('rowthit'+month.toString()).className= 'mova2522';			
		}
		else
		{
		    document.getElementById('rowthit'+i.toString()).className= 'mova2521';	   		   
		}
		
	}

    var type='';
    for(var i=1;i<4;i++)
    {
        if(document.getElementById('menu'+i.toString()).className=='mova242')
        {
            if(i==1)            
                type='hit';            
            if(i==2)
                type='mark';
            if(i==3)
                type='hope';
        }
    }   

    var CallBack = function callback(obj)
    {
        document.getElementById('film1').innerHTML="";
        document.getElementById('film1').innerHTML=obj.responseText;
    }
    Request.SendToPage('AjaxDataOperate/AjaxHttp.aspx?month=' + monthTrue.toString() + '&type=' + type + '&net4=' + Math.floor(Math.random()*10000000),'',CallBack,false,null);
}

//电影月份上的点击链接
function ajaxSendMonth(yearMonth,region)
{
    var type='';
    for(var i=1;i<4;i++)
    {
        if(document.getElementById('menu'+i.toString()).className=='mova242')
        {
            if(i==1)            
                type='hit';            
            if(i==2)
                type='mark';
            if(i==3)
                type='hope';
        }
    }
    var CallBack = function callback(obj)
    {      
        window.open(obj.responseText);
    }
    Request.SendToPage('AjaxDataOperate/AjaxSendMonth.aspx?yearMonth=' + yearMonth.toString() + '&filmType=' + type.toString() + '&region=' + region.toString() ,'',CallBack,false,null);

}


//异部更新区域电影十二个月中每个月中电影
function ajaxFilmHttp(month,region,mt)
{
    var reg='';
    if(region==1)
        reg = "om";
    if(region==2)
        reg = "rh";
    if(region==3)
        reg = "gt";
    if(region==4)
        reg = "nd";
    for(var i=1;i<=12;i++)
	{
		if(month == i)
		{
			document.getElementById(reg+month.toString()).className= 'mova2522';			
		}
		else
		{
		    document.getElementById(reg+i.toString()).className= 'mova2521';	   
		}		
	}
	
	var CallBack = function callback(obj)
    {
        document.getElementById('region' + region.toString()).innerHTML=""; 
        document.getElementById('region' + region.toString()).innerHTML=obj.responseText;                
    }
    Request.SendToPage('AjaxDataOperate/AjaxFilmHttp.aspx?month=' + mt.toString() + '&region=' + region.toString() + '&net4=' + Math.floor(Math.random()*10000000),'',CallBack,false,null);    
}

function writeFlash(pics,texts,links)
{ 
	var focus_width=500;
	var focus_height=250;
	var text_height=24;
	var swf_height=focus_height + text_height;
	var bgcolor="#FFFFFF";
	var bordercolor="0xcccccc";
	var fontsize=12;
	var fontcolor="3333333";
//	var pics="http://digital.zol.com.cn/210_module_images/760.jpg|http://digital.zol.com.cn/210_module_images/746.jpg|http://digital.zol.com.cn/210_module_images/748.jpg|http://digital.zol.com.cn/210_module_images/753.jpg|http://digital.zol.com.cn/210_module_images/757.jpg";
//	var links="http://nb.zol.com.cn/82/827941.html|http://nb.zol.com.cn/topic/824356.html|http://nb.zol.com.cn/82/822107.html|http://nb.zol.com.cn/82/829228.html|http://nb.zol.com.cn/83/830845.html";
 //   var texts="独显迅驰4为先 海尔万元超强本首测|究竟有多强？苹果MacBook Air实测全解密|一家之言:看数码产品的“劣币驱逐良币”|索尼限量版VAIO FZ本问世 绘诱惑图案|仅有两台 苹果MacBook Air到货中关村";
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/focus.swf?v1.0"><param name="quality" value="high"><param name="bgcolor" value="'+bgcolor+'">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&border_color='+bordercolor+'&fontcolor='+fontcolor+'&fontsize='+fontsize+'">');
	document.write('<embed src="images/focus.swf?v1.0" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="'+bgcolor+'" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" border_color="0x478E7A" fontcolor="'+fontcolor+'" fontsize="'+fontsize+'">');
	
	document.write('</object>');
}

function getFilmMark_mark(FilmID,ipAddress)
{
    //var rad = window.fram1.document.getElementsByName("radbut");
	var rad = document.getElementsByName("radbut");
    var mark=20;    

    for(var i=0;i<rad.length;i++)
    {
        if(rad[i].checked)
        {
            mark=rad[i].value;
            break;
        }        
    }

    if(mark==20)
    {
        alert("请选择分数!");
        return;
    }

    var CallBack = function callback(obj)
    {
        alert(obj.responseText);
        window.location = "GetFilmMark.aspx?FilmID=" + FilmID;  
		//document.frames("fram1").location.reload();     
    }
    var d = new Date();
    Request.SendToPage('AjaxDataOperate/AjaxUpdateFilmMark.aspx?FilmID=' + FilmID.toString() + '&Mark=' + mark.toString() + '&IpAddress=' + ipAddress.toString() + '&aw4=' + d.getUTCMilliseconds(),'',CallBack,false,null);
   
}

//拷贝网址
function copyToClipBoard()
{
      var clipBoardContent='';
      clipBoardContent=top.window.location.href;
      window.clipboardData.setData("Text",clipBoardContent);
      alert('网址已复制成功，赶快Ctrl+V粘贴给QQ/MSN上的好友吧!');
}

function downFilmBtn(filmID,PageType)
{
    var a = filmID / 1000000;
    var b = filmID / 1000;

    window.open(filmID + "_" + PageType + "_" + parseInt(a.toString()) + "_" + parseInt(b.toString()) + ".html");
}
