// JavaScript Document
$(document).ready(function(){
	$(".p_column dl dt").click(function(){
		$(".p_column dl dd").hide();
		$(this).nextAll("dd").slideDown('800');
	});
	
	$(".p_column dl dt").click(function(){
	$(".p_column dl dd").hide();
	$(this).nextAll("dd").slideDown('800');
	});
	news_gude();
});

function news_gude()
	{
		//切换指南3
		$(".xuan ul li").each(function(index){
			$(this).click(function(){
			$(this).children("a").addClass('cur');
			$(this).prevAll().children("a").removeClass('cur');
			$(this).nextAll().children("a").removeClass('cur');
			for(i=0;i<4;i++){
			if(i==index){
			$(".xuan_content_"+index).css("display","block");   
				}else{
				$(".xuan_content_"+i).css("display","none");   	
						}
			}
			
		   });
	   });
		
	}

function find_img(oop){
	$("#show_img").attr("src","upload/"+oop);

}

function find_img_index(oop){
	$("#show_img").attr("src",oop);

}

function submit_date(){
	var username = $('#username').val();
	var email = $('#email').val();
	var phone = $('#phone').val();
	var address = $('#address').val();
	var tel = $('#tel').val();
	var content = $('#content').val();
	
	if(username ==""){
		alert('姓名不能为空，请填写');
		$('#username').focus();
		return false;
	}
	
	if(phone ==""){
		alert('手机不能为空，请填写');
		$('#phone').focus();
		return false;
	}
	
	if(tel ==""){
		alert('联系电话不能为空，请填写');
		$('#tel').focus();
		return false;
	}
	
	if(email ==""){
		alert('邮箱不能为空，请填写');
		$('#email').focus();
		return false;
	}
	
	var myReg = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/; 
	if(!myReg.test(email)){ 
		alert("邮箱格式有错！");
		$('#email').focus();
		return false;
	}
		
	if(address ==""){
		alert('地址不能为空，请填写');
		$('#address').focus();
		return false;
	}
	
	if(content.length <22){
		alert('内容太短，请重新填写');
		$('#content').focus();
		return false;
	}
}
// 收缩展开效果
$(document).ready(function(){
   $("#mark_tb2").toggle(
   		function(){
     		$(this).next(".mark_text").animate({height: '60px'}, "slow");
			this.innerHTML="收起";
   		},
   		function(){
			$(this).next(".mark_text").animate({height: '25px'}, "slow");
			this.innerHTML="更多";

   });
});

