/*
// 阿不
// QQ:37348320
// www.raofeng.cn
*/
$(document).ready(function(){
	var obj = setInterval('autoScroll(".rollBody","30")',3000);
	$("ul.navMenu li").hover(function(){
		$(this).children("a.droplink").addClass("selected");
		$(this).children(".sub").show(300);
	},function(){
		$(this).children("a.droplink").removeClass("selected");
		$(this).children(".sub").hide(300);
	});
	$("ul.navMenu li ul li").hover(function(){
		$(this).children("a.sublink").addClass("selected");
		$(this).children("ul").show(300);
	},function(){
		$(this).children("a.sublink").removeClass("selected");
		$(this).children("ul").hide(300);
	});
	$("ul.leftMenu li").hover(function(){
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");;
	});
	$("a").focus(function(){
		$(this).blur();
	});
	$(".input").focus(function(){
		$(this).addClass("inputFocus");
	});
	$(".input").blur(function(){
		$(this).removeClass("inputFocus");
	});
	var LH = $("#left").height();
	var RH = $("#right").height();
	if(LH>RH){
		$("#right").height(LH);
	}else{
		$("#left").height(RH);
	}
	/*$("body").bind("contextmenu",function(){return false;});
	$("body").bind("selectstart",function(){return false;});
	$("body").bind("dragstart",function(){return false;});*/
});
function autoScroll(obj,hei){
	$(obj).animate({
		marginTop:"-"+hei+"px"
	},1000,function(){
		$(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
	});
}
function gbookFormCheck(){
	var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
	if($("#realname").attr("value")==""){
		inlineMsg('realname','<strong>Error</strong><br />姓名 不能为空！',2);
		return false;
	}else if($("#email").attr("value")!=""&&!$("#email").attr("value").match(emailRegex)){
		inlineMsg('email','<strong>Error</strong><br />电子邮箱 格式不正确！',2);
		return false;
	}else if($("#phone").attr("value")==""){
		inlineMsg('phone','<strong>Error</strong><br />联系电话 不能为空！',2);
		return false;
	}else if($("#content").attr("value")==""){
		inlineMsg('content','<strong>Error</strong><br />留言内容 不能为空！',2);
		return false;
	}else if($("#verify").attr("value")==""){
		inlineMsg('verify','<strong>Error</strong><br />验证码 不能为空！',2);
		return false;
	}
	return true;
}
