// 전체메뉴 
$(document).ready(function() {
  var $firstPara = $('#top_menuall');
  $firstPara.hide();  
  $('.allmenu p').click(function() {
    $firstPara.slideToggle('slow');
    var $link = $(this);
    if ( $link.text() == "전체메뉴보기" ) {
      $link.text('전체메뉴닫기');      
    } else {
      $link.text('전체메뉴보기');
    }
    return false;
  });

    
});

$(document).ready(function() {
  var $search = $('#search').addClass('overlabel');
  var $searchInput = $search.find('input');
  var $searchLabel = $search.find('label');
  
  if ($searchInput.val()) {
    $searchLabel.hide();
  }

  $searchInput
  .focus(function() {
    $searchLabel.hide();
  })
  .blur(function() {
    if (this.value == '') {
      $searchLabel.show();
    }
  });
  
  $searchLabel.click(function() {
    $searchInput.trigger('focus');
  });
});

$(document).ready(function() {
  var $search = $('#search2').addClass('overlabel2');
  var $searchInput = $search.find('input');
  var $searchLabel = $search.find('label');
  
  if ($searchInput.val()) {
    $searchLabel.hide();
  }

  $searchInput
  .focus(function() {
    $searchLabel.hide();
  })
  .blur(function() {
    if (this.value == '') {
      $searchLabel.show();
    }
  });
  
  $searchLabel.click(function() {
    $searchInput.trigger('focus');
  });
});

function ready(){		
alert(" 서비스 준비중 입니다.문의는 1599-8596");
return;
}

function viewFlash(src,width,height,wmode)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
	document.write('<param name=movie value="' + src + '">');
	document.write('<param name=quality value=high>');
	document.write('<param name=allowScriptAccess value=always>');
	if(wmode == 0){ document.write('<param name="wmode" value="transparent">');}
	document.write('<embed src="' + src + '" quality=high pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent" width="' + width + '" height="' + height + '">');
	document.write('</embed> ');
	document.write('</object>');
}

function top_menu(a) { 
if(a=='basket') { window.location="./upia.php?f=shop&m=cart";  }
if(a=='search_1') { window.location="./upia.php?f=shop&m=orderfind";  }
if(a=='search_2') { window.location="./upia.php?f=shop&m=orderfind";  }	
if(a=='logo') { window.location="./main.php";  }
if(a=='m_1') { window.location="./upia.php?f=shop&m=goods_list1&cid=88";  }
if(a=='m_2') { window.location="./subpage.php?f=user&m=p2_1";  }
if(a=='m_3') { window.location="./board.php?table_code=this_faq&group_id=this";  }
if(a=='m_4') { window.location="";  }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/**************************  레이어 이동 소스  ****************************************/
var TnTL_clickTime;
function DragResize_DN(it_Resize,evt,div_id){

    if(div_id){
        mv_act_objt=document.getElementById(div_id);
        if(mv_act_objt.style.position!='absolute'){
            mv_act_objt.style.left=TnT_get_objLeft(mv_act_objt);
            mv_act_objt.style.top=TnT_get_objTop(mv_act_objt);
            mv_act_objt.style.position='absolute';
        }
        mv_act_objt.style.zIndex=++iwinzidx;
    }
    else{mv_act_objt=iwindowLAYER;}

    DragResize_start=1;
    Drg_x=(this_browser=='n')? evt.pageX : event.clientX;
    Drg_y=(this_browser=='n')? evt.pageY : event.clientY;

    if(it_Resize<1){// Drag
        temp1=parseInt(mv_act_objt.style.left);
        temp2=parseInt(mv_act_objt.style.top);
        if(this_browser=='n')  document.onmousemove=TnTmoveAct_n;
        else document.onmousemove=TnTmoveAct;
    }
    else{// Resize
        iwindoWidth=parseInt(TntiwindowTable.width); // 가로
        iwindoHeight=parseInt(TntiwindowTable.height); // 세로
        if(this_browser=='n')  document.onmousemove=TnTresizeAct_n;
        else document.onmousemove=TnTresizeAct;
    }
    TnTL_clickTime=1;
}


function TnTmoveAct(){ // drag
    if(DragResize_start==1){
        mv_act_objt.style.left=temp1+event.clientX-Drg_x;
        mv_act_objt.style.top=temp2+event.clientY-Drg_y;
        return false;
    }
}

// resize move
function TnTresizeAct(){
    if(DragResize_start==1){
        var re_x=iwindoWidth+event.clientX-Drg_x;
        var re_y=iwindoHeight+event.clientY-Drg_y;
        if(re_x<50 || re_y<50) return false;
        iwindow_RESIZE(re_x,re_y);
        return false;
    }
}

// 부라우저 바탕화면 클릭시 레이어 자동으로 닫히게함(지워 버려도 됨) ----------------------
 document.onclick=iwindow_CLOSE_AUTO;
function iwindow_CLOSE_AUTO(){
	DragResize_start=0;
	if(TnTL_clickTime==1) return; // iwindow 를 드래그 ro 크기변경 동작후에는 자동닫기 적용안함(무조건 자동닫기 적용하려면 이 라인을 삭제)
	if(this_browser=='e'){
		if (event.srcElement.className=="TnT_Layer_dragin") return; // iwindow: Drag, Resize
		if (event.srcElement.className=="TnT_Top_button") return; // iwindow : TopButton
		if (event.srcElement.className=="TnT_Editor_button") return; // editor : Button
	}
	if((TnTL_clickTime+500)<(new Date()).getTime()){iwindow_CLOSE();}
}


function TnTmoveAct_n(evt){ // drag
    if (DragResize_start==1){
        mv_act_objt.style.left=temp1+evt.pageX-Drg_x;
        mv_act_objt.style.top=temp2+evt.pageY-Drg_y;
        return false;
    }
}

// resize move
function TnTresizeAct_n(evt){
    if (DragResize_start==1){
        var re_x=iwindoWidth+evt.pageX-Drg_x;
        var re_y=iwindoHeight+evt.pageY-Drg_y;
        if(re_x<50 || re_y<50) return false;
        iwindow_RESIZE(re_x,re_y);
        return false;
    }
}

// thisobj 의 Top
function TnT_get_objTop(thisobj){
    if (thisobj.offsetParent==document.body) return thisobj.offsetTop;
    else return thisobj.offsetTop + TnT_get_objTop(thisobj.offsetParent);
}

// thisobj 의 Left
function TnT_get_objLeft(thisobj){
    if (thisobj.offsetParent==document.body) return thisobj.offsetLeft;
    else return thisobj.offsetLeft + TnT_get_objLeft(thisobj.offsetParent);
}


// onload 기본모드
mouseDN_X=0;
mouseDN_Y=0;
if(navigator.userAgent.indexOf('MSIE') == -1){
	this_browser='n';
	document.onmousedown=function(n_evt){
		mouseDN_X=n_evt.pageX;
		mouseDN_Y=n_evt.pageY;
	}
	it_img_tag='input type=image '; // iwindow title
}
else{
	this_browser='e';
	it_img_tag='img ';
}
iwinzidx=10;
tntactiwin='';
/************************** //레이어 이동 소스  ****************************************/
