// 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 (){
	
	if (navigator.userAgent.indexOf("MSIE 6") > 0) {
		// 배너스피드
		var banspeed = 0;
		bstop = "go"
		//플라잉배너
		$(window).scroll(function(){
			bantop = 0;
			banstart = 0;
			
			if (bstop == "go") {
				pos = $(document).scrollTop() - banstart;
				//$(".test").html(pos)
				if (pos < 0) {
					pos = 0
				}
				$('.flying-left').stop().animate({
					top: pos - bantop
				}, {
					queue: false,
					duration: banspeed
				});
				$('.flying-right').stop().animate({
					top: pos - bantop
				}, {
					queue: false,
					duration: banspeed
				});
			}
		});
	}
	
	//------공통셀렉트박스-------
	//셀렉트 박스와 동일한 이벤트로 셋팅되어있습니다.
	//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())
	}
	
	// 상품상세탭셀렉트
	$(".bohum-details .tab a").click(function() {
		clickBtn = $(this).index();
		product_tabCall(clickBtn);
	})
	
});


//메인 보험랭킹
function mainBHCTL(op){
	var mainFBan = $("#mle-rank");
	mainFBan.find("li .tab").click(function(){
		t=$(this);
		btNum = t.parent().index();
		mainFBan.find(".tabwrap").css({
			display: "none"
		});
		t.parent().find(".tabwrap").css({
			display: "block"
		});
		mainFBan.find("li .tab").removeClass("on");
		t.addClass("on");
		
	})
	
	mainFBan.find(">li>a").removeClass("on");
	mainFBan.find(".tabwrap").css({display: "none"});
	
	mainFBan.find("li:eq("+op+") .tabwrap").css({display: "block"});
	mainFBan.find("li:eq("+op+")>a").addClass("on");
}


//메인 하단 배너탭
function mainFBCTL(op){
	var mainFBan = $("#bohum_fb");
	mainFBan.find(".btn").click(function(){
		t=$(this);
		btNum = t.parent().index();
		mainFBan.find("p").css({
			display: "none"
		});
		t.parent().find("p").css({
			display: "block"
		});
		mainFBan.find(">li a").removeClass("on");
		t.addClass("on");
	})
	
	mainFBan.find(">li a").removeClass("on");
	mainFBan.find("p").css({display: "none"});
	
	mainFBan.find("li:eq("+op+") p").css({display: "block"});
	mainFBan.find("li:eq("+op+") a").addClass("on");
}



// ===================================================================================
// 인기상품 순위롤링
function hotPudlist(){
	var hotlist_timer = 3000;
	var list_size = 18;
	
	$(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));
	}
	hotList();
}

// ===================================================================================
// 실시간 가입상담 롤링
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));
	}
	rtJoinList();
	
	function rtStop() {
		clearInterval(rtmTFrame.attr("rtJoinTimer"));	
	}
	$("#join-list").mouseenter(rtStop);
	$("#join-list").mouseleave(rtJoinList);
	
	// 리스트갯수 3개 이하는 작동않함
	if(thisRtNum >= 3){
		rtJoinList();	
	}
}
// ===================================================================================



// 하단상품롤링 제어파트와 연동 필요 ======================================================
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 > 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(2)").fadeOut(0);
		masterFrame.animate({
			left: -product_size
		}, 300, function(){
			masterFrame.css("left", "0px");
			imageFrame.eq(3).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 - 135
			$("#global_floating").stop().animate({
			top: goFloat_pos
		}, 0);
		} else {
			goFloat_pos = domHStop + domHigSize - 37
			$("#global_floating").stop().animate({
			top: goFloat_pos
		}, 0);
		}
		
	}
	
	if (navigator.userAgent.indexOf("MSIE 6") > 0) {
		$(window).scroll(function(){
			floatMoveGo();
		})
		$(window).resize(function(){
			floatMoveGo();
		})
	}
}
// ===================================================================================


// 비교전문가롤링 시작 =================================================================
function bestFpSlide(sds,away){
	
	var bestFp_timer = sds;
	var bestFp_move = 220;
	var bestFp_fade = 200; // FadeIn 효과속도
	var bestFp_chk = 500; // 과도한 클릭호출방지및 장난클릭방지 캐쉬값
	var bestFp_sCTL = 300 //슬라이드 속도
	var bestFp_goFloat = away
	
	var FpVFrame = $("#bestFP_roll");
	var FpMFrame =  FpVFrame.find(".view-box>ul");
	var FpSFrame = FpVFrame.find(".view-box>ul>li");
	
	//슬라이드 컨트롤 체크
	
	//박스 길이 체크
	maxBFPnum = FpSFrame.length
	//alert(maxBFPnum)
	// 연타클릭방지
	bestFp_cl = "on"
	if(maxBFPnum > 1){
	FpVFrame.find(".le").click(function() {
		clearInterval(FpMFrame.attr("timer"));
		cot = 0;
		if(bestFp_cl == "on"){
			bestFp_cl = "off"
			//bestFp_prStart("L");
			bestFp_goFloat = "L"
			bestFp_Left()
			// 연타클릭방지
			setTimeout(call_click,bestFp_chk);
		}
	})
	FpVFrame.find(".ri").click(function() {
		clearInterval(FpMFrame.attr("timer"));
		cot = 0;
		if(bestFp_cl == "on"){
			bestFp_cl = "off"
			//bestFp_prStart("R");
			bestFp_goFloat = "R"
			bestFp_Right()
			// 연타클릭방지
			setTimeout(call_click,bestFp_chk);
		}
	})
	}
	function call_click() {
		bestFp_cl = "on"
	}
	
	// 마우스 체크
	var mouseChk = $("#bestFP_roll")
	var mouseFPChk = "go"
	var cot = 0; // 과도한 호출방지 캐쉬
	mouseChk.mouseover(function(){
		mouseFPChk = "stop"
		bestFp_stop();
	});
	mouseChk.mouseleave(function(){
		mouseFPChk = "go"
		if(mouseFPChk == "go"){	
			bestFp_go();
		}
	})

	function bestFp_prStart(tp){
		clearInterval(FpMFrame.attr("timer"));
		if(bestFp_goFloat == "R"){ // Move Right
			FpMFrame.attr("timer", setInterval( bestFp_Right, bestFp_timer));
		}else{ // Move Left
			FpMFrame.attr("timer", setInterval(bestFp_Left, bestFp_timer));
		}
	}
	function bestFp_Right(){
		var FpMFrame =  FpVFrame.find(".view-box>ul");
		var FpSFrame = FpVFrame.find(".view-box>ul>li");
		FpMFrame.find(".fp-text").css("left", "0px");
		
		
		FpSFrame.eq(0).clone().appendTo(FpMFrame);
		
		FpMFrame.find(".fp-text").animate({
			left : -bestFp_move
		},bestFp_sCTL,function(){
			FpMFrame.find(".fp-text").css("left", "0px");
			FpSFrame.eq(0).remove();
		});
		
	}
	function bestFp_Left(){
		var FpMFrame =  FpVFrame.find(".view-box>ul");
		var FpSFrame = FpVFrame.find(".view-box>ul>li");
		var leng = bestFp_move
		
		FpMFrame.find(".fp-text").css("left", "-220px");
		
		FpSFrame.eq(maxBFPnum-1).remove();
		FpSFrame.eq(maxBFPnum-1).clone().prependTo(FpMFrame);
		
		FpMFrame.find(".fp-text").animate({
			left : bestFp_move - bestFp_move
		},bestFp_sCTL,function(){
			FpMFrame.find(".fp-text").css("left", "0px");
		});
	}
	function bestFp_stop(){
		clearInterval(FpMFrame.attr("timer"));
	}
	function bestFp_go(){
		bestFp_prStart(bestFp_goFloat);
	}
	bestFp_prStart(away)
}
// 비교전문가롤링 끝 =================================================================


// 하단파트너롤링 시작 =================================================================

function partnersSlide(sds,away){
	
	var partners_timer = sds;
	var partners_size = 146;
	var partners_fade = 200; // FadeIn 효과속도
	var prdl_chk = 500; // 과도한 클릭호출방지및 장난클릭방지 캐쉬값
	var slide_CTL = 250 //슬라이드 속도
	var pr_goFloat = away
	
	var viewFrame = $("#part_roll");
	var mFrame =  viewFrame.find(".banners");
	var imgFrame = viewFrame.find(".banners>li");
	
	//박스 길이 체크
	maxBXnum = imgFrame.length
	//alert(maxBXnum)
	// 연타클릭방지
	chk_cl = "on"
	if(maxBXnum > 6){
	viewFrame.find(".btn-le").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(".btn-ri").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 = $("#part_roll")
	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(5)").fadeOut(0);
		mFrame.animate({
			left : -partners_size
		},slide_CTL,function(){
			mFrame.css("left", "0px");
			imgFrame.eq(6).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)
}
// 하단파트너롤링 끝 =================================================================

// 상담센터 LNB =================================================================
function cstabCall(n1,n2){
	var csGNB = $("#cscnter-lnb>ul");

	csGNB.find(">li").mouseenter(function(){
		t= $(this);
		csGNB.find("li a").removeClass("on");
		t.find(">a").addClass("on");
		t.mouseleave( function(){
			csGNB.find(">li a").removeClass("on");
			csGNB.find(">li:eq("+n1+")>a").addClass("on");
			csGNB.find(">li:eq("+n1+") li:eq("+n2+")>a").addClass("on");
		})
	})
	csGNB.find("li a").removeClass("on");
	csGNB.find(">li:eq("+n1+")>a").addClass("on");
	csGNB.find(">li:eq("+n1+") li:eq("+n2+")>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")
}



//상품상세탭 셀렉트 로드페이지지정
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 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)
}
// 보험정보관 롤링 끝 =================================================================

