$(function() {
	//게시판 목록1 텝 전환 (마우스 오버시)
	$('#board_list > ul > li > a').mouseover(function(){
		$('#board_list > ul > li > div').hide();
		$('#board_list > ul > li > a > img').each(function(index, value){
			$(this).attr('src',$(this).attr('src').replace('_ov','_off'));
		});
		$('img:first',this).attr('src',$('img:first',this).attr('src').replace('_off','_ov'));
		$(this).next('div').show()
	});

	//게시판 목록1 텝 전환 (온 포커스시)
	$('#board_list > ul > li > a').focus(function(){
		$('#board_list > ul > li > div').hide();
		$('#board_list > ul > li > a > img').each(function(index, value){
			$(this).attr('src',$(this).attr('src').replace('_ov','_off'));
		});
		$('img:first',this).attr('src',$('img:first',this).attr('src').replace('_off','_ov'));
		$(this).next('div').show();
	});

	$('#divMenu1').click(function(){
		$("#info").toggle('slide',"fast",$("#all_menu_pos").hide());
	});

	$('#Tbutton').click(function(){
		$("#info").toggle('slide',"fast",$("#all_menu_pos").show());
	});

	function xajax1(dataVal){
		if (dataVal){
			$.ajax({
				type: "POST",
				url: "/inc/left_service_tr.php?mode=1",
				data: "qlinkc="+dataVal,
				success: function(msg){
					$('#go1').html(msg);
				}
			});
		}else{
			$.ajax({
				type: "POST",
				url: "/inc/left_service_tr.php",
				success: function(msg){
					//alert(msg);
					$('#go1').html(msg);
				}
			});
		}
	}
	xajax1();

	$('#Pop_pause_bt').click(function() {
		$('#PopUpZone').cycle('pause');
	});

	$('#Pop_pause_bt').keypress(function() {
		$(this).click();
	});

	$('#Pop_resume_bt').click(function() {
		$('#PopUpZone').cycle('resume');
	});

	$('#Pop_resume_bt').keypress(function() {
		$(this).click();
	});

	$('#PopUpZone > a').mouseover(function(){
		$('#PopUpZone').cycle('pause');
	});

	$('#PopUpZone > a').mouseout(function(){
		$('#PopUpZone').cycle('resume');
	});

	$('#banner_resume').click(function() {
		$('#rolling_banner').cycle('resume');
		return false;
	});

	$('#banner_stop').click(function() {
		$('#rolling_banner').cycle('pause');
		return false;
	});

	$('#rolling_banner > span > a').mouseover(function() {
		$('#rolling_banner').cycle('pause');
		return false;
	});

	$('#rolling_banner > span > a').focus(function() {
		$(this).mouseover();
	});

	$('#rolling_banner > span > a').mouseout(function() {
		$('#rolling_banner').cycle('resume');
		return false;
	});

	$('#rolling_banner > span > a').blur(function() {
		$(this).mouseout();
	});

	// Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});

	$('#dialogClose').click(function(){
		$('#dialog').dialog("close");
		return false;
	});

	$('#mailTolink').click(function(){
		$('#mailToMasterDialog').show().dialog('open');
		return false;
	});

	$('#qlickFrm').submit(function(){
		j = 0;
		var dataVal = "";
		for(k=0; k< document.qlick.qlinkc.length; k++){
			if (document.qlick.qlinkc[k].checked == true){
				j++;
				if(j < 7) {
					dataVal = dataVal+"|"+ document.qlick.qlinkc[k].value;
				}else{
					alert("6개항목 이내로 선택해 주세요");
					break;
					return false;
				}
			}
		}
		xajax1(dataVal);
		$('#dialog').dialog("close");
		return false;
	});
});