
/* 테마 기프티콘 */
function NeoPubl(num){
	for(i=1; i <= 3; i++){
	    var objNeo = document.getElementById("c_neo"+i);
	    //var objM   = document.getElementById("c_m"+i);
    	if( objNeo /*&& objM*/ ){
    		document.getElementById("c_neo"+i).style.display = "none";
    		//document.getElementById("c_m"+i).className = "tableft_off";
    	}
	}
	document.getElementById("c_neo"+num).style.display = "block";
	//document.getElementById("c_m"+num).className = "tableft_on";
}




/* 고객센터 faq 탭메뉴 */
function neopubl(num){
	for(i=1; i <= 7; i++){
	    var objNeo = document.getElementById("cneo"+i);
	    var objM   = document.getElementById("cm"+i);
    	if( objNeo && objM ){
    		document.getElementById("cneo"+i).style.display = "none";
    		document.getElementById("cm"+i).src='/company/img/common/faq_b0'+i+'.gif';
    	}
	}
	document.getElementById("cneo"+num).style.display = "block";
	document.getElementById("cm"+num).src='/company/img/common/faq_b0'+num+'_on.gif';
}




var quickMove_save; //모션저장
var topPoint; //top고정값저장
var quickBottom = 200;//하단제어값
function quickMove_set(){
	var $j=jQuery;
	topPoint = $j("#side_bar").position().top;
	$j(window).scroll(quickMove_moveSet);
}
function quickMove_moveSet(){
	var $j=jQuery;
	clearInterval(quickMove_save);
	$j("#side_bar").stop();

	quickMove_save = setInterval(quickMove_move,10);
}
function quickMove_move(){
	var $j=jQuery;
	var scroll_top = Number($(window).scrollTop())+topPoint;
	var check = $j("body").height()-$j("#side_bar").height()-topPoint-300;

	clearInterval(quickMove_save);
	$j("#side_bar").stop();
	if(check > Number($(window).scrollTop())){
		$j("#side_bar").animate({top:scroll_top},400);
	} else {
		$j("#side_bar").animate({top:scroll_top-$j("#side_bar").height()},400);
	}
}




// 메인 배너 이미지 롤링
function mainBannerUi(){
	
	// 배너존
	function popOn(){
		
		$('.pop_img > div').hide(); // 팝업 모두 이미지 숨김
		$('.pop_num > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")); // 모든 버튼 Off
		})
		$('.pop_num > a').removeClass(); // 활성 클래스 제거

		$(this).addClass('currentPop'); // 활성 클래스 추가
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On
		var popNum = $(this).index();
		

		$('.pop_img > div').eq(popNum).show(); // 해당 팝 이미지 출력
		return false;
	}

	function popRoll(){
		
		if($('.pop_num > a.currentPop').next().length != 0){
			//$('.pop_num > a.currentPop').next().trigger('click');
			$('.pop_num > a.currentPop').next().trigger('mouseover');			
		} else {
			//$('.pop_num > a').eq(0).trigger('click');
			$('.pop_num > a').eq(0).trigger('mouseover');			
		}

		popRollTime = setTimeout(popRoll,6000); //팝업 시간 제어
	}

	$('.pop_num > a').mouseover(popOn);	
	//$('.pop_num > a').click(popOn);	
	popRoll();
	//$('.pop_num > a').eq(0).trigger('mouseenter');

}


//메인 배너 이미지 롤링
function QuickImgUi(){

	// 배너존
	function Quick_popOn(){
		//alert("Quick_popOn");
		$('.sample_zone > div').hide(); // 팝업 모두 이미지 숨김
		//$('.pop_num > a').each(function(){
		//	$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		//})
		//$('.pop_num > a').removeClass(); // 활성 클래스 제거

		//$(this).addClass('currentPop'); // 활성 클래스 추가
		//$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On
		var popNum = $(this).index();
		alert("Quick_popRoll popNum :" +popNum);
		$('.sample_zone > div').eq(popNum).show(); // 해당 팝 이미지 출력
		return false;
	}

	function Quick_popRoll(){
		//alert("Quick_popRoll");
		//if($('.pop_num > a.currentPop').next().length != 0){
		//	$('.pop_num > a.currentPop').next().trigger('click');
		//} else {
		//	$('.pop_num > a').eq(0).trigger('click');
		//}

		Quick_popRollTime = setTimeout(Quick_popRoll,2000); //팝업 시간 제어
	}

	//$('.pop_num > a').click(Quick_popOn);	
	Quick_popOn();
	Quick_popRoll();
	//$('.pop_num > a').eq(0).trigger('mouseenter');


}

function overPont(idx){
	alert(idx);
	$('.pop_img > div').hide(); // 팝업 모두 이미지 숨김
	$('.pop_num > a').each(function(){
		$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
	})
	$('.pop_num > a').removeClass(); // 활성 클래스 제거

	$('.pop_num > a').addClass('currentPop'); // 활성 클래스 추가
	$('.pop_num > a').children().attr("src",$('.pop_num > a').children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On	

	$('.pop_img > div').eq(idx).show(); // 해당 팝 이미지 출력
	return false;
}
function outPoint(idx){
	
}

function mainBannerStop(){
	clearTimeout(popRollTime);	
}
function mainBannerStart(){
	mainBannerUi();
}

//서브 배너
var dangjin_8s_count=0;
var dangjin_8s_p_click_check= 0;
function dangjin_8s_init(){
	var $j=jQuery;
	dangjin_8s_count = $j(".sub > ul > li").size();
	
	$j(".sub").css({"height":"309px","overflow":"hidden"});

	$j("#dangjin_p").click(function(){dangjin_8s_p_click();return false;});
	$j("#dangjin_s").click(function(){dangjin_8s_s_click();return false;});
	//$j("#banner_1").hover(function(){ch_hover();return false;});
	//$j("#dangjin_r").click(function(){dangjin_8s_r_click();return false;});
	//$j("#dangjin_l").click(function(){dangjin_8s_l_click();return false;});

	dangjin_8s_p_click();
}
function dangjin_8s_p_click(){
	
	var $j=jQuery;
	var setheight = $j(".sub > ul > li").eq(0).height();
	
	if(dangjin_8s_p_click_check == 0){
		dangjin_8s_p_click_check = 1;
		$j(".sub > ul > li").eq(0).clone().appendTo($j(".sub > ul"));
		$j(".sub > ul").animate(
			{
				bottom: + setheight
			}
			,3000
			,function(){
				$j(".sub > ul > li").eq(0).remove();
				$j(".sub > ul").css({"bottom":"0px"});
				dangjin_8s_p_click_check = 0;
				dangjin_8s_p_click();
			}
		);
	}else if(dangjin_8s_p_click_check == 1){
		$j(".sub > ul").animate(
				{
					bottom: + setheight
				}
				,3000
				,function(){
					$j(".sub > ul > li").eq(0).remove();
					$j(".sub > ul").css({"bottom":"0px"});
					dangjin_8s_p_click_check = 0;
					dangjin_8s_p_click();
				}
			);
	}
}

function overStop(){	
	$(".sub > ul").stop();
}

function overStart(){
	dangjin_8s_p_click();
}

function Gift_Banner(){

	//선물 가게 탑 배너 롤링

	var bannerList = $('#banner_roll > div > ul');
	var rollNum = bannerList.children().length -4;
	var sumWidth = rollNum * bannerList.children().outerWidth();

	function bannerMaxCheck(){
		if(parseInt(bannerList.css('left')) <= -sumWidth){
			$('#banner_roll > .next').addClass('maxBtn');
		} else {
			$('#banner_roll > .next').removeClass('maxBtn');
		}
		if(parseInt(bannerList.css('left')) == 0){
			$('#banner_roll > .pre').addClass('maxBtn')
		} else {
			$('#banner_roll > .pre').removeClass('maxBtn')
		}
	}

	$('#banner_roll > .next').click(function(){
		$(this).addClass('maxBtn');
		bannerList.animate({'left':'-=112'+'px'},200,bannerMaxCheck);
	})

	$('#banner_roll > .pre').click(function(){
		$(this).addClass('maxBtn');
		bannerList.animate({'left':'+=112'+'px'},200,bannerMaxCheck);
	})

	bannerMaxCheck();

}







//닫기버튼

	function closepop(tableMenu){
		if(tableMenu.style.display == "")
		{
			tableMenu.style.display = "none";
		}
		else
			tableMenu.style.display = "";
		}





/* faq 토글키 메인 */
function clickblock(num)
	{
	for(i=1; i<35; i++) { //5라는 수는 줄수보다 1 더한겂을 적는다.
		if(num == i) {
			if(document.getElementById('block'+i).style.display == "block") {
				document.getElementById('block'+i).style.display = "none";
			} else {
				document.getElementById('block'+i).style.display = "block";
			}
			} else {
				document.getElementById('block'+i).style.display ="none";
			}
		}
	}




/* faq 토글키 */
function ClickBlock(num)
	{
	for(i=1; i<5; i++) { //5라는 수는 줄수보다 1 더한겂을 적는다.
		if(num == i) {
			if(document.getElementById('block'+i).style.display == "block") {
				document.getElementById('block'+i).style.display = "none";
			} else {
				document.getElementById('block'+i).style.display = "block";
			}
			} else {
				document.getElementById('block'+i).style.display ="none";
			}
		}
	}




/* 레이어 팝업 */
function layer_popup(id,action){
	if(action == 'show'){
		document.getElementById(id).style.display = "block";
	}else{
		document.getElementById(id).style.display = "none";
	}
}




/* 캠페인 말풍선 */
function Onlayer01() {
	document.getElementById('hover_speech_bubble01').style.display = "block";
	return false;
}

function Offlayer01() {
	document.getElementById('hover_speech_bubble01').style.display = "none"
	return false;
}

/* 캠페인 말풍선 */
function Onlayer02() {
	document.getElementById('hover_speech_bubble').style.display = "block";
	return false;
}

function Offlayer02() {
	document.getElementById('hover_speech_bubble').style.display = "none"
	return false;
}




/* 연동 테스트 정보 */
function Onlayer04() {
	document.getElementById('area_jstyle16_01').style.display = "block";
	return false;
}

function Offlayer04() {
	document.getElementById('area_jstyle16_01').style.display = "none"
	return false;
}



function Tab_lank(){
//공지사항 최근게시물
	$('.lanking > ul > li > a').click(function(){
		$('.lanking > ul > li > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		})
		$('.lanking .lanking_list').hide(); //모든 게시물 Off
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")) // 해당 버튼 On
		$(this).next().show();
		return false;
	})

	$('.lanking > ul > li').eq(0).children().eq(0).trigger('click'); // 첫번째 최근게시물 탭 활성화

	function noticeOn(){
		$('.lanking > ul > li > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		})
		$('.lanking .lanking_list').hide(); //모든 게시물 Off
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")) // 해당 버튼 On
		$(this).next().show();
		return false;
	}

	$('.lanking > ul > li > a').focus(noticeOn);

}






function Brand_Banner(){
// 브랜드 메인 배너
	function popOn(){

		$('.pop_img01 > div').hide(); // 팝업 모두 이미지 숨김
		$('.pop_num02 > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		})
		$('.pop_num02 > a').removeClass(); // 활성 클래스 제거

		$(this).addClass('currentPop'); // 활성 클래스 추가
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On
		var popNum = $(this).index();

		$('.pop_img01 > div').eq(popNum).show(); // 해당 팝 이미지 출력
		return false;
	}

	function popRoll(){
		if($('.pop_num02 > a.currentPop').next().length != 0){
			$('.pop_num02 > a.currentPop').next().trigger('click');
		} else {
			$('.pop_num02 > a').eq(0).trigger('click');
		}

		popRollTime = setTimeout(popRoll,2000); //팝업 시간 제어
	}


	$('.pop_num02 > a').click(popOn);

	$('.p_play').click(function(){
		clearTimeout(popRollTime);
		popRoll();
		return false;
	})

	$('.p_stop').click(function(){
		clearTimeout(popRollTime);
		return false;
	})

	popRoll();
	$('.pop_num02 > a').eq(0).trigger('click');
}





function Event_Banner(){
// 신나는 이벤트 메인 배너
	function popOn(){

		$('.event_bd_img > div').hide(); // 팝업 모두 이미지 숨김
		$('.event_btn > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		})
		$('.event_btn > a').removeClass(); // 활성 클래스 제거

		$(this).addClass('currentPop'); // 활성 클래스 추가
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On
		var popNum = $(this).index();

		$('.event_bd_img > div').eq(popNum).show(); // 해당 팝 이미지 출력
		return false;
	}

	function popRoll(){
		if($('.event_btn > a.currentPop').next().length != 0){
			$('.event_btn > a.currentPop').next().trigger('click');
		} else {
			$('.event_btn > a').eq(0).trigger('click');
		}

		popRollTime = setTimeout(popRoll,2000); //팝업 시간 제어
	}


	$('.event_btn > a').click(popOn);

	$('.p_play').click(function(){
		clearTimeout(popRollTime);
		popRoll();
		return false;
	})

	$('.p_stop').click(function(){
		clearTimeout(popRollTime);
		return false;
	})

	popRoll();
	$('.event_btn > a').eq(0).trigger('click');
}




// 탭 Ui
function ui_tab(){
	$('div.ui_tab ul').hide();
	$('ul.ui_tab li').removeClass('on')
	$('ul.ui_tab a').click(function(){
		var eqnum = $('ul.ui_tab a').index(this);
		$(this).parent().parent().next().children().hide();
		$(this).parent().parent().children().removeClass('on')
		$('ul.ui_tab li:eq('+eqnum+')').addClass('on')
		$('div.ui_tab > ul:eq('+eqnum+')').show();
		return false;
	})
	$('ul.ui_tab').each(function(){
		$(this).children().children().eq('0').trigger('click');
	})
}



/* 장바구니 5페이지~8페이지 */
function register(id){
	for(i=1; i<=2; i++){
		document.getElementById('register0'+i).style.display = "none";
	}
	document.getElementById('register0'+id).style.display = "block";
}




/* 수신자 입력정보 */
function fncChecked(num){
	if(num == 1)
	{
		document.getElementById('div1').style.display = '';
		document.getElementById('div2').style.display = 'none';
		document.getElementById('receivelist_hide').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('div1').style.display = 'none';
		document.getElementById('div2').style.display = '';
		document.getElementById('receivelist_hide').style.display = '';
	}

}

/* 수신자 입력정보 */
function fncCheck(num){
	if(num == 1)
	{
		document.getElementById('cover1').style.display = '';
		document.getElementById('cover2').style.display = 'none';
		document.getElementById('receive_hide').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('cover1').style.display = 'none';
		document.getElementById('cover2').style.display = '';
		document.getElementById('receive_hide').style.display = '';
	}

}



/* 이미지 꾸미기 */
function smsChecked(num){
	if(num == 1)
	{
		document.getElementById('SMS').style.display = '';
		document.getElementById('MMS').style.display = 'none';
		document.getElementById('SMS_hide').style.display = '';
	}
	else if(num == 2)
	{
		document.getElementById('SMS').style.display = 'none';
		document.getElementById('MMS').style.display = '';
		document.getElementById('SMS_hide').style.display = 'none';
	}

}



/* 이미지 꾸미기 */
function smsCheck(num){
	if(num == 1)
	{
		document.getElementById('SMSs').style.display = '';
		document.getElementById('MMSs').style.display = 'none';
		document.getElementById('SMSs_hide').style.display = '';
	}
	else if(num == 2)
	{
		document.getElementById('SMSs').style.display = 'none';
		document.getElementById('MMSs').style.display = '';
		document.getElementById('SMSs_hide').style.display = 'none';
	}

}




function MakeCheck(num){
	if(num == 1)
	{
		document.getElementById('noline_hide').style.display = '';
	}
	else if(num == 2)
	{
		document.getElementById('noline_hide').style.display = 'none';
	}
}



/* 무선페이지꾸미기 */ //2010-12-13 수정

function MakeChecked(num){
	if(num == 1)
	{
		document.getElementById('nolinemake_hide').style.display = '';
	}
	else if(num == 2)
	{
		document.getElementById('nolinemake_hide').style.display = 'none';
	}
}

function MakeChecked1(num){
	if(num == 1)
	{
		document.getElementById('nolinemake_hide1').style.display = '';
		document.getElementById('minus_hide1').style.display = '';
		document.getElementById('plus_hide1').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('nolinemake_hide1').style.display = 'none';
		document.getElementById('minus_hide1').style.display = 'none';
		document.getElementById('plus_hide1').style.display = '';
	}
}

function MakeChecked2(num){
	if(num == 1)
	{
		document.getElementById('nolinemake_hide2').style.display = '';
		document.getElementById('minus_hide2').style.display = '';
		document.getElementById('plus_hide2').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('nolinemake_hide2').style.display = 'none';
		document.getElementById('minus_hide2').style.display = 'none';
		document.getElementById('plus_hide2').style.display = '';
	}
}

function MakeChecked3(num){
	if(num == 1)
	{
		document.getElementById('nolinemake_hide3').style.display = '';
		document.getElementById('minus_hide3').style.display = '';
		document.getElementById('plus_hide3').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('nolinemake_hide3').style.display = 'none';
		document.getElementById('minus_hide3').style.display = 'none';
		document.getElementById('plus_hide3').style.display = '';
	}
}


/* 예약발송설정 */
function TimeChecked(num){

	if(num == 1)
	{
		document.getElementById('time_hide').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('time_hide').style.display = '';
	}

}


/* 예약발송설정 */
function TimeCheck(num){

	if(num == 1)
	{
		document.getElementById('time_hides').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('time_hides').style.display = '';
	}

}



function Quick_Main01(){
//오늘 본 배너 롤링

	var bannerList = $('.srolling > div > ul');
	var rollNum = bannerList.children().length;
	var sumHeight = rollNum * bannerList.children().outerHeight();

	function bannerMaxCheck(){
		if(parseInt(bannerList.css('top')) <= -sumHeight+102){// 상품 갯수 * 상품 높이 -102
			$('.srolling > .down').addClass('maxBtn');
		} else {
			$('.srolling > .down').removeClass('maxBtn');
		}
		if(parseInt(bannerList.css('top')) == 0){
			$('.srolling > .up').addClass('maxBtn')
		} else {
			$('.srolling > .up').removeClass('maxBtn')
		}
	}

	$('.srolling > .down').click(function(){
		$(this).addClass('maxBtn');
		bannerList.animate({'top':'-=111'+'px'},200,bannerMaxCheck);
	})

	$('.srolling > .up').click(function(){
		$(this).addClass('maxBtn');
		bannerList.animate({'top':'+=111'+'px'},200,bannerMaxCheck);
	})

	bannerMaxCheck();
}


function Word_Search(){
// 인기검색어 추천검색어 롤링
	function popOn(){

		$('.pop_word > div').hide(); // 팝업 모두 이미지 숨김
		$('.pop_word01 > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		})
		$('.pop_word01 > a').removeClass(); // 활성 클래스 제거

		$(this).addClass('currentPop'); // 활성 클래스 추가
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On
		var popNum = $(this).index();

		$('.pop_word > div').eq(popNum).show(); // 해당 팝 이미지 출력
		return false;
	}

	function popRoll(){
		if($('.pop_word01 > a.currentPop').next().length != 0){
			$('.pop_word01 > a.currentPop').next().trigger('click');
		} else {
			$('.pop_word01 > a').eq(0).trigger('click');
		}

		popRollTime = setTimeout(popRoll,3000); //팝업 시간 제어
	}


	$('.pop_word01 > a').click(popOn);

	popRoll();
	$('.pop_word01 > a').eq(0).trigger('click');

	//마우스 오버시 롤링 멈춤
	$('.pop_word > div >.recommend_word > a').hover( function(){
		clearTimeout(popRollTime);
		return false;
		}, function(){
		clearTimeout(popRollTime);
		popRoll();
		return false;
		})
	}





// auto scroll 배너 관련

var move_ul=''; // ul
var bann_li=''; // li
var bann_li_size=0; // 갯수
var bann_li_width=0; // 1개 width값
var pos=0; // left 위치값
var bann_arr=[]; //width 값 지정 배열
var total_width=0;
var check=0;
var total=0;
var tot_mar=0;
var direc_num=0;
//var init_po=-1110; 2010-12-20 삭제 해주세요
//배너 초기화
function bann_init(){
	move_ul= jQuery("div#list > ul");
	move_ul.parent().css("left","15px");
	//alert(move_ul.size());
	move_ul.css({"width":"17280px","position":"absolute"});// ex) 20(li갯수)*90(li넓이)*3=width값 브랜드 배너의 갯수가 바뀐다면 넓이값도 수정해줘야 함.
	bann_li=move_ul.find(">li");
	bann_li_size=bann_li.size(); // 갯수
	bann_li_width=bann_li.width(); // 1개 width값 111px

	bann_li.each(function(n){
		bann_arr[n]=$(this).width();
		total_width +=bann_arr[n];
		tot_mar+=16;
	});
	clone_li();
	clone_li();
	total =total_width+tot_mar;
	move_ul.attr("timer", setInterval(bann_move, 20));
	bann_hover(0);
	pos=(total_width*-1)-tot_mar;
	//alert(pos);

//focus 제어 추가
bann_li.children().focus(bn_skip);
jQuery("#wrap > a.prev_btn").focus(mv_left);
jQuery("#wrap > a.next_btn").focus(mv_right);

}

// hover 기능
function bann_hover(d_num){
		move_ul.hover(function(){
			clearInterval(move_ul.attr("timer"));
		},function(){
			if(d_num==0){
				clearInterval(move_ul.attr("timer"));
				move_ul.attr("timer", setInterval(bann_move,20));
				}else{
				clearInterval(move_ul.attr("timer"));
				move_ul.attr("timer", setInterval(mv_right,20));
			}

		});


}


// 배너 복사
function clone_li(){
	for(i=0;i <=bann_li_size;i++){
		bann_li.eq(i).clone().appendTo(jQuery("div#list > ul"));
	}
}

// 왼쪽으로 동작
function bann_move(){
	if(pos >= total*-2){
		move_ul.css({"left":pos});
		pos-=1;
	}else{
		pos=(total_width*-1)-tot_mar;
	}
}

// 오른쪽으로 동작
function mv_right2(){
		if(pos<=0){
			pos+=1;
			move_ul.css({left:pos});
		}else{

			pos=(total_width*-1)-tot_mar;
		}
}

// 왼쪽제어
function mv_left(){
	bann_hover(0);
	direc_num=0;
	bn_play();
}

// 오른쪽제어
function mv_right(){
	jQuery("div#list > ul > li > a").focus(bn_skip);
	bann_hover(1);
	direc_num=1;
	bn_play();
}

//중지
function bn_skip(){
		clearInterval(move_ul.attr("timer"));
}

//재생
function bn_play(){
		clearInterval(move_ul.attr("timer"));
		if(direc_num==0){
			move_ul.attr("timer", setInterval(bann_move, 20));
		}else if(direc_num==1){
			move_ul.attr("timer", setInterval(mv_right2, 20));
		}
}


function mainUi() {

}



function BtoBBannerUi(){

	// 서브배너존
	function popOn01(){

		$('.this_con_b > ul').hide(); // 팝업 모두 이미지 숨김
		$('.b_btn_round > a').each(function(){
			$(this).children().attr("src",$(this).children().attr("src").replace("_on.gif",".gif")) // 모든 버튼 Off
		})
		$('.b_btn_round > a').removeClass(); // 활성 클래스 제거

		$(this).addClass('currentPop'); // 활성 클래스 추가
		$(this).children().attr("src",$(this).children().attr("src").replace(".gif","_on.gif")); // 해당 버튼 On
		var popNum = $(this).index();

		$('.this_con_b > ul').eq(popNum).show(); // 해당 팝 이미지 출력
		return false;
	}

	function popRoll01(){
		if($('.b_btn_round > a.currentPop').next().length != 0){
			$('.b_btn_round > a.currentPop').next().trigger('click');
		} else {
			$('.b_btn_round > a').eq(0).trigger('click');
		}

		popRoll01Time = setTimeout(popRoll01,2000); //팝업 시간 제어
	}

	$('.b_btn_round > a').click(popOn01);

	$('.p_play01').click(function(){
		clearTimeout(popRoll01Time);
		popRoll01();
		return false;
	})

	$('.p_stop01').click(function(){
		clearTimeout(popRoll01Time);
		return false;
	})

	popRoll01();
	$('.b_btn_round > a').eq(0).trigger('click');

}


function flash(url,w,h,id, win){

 // 플래시 정의
 var flashStr=
 "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
 "<param name='movie' value='"+url+"' />"+
 "<param name='wmode' value='"+win+"' />"+
 "<param name='menu' value='false' />"+
 "<param name='quality' value='high' />"+
 "<param name='allowScriptAccess' value='always' />"+
 "<param name='allowNetworking' value='all' />"+
 "<param name='base' value='.' />"+
 "<embed src='"+url+"' base='.' menu='false' quality='high'  width='"+w+"' height='"+h+"' name='"+id+"' wmode='"+win+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' allowScriptAccess='always' allowFullScreen='false' />"+
 "</object>";

 // 플래시 출력
 document.write(flashStr);
}

	$(document).ready(function(){

	// 일반 셀렉트 박스
	$('a.select').toggle(function(){
		$(this).parent().attr('id','current_selected');//활성화 클래스
		$(this).next().slideDown('fast');
	},function(){
		$(this).next().slideUp('fast',function(){
			$(this).parent().attr('id','');
		});
	})

	// 옵션 선택되었을때 class명 부여
	$('ul.select_list a').hover(function(){
		$(this).addClass('sel_op');
	},function(){
		$(this).removeClass('sel_op');
	})


	//선택된 값 넣기
	$('ul.select_list a').click(function(){
		$(this).parent().parent().prev().children().text($(this).text());
		$(this).parent().parent().prev().trigger('click');
			return false;
	})

		// 다른것 선택되었을때 닫기
		$('a.select').blur(function(){
			if($(this).parent().attr('id')=="current_selected" && $('.select_list  a.sel_op').size() == "0"){
				$(this).trigger('click');
			}
		})

	})



//이메일 직접입력 셀렉트 박스
		$(document).ready(function(){

	// 일반 셀렉트 박스
	$('a.select24').toggle(function(){
		$(this).parent().attr('id','current_selected01');//활성화 클래스
		$(this).next().slideDown('fast');
	},function(){
		$(this).next().slideUp('fast',function(){
			$(this).parent().attr('id','');
		});
	})

	// 옵션 선택되었을때 class명 부여
	$('ul.sel_list24 a').hover(function(){
		$(this).addClass('sel_op');
	},function(){
		$(this).removeClass('sel_op');
	})


	//선택된 값 넣기
	$('ul.sel_list24 a').click(function(){
		$(this).parent().parent().prev().children().text($(this).text());
		$(this).parent().parent().prev().trigger('click');
			return false;
	})

	// 직접입력 을 선택하였을 때
	$('ul.sel_list24 li a').click(function(){

		if($(this).parent().attr("class")=="select"){
			$('#email_02').show();
			} else {
			$('#email_02').hide();
		}
	})

		// 다른것 선택되었을때 닫기
		$('a.select24').blur(function(){
			if($(this).parent().attr('id')=="current_selected01" && $('.sel_list24  a.sel_op').size() == "0"){
				$(this).trigger('click');
			}
		})

	})


	// 선물가게 번호 직접입력
$(document).ready(function(){

		$('a.select85').toggle(function(){
		$(this).parent().attr('id','current_selected01');//활성화 클래스
		$(this).next().slideDown('fast');
			},function(){
				$(this).next().slideUp('fast',function(){
					$(this).parent().attr('id','');
				});
			})

		$('ul.sel_list85 a').click(function(){
			$(this).parent().parent().prev().children().text($(this).text());	//선택된 값 넣기
			$('a.select85').parent().attr('id','');
			$('ul.sel_list85').slideUp('fast');
		})

		// class add
		$('ul.sel_list85 a').hover(function(){
			$(this).addClass('sel_op');
		},function(){
			$(this).removeClass('sel_op');
		})

		// 다른곳 클릭시 박스 hidden
		$('#wrap_body').click(function(){
			$('a.select85').parent().attr('id','');
			$('ul.sel_list85').slideUp('fast');
		})

	})


		// 선물가게 번호 직접입력
$(document).ready(function(){

		$('a.select').toggle(function(){
		$(this).parent().attr('id','current_selected01');//활성화 클래스
		$(this).next().slideDown('fast');
			},function(){
				$(this).next().slideUp('fast',function(){
					$(this).parent().attr('id','');
				});
			})

		$('ul.sel_list a').click(function(){
			$(this).parent().parent().prev().children().text($(this).text());	//선택된 값 넣기
			$('a.select').parent().attr('id','');
			$('ul.sel_list').slideUp('fast');
		})

		// class add
		$('ul.sel_list a').hover(function(){
			$(this).addClass('sel_op');
		},function(){
			$(this).removeClass('sel_op');
		})

		// 다른곳 클릭시 박스 hidden
		$('body').click(function(){
			$('a.select').parent().attr('id','');
			$('ul.sel_list').slideUp('fast');
		})

// 직접입력 을 선택하였을 때
	$('ul.sel_list li a').click(function(){

		if($(this).parent().attr("class")=="select"){
			$('#email_02').show();
			} else {
			$('#email_02').hide();
		}
	})


	})





/* Select Box 선물가게 번호 직접입력 */
$(document).ready(function(){

	// 상세검색 팝업 셀렉트박스
	$('a.select_title').toggle(function(){
		$(this).parent().attr('id','current_selected01');//활성화 클래스
		$(this).next().slideDown('fast');
	},function(){
		$(this).next().slideUp('fast',function(){
			$(this).parent().attr('id','');
		});
	})

	// 옵션 선택되었을때 class명 부여
	$('ul.select_option a').hover(function(){
		$(this).addClass('sel_op');
	},function(){
		$(this).removeClass('sel_op');
	})

	//선택된 값 넣기
	$('ul.select_option a').click(function(){
		$(this).parent().parent().prev().children().text($(this).text());
		$(this).parent().parent().prev().trigger('click');
			return false;
	})

	// 다른것 선택되었을때 닫기
	$('a.select_title').blur(function(){
		if($(this).parent().attr('id')=="current_selected01" && $('.select_option  a.sel_op').size() == "0"){
			$(this).trigger('click');
		}
	})


})

function Register_info(num){
	if(num == 1)
	{
		document.getElementById('Regi01').style.display = 'block';
		document.getElementById('Regi02').style.display = 'none';
	}
	else if(num == 2)
	{
		document.getElementById('Regi01').style.display = 'none';
		document.getElementById('Regi02').style.display = 'block';
	}
}

//장바구니 구매입력정보 폼 보더 나타내기 숨기기
$(document).ready(function(){

	// 구매정보 입력을 눌렀을 때 class명 부여
	$('span.click01 a').click(function(){
		$('.cart_form tbody tr.dbb_show').addClass('bdb_solid11');
		$('span.click01 a').children().attr("src",$('span.click01 a').children().attr("src").replace(".gif","_on.gif"));

	})

		// 구매정보 재입력을 눌렀을 때 class명 부여
	$('span.click02 a').click(function(){
		$('.cart_form tbody tr.dbb_show').removeClass('bdb_solid11');
		$('span.click01 a').children().attr("src",$('span.click01 a').children().attr("src").replace("_on.gif",".gif"));
	})
})


// 마이기프티콘 받은 선물내역
$(document).ready(function(){

	// 상세보기클릭
	$('.search_click').click(function(){
		$('div.my_receive_detail').addClass('default_search');
		$('#date_search').show();
	})
})


/**
* YYYYMMDDHHMISS 형식의 현재 날짜를 반환
*/
function getCurrDate()
{
	var currDateStr;
	var currDate =  new Date();
	var years = currDate.getYear();
	var months = currDate.getMonth() + 1;
	var days = currDate.getDate();

    var hours=currDate.getHours();
    var minutes=currDate.getMinutes();
    var seconds=currDate.getSeconds();

	months = months < 10 ? "0" + months : months+"";
	days = days < 10 ? "0" + days : days+"";
	hours = hours < 10 ? "0" + hours : hours+"";
	minutes = minutes < 10 ? "0" + minutes : minutes+"";
	seconds = seconds < 10 ? "0" + seconds : seconds+"";

	var currDateStr = years + months + days + hours + minutes + seconds;

    return currDateStr;
}



	

	


