function set_menu(id)
{
	$('#menu>li ul').hide();
	$('#menu>li').mouseover(function(){
		$('#menu>li ul').hide();
		$(this).find('ul').show();
	} );
	$('#menu>li').mouseout(function(){
		$(this).find('ul').hide();
	});
	$("#menu>li").eq(id).attr('class','on');
	
	var height=$(".sub_con").height();
	$(".sub_side").height(height+20);
}

function add_comment()
{
	$('#ComSubmit').click(function(){
		if($("#username").val()=="")
		{
			alert(iname);
			return false;
		}
		if($("#tel").val()=="")
		{
			alert(itel);
			return false;
		}
		if($("#comment").val()=="")
		{
			alert(icontent);
			return false;
		}
		if($("#comment").val().length<5 || $("#comment").val().length>5000)
		{
			alert(ilength);
			return false;
		}
		if($("#captcha").val()=="")
		{
			alert(icaptcha);
			return false;
		}
		else
		{
			$("#ComSubmit").addClass("disable"); 
			$("#ComSubmit").attr({"disabled":"disabled"});
			$.post("source/comment.php?do=add", {
						username:$('#username').val(),
						comment:$('#comment').val(),
						captcha:$('#captcha').val(),
						tel:$('#tel').val()
					},function (data,textStatus){
						if (data.error == 0)
						{
							window.location.reload();
		  					alert(data.message);
						}
						else
						{
		  					alert(data.message);
							$("#ComSubmit").removeAttr("disabled"); 
							$("#ComSubmit").removeClass("disable"); 
						}
						return false; 
					},"json");
			return false;
		}
	});	
}
