

 jQuery(function($){
 	$(".menu1").toggle(menuHover1, btn_close);
 	$(".menu2").toggle(menuHover2, btn_close);
 	$(".menu3").toggle(menuHover3, btn_close);
 	$(".menu4").toggle(menuHover4, btn_close);
 	$(".btn_close").click(btn_close);
 	$(".mCategory").click(cate,cate_close);
 	$(".mCategory_close").click(cate_close);
 	$("#slider").easySlider({
 		auto: true, continuous:true	
 	});
 	var tab = $('.goodsTab');
 	tab.removeClass('js_off');
 	//tab.css('height', tab.find('>ul>li>ul:visible').height()+40);
 	function onSelectTab(){
 		var t = $(this);
 		var myClass = t.parent('li').attr('class');
 		t.parents('.goodsTab:first').attr('class', 'goodsTab '+myClass);
 		//tab.css('height', t.next('ul').height()+40);
 	}
 	tab.find('>ul>li>a').click(onSelectTab).focus(onSelectTab);
 });

 function menuHover1(){
 	$(".panel1").show("slow");
 	$(".panel2").hide("slow");
 	$(".panel3").hide("slow");
 	$(".panel4").hide("slow");
 	
 }
 function menuHover2(){
 	$(".panel2").show("slow");
 	$(".panel1").hide("slow");
 	$(".panel3").hide("slow");
 	$(".panel4").hide("slow");
 }
 function menuHover3(){
 	$(".panel3").show("slow");
 	$(".panel1").hide("slow");
 	$(".panel2").hide("slow");
 	$(".panel4").hide("slow");
 }
 function menuHover4(){
 	$(".panel4").show("slow");
 	$(".panel1").hide("slow");
 	$(".panel2").hide("slow");
 	$(".panel3").hide("slow");
 }
 function btn_close(){
 	$(".panel1").hide("slow");
 	$(".panel2").hide("slow");
 	$(".panel3").hide("slow");
 	$(".panel4").hide("slow");
 	
 }
 function cate(){
 	$(".div_category").show("slow");
 	
 }
 function cate_close(){
 	$(".div_category").hide("slow");
 	
 }


 // 플래시 파일 링크

 function onFlash(f_name, f_src, w_size, h_size, yn){
 	
 	var f_name = f_name;	//플래시 명
 	var f_src = f_src;		//플래시 소스
 	var h_size = h_size;	//플래시 세로사이즈
 	var w_size = w_size;	//플래시 가로사이즈
 	var yn = yn;			//투명처리 사용 여부 'Y/N'
 		
 	document.write("<object name="+ f_name +" classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+w_size+"' height='"+h_size+"'>");
 	document.write("<param name='movie' value='"+f_src+"' />");
 	document.write("<param name='quality' value='high' />");	
 	if(yn == "Y"){
 		document.write("<param name='wmode' value='transparent' />");
 	}	
 	document.write("<embed src='"+f_src+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w_size+"' height='"+h_size+"' ");
 	if(yn == "Y"){
 		document.write("wmode='transparent'");
 	}		
 	document.write("></embed>");
 	document.write("</object>"); 
 		
 }

 // 메인페이지의 탭작업

 function tabWin(n) {
     for(var i = 1; i <= 2; i++) {
         obj = document.getElementById('tab'+i);
         img = document.getElementById('tabBtn'+i);
         if ( n == i ) {
             obj.style.display = "block";
             img.src = "/images/mainTab_on_0"+i+".gif";    
         } else {
             obj.style.display = "none";
             img.src = "/images/mainTab_off_0"+i+".gif";
         }
     }
 }

 // png파일 사용팁 

 function setPng24(obj){
 	obj.width = obj.height = 1;
 	obj.className = obj.className.replace(/\bpng24\b/i,'');
 	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
 	obj.src = '';
 	return '';
 }


 // 화면 확대 축소 시작 IE 전용 

  var nowZoom = 100; // 현재비율
  var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
  var minZoom = 80; // 최소비율
  var nowMargin = 0;
  

  //화면 키운다.
  function zoomIn() {
   if (nowZoom < maxZoom) {
    nowZoom += 10; //25%씩 커진다
    nowMargin -= 10;
   } else {
    return;
   }
 	document.body.style.zoom = nowZoom + "%";
 	var us = window.navigator.userAgent;
 	if (us.indexOf('MSIE 8') != -1) {
 		document.body.style.marginLeft = nowMargin + "%";
 	}
  }


  //화면 줄인다.
  function zoomOut() {
   if (nowZoom > minZoom) {
    nowZoom -= 10; //25%씩 작아진다.
    nowMargin += 10;
   
   } else {
    return;
   }
 	document.body.style.zoom = nowZoom + "%";
 	var us = window.navigator.userAgent;
 	if (us.indexOf('MSIE 8') != -1) {
 		document.body.style.marginLeft = nowMargin + "%";
 	}
  }

 /* 화면 확대 축소 끝 */

 /*
  * 	Easy Slider 1.5 - jQuery plugin
  *	written by Alen Grakalic	
  *	http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
  *
  *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
  *	Dual licensed under the MIT (MIT-LICENSE.txt)
  *	and GPL (GPL-LICENSE.txt) licenses.
  *
  *	Built for jQuery library
  *	http://jquery.com
  *
  */
  
 (function($) {

 	$.fn.easySlider = function(options){
 	  
 		// default configuration properties
 		var defaults = {			
 			prevId: 		'prevBtn',
 			prevText: 		'',
 			nextId: 		'nextBtn',	
 			nextText: 		'',
 			controlsShow:	true,
 			controlsBefore:	'',
 			controlsAfter:	'',	
 			controlsFade:	true,
 			firstId: 		'firstBtn',
 			firstText: 		'First',
 			firstShow:		false,
 			lastId: 		'lastBtn',	
 			lastText: 		'Last',
 			lastShow:		false,				
 			vertical:		false,
 			speed: 			800,
 			auto:			false,
 			pause:			2000,
 			continuous:		false
 		}; 
 		
 		var options = $.extend(defaults, options);  
 				
 		this.each(function() {  
 			var obj = $(this); 				
 			var s = $("li", obj).length;
 			var w = $("li", obj).width(); 
 			var h = $("li", obj).height(); 
 			obj.width(w); 
 			obj.height(h); 
 			obj.css("overflow","hidden");
 			var ts = s-1;
 			var t = 0;
 			$("ul", obj).css('width',s*w);			
 			if(!options.vertical) $("li", obj).css('float','left');
 			
 			if(options.controlsShow){
 				var html = options.controlsBefore;
 				if(options.firstShow) html += '<span id="'+ options.firstId +'"><a href=\"javascript:void(0);\">'+ options.firstText +'</a></span>';
 				html += ' <span id="'+ options.prevId +'"><a href=\"javascript:void(0);\">'+ options.prevText +'</a></span>';
 				html += ' <span id="'+ options.nextId +'"><a href=\"javascript:void(0);\">'+ options.nextText +'</a></span>';
 				if(options.lastShow) html += ' <span id="'+ options.lastId +'"><a href=\"javascript:void(0);\">'+ options.lastText +'</a></span>';
 				html += options.controlsAfter;						
 				$(obj).after(html);										
 			};
 	
 			$("a","#"+options.nextId).click(function(){		
 				animate("next",true);
 			});
 			$("a","#"+options.prevId).click(function(){		
 				animate("prev",true);				
 			});	
 			$("a","#"+options.firstId).click(function(){		
 				animate("first",true);
 			});				
 			$("a","#"+options.lastId).click(function(){		
 				animate("last",true);				
 			});		
 			
 			function animate(dir,clicked){
 				var ot = t;				
 				switch(dir){
 					case "next":
 						t = (ot>=ts) ? (options.continuous ? 0 : ts) : t+1;						
 						break; 
 					case "prev":
 						t = (t<=0) ? (options.continuous ? ts : 0) : t-1;
 						break; 
 					case "first":
 						t = 0;
 						break; 
 					case "last":
 						t = ts;
 						break; 
 					default:
 						break; 
 				};	
 				
 				var diff = Math.abs(ot-t);
 				var speed = diff*options.speed;						
 				if(!options.vertical) {
 					p = (t*w*-1);
 					$("ul",obj).animate(
 						{ marginLeft: p }, 
 						speed
 					);				
 				} else {
 					p = (t*h*-1);
 					$("ul",obj).animate(
 						{ marginTop: p }, 
 						speed
 					);					
 				};
 				
 				if(!options.continuous && options.controlsFade){					
 					if(t==ts){
 						$("a","#"+options.nextId).hide();
 						$("a","#"+options.lastId).hide();
 					} else {
 						$("a","#"+options.nextId).show();
 						$("a","#"+options.lastId).show();					
 					};
 					if(t==0){
 						$("a","#"+options.prevId).hide();
 						$("a","#"+options.firstId).hide();
 					} else {
 						$("a","#"+options.prevId).show();
 						$("a","#"+options.firstId).show();
 					};					
 				};				
 				
 				if(clicked) clearTimeout(timeout);
 				if(options.auto && dir=="next" && !clicked){;
 					timeout = setTimeout(function(){
 						animate("next",false);
 					},diff*options.speed+options.pause);
 				};
 				
 			};
 			// init
 			var timeout;
 			if(options.auto){;
 				timeout = setTimeout(function(){
 					animate("next",false);
 				},options.pause);
 			};		
 		
 			if(!options.continuous && options.controlsFade){					
 				$("a","#"+options.prevId).hide();
 				$("a","#"+options.firstId).hide();				
 			};				
 			
 		});
 	  
 	};

 })(jQuery);
