// JavaScript Document
// 플레쉬 임베드
function displayFlash(src, width, height, id) {
	var flashDSP = "<!--[if IE]><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0' width='" + width + "' height='" + height + "' id='" + id + "' align='middle' /><param name='allowScriptAccess' value='always' /><param name='movie' value='" + src + "' /><param name='loop' value='false' /><param name='menu' value='false' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='allowFullScreen' value='true' /><![endif]--><embed src='" + src + "' 'quality='best' wmode='transparent' allowFullScreen='true' id='" + id + "'  bgcolor='#ffffff' width='" + width + "' height='" + height + "' name='flash' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /><!--[if IE]></object><![endif]-->";document.write(flashDSP)}
// 플레쉬 임베드

$(window).load(function (){
	
	// IE 6버전만 배너를 스크립트로 제어합니다.
	if (navigator.userAgent.indexOf("MSIE 6") > 0) {
		// 배너스피드
		var banspeed = 0;
		bstop = "go"
		//플라잉배너
		$(window).scroll(function(){
			bantop = 0;
			banstart = 100;
			
			if (bstop == "go") {
				pos = $(document).scrollTop() - banstart;
				//$(".test").html(pos)
				if (pos < 0) {
					pos = 0
				}
				$('#bohummall-body .flying-left').stop().animate({
					top: pos - bantop
				}, {
					queue: false,
					duration: banspeed
				});
				$('#bohummall-body .flying-right').stop().animate({
					top: pos - bantop
				}, {
					queue: false,
					duration: banspeed
				});
			}
		});
	}
	/* 사이즈 체크
	function reSizeChk() {
		Dom_wSize = $(document).width();
		flyBanners = $("#bohummall-body .flying-left, #bohummall-body .flying-right");
		if(Dom_wSize < 1204){
			//alert("작음"+Dom_wSize)
			flyBanners.css({ "display":"none"});
		} else {
			//alert("큼"+Dom_wSize)
			flyBanners.css({ "display":"block"});
		}
	}
	reSizeChk();
	$(window).resize(function(){
		reSizeChk()
	})
	*/
	
	//------공통셀렉트박스-------
	//셀렉트 박스와 동일한 이벤트로 셋팅되어있습니다.
	//Class만 유지되면 사이트에서 동일한 디자인과 이벤트속성을 가집니다.
	
	//드랍다운 스피드
	var selspeed = 200
	
	//이벤트 셋팅
	seletcGo = $(".selectname")
	seletcGo.find(">a").focus(openSeletc).click(openSeletc)
	seletcGo.mouseleave(close_apset);
	$(".downarrow").click(openSeletc);
	$(".selectlist").mouseleave(close_apset);
	$(".selectlist li:last-child a").focusout(sel_outfocus);
	
	function openSeletc() {
		thisDom = $(this).parent();
		thisDom.css("overflow","visible");
		thisDom.find(">ul").slideDown(selspeed);
		thisDom.find(">ul").css({"display":"block"});
		thisDom.css({"z-index":"85" });
	}
	// 리스트 
	$(".selectlist a").click(function() {
		select_text = $(this).text();
		thisDom = $(this).parent().parent().parent()
		thisDom.find(".current").html(select_text);
		// 크롬,사파리 잔상 문제
		//thisDom.css("overflow","hidden");
		thisDom.find(">ul").css({ "display":"none"});
		$(this).parent().find(">a:last-child").focus();
		thisDom.css({"z-index":"0" });
		//테스트
		//alert("셀렉트박스 ▶"+select_text)
	})
	// 닫기
	function closeSelect() {
		boxchk = "ok"
		thisDom = $(this).parent().find(">ul")
		thisDomE = $(this).parent()
		//alert(thisDomE.html())
		function boxcl() {
			if(boxchk == "ok"){
				thisDom.slideUp(0);
				thisDomE.css({"z-index":"0" });
			}
		}
		setTimeout(boxcl,selspeed)
	}
	// 리스트박스 아웃포커스
	function sel_outfocus() {
		thisDom = $(this).parent().parent().parent();
		thisDomE = $(this).parent().parent()
		thisDom.css({"z-index":"0" });
		thisDomE.slideUp(0);
		//alert($(this).parent().parent().parent().html())
	}
	//셀렉트박스 아웃포커스
	function close_apset() {
		boxchk = "ok"
		thisDom = $(this).find(">ul")
		thisDomE = $(this)
		function boxcl() {
			if(boxchk == "ok"){
				thisDom.slideUp(0);
				thisDomE.css({"z-index":"0" });
			}
		}
		setTimeout(boxcl,0)
		//alert(thisDomE.html())
	}
		
});

//공통 텝셀렉트
function tab_common(tName,clickBtn){
	var thistab = $(tName)
	var thisNoad = $(tName+">li")
	var tabNum = thistab.find(">li").length-1
	
	thisNoad.click(function() {
		clickBtn = $(this).index();
		//alert(clickBtn)
		for (i = 0; i <= tabNum; i++){
			if(i == clickBtn){
				onName = thistab.find(">li:eq("+clickBtn+")>a img").attr("src");
				onImages = onName.replace("_off","_on");
				thistab.find(">li:eq("+clickBtn+")>a img").attr({src:onImages});
				thistab.find(">li:eq("+clickBtn+") .tabwrap").css({"display":"block"});
			}else{
				offName = thistab.find(">li:eq("+i+")>a img").attr("src");
				
				if(offName.indexOf("_on")>-1){
					offImage = offName.replace("_on","_off");
					thistab.find(">li:eq("+i+")>a img").attr({src:offImage});
					thistab.find(">li:eq("+i+") .tabwrap").css({"display":"none"});
				}
			}
		}
		
	})
	
	onName = thistab.find(">li:eq("+clickBtn+")>a img").attr("src").replace("_off.gif","_on.gif");
	thistab.find(">li:eq("+clickBtn+")>a img").attr({src:onName})
	thistab.find(">li:eq("+clickBtn+") .tabwrap").css({"display":"block"});
}

//탭제어 
function mainTab(){
	tab_common ("#bojong-list .tab-CTL",0);
	tab_common ("#beat-seller .tab-CTL",0);
	//tab_common ("#center-banner .tab-CTL",0);
}



// ===================================================================================
// 인기상품 순위롤링
var hotlist_timer = 3000;
var list_size = 18;

$(function(){
	hotList();
});
$(document).ready(function(){
	dummylist = $("#top-list ol").clone().prependTo($("#top-list .hotView"))
	dummylist.removeClass("onview")
	dummylist.addClass("rolllist");
	$("#top-list").mouseenter(onviewList);
	$("#top-list").mouseleave(offviewList);
	
function onviewList(){$("#top-list").addClass("overview")}
function offviewList(){$("#top-list").removeClass("overview")}
})

function hotList(){
	$("#top-list").removeClass("overview");
	masterTFrame = $("#top-list .hotView ol");
	clearInterval( masterTFrame.attr("hottimer"));
	masterTFrame.attr("hottimer", setInterval(function(){
	masterTFrame = $("#top-list .hotView ol");
	imageTFrame = $("#top-list .hotView li");
	masterTFrame.animate({
		top : -list_size
		},300,function(){
			masterTFrame.css("top", "0px");
			imageTFrame.eq(0).clone().appendTo(masterTFrame);
			imageTFrame.eq(0).remove();
		});
	}, hotlist_timer));
}

// ===================================================================================
function rtJoinStart(){
	var rtJoin_timer = 1500;
	var rtlist_size = 18;
	var rtJoin = $("#join-list");
	var thisRtNum = rtJoin.find(".view-box ul>li").length;
	
	function rtJoinList(){
		rtmTFrame = rtJoin.find(".view-box ul");
		clearInterval(rtmTFrame.attr("rtJoinTimer"));
		rtmTFrame.attr("rtJoinTimer", setInterval(function(){
			rtmTFrame = rtJoin.find(".view-box ul");
			rtITFrame = rtJoin.find(".view-box li");
			rtmTFrame.animate({
				top: -rtlist_size
			}, 300, function(){
				rtmTFrame.css("top", "0px");
				rtITFrame.eq(0).clone().appendTo(rtmTFrame);
				rtITFrame.eq(0).remove();
			});
		}, rtJoin_timer));
	}
	
	function rtStop() {
		clearInterval(rtmTFrame.attr("rtJoinTimer"));	
	}
	$("#join-list").mouseenter(rtStop);
	$("#join-list").mouseleave(rtJoinList);
	
	// 리스트갯수 3개 이하는 작동않함
	if(thisRtNum >= 3){
		rtJoinList();	
	}
}

/*
// 플레쉬 배너 HTML 버전 -------------------(보류)
$(document).ready(function(){
	var flashB = $("#flash-banner");
	var flashLi = flashB.find("ul>li");
	var flashNum = flashB.find("ul>li").length;
	var flashSpeed = 150;
	var maxHeight = "80px"
	var flashChk = null // 과도한 호출 방지 캐쉬
	
	//초기화
	for (i = 0; i <= flashNum; i++) {
		if(flashLi.eq(i).hasClass("on")){
			flashLi.eq(i).find(">a").animate({height : maxHeight},flashSpeed);
		}else{
			flashLi.eq(i).find(">a").animate({height : "0px"},0);
		}		
	}
	
	
	function onThisLi(onBTN){
		for (i = 0; i <= flashNum; i++) {
			if (i == onBTN) {
				flashLi.eq(i).find(">a").animate({
					height: maxHeight
				}, flashSpeed);
			}
			else {
				flashLi.eq(i).find(">a").animate({
					height : "0px"
				},flashSpeed);
			}
		}
	}
	flashLi.mouseenter(function(){
		t = $(this);
		flashChk = t.index();
		setTimeout(function(){
			onBTN = t.index();
			flashLi.removeClass();
			flashLi.eq(onBTN).addClass("on")
			if (flashChk == onBTN) {
				onThisLi(onBTN);
			}
			else{
			flashChk = "ok"
			}
		},300)
	});
	
	flashB.mouseleave(function(){
		flashChk = "off"
	});

})
*/


// 하단파트너롤링 시작 =================================================================

function partnersSlide(sds,away){
	
	var partners_timer = sds;
	var partners_size = 144;
	var partners_fade = 200; // FadeIn 효과속도
	var prdl_chk = 500; // 과도한 클릭호출방지및 장난클릭방지 캐쉬값
	var slide_CTL = 250 //슬라이드 속도
	var pr_goFloat = away
	
	var viewFrame = $("#partners");
	var mFrame =  viewFrame.find(".banners");
	var imgFrame = viewFrame.find(".banners>li");
	
	//슬라이드 컨트롤 체크
	$(document).ready(function(){
		//박스 길이 체크
		maxBXnum = imgFrame.length
		//alert(maxBXnum)
		// 연타클릭방지
		chk_cl = "on"
		if(maxBXnum > 6){
		viewFrame.find(".left-btn").click(function() {
			clearInterval(mFrame.attr("timer"));
			cot = 0;
			if(chk_cl == "on"){
				chk_cl = "off"
				//foot_prStart("L");
				pr_goFloat = "L"
				partners_Left()
				// 연타클릭방지
				setTimeout(call_click,prdl_chk);
			}
		})
		viewFrame.find(".right-btn").click(function() {
			clearInterval(mFrame.attr("timer"));
			cot = 0;
			if(chk_cl == "on"){
				chk_cl = "off"
				//foot_prStart("R");
				pr_goFloat = "R"
				partners_Right()
				// 연타클릭방지
				setTimeout(call_click,prdl_chk);
			}
		})
		}
		function call_click() {
			chk_cl = "on"
		}
		
		// 마우스 체크
		var mouseChk = $("#partners")
		var mouseOkChk = "go"
		var cot = 0; // 과도한 호출방지 캐쉬
		mouseChk.mouseover(function(){
			mouseOkChk = "stop"
			partners_stop();
		});
		mouseChk.mouseleave(function(){
			mouseOkChk = "go"
			if(mouseOkChk == "go"){	
				partners_go();
			}
		})
		
	})
	
	function foot_prStart(tp){
		clearInterval(mFrame.attr("timer"));
		if(pr_goFloat == "R"){ // Move Right
			mFrame.attr("timer", setInterval( partners_Right, partners_timer));
		}else{ // Move Left
			mFrame.attr("timer", setInterval(partners_Left, partners_timer));
		}
	}
	function partners_Right(){
		var mFrame =  viewFrame.find(".banners");
		var imgFrame = viewFrame.find(".banners>li");
		mFrame.find("li:gt(4)").fadeOut(0);
		mFrame.animate({
			left : -partners_size
		},slide_CTL,function(){
			mFrame.css("left", "0px");
			imgFrame.eq(5).fadeIn(partners_fade);
			imgFrame.eq(0).clone().appendTo(mFrame);
			imgFrame.eq(0).remove();
		});
	}
	function partners_Left(){
		var mFrame =  viewFrame.find(".banners");
		var imgFrame = viewFrame.find(".banners>li");
		var leng = partners_size
		mFrame.animate({
		left : partners_size
		},slide_CTL,function(){
			mFrame.css("left", "0");
			imgFrame.eq(maxBXnum-1).clone().fadeIn(partners_fade).prependTo(mFrame);
			imgFrame.eq(maxBXnum-1).remove();
		});
	}
	function partners_stop(){
		clearInterval(mFrame.attr("timer"));
	}
	function partners_go(){
		foot_prStart(pr_goFloat);
	}
	foot_prStart(away)
}
// 하단파트너롤링 끝 =================================================================

// 보험정보관 롤링 시작 =================================================================
function insuSlide(sds,away){

	var insu_timer = sds;
	var insu_size = 227;
	var insu_fade = 200; // FadeIn 효과속도
	var prdl_chk = 500; // 과도한 클릭호출방지및 장난클릭방지 캐쉬값
	var slide_CTL = 250 //슬라이드 속도
	var insu_goFloat = away
	
	var insu_viewFrame = $("#insu-roll");
	var insu_mFrame =  insu_viewFrame.find(".banner");
	var insu_imgFrame = insu_viewFrame.find(".banner>li");
	
	//슬라이드 컨트롤 체크
	$(document).ready(function(){
		
		//박스 길이 체크
		insuBXnum = insu_imgFrame.length
		//alert(insuBXnum)
		// 연타클릭방지
		chk_cl = "on"
		if(insuBXnum > 3){
		insu_viewFrame.find(".left-btn").click(function() {
			clearInterval(insu_mFrame.attr("timer"));
			cot = 0;
			if(chk_cl == "on"){
				chk_cl = "off"
				//insu_prStart("L");
				insu_goFloat = "L"
				insu_Left()
				// 연타클릭방지
				setTimeout(call_click,prdl_chk);
			}
		})
		insu_viewFrame.find(".right-btn").click(function() {
			clearInterval(insu_mFrame.attr("timer"));
			cot = 0;
			if(chk_cl == "on"){
				chk_cl = "off"
				//insu_prStart("R");
				insu_goFloat = "R"
				insu_Right()
				// 연타클릭방지
				setTimeout(call_click,prdl_chk);
			}
		})
		}
		function call_click() {
			chk_cl = "on"
		}
		
		// 마우스 체크
		var mouseChk = $("#insu-roll")
		var mouseOkChk = "go"
		var cot = 0; // 과도한 호출방지 캐쉬
		mouseChk.mouseover(function(){
			mouseOkChk = "stop"
			insu_stop();
		});
		mouseChk.mouseleave(function(){
			mouseOkChk = "go"
			if(mouseOkChk == "go"){	
				insu_go();
			}
		})
		
	})
	
	function insu_prStart(tp){
		clearInterval(insu_mFrame.attr("timer"));
		if(insu_goFloat == "R"){ // Move Right
			insu_mFrame.attr("timer", setInterval( insu_Right, insu_timer));
		}else{ // Move Left
			insu_mFrame.attr("timer", setInterval(insu_Left, insu_timer));
		}
	}
	function insu_Right(){
		var insu_mFrame =  insu_viewFrame.find(".banner");
		var insu_imgFrame = insu_viewFrame.find(".banner>li");
		insu_mFrame.find("li:gt(3)").fadeOut(0);
		insu_mFrame.animate({
			left : -insu_size
		},slide_CTL,function(){
			insu_mFrame.css("left", "0px");
			insu_imgFrame.eq(4).fadeIn(insu_fade);
			insu_imgFrame.eq(0).clone().appendTo(insu_mFrame);
			insu_imgFrame.eq(0).remove();
		});
	}
	function insu_Left(){
		var insu_mFrame =  insu_viewFrame.find(".banner");
		var insu_imgFrame = insu_viewFrame.find(".banner>li");
		var leng = insu_size
		insu_mFrame.animate({
		left : insu_size
		},slide_CTL,function(){
			insu_mFrame.css("left", "0");
			insu_imgFrame.eq(insuBXnum-1).clone().fadeIn(insu_fade).prependTo(insu_mFrame);
			insu_imgFrame.eq(insuBXnum-1).remove();
		});
	}
	function insu_stop(){
		clearInterval(insu_mFrame.attr("timer"));
	}
	function insu_go(){
		insu_prStart(insu_goFloat);
	}
	insu_prStart(away)
}
// 보험정보관 롤링 끝 =================================================================


// 하단상품롤링 제어파트와 연동 필요 ======================================================
function floating_CTL(tabGo){
	var set_timer = 2000;
	var product_size = 153;
	var product_fade = 200; // FadeIn 효과속도
	var dl_chk = 500; // 과도한 클릭호출방지및 장난클릭방지 캐쉬값
	var goFloat = "R";
	var floatDoor = null;
	//슬라이드 컨트롤 체크
	
	//박스 길이 체크
	viewBxLi = $("#floating-nav");
	maxnum = viewBxLi.find(".view-box li").length
	viewBxLi.find(".prnum").html("(" + maxnum + ")")
	
	
	//하단 플로팅 셀렉트
	viewBxLi.find(".floattab .clicktab").click(function() {
		clickBtn = $(this).parent().index();
		floating_tabCall(clickBtn);
	})
	
	viewBxLi.find(".open a").click(function() {
		viewBxLi.removeClass("floating-close");
		if (navigator.userAgent.indexOf("MSIE 6") > 0) {
			floatDoor = "open";
			floatMoveGo();
		}
	})
	viewBxLi.find(".close a").click(function() {
		viewBxLi.addClass("floating-close");
		floating_tabCall(0);
		if (navigator.userAgent.indexOf("MSIE 6") > 0) {
			floatDoor = null;
			floatMoveGo();
		}
	})

	// 연타클릭방지
	chk_click = "on"
	
	//상품체크
	if (maxnum == 0) {
		//alert("상품없음");
		
	}else {
		//alert("상품있음");
		$("#floating-nav .view-box").removeClass("no-product");
	}
	
	//상품 3개이하 롤링체크
	if (maxnum > 3) {
		viewBxLi.find(".liwrap .le").click(function(){
			clearInterval($("#floating-nav .view-box").attr("floatTimer"));
			cot = 0;
			if (chk_click == "on") {
				chk_click = "off"
				//imgStart("L");
				goFloat = "L"
				imgLeft()
				// 연타클릭방지
				setTimeout(call_click, dl_chk);
			}
		})
		viewBxLi.find(".liwrap .ri").click(function(){
			clearInterval($("#floating-nav .view-box").attr("floatTimer"));
			cot = 0;
			if (chk_click == "on") {
				chk_click = "off"
				//imgStart("R");
				goFloat = "R"
				imgRight()
				// 연타클릭방지
				setTimeout(call_click, dl_chk);
			}
		})
	}
	function call_click(){
		chk_click = "on"
	}

	function imgStart(){
		
		maxnum = $("#floating-nav").find(".view-box li").length
		if (maxnum > 3) {
			masterFrame = $("#floating-nav .view-box");
			clearInterval(masterFrame.attr("floatTimer"));
			if (goFloat == "R") { // Move Right
				masterFrame.attr("floatTimer", setInterval(imgRight, set_timer));
			}
			else { // Move Left
				masterFrame.attr("floatTimer", setInterval(imgLeft, set_timer));
			}
		}
	}
	function imgRight(){
		masterFrame = $("#floating-nav .view-box");
		imageFrame = $("#floating-nav .view-box>li");
		masterFrame.find("li:gt(3)").fadeOut(0);
		masterFrame.animate({
			left: -product_size
		}, 300, function(){
			masterFrame.css("left", "0px");
			imageFrame.eq(4).fadeIn(product_fade);
			imageFrame.eq(0).clone().appendTo(masterFrame);
			imageFrame.eq(0).remove();
		});
	}
	function imgLeft(){
		masterFrame = $("#floating-nav .view-box");
		imageFrame = $("#floating-nav .view-box>li");
		var leng = product_size
		masterFrame.animate({
			left: product_size
		}, 300, function(){
			masterFrame.css("left", "0");
			imageFrame.eq(maxnum - 1).clone().fadeIn(product_fade).prependTo(masterFrame);
			imageFrame.eq(maxnum - 1).remove();
		});
	}
	function slide_stop(){
		clearInterval($("#floating-nav .view-box").attr("floatTimer"));
	}
	function slide_go(){
		imgStart();
	}
	
	// 마우스 체크
	var mouseChk = $("#floating-nav .tab02 .liwrap")
	var mouseOkChk = "go"
	var cot = 0; // 과도한 호출방지 캐쉬
	mouseChk.mouseover(function(){
		mouseOkChk = "stop"
		slide_stop();
	});
	mouseChk.mouseleave(function(){
		setTimeout(function(){
			if (mouseOkChk == "go") {
				slide_go();
			}
		}, set_timer)
		mouseOkChk = "go"
	});
	
	//버튼 이벤트셋팅
	$("#floating-nav .clicktab").click(function(){
		clickBtn = $(this).parent().index();
		floating_tabCall(clickBtn);
		if (navigator.userAgent.indexOf("MSIE 6") > 0) {
			floatDoor = "open";
			floatMoveGo();
		}
		viewBxLi.removeClass("floating-close");
	});
	
	//하단 플로팅 셀렉트
	function floating_tabCall(clickBtn){
		var floatFrame = $("#floating-nav");
		for (i = 0; i <= 1; i++) {
			if (i != clickBtn) {
				offName = floatFrame.find(".floattab>li:eq(" + i + ")>a img").attr("src");
				offNameimg = offName.replace("_on", "_off");
				floatFrame.find(".floattab>li:eq(" + i + ")>a img").attr({
					src: offNameimg
				});
				floatFrame.find(".floattab>li:eq(" + i + ") .liwrap").css({
					"display": "none"
				})
			}
			onName = floatFrame.find(".floattab>li:eq(" + clickBtn + ")>a img").attr("src");
			onNameimg = onName.replace("_off", "_on");
			floatFrame.find(".floattab>li:eq(" + clickBtn + ")>a img").attr({
				src: onNameimg
			});
			floatFrame.find(".floattab>li:eq(" + clickBtn + ") .liwrap").css({
				"display": "block"
			})
		}
		if (clickBtn == "0") {
			floatFrame.find(".prnum").css({
				"display": "none"
			});
			clearInterval(floatFrame.find(".view-box").attr("floatTimer"));
		}
		else {
			floatFrame.find(".prnum").css({
				"display": "block"
			});
			imgStart(goFloat)
		}
	}
	if (tabGo >= 0) {
		viewBxLi.removeClass("floating-close");
		floating_tabCall(tabGo);
		floatDoor ="open";
	}
	
	function floatMoveGo(){
		domHigSize = $(window).height();
		domHStop = $(document).scrollTop();
		if (floatDoor == "open") {
			goFloat_pos = domHStop + domHigSize - 200
			$("#global_floating").stop().animate({
			top: goFloat_pos
		}, 0);
		} else {
			goFloat_pos = domHStop + domHigSize - 43
			$("#global_floating").stop().animate({
			top: goFloat_pos
		}, 0);
		}
		
	}
	
	if (navigator.userAgent.indexOf("MSIE 6") > 0) {
		$(window).scroll(function(){
			floatMoveGo();
		})
		$(window).resize(function(){
			floatMoveGo();
		})
		floatMoveGo();
	}
}
// ===================================================================================

// 상품상세탭 셀렉트 로드페이지지정
function tab_subCTL(tName,scName,clickBtn){
	var thistab = $(tName)
	var thisView = $(scName)
	var thisNoad = $(tName+" a")
	var tabNum = thistab.find("a").length-1
	
	thisNoad.click(function() {
		clickBtn = $(this).index();
		//alert(clickBtn)
		for (i = 0; i <= tabNum; i++){
			if(i == clickBtn){
				onName = thistab.find("a:eq("+clickBtn+") img").attr("src");
				onImages = onName.replace("_off","_on");
				thistab.find("a:eq("+clickBtn+") img").attr({src:onImages});
				thisView.find(".bohum-text:eq("+clickBtn+")").css({"display":"block"});
			}else{
				offName = thistab.find("a:eq("+i+") img").attr("src");
				
				if(offName.indexOf("_on")>-1){
					offImage = offName.replace("_on","_off");
					thistab.find("a:eq("+i+") img").attr({src:offImage});
					thisView.find(".bohum-text:eq("+i+")").css({"display":"none"});
				}
			}
			if(clickBtn == 3){
				$(".bohum-details .bohum-right").css({"display":"none"});
			}else{
				$(".bohum-details .bohum-right").css({"display":"block"});
			}
		}
	})
	if(clickBtn == 3){
		$(".bohum-details .bohum-right").css({"display":"none"});	
	}else{
		$(".bohum-details .bohum-right").css({"display":"block"});
	}
	//초기화
	for (i = 0; i <= tabNum; i++) {
		offName = thistab.find("a:eq("+i+") img").attr("src").replace("_on.gif", "_off.gif");
		thistab.find("a:eq("+i+") img").attr({
			src: offName
		})
	}
	$(".bohum-details .cont-list .bohum-text").css({"display":"none"});
	onName = thistab.find("a:eq("+clickBtn+") img").attr("src").replace("_off.gif","_on.gif");
	thistab.find("a:eq("+clickBtn+") img").attr({src:onName})
	thisView.find(".bohum-text:eq("+clickBtn+")").css({"display":"block"});
}

function product_tabCall(sTabnum){
	//tab_subCTL(탭,탭컨텐츠,표시될번호 )
	//alert("호출 상품탭메뉴번호 >"+sTabnum)
	tab_subCTL(".bohum-details .tab",".bohum-details .cont-list",sTabnum);
}


//상단 실시간 보험료
function rt_tabCTL(rtTabnum){
	var rt_main = $("#realtime-insurance");
	var rt_layer = rt_main.find(".tab-bojong");
	var rt_tab = rt_layer.find(">li").find(">a");
	var rt_table = rt_layer.find(".rt-bohum");
	
	$(document).ready(function(){
		function rt_tabSel(){
			t= $(this);
			rtTabnum =t.parent().index()
			rt_table.css({"display":"none"})
			rt_layer.find(">li:eq("+rtTabnum+")").find(".rt-bohum").css({"display":"block"});
			rt_tab.removeClass();
			rt_tab.addClass("off");
			t.removeClass();
			t.addClass("on");
		}
		rt_tab.focus(rt_tabSel).click(rt_tabSel)
	
	rt_main.find(".bohum-sel>a").mouseenter(function(){
		t=$(this);
		var infoBox = t.parent("div");
		n= t.index()/4+0.5
		infoBox.find(".more-window01").css({"display":"none"});
		infoBox.find(".plen0"+n).css({"display":"block"});
		t.mouseleave(function(){
			infoBox.find(".more-window01").css({"display":"none"});
		})
	})	
		
	})	
	
	rt_table.css({"display":"none"})
	rt_layer.find(">li:eq("+rtTabnum+")").find(".rt-bohum").css({"display":"block"});
	rt_tab.removeClass();
	rt_tab.addClass("off");
	rt_layer.find(">li:eq("+rtTabnum+")").find(">a").removeClass();
	rt_layer.find(">li:eq("+rtTabnum+")").find(">a").addClass("on");
}

//베스트 보험 텝
function best_tabCTL(bestN){
	var thisTab = $("#best-tab");
	
	$(document).ready(function(){
		thisTab.find("a").click(function(){
			n = $(this).index() + 1
			thisTab.removeClass()
			thisTab.addClass("tab0" + n)
		})
	})
	
	thisTab.removeClass()
	thisTab.addClass("tab0" + bestN)
}

//보험랭킹 텝
function rank_tabCTL(bestN){
	var thisTab = $("#rank-tab");
	var rankBtn = thisTab.find("li>a");
	$(document).ready(function(){
		rankBtn.click(function(){
			t= $(this);
			rankBtn.removeClass()
			t.addClass("on")
		})
	})
	
	rankBtn.removeClass()
	thisTab.find(".tm1").css({"margin":"0 0 0 0"})
	rankBtn.eq(bestN).addClass("on")
}



//보험비교 보험료기준창
$(document).ready(function(){
	var moreBTN = $(".compwrap-ri .ex .more");
	var bohumStnCl = $(".bohum-standard .close");
	
	moreBTN.mouseenter( function(){z
		bohumNum = $(this).parent().index()
		viewBohum = $("#bohumComp0"+bohumNum)
		viewBohum.css({"display":"block"});
		//alert($(this).parent().index())
		
		viewBohum.mouseleave(function(){
			$(this).css({"display":"none"});
		})
		
		bohumStnCl.click(function(){
			viewBohum.css({"display":"none"});
		})
	})	
})


