// JavaScript Document

$(function(){
	$(".dh_62").mouseover(function(){
		var img_src=$(this).find("img").attr("src");	
		$(this).find("img").attr("src",img_src.replace("images/","images/h_"))	
		$(this).css({background:"url(images/dh_bg.jpg)"})
		$(this).find(".dh_dn").show();	

	})	
	$(".dh_62").mouseout(function(){
		var img_src=$(this).find("img").attr("src");	
		$(this).find("img").attr("src",img_src.replace("images/h_","images/"))						   
		$(this).css({background:"url(images/dh_bg_2.jpg)"})
		$(this).find(".dh_dn").hide();	
	})		   
})

function showLeftTree(n){
	for(i=1;i<=4;i++){
		$("#leftTree_"+i).find("dd").each(function(){
			$(this).hide();
		})	
		$("#leftTree_"+i).find("dt").removeClass("left_menu_bg2_bg");
		$("#leftTree_"+i).find("dt").removeClass("left_menu_bg2");
		if(i!=n){$("#leftTree_"+i).find("dt").addClass("left_menu_bg2");}
	}
		$("#leftTree_"+n).find("dd").each(function(){
			$(this).show();
		})
		$("#leftTree_"+n).find("dt").addClass("left_menu_bg2_bg");
}

function changecode()
{
var t=new Date();
document.getElementById("codeimg").src='inc/code.php?id='+t;
}

function checkMsg(){
var fn=document.add;
if(!fn.username.value){alert('请填写您的姓名！');fn.username.focus();return false;}
if(!fn.phone.value){alert('请填写联系电话！');fn.phone.focus();return false;}
if(!fn.address.value){alert('请填写联系地址！');fn.address.focus();return false;}
if(!fn.title.value){alert('请填写留言标题！');fn.title.focus();return false;}
if(!fn.code.value){alert('请填写验证码！');fn.code.focus();return false;}
}

/*****选择下拉列表******/
function CheckSel(Voption,Value)
{
 var obj = document.getElementById(Voption);
 for (i=0;i<obj.length;i++){
  if (obj.options[i].value==Value){
  obj.options[i].selected=true;
  break;
  }
 }
}

function checkJob(){
var fn=document.jobForm;
if(!fn.username.value){alert('请填写您的姓名！');fn.username.focus();return false;}
if(!fn.phone.value){alert('请填写联系电话！');fn.phone.focus();return false;}
fn.info.value=document.getElementById("contentHtml").innerHTML;
}

