// JavaScript Document
function displayimg(){
	$("#banner").slideUp("slow");    
}
function hidead(){
	$("#ad").hide();
}
$(function(){
	nav_top_no();
	function nav_top_no(){
		var ntid = $("#navzid").text();
		$("#mb").children("li").children("a").eq(ntid).addClass("on");
	}
	function nav_top_off(){$(".mc_nav a").removeClass("on");}
	$(".mc_nav a").hover(function(){nav_top_off();},function(num){nav_top_no();});
	$("form[name='form_gbook']").submit(function() {
	  if(!/.+/.test($("#g_name").val())){alert("您的称呼不能为空，请填写！");return false;}
	  if(!/.+/.test($("#g_phone").val())){alert("联系方式不能为空，请填写！");return false;}
	  if(!/.+/.test($("#g_title").val())){alert("留言标题不能为空，请填写！");return false;}
	  if(!/.+/.test($("#g_content").val())){alert("留言内容不能为空，请填写！");return false;}
	  if(!/.+/.test($("#g_yzm").val())){alert("验证码不能为空，请填写！");return false;}
	});
	$("#g_yzm,#yanzm").click(function(){
		$(this).next("span").show();
		$("#yanzm").attr("src","js/yzm_img.asp?a=gbook&zz="+Math.random());
		$("#g_yzm").unbind("click");
	});
	//祝福广告
	$("#wishBanner").slideDown("slow");
	setTimeout("displayimg()",1500);
	
	$(".zoom img").click(function(){
		var thisEle = $(".list_body").css("font-size");
		var textFontSize = parseFloat(thisEle , 10);
		var cName = $(this).attr("class");
		if(cName == "zoomin"){
				textFontSize += 2;
		}else if(cName == "zoomout"){
				textFontSize -= 2;
		}
		$(".list_body").css("font-size",  textFontSize+'px' );
		$(".list_about_bg").css("font-size",  textFontSize+'px' );
	});
	$("a.switch_thumb").toggle(function(){
	  $(this).addClass("swap"); 
	  $("ul.display").fadeOut("fast", function() {
	  	$(this).fadeIn("fast").addClass("thumb_view"); 
		 });
	  }, function () {
      $(this).removeClass("swap");
	  $("ul.display").fadeOut("fast", function() {
	  	$(this).fadeIn("fast").removeClass("thumb_view");
		});
	}); 
	$('#roll_top').click(function () { $('html,body').animate({ scrollTop: '0px' }, 800); });
    $(window).scroll(function (event) {
        if ($.browser.ie6) {
            $('#roll').css('top', $(this).scrollTop() + $(this).height() - 170);
        }
        if ($(this).scrollTop() > 260) {
            $('#roll').fadeIn();
        } else {
            $('#roll').fadeOut();
        }
    });
	$(".tj_news ul li:eq(0),.tj_news ul li:eq(1),.tj_news ul li:eq(2)").children("span").css('background','#FF3000');
	$(".gpyouhui tr").each(function(){
		$(this).find("td:even").css("padding-left","30px");	
		$(this).find("td:odd").css("text-align","center");							
	});
	$(".gplist").find("li").children("p:first").addClass("gpliston");
});
var img_str=Math.floor(Math.random() * 2 + 1)