var $ = jQuery.noConflict();

$(document).ready(function() {
	$('#gnb1, #gnb2, #gnb3, #gnb4, #gnb5, #gnb6, #gnb7').hoverIntent(function() {
		$(this).children('.subgnb').slideDown('fast');
	}, function() {
		$(this).children('.subgnb').slideUp('normal');
	});
});

$(document).ready(function() {
	$('.aktt_tweets ul').cycle({
		fx: 'scrollUp',
		speed:  1000,
		timeout: 4000,
		pause: 1,
		cleartypeNoBg: true
	});
});

$(document).ready(function() {
	$('#errorbox').bounceBox();
	$('#errorbox span').click(function(){
		$('#errorbox').bounceBoxHide();
	});
});

// check contack form
function chk_contact() {
	var form=document.form;
	var email=$('#formemail').attr('value'); 
	var chkemail1=email.split("@");
	if (chkemail1[1]!=null) {
		var chkemail2=chkemail1[1].split(".");
	}
	if (form.contact1.value=="") {
		$('#errorbox').bounceBoxToggle();
		$("#errorbox p").html("<strong>성함</strong>을<br />입력해주세요.");
		form.contact1.focus();
		return false;
	}
	else if (form.contact2.value=="") {
		$('#errorbox').bounceBoxToggle();
		$("#errorbox p").html("<strong>회사 상호</strong>를<br />입력해주세요.");
		form.contact2.focus();
		return false;
	}
	else if (form.contact4.value=="") {
		$('#errorbox').bounceBoxToggle();
		$("#errorbox p").html("<strong>핸드폰 번호</strong>를<br />입력해주세요.");
		form.contact4.focus();
		return false;
	}
	else if (form.contact5.value=="") {
		$('#errorbox').bounceBoxToggle();
		$("#errorbox p").html("<strong>이메일 주소</strong>를<br />입력해주세요.");
		form.contact5.focus();
		return false;
	}
	else if (chkemail1[1]==null || chkemail2[1]==null) {
		$('#errorbox').bounceBoxToggle();
		$("#errorbox p").html("<strong>올바른 이메일 주소</strong>를<br />입력해주세요.");
		form.contact5.focus();
		return false;
	}
	else if (form.contact6.value=="") {
		$('#errorbox').bounceBoxToggle();
		$("#errorbox p").html("<strong>제목</strong>을<br />입력해주세요.");
		form.contact6.focus();
		return false;
	}
	else {
		return true; 
	}
}
