
// flash Laod
function flashX(src, w, h, swfid) {
	swf_html = '';
	swf_html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + w + '" height="' + h + '" id="' + swfid + '">';
	swf_html += '<param name="allowScriptAccess" value="sameDomain">';
	swf_html += '<param name="movie" value="' + src + '">';
	swf_html += '<param name="quality" value="high">';
	swf_html += '<param name="bgcolor" value="#FFFFFF">';
	swf_html += '<PARAM NAME="wmode" VALUE="transparent">';
	swf_html += '<PARAM NAME="base" VALUE=".">';
	swf_html += '<embed base="." src="' + src + '" quality="high" bgcolor="#FFFFFF" width="' + w + '" height="' + h + '" name="' + swfid + '" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	swf_html += '</object>';
	document.write(swf_html);
}

//check browser
var isie=(/msie/i).test(navigator.userAgent); //ie
var isie6=(/msie 6/i).test(navigator.userAgent); //ie 6
var isie7=(/msie 7/i).test(navigator.userAgent); //ie 7
var isie8=(/msie 8/i).test(navigator.userAgent); //ie 8
var isie9=(/msie 9/i).test(navigator.userAgent); //ie 9
var isfirefox=(/firefox/i).test(navigator.userAgent); //firefox
var isapple=(/applewebkit/i).test(navigator.userAgent); //safari,chrome
var isopera=(/opera/i).test(navigator.userAgent); //opera
var isios=(/(ipod|iphone|ipad)/i).test(navigator.userAgent);//ios
var isipad=(/(ipad)/i).test(navigator.userAgent);//ipad
var isandroid=(/android/i).test(navigator.userAgent);//android
if(isie7 || isie8 || isie9) isie6=false;
if(isie9) isie=false;

// IE6 PNG Load
if (isie6) {
	DD_belatedPNG.fix ( "img, .imageflow, .ctype_orange , .ctype_blue , .ctype_brown, .ctype_brown02 , .ctype_brown_pd, .sbToggle, .sbToggleOpen, .ctype_blue02, .ctype_brown, .ctype_dblue, .ctype_pink, .smart_search" );
}

// IE6 background fix
try{
	document.execCommand('BackgroundImageCache',false,true);
}
catch(e){}


function popMSG(msg){
	var ms = msg;
	alert(ms);
}
// popup
function popupOpen(url,w,h,type){
	window.open(url ,  "openWin", "width="+w+",height="+h+",top=30,left=100,resizable=no,scrollbars="+type) ;
}

(function($){
	
	$(document).ready(function(){
		$(".layer_add").css("display","none");
		$(".loadadd").click(function(){
			$(".layer_add").css("display","block");
		});
		$(".addok").click(function(){
			$(".layer_add").css("display","none");
		});

		if($('#social_qmenu').length){
			var options = { 'speed' : 500, // ?피??
				'initTop':531 ,  // 기본 top ?치
				'alwaysTop' : false, // ??고정 true , false ?동
				'default_x' : '#wrap'  //?어?웃??가?데 ?렬 ?때 ?이?? 붙는 ?이?값
			}
			$('#social_qmenu').Floater(options);
		}

		//무료쿠폰 ?브메인 지????
		$("#mycustomscroll01 .inn").css("display","none");
		$("#mycustomscroll01 ul li .sel_area").css("cursor","pointer");
		$("#mycustomscroll01 ul li .sel_area").each(function(){
			$(this).toggle(
				function(){
					$("#mycustomscroll01 .inn").css("display","none");
					$(this).next(".inn").slideToggle("fast");
				},function(){
					$(this).next(".inn").hide();
				}
			);
		});
		
		$("#selmycustomscroll02 .inn").css("display","none");
		$("#selmycustomscroll02 ul li .sel_area").css("cursor","pointer");
		$("#selmycustomscroll02 ul li .sel_area").each(function(){
			$(this).toggle(
				function(){
					$("#selmycustomscroll02 .inn").css("display","none");
					$(this).next(".inn").slideToggle("fast");
				},function(){
					$(this).next(".inn").hide();
				}
			);
		});

	}); //ready
})(jQuery); //function

//
(function($){
	$(document).ready(function() {
		
//        //??부분이 ??지 경로?니??
//		$("#top_adv").append('<p class="adv"><span><img src="/image/open_temp/main_banner_s01.gif" alt="" /></span></p>');
//		$("#top_adv").append('<p><a class="big_adv" href="#" target="_blank"><img src="/image/open_temp/main_banner_L01.gif" alt="" /></a></p>');

		$(".adv span").mouseover(function() {
			$(".big_adv").show(50);
            $(".adv").hide(0);
		});
		$(".big_adv").mouseout(function() {
			$(".big_adv").hide(0);
            $(".adv").show(0);
		});
		$(".big_adv").click(function() {
			$(".big_adv").hide(0);
		});

		$("#coupon_btn_plus").click(function() {
			$("#coupon_set2").show(50);
			$("#coupon_btn_plus").hide(0);
			$("#coupon_btn_minus").show(50);
		});

		$("#coupon_btn_minus").click(function() {
			$("#coupon_set2").hide(0);
			$("#coupon_btn_plus").show(50);
			$("#coupon_btn_minus").hide(0);
		});
	});

	var headline_count;
	var headline_interval;
	var old_headline = 0;
	var current_headline = 0;
	 
	$(document).ready(function(){
	  headline_count = $("p.hot").size();
//	  $("p.hot:eq("+current_headline+")").css('top','14px'); 2011-09-30 Edit
	  $("p.hot:eq("+current_headline+")").css('top','10px');
	  
	  headline_interval = setInterval(headline_rotate,4000); //time in milliseconds
	  $('#scrollup').hover(function() {
		clearInterval(headline_interval);
	  }, function() {
		headline_interval = setInterval(headline_rotate,4000); //time in milliseconds
		headline_rotate();
	  });
	});
	 
	function headline_rotate() {
	  current_headline = (old_headline + 1) % headline_count; 
	  $("p.hot:eq(" + old_headline + ")").animate({top: -30},"fast", function() {
//		$(this).css('top','210'); 2011-09-30 Edit
		$(this).css('top','165px');
		});
	  $("p.hot:eq(" + current_headline + ")").show().animate({top: 10},"fast");  
//	  $("p.hot:eq(" + current_headline + ")").show().animate({top: 0},"fast");  
	  old_headline = current_headline;
	}
})(jQuery);
