function play_flash(focus_width,focus_height,text_height,pics,links,texts){
	var swf_height = focus_height+text_height;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowscriptAccess" value="sameDomain"><param name="movie" value="/images/play.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
	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+'">');
	document.write('<embed src="/images/play.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowscriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
function WMast()
{
	if($("#wmast").length == 0)
	{
		var w = $(document).width();
		var h = $(document).height()- ($.browser.msie?4:0);
		var mast = $('<div id="wmast" style="position:absolute;left:0px;top:0px;width:100%;height:100px;text-align:center;background:#fff;filter: Alpha(Opacity=00); -moz-opacity:0.00; opacity:0.00;z-index:999;"></div>').appendTo("body");
		$("#wmast").css({height:h});	
	}
}
function CheckPro(){
	var name=$("#name").val();
	if(name==''){
		alert("请填入你的姓名！");
		return false;
	}else{
		$("#form2").submit();
	}	
}
function checkProduct(id){
	$('.pic01_about02_div').css("display","none");
	$('#pro'+id).css("display","block");
}
/*用户登录*/
function checklogin(){
	if($('#username').val()==''){
		alert('请输入你的登陆用户名！');	
		return false;	
	}
	else if($('#password').val()==''){
		alert('请输入你的登陆密码！');
		return false;		
	}else{
		$("#form1").submit();
	}
}
$(document).ready(function(){
	$("#page").change(function(){
		var p = parseInt($("#page").val());
		if(p>0){
			var href=$("#page_id").attr('href');
			$("#page_id").attr('href',href+"&page="+p);
			return;
		}
		else{
			alert('请输入正确的页码');
			$("#page").focus();
		}
	})
		$(".wenhua").css("display","none");
	//	荣誉殿堂
	 var page = 1;
     var i = 3; //每版放3个图片
	 $("div.spanright").click(function(){    //绑定click事件
	     var $parent = $(this).parents("div.list01_about02");//根据当前点击元素获取到父元素
		 var $v_show = $parent.find("div.list01_about02_1"); //寻找到“视频内容展示区域”
		  var $v_content = $parent.find("div.v_content"); //寻找到“视频内容展示区域”外围的DIV元素
		 var v_height= $v_content.height();
		 var len = $v_show.find("li").length;
		 var height=$v_show.find("li").height()+8;
		 var page_count = Math.ceil(len-i+1) ;   //只要不是整数，就往大的方向取最小的整数
		 
		 if( !$v_show.is(":animated") ){    //判断“视频内容展示区域”是否正在处于动画
			  if( page == page_count ){  //已经到最后一个版面了,如果再向后，必须跳转到第一个版面。
				//$v_show.animate({ top : '0px'}, "slow"); //通过改变，跳转到第一个版面
				//page = 1;
				}else{
				$v_show.animate({ top : '-='+height }, "slow");  //通过改变，达到每次换一个版面
				page++;
			 }
		 }
      });
       $("div.spanleft").click(function(){
	     var $parent = $(this).parents("div.list01_about02");//根据当前点击元素获取到父元素
		 var $v_show = $parent.find("div.list01_about02_1"); //寻找到“视频内容展示区域”
		 var $v_content = $parent.find("div.v_content"); //寻找到“视频内容展示区域”外围的DIV元素
		 var v_width = $v_content.height();
		 var len = $v_show.find("li").length;
		  var height=$v_show.find("li").height()+8;
		 var page_count = Math.ceil(len-i+1) ;   //只要不是整数，就往大的方向取最小的整数
		 if( !$v_show.is(":animated") ){    //判断“视频内容展示区域”是否正在处于动画
		 	 if( page == 1 ){  //已经到第一个版面了,如果再向前，必须跳转到最后一个版面。
				//$v_show.animate({ top : '-='+v_width*(page_count-1) }, "slow");
				//page = page_count;
			}else{
				$v_show.animate({ top : '+='+height }, "slow");
				page--;
			}
		 }
      });
});
/*联系金老汉*/
function showContact(id){
	WMast();
	var lw = parseInt($("#"+id).css("width"));
	var dw = $(document).width();
	var scrollTop=$(document).scrollTop();
	var height=$(window).height();					 
	var left = Math.ceil((dw - lw)/2);
	var top = Math.ceil((height/3)+scrollTop);
	var num=id-1;
	var offset = $(".list01_contact img:eq("+num+")").offset();
	var left1 = offset.left;
	if(num == 1) left1 = ($(document).width() - $("#"+id).width())/2;
	var top1 = offset.top;
	//alert(offset.left);
	//alert($(".list01_contact").length);	
	//var offset = $(".list01_contact img:eq("+num+")").offset();
	//alert(offset.left);
	//return false;
	$("#wmast").show();
	$("#"+id).css("top",top1+'px');
	$("#"+id).css("left",left1+'px'); 
	$('#'+id).css("z-index","1000");
	$('#'+id).attr('t',top1).attr("l",left1);
	//$('#'+id).css("opacity",0.8);
	$('#'+id).animate({left: left, opacity:'toggle',top:top}, { duration: 500 });
}
function hidediv(id){
	var top = $('#'+id).attr("t");
	var left = $('#'+id).attr("l")
	$('#'+id).animate({left: left,top:top, opacity:'toggle'}, { duration: 500 });
	//$('#'+id).fadeOut(2000);
	$("#wmast").hide();
}
/*品牌视角*/
function showwenhua(id){
	WMast();
	$("#jiameng").attr("disabled","true");
	var lw = parseInt($("#"+id).css("width"));
	var dh = parseInt($("#"+id).height());
	var dw = $(document).width();
	var scrollTop=$(document).scrollTop();
	var height=$(window).height();					 
	var left = Math.ceil((dw - lw)/2);
	var top = Math.ceil((height-dh)/2+scrollTop);
	$("#"+id).css("top",top+'px');
	$("#"+id).css("left",240+'px'); 
	$('#'+id).css("z-index","1000");
	$("#wmast").show();
	$('#'+id).animate({left: left+80, opacity:'toggle'}, { duration: 500 });
}
function hidewenhua(id){
	$("#jiameng").css("display","block");
		$("#jiameng").removeAttr("disabled");
		var dw = $(document).width();
	$('#'+id).animate({left: 500, opacity:'toggle'}, { duration: 500 });
	$("#wmast").hide();
}

