﻿document.ready = function(){
	//공통 사항
	$('#skipnavi li a').attr('tabindex', '1');

	var head = $('head').html();

	$('.contents').attr('id', 'Contents');
	//공통사항 end

	var alt = $('.left_navi dt img').attr('alt');
	var location1 = ['회사소개 ABOUT KOSCOM','서비스 KOSCOM SERVICE','코스콤 소식 KOSCOM NEWS','고객센터 CUSTOMER CENTER','ETC KOSCOM ETC'];
	var elocation = ['KOSCOM','Service','PR Center','Customer Center','etc'];
	var addBg = ['top_com_int','top_service','top_news','top_custom','top_etc']

	for(var i=0; i<location1.length; i++){
		if(location1[i] == alt){
			$('.cont_top').addClass(addBg[i]);
		}
	}

	for(var i=0; i<elocation.length; i++){
		if(elocation[i] == alt){
			$('.cont_top').addClass(addBg[i]);
		}
	}

	//GNB
	$('.navi_wrap .depth2').hide();
	$('.main_navi_gra').hide();

	$('.navi_wrap').hover(function dd(){
		$('.quick_menu').css('zIndex','100');
		$('.navi_wrap .depth2').show();
		$('.main_navi_gra').show();
		$('.navi_wrap').css('background', '#fff');
		$('.main_navi .middle').css('background', 'none');
		}, function(){
			$('.quick_menu').css('zIndex','900');
			$('.main_navi .middle').css('background', "url('/images/main/header/bg_gnb_middle.png') no-repeat center 4px");
			$('.navi_wrap .depth2').hide();
			$('.main_navi_gra').hide();
			$('.navi_wrap').css('background', 'none');
		});

		$('.navi_wrap .depth2').find('img').hover(function(){
			var imgSrc = $(this).attr('src');
			$(this).attr('src', imgSrc.replace('off', 'on'));
		}, function(){
			var imgSrc = $(this).attr('src');
			$(this).attr('src', imgSrc.replace('on', 'off'));
		});
		//GNB 접근성 탭
		$('.main_navi .depth1').focusin(function(){
			$('.navi_wrap .depth2').show();
			$('.navi_wrap').css('background', '#fff');
			$('.main_navi .middle').css('background', 'none');
		});

		$('#skip_gnb').focusin(function(){
			$('.main_navi .middle').css('background', "url('/images/main/header/bg_gnb_middle.png') no-repeat center 4px");
			$('.navi_wrap .depth2').hide();
			$('.navi_wrap').css('background', 'none');
		});

		$('.main_navi .a_tag_last').focusout(function(){
			$('.main_navi .middle').css('background', "url('/images/main/header/bg_gnb_middle.png') no-repeat center 4px");
			$('.navi_wrap .depth2').hide();
			$('.navi_wrap').css('background', 'none');
		})
		// 접근성 end

	// 영문
	$('.enavi_wrap').hover(function(){
		$('.navi_wrap').css('background', '#fff');
	}, function(){
		$('.main_navi .middle').css('background', "url('/images/emain/header/bg_gnb_middle.png') no-repeat center 4px");
	});
	//GNB-end

	var animateSpeed = 200;

	var imgBtn = $('.quick_menu .btn a img');
	var imgSrc = imgBtn.attr('src');
	$('.quick_menu .btn').css('border', '0');



	$('.quick_menu .btn').click(function(){
		if($('.quick_menu ul').css('right') == -626+'px'){
			$('.quick_menu ul').animate({right:'0px'}, animateSpeed);
			$('.equick_menu ul').css('width','500px');

			$(this).find('img').attr('src', $(this).find('img').attr('src').replace('off', 'on'));
		}
	})

	$('.quick_menu .btn').click(function(){
		if($('.quick_menu ul').css('right') == 0+'px'){
			$('.quick_menu ul').animate({right:'-626px'}, animateSpeed);
			$('.equick_menu ul').animate({width:'700px'}, 1);

			$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on', 'off'));
		}
	})


	//main_middle 이미지교체, 화살표
	
	// main1
	$('.quick_menu').appendTo($('.cont_top')).css('visibility','visible');
	if($('.main_body_bg').index() != -1){
		//main_middle 이미지교체, 화살표
		var mainMidSection = $('.main_middle_section');
		// main1
		var playStat;
		$('.main_middle li a').each(function(i){
			$(this).bind('click', function(){
				var item = $(this);
				var _thisWrap = $('.main_middle_wrap');
				if(_thisWrap.is('.on')){
					if(item.parent().index()==playStat){
						mainMidSection.css('zIndex','10').stop().animate({
							height: '0'
						},300,function(){
							$('.main_middle_section').css({
								'zIndex':0
							})
						});
						_thisWrap.removeClass('on').find('img').each(function(){
							this.src = this.src.replace('on.png','off.png')
						})
						return false;
					}
				}else{
					var contWrap = $('.main_middle_section');
					contWrap.css({
						'left':0,
						'position':'relative',
						'height':0
					}).stop().animate({
						'height':'295px'
					});
					
					_thisWrap.addClass('on')
				}
				$('.main_middle li').find('.arrow_location').remove();
				if($(this).parent().find('.arrow_location').length){
					return;
				}else{
					$(this).parent().append("<span class='arrow_location'>&nbsp;</span>");
				}
				
				var srcImg = $(this).find('img').attr('src');
				
				$('.main_middle li').each(function(){
					$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on','off'));
				});
				
				$(this).find('img').attr('src', srcImg.replace('off','on'));
				
				//main1 show and hide
				$('.main1 .middle_node_list').each(function(){
					$('.main1 .middle_node_list').hide();
				});
				$('.main1 .middle_node_list').eq(i).show();
				playStat = i
				return false;
			});
		});
		
		// main2
		$('.main_middle2').hide();
		$('.main_middle2 li a').each(function(i){
			$(this).bind('click', function(){
				var item = $(this);
				var _thisWrap = $('.main_middle_wrap');
				if(_thisWrap.is('.on')){
					if(item.parent().index()==playStat){
						mainMidSection.css('zIndex','10').stop().animate({
							height: '0'
						},300,function(){
							$('.main_middle_section').css({
								'zIndex':0
							})
						});
						_thisWrap.removeClass('on').find('img').each(function(){
							this.src = this.src.replace('on.png','off.png')
						})
						return false;
					}
				}else{
					var contWrap = $('.main_middle_section');
					contWrap.css({
						'left':0,
						'position':'relative',
						'height':0
					}).stop().animate({
						'height':'200px'
					})

					_thisWrap.addClass('on')
				}
				$('.main_middle2 li').find('.arrow_location').remove();
				
				if($(this).parent().find('.arrow_location').length){
					return;
				}else{
					$(this).parent().append("<span class='arrow_location'>&nbsp;</span>");
				}
				
				var srcImg = $(this).find('img').attr('src');
				
				$('.main_middle2 li').each(function(){
					$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on','off'));
				});
				
				$(this).find('img').attr('src', srcImg.replace('off','on'));
				
				$('.main2 .middle_node_list').each(function(){
					$('.main2 .middle_node_list').hide();
				});
				$('.main2 .middle_node_list').eq(i).show();
				playStat = i
				return false;
			});
		});
				
		
		//영문 전환
		var switch_cnt = 1;
		
		$('.eswich_btn').bind({
			"click":function(){
				playStat=false;
				if(mainMidSection.css('position') != "absolute"){
					
					mainMidSection.css('zIndex','10').animate({
						height: '0'
					},300,function(){
						$('.main_middle_section').css({
							'zIndex':0
						})
					});
					$('.main_middle_wrap').removeClass('on').find('img').each(function(){
						this.src = this.src.replace('on.png','off.png')
					})
				}
				
			}
		})
		$('.abs-close').bind({
			'click':function(){
					mainMidSection.css('zIndex','10').animate({
						'height':'0px'
					},300,function(){
						mainMidSection.css({
							'zIndex':0
						})
					});
					
					$('.main_middle_wrap').removeClass('on').find('img').each(function(){
						this.src = this.src.replace('on.png','off.png')
					})
				return false;
			}
		})
		$('.eswich_btn').toggle(function swich_btn(){
			$(this).find('img').attr('src', '/images/emain/header/btn_main2_swich.png'); //swich btn
			$('.page_iden').find('img').attr('src', '/images/emain/header/hTag/h2_page2_iden_koscom.png'); //page1 iden
			$('.quick_menu .btn').find('img').attr('src', '/images/emain/header/btn_quick_off_arrow.gif'); //quick btn
			$('.quick_menu ul').animate({right:'-626px'}, animateSpeed);
			$('.equick_menu ul').animate({width:'700px'}, 1);
			
			//$('.cont_top').css('background', "url('/images/main/header/bg_main2_top.jpg') no-repeat center 0"); 
			//$('.main_body_bg').css('background', "url('/images/main/bg_mainbody2.gif') repeat-x"); 
			$('.cont_top').css('background', "url('/images/main/header/bg_main2_top.jpg') no-repeat center 0");
			$('.main_header').css('background', "url('/images/main/header/bg_main_def2.jpg') repeat-x");
			$('.main_middle').css({left:'-50%'}); //middle1_slide
			$('.main_middle2').show();
			$('.main_middle').hide();
			$('.main_middle2').animate({left:'50%'},function(){$('.main2').css({left:'50%'});}); //middle2_slide
			
			$('.main1').css({left:'-50%'}); //main1_middle_section_slide
			 //main2_middle_section_slide
			//$('.main_middle_section').css({height: '184px'}); //main_middle_section height --
			
			callDownFlash();
		},function swich_btn2(){
			$(this).find('img').attr('src', '/images/emain/header/btn_main_swich.png');//swich btn
			$('.page_iden').find('img').attr('src', '/images/emain/header/hTag/h2_page1_iden_koscom.png'); //page2 iden
			$('.quick_menu .btn').find('img').attr('src', '/images/emain/header/btn_quick_off_arrow.gif'); //quick btn
			$('.quick_menu ul').animate({right:'-626px'}, animateSpeed);
			$('.equick_menu ul').animate({width:'700px'}, 1);
			$('.cont_top').css('background', "url('/images/main/header/bg_main_top.gif') no-repeat center 0");
			$('.main_header').css('background', "url('/images/main/header/bg_main_def.jpg') repeat-x");
		
			$('.main_middle').animate({left:'50%'},function(){$('.main1').css({left:'50%'});}); //middle1_slide
			$('.main_middle').show();
			$('.main_middle2').hide();
			$('.main_middle2').css({left:'150%'}); //middle2_slide
			
			 //main1_middle_section_slide
			$('.main2').css({left:'150%'});
			
			//$('.main_middle_section').css({height: '284px'}); //main_middle_section height ++
			callTopFlash();
		});
		
		
		
		
		//middle section
		
		$('.middle_node_list').hide();
		$('.main1 .middle_node_list:first').show();
		
		
		//main_bottom_info > 뉴스
		$('.small_list').hide();
		$('.small_tab .small_list:first').show();
		
		$('.small_tab .fir_depth').bind('click focusin', function(){
			var imgSrc = $(this).find('img').attr('src');
			$('.small_tab .fir_depth').each(function(){
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on','off'));
			});

			$(this).find('img').attr('src', imgSrc.replace('off', 'on'));
			
			$('.small_list').hide();
			$('.more_news').hide();
			$(this).parent().find('.small_list').show();
			$(this).parent().find('.more_news').show();
			$(this).parent().find('.more_news img').css('display','block');
			return false;
		});
		
		//main_bottom_info > 코스콤 인
		var cnt = 0;
		var _currentDiv;
		$('.btn_people .btn_pre').click(function(){
			var _thisDiv = "#mainPeople_"+cnt;
			if (cnt > 0){
				cnt = cnt - 1;
			}else{
				$('.btn_people .btn_next').find('img').attr('src', $('.btn_people .btn_next').find('img').attr('src').replace('off', 'on'));
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on', 'off'));
			}
			_currentDiv = "#mainPeople_" + cnt;
			$(_thisDiv).css('display','none');
			$(_currentDiv).css('display','block');
		});
		
		$('.btn_people .btn_next').click(function(){
			var _thisDiv = "#mainPeople_"+cnt;
			if (cnt < 2){
				cnt = cnt + 1;		
			}else{
				$('.btn_people .btn_pre').find('img').attr('src', $('.btn_people .btn_pre').find('img').attr('src').replace('off', 'on'));
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on', 'off'));
			}
			_currentDiv = "#mainPeople_" + cnt;
			$(_thisDiv).css('display','none');
			$(_currentDiv).css('display','block');
		});
	}
	//main_middle-end
	//paragraph style
	$('.txt_con.pdb_16').wrapInner('<div class=con-bg></div>')
	$('#Contents dl dd').each(function(){
		var item = $(this);
		if($('#Contents .wrap3, #Contents .etc, ,#Contents .manage').index() == -1){
			if(item.children().prop('nodeName') == undefined || item.children().prop('nodeName') == "BR"){
				item.wrapInner('<div class=con-bg></div>')
			}else if(item.children().prop('nodeName') == "UL"){
				item.children().css('marginLeft','18px')
			}
		}
	})

	/* bp */
	$('.explain .btn_box').hide();

	$('.explain .btn').toggle(function(){
		$(this).parent().parent().find('.btn_box').show();
		$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on','off'));
		return false;
	},function(){
		$(this).parent().parent().find('.btn_box').hide();
		$(this).find('img').attr('src', $(this).find('img').attr('src').replace('off','on'));
		return false;
	});
	// end_bp

	/* LNB */
	$('.left_navi dd .fir_dep, .left_navi dd .e_etc_dep, .left_navi dd .e_etc_dep2').click(function(){
		var lnb2Depth = $(this).parent().find('ul');

		$('.left_navi dd a').each(function(){
			$(this).removeClass('fir_on');
			$(this).removeClass('e_etc_on');
		});

		$('.left_navi dd ul').each(function(){
			$('.left_navi dd ul').slideUp();
		});

		$(this).addClass('fir_on');
		$(this).addClass('e_etc_on');

		if(lnb2Depth.css('display') == 'none'){
			lnb2Depth.slideDown();
		}else if(lnb2Depth.css('display') == 'block'){
			lnb2Depth.slideUp();
			$(this).removeClass('fir_on');
			$(this).removeClass('e_etc_on');
		}
	});

	var lnb2DepthAtag = $('.left_navi dd ul li a');

	lnb2DepthAtag.bind('focusin',function(){
		var depth2SrcImg = $(this).find('img').attr('src');
		if(depth2SrcImg.indexOf('on') == -1){
			$(this).find('img').attr('src', depth2SrcImg.replace('off', 'on'));
		}else{
			return;
		}
	});

	lnb2DepthAtag.bind('focusout',function(){
		var depth2SrcImg = $(this).find('img').attr('src');
		if(depth2SrcImg.indexOf('off') == -1){
			$(this).find('img').attr('src', depth2SrcImg.replace('on', 'off'));
		}else{
			return;
		}
	});

	$('.left_navi dd ul').css('display', 'none');
	// end_LNB

	/* LNB Location */
	//1depth
	var locationText = $('.location_tab .on').text();
	$('.left_navi dd a').each(function(){
		if($(this).text() == locationText){
			$(this).addClass('fir_on');
			$(this).addClass('e_etc_on');
		}
	});

	//2depth
	$('.left_navi dd a img').each(function(){
		if($(this).attr('alt') == locationText){
			$(this).parent().parent().parent().parent().find('.fir_dep').addClass('fir_on');
			$(this).parent().parent().parent().parent().find('.e_etc_dep').addClass('e_etc_on');
			$(this).parent().parent().parent().css('display', 'block');
			$(this).attr('src', $(this).attr('src').replace('off','on'));
		}
	});

	// end_LNB Location

	$('.pop_address').hide();
	$('.pop_close').click(function(){
		$('.pop_address').fadeOut(500);
		return false;
	});
	$('.btn_address').click(function(){
		$('.pop_address').fadeIn(500);
	});


	//list_accordion 증권,파생상품 리스트
	$('.list_accordion .depth2').hide()
	$('.list_accordion ul li:first .depth2').show();

	$('.list_accordion .detail').click(function(){
		var liTag = $(this).parent();
		if(liTag.find('.depth2').css('display') == 'none'){
			liTag.find('.depth2').show();
			liTag.css('padding-bottom', '0px');
		}else if(liTag.find('.depth2').css('display') == 'block'){
			liTag.find('.depth2').hide();
			liTag.css('padding-bottom', '10px');
		}
		return false;
	});

	//list_accordion 자주하는 질문
	$('.list_accordion2 .depth2').hide();
	$('.list_accordion2 .accor_title a').toggle(function(){
		$(this).parent().parent().find('.depth2').show();
		$(this).parent().parent().addClass('on');
		$(this).css('color', '#494949');
		$(this).parent().css('font-weight', 'bold');
	},function(){
		$(this).parent().parent().find('.depth2').hide();
		$(this).parent().parent().removeClass('on');
		$(this).css('color', '#666');
		$(this).parent().css('font-weight', 'normal');
	});

	//고객 현장

	$('.tab_js div').hide();
	$('.tab_js div').eq(0).show();


	$('.service_tab li a').eq(0).click(function(){
		$('.tab_js div').hide();
		$('.service1').show();
		return false;
	});

	$('.service_tab li a').eq(1).click(function(){

		$('.tab_js div').hide();
		$('.service2').show();
		return false;
	});

	$('.service_tab li a').eq(2).click(function(){

		$('.tab_js div').hide();
		$('.service3').show();
		return false;
	});

	$('.service_tab li a').eq(3).click(function(){

		$('.tab_js div').hide();
		$('.service4').show();
		return false;
	});

	$('.service_tab li a').eq(4).click(function(){

		$('.tab_js div').hide();
		$('.service5').show();
		return false;
	});

	/* all_used */

	var plus = 12;
	var cont = $('.contents');
	var pop_cont = $('#popWrap');

	//plus
	$('.etc_use .plus a').click(function(){
		plus++;
		var fontSize = parseInt(cont.css('font-size'));

		if(fontSize < 20){
			cont.css('font-size', plus);
		}
		if(fontSize == 20){
			plus = 20;
		}
		return false;
	});

	//mi
	$('.etc_use .mi a').click(function(){
		plus--;
		var fontSize = parseInt(cont.css('font-size'));

		if(fontSize > 12){
			cont.css('font-size', plus);
		}
		if(fontSize == 12){
			plus = 12;
		}
		return false;
	});

	//re
	$('.etc_use .re a').click(function(){
		location.reload();
	});

	//ca

	$('.etc_use .ca a').click(function(){
		CopyClipboard();
	});

	//print
	$('.print').click(function(){
			printLayer(document.getElementById('Contents').innerHTML);
	});

	// end all used



	//plus
	$('.pop_etc_use .plus a').click(function(){
		plus++;
		var fontSize = parseInt(pop_cont.css('font-size'));

		if(fontSize < 20){
			pop_cont.css('font-size', plus);
		}
		if(fontSize == 20){
			plus = 20;
		}
		return false;
	});

	//mi
	$('.pop_etc_use .mi a').click(function(){
		plus--;
		var fontSize = parseInt(pop_cont.css('font-size'));

		if(fontSize > 12){
			pop_cont.css('font-size', plus);
		}
		if(fontSize == 12){
			plus = 12;
		}
		return false;
	});

	//re
	$('.pop_etc_use .re a').click(function(){
		location.reload();
	});

	//ca

	$('.pop_etc_use .ca a').click(function(){
		CopyClipboard();
	});



	// end all used
	//고객센터 자주하는 질문

	$('.normal_tab li a').click(function(){

		$('.normal_tab li').each(function(){
			$(this).removeClass('tab_on');
			$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on', 'off'));
		});

		$(this).parent().addClass('tab_on');
		$(this).find('img').attr('src', $(this).find('img').attr('src').replace('off', 'on'));

		return false;
	});

	//경영활동 - 임원연봉
	var salaryTable = $('.activity2 .table_data2');
	salaryTable.hide();
	salaryTable.eq(0).show();

	$('.key_borad').css('visibility', 'hidden');
	$('#salary_sel').focusin(function(){
		$('.key_borad').css('visibility', 'visible');
	});
	$('#salary_sel').focusout(function(){
		$('.key_borad').css('visibility', 'hidden');
	});

	$('#salary_sel').change(function(){
		var values = $(this).attr('value');
		salaryTable.hide();
		salaryTable.eq(values).show();
	});

	//사이버홍보관
	$('.cyber_gnb li a').hover(function(){
		$(this).find('img').attr('src', $(this).find('img').attr('src').replace('off','on'));
	},function(){
		$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on','off'));
	});

	$('.cyber_gnb li a img').each(function(){
		if($('.page_iden h2 img').attr('alt') == $(this).attr('alt')){
			$(this).attr('src', $(this).attr('src').replace('off', 'on'));
		}
	});

	//사이버홍보관 사보 팝업

	$('.pop_sabo_wrap').hide();

	$('.sabo_rnb ul li a img').click(function(){
		$('.sabo_rnb ul li a img').each(function(){
			$(this).attr('src', $(this).attr('src').replace('on','off'));
		});
		$(this).attr('src', $(this).attr('src').replace('off','on'));
	});

	$('.btn_sabos img').click(function(){
		$('.pop_sabo_wrap').fadeIn();
	});

	$('.pop_sabo_wrap .close').click(function(){
		$('.pop_sabo_wrap').fadeOut();
	});
	//플래시 대체 페이지

	//큰 년도
	$('.big_year li a').click(function(){
		$('.big_year li a').each(function(){
			var imgSrc = $(this).find('img').attr('src');
			$(this).find('img').attr('src', imgSrc.replace('on','off'));
		});

		var imgSrc = $(this).find('img').attr('src');
		$(this).find('img').attr('src', imgSrc.replace('off','on'));
	});
	//작은 년도
	$('.small_year li a').click(function(){
		$('.small_year li a').each(function(){
			var imgSrc = $(this).find('img').attr('src');
			$(this).find('img').attr('src', imgSrc.replace('on','off'));
		});

		var imgSrc = $(this).find('img').attr('src');
		$(this).find('img').attr('src', imgSrc.replace('off','on'));
	});
	//월
	$('.month li a').click(function(){
		$('.month li a').each(function(){
			var imgSrc = $(this).find('img').attr('src');
			$(this).find('img').attr('src', imgSrc.replace('on','off'));
		});

		var imgSrc = $(this).find('img').attr('src');
		$(this).find('img').attr('src', imgSrc.replace('off','on'));
	});

	//list
	$('.list_name').click(function(){
		$('.list_name').each(function(){
			$(this).find('a').removeClass('on');
			$(this).parent().find('.date').removeClass('date_on');
			$(this).parent().find('img').css('display', 'none');
			$(this).parent().find('.list_img_pop img').css('display', 'none');
		});

		$(this).find('a').addClass('on');
		$(this).parent().find('.date').addClass('date_on');
		$(this).parent().find('img').css('display', 'block');
		$(this).parent().find('.list_img_pop img').css('display', 'block');
	});

	$('.list_img_pop').hide();

	$('.list_img').click(function(){
		$('.list_img_pop').fadeIn();
	});
	$('.pop_close').click(function(){
		$('.list_img_pop').fadeOut();
	});




	//사이트 링크

	$('.tab_site .fir_dep .tow_dep').hide();
	$('.tab_site .fir_dep .tow_dep:first').show();

	$('.tab_site .fir_dep .fir_btn').click(function(){
		$('.tab_site .fir_dep .tow_dep').hide();
		$(this).parent().find('ul').show();

		$('.tab_site .fir_dep .fir_btn img').each(function(){
			$(this).attr('src', $(this).attr('src').replace('on', 'off'));
		});

		$(this).find('img').attr('src', $(this).find('img').attr('src').replace('off', 'on'));
		return false;
	});

	$('.tab_site .fir_dep .fir_btn').click(function(){
		$('.tab_site').css('height', '550px');
	});

	$('.tab_site .fir_dep .fir_btn:last').click(function(){
		$('.tab_site').css('height', '850px');
	});

	/* 탭_2 */

	$('.dis').hide();
	$('.dis:first').show();

	$('.gray_tab li').each(function(i){
		$(this).click(function(){
			$('.gray_tab li').each(function(){
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('on', 'off'))
			})
			$(this).find('img').attr('src', $(this).find('img').attr('src').replace('off', 'on'));
			$('.dis').hide();
			$('.dis').eq(i).show();
			return false;
		});
	});

	/* 탭_text */

	$('.dis').hide();
	$('.dis:first').show();

	$('.text_tab li').each(function(i){
		$(this).click(function(){

			$('.text_tab li a').each(function(){
				$(this).removeClass('on')
			});

			$(this).find('a').addClass('on');
			$('.dis').hide();
			$('.dis').eq(i).show();
			return false;
		});
	});

	//main 하단 배너
		$('.bottom_btn_pre').click(function(){

			$('.banner_bottom li').each(function(){
				$('.banner_bottom li:first').fadeOut(function(){
					var endSend = $(this).html();
					$(this).remove();
					$('.banner_bottom').append('<li>'+ endSend +'<li/>');
				});
			})

			return false;
		});

		$('.bottom_btn_next').click(function(){

			$('.banner_bottom li').each(function(){
				$('.banner_bottom li:last').fadeOut(function(){
					var endSend = $(this).html();
					$(this).remove();
					$('.banner_bottom li:first').before('<li>'+ endSend +'<li/>');
				});
			})

			return false;
		});

		$(".footer_select").change(function () {
          var link = "";
          $(".footer_select option:selected").each(function () {
                link += $(this).attr('value') + " ";
              });
          $('.footer_select_btn').attr('href', link);
        })
        .change();

}

function display(view){
	$('.gnb').css('display', view);
}

function SetDocument(pVal) {
	try	{
		docHeight = document.body.scrollHeight-100;
		if((document.body.scrollTop+document.body.clientHeight-40) <= (document.body.scrollHeight-100)) {
			divTop.style.display="none";
			divTop.style.top=document.body.scrollTop+document.body.clientHeight-40;
		}

	} catch(E) {
	}

	var tb=document.all.tags('BODY');

	if(tb.length==0) {
		for(var i=0;i< top.frames.length;i++) {
			r(top.frames[i].document,pVal);
		}
	} else {
		r(document,pVal);
	}
	setTimeout("StatusOn()",1000);
}
