﻿var   HDURL = false;
var   isIesix=window.clientInformation.appVersion.indexOf("7.0");   
var   str=isIesix<0?"":"\n——————————————————————————\n系统检测到您的浏览器为IE7.0，安装完播放器后若再出现本提示，请\n点击取消，然后允许运行加载项（可以参考页面上的帮助说明链接）。";


//document.write("<object classid='clsid:F3D0D36F-23F8-4682-A195-74C92B03D4AF' width='100%' height='343' id='QvodPlayer' name='QvodPlayer' onError='setError()'}><PARAM NAME='URL' VALUE='"+yanghuan+"'><PARAM NAME='Autoplay' VALUE='1'><PARAM NAME='QvodAdUrl' VALUE=''><PARAM NAME='Showcontrol' VALUE='0'></object>");



var myimages=new Array()
function preloadimages(){
	if (document.images){
		for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
		}
	}
}
preloadimages("/HDSkin/images/btn_pause.jpg","/HDSkin/images/btn_soundX.jpg","/HDSkin/images/btn_player_process_bar.jpg")

function setError()
{

	$('error').innerHTML = '<a href="index.php?c=index&d=download"><img src="/HDSkin/images/player.gif" /></a>';
	$('player_center').style.display = "none";
	alert('您还没有安装QVOD播放器，将不能正常播放本站的电影！' + str);
	
}
function killErrors() {
	return true;
}
window.onerror = killErrors;


function show_dbph(str1,str2,str3)
{
	$("tab_dbph_"+str1).className = "current";
	$("tab_dbph_"+str2).className = "";
	$("tab_dbph_"+str3).className = "";
	$("paihang_list_"+str1).style.display = "block";
	$("paihang_list_"+str2).style.display = "none";
	$("paihang_list_"+str3).style.display = "none";
}
function show_tjgk(str1,str2,str3,str4,str5)
{
	$("top_tab_"+str1).className = "current";
	$("top_tab_"+str2).className = "";
	$("top_tab_"+str3).className = "";
	$("top_tab_"+str4).className = "";
	$("top_tab_"+str5).className = "";
	$("tjgk_"+str1).style.display = "block";
	$("tjgk_"+str2).style.display = "none";
	$("tjgk_"+str3).style.display = "none";
	$("tjgk_"+str4).style.display = "none";
	$("tjgk_"+str5).style.display = "none";
}
function show_page(strPage, strPic, str1, str2, str3, str4)
{
	if (strPic == '41' || strPic == '42' || strPic == '43' || strPic == '44' || strPic == '45' || strPic == '46')
	{
		$("pic_page_"+strPic+"_"+str1).src="/Skin/skin_15/images/ring_black_blackbg.gif";
		$("pic_page_"+strPic+"_"+str2).src="/Skin/skin_15/ring_gray_blackbg.gif";
		$("pic_page_"+strPic+"_"+str3).src="/Skin/skin_15/ring_gray_blackbg.gif";
		$("pic_page_"+strPic+"_"+str4).src="/Skin/skin_15/ring_gray_blackbg.gif";
	}
	else
	{
		$("pic_page_"+strPic+"_"+str1).src="/Skin/skin_15/images/ring_black.gif";
		$("pic_page_"+strPic+"_"+str2).src="/Skin/skin_15/images/ring_gray.gif";
		$("pic_page_"+strPic+"_"+str3).src="/Skin/skin_15/images/ring_gray.gif";
		$("pic_page_"+strPic+"_"+str4).src="/Skin/skin_15/images/ring_gray.gif";
	}
	$(strPage+"_page_"+str1).style.display = "block";
	$(strPage+"_page_"+str2).style.display = "none";
	$(strPage+"_page_"+str3).style.display = "none";
	$(strPage+"_page_"+str4).style.display = "none";
	$("hid_"+strPage+"_page").value = str1;
}
function gopage(strPage, strPic, flg)
{
	var current_page = $("hid_"+strPage+"_page").value;
	var new_page;
	if (!((flg == '1' && current_page == "1") || (flg == '2' && current_page == "4")))
	{
		if (flg == '1') //go prev
		{
			new_page = (parseInt(current_page)-1).toString();
		}
		if (flg == '2') //go next
		{
			new_page = (parseInt(current_page)+1).toString();
		}
		switch (new_page)
		{
			case '1':
				show_page(strPage, strPic, '1', '2', '3', '4');
				break;
			case '2':
				show_page(strPage, strPic, '2', '1', '3', '4');
				break;
			case '3':
				show_page(strPage, strPic, '3', '1', '2', '4');
				break;
			case '4':
				show_page(strPage, strPic, '4', '1', '2', '3');
				break;
		}
	}
}
function show_flys_tab(str1,str2,str3,str4,str5,str6)
{
	$("flys_tab_"+str1).className = "current";
	$("flys_tab_"+str2).className = "";
	$("flys_tab_"+str3).className = "";
	$("flys_tab_"+str4).className = "";
	$("flys_tab_"+str5).className = "";
	$("flys_tab_"+str6).className = "";
	$("flys_tab_page_"+str1).style.display = "block";
	$("flys_tab_page_"+str2).style.display = "none";
	$("flys_tab_page_"+str3).style.display = "none";
	$("flys_tab_page_"+str4).style.display = "none";
	$("flys_tab_page_"+str5).style.display = "none";
	$("flys_tab_page_"+str6).style.display = "none";
	$("flys_block_"+str1).style.display = "block";
	$("flys_block_"+str2).style.display = "none";
	$("flys_block_"+str3).style.display = "none";
	$("flys_block_"+str4).style.display = "none";
	$("flys_block_"+str5).style.display = "none";
	$("flys_block_"+str6).style.display = "none";
	if (str1 == "6")
	{
		$("flys_tab_"+str1).className = "current last";
	}
	else
	{
		$("flys_tab_6").className = "last";
	}
}
function show_more_menu()
{
	if ($("more_menu").style.display == "block")
	{
		$("more_menu").style.display = "none";
	}
	else
	{
		$("more_menu").style.display = "block";
	}
}

function show_list_tab(str1,str2,str3)
{
	$("list_tab_"+str1).className = "current";
	$("list_tab_"+str2).className = "";
	$("list_tab_"+str3).className = "";
	$(str1).style.display = "block";
	$(str2).style.display = "none";
	$(str3).style.display = "none";
}

/*ajax读取分页*/

function LoadComment(id,page)
{

   $("comment_box").innerHTML = '正在读取评论，请稍候....';
   var myAjax = new Ajax.Request(
        "index.php?c=index&d=getComment",
        {
            method:"get",       //表单提交方式 
            parameters:"Id="+id + "&page="+page,   //提交的表单数据
            setRequestHeader:{"If-Modified-Since":"0"},     //禁止读取缓存数据
            onComplete:function(x){    //提交成功回调 
                   $("comment_box").innerHTML=x.responseText;
				   //alert(x.responseText);
            },
            onError:function(x){          //提交失败回调
                    alert('评论读取失败，请刷新重新操作！');
            } 
        } 
   ); 
}

/*发送信息*/
function PostComment(id)
{
	var Content = $V('Content');
	var UserName = $V('UserName');
	var quote = $V('quote');
	
	
	if(Content == '')
	{
		//alert('难道您不想说点什么吗？');
		$('comment_txt').innerHTML = '难道您不想说点什么吗？';
		$('Content').focus();
		return false;
	}
	
	if(Content.length > 100 )
	{
		//alert('不能超过100个字哦？');
		$('comment_txt').innerHTML = '不能超过100个字哦？';
		$('Content').focus();
		return false;
	}
	
	 var myAjax = new Ajax.Request(
        "index.php?c=index&d=PostComment",
        {
            method:"post",       //表单提交方式 
            parameters:"UserName="+ UserName + "&Content="+ $E(Content) +"&Id="+id +"&quote="+quote,   //提交的表单数据
            setRequestHeader:{"If-Modified-Since":"0"},     //禁止读取缓存数据
            onComplete:function(x){    //提交成功回调 
                 $('comment_txt').innerHTML = x.responseText;
				  $('Content').value ='';
				  $('UserName').value ='';
				  LoadComment(id,1)
				  return false;
            },
            onError:function(x){          //提交失败回调
                    alert('评论保存失败，请刷新重新操作！');
					return false;
            } 
        } 
   ); 

 return false;
}

function getValidateCode()
{
	$('validate_txt').innerHTML = '<img src="png.php?act=init" border="0" alt="验证码,看不清楚?请点击刷新验证码" style="cursor : pointer;" onClick="this.src="png.php?act=init&t="+ Math.random();"/>';
}
					
//引用发言

function quote(a) {
	$('quote').value = a;
	$('comment_txt').innerHTML = '引用成功,请输入您的评论信息！';
	//alert('引用成功');
}
//判断搜索

function checkSeach()
{

	if($V('s_key') =='')
	{
		alert('请输入关键字，可直接输片名，或者演员名！');
		$('s_key').focus();
		$('s_key').value ='';
		return false;
	}
	
	if($V('s_key') =='可直接输片名或者演员名')
	{
		alert('请输入关键字，可直接输片名，或者演员名！');
		$('s_key').focus();
		$('s_key').value ='';
		return false;
	}
}
