$(document).ready(function() {
  $('.bottomPrivacy').click(function(){
    var html ='<div id="dialog" title="" style="width:1024px;height:721px;"><iframe id="webzine" src="../kor/_ext/template/new_kerker/etc/_privacy.php" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="6080px" scrolling="no"></iframe></div>';
    $("#pageWrap").append(html);
    $("#dialog").dialog({
      title : "개인정보보호정책",
      width: 500,
      height: 600,
      resizable: false,
      bgiframe: false,
      closeOnEscape: true,
      stack: false
    });
  });

  $('.bottomTerm').click(function(){
    var html ='<div id="dialog" title="" style="width:1024px;height:721px;"><iframe id="webzine" src="../kor/_ext/template/new_kerker/etc/_term.php" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="2600px" scrolling="no"></iframe></div>';
    $("#pageWrap").append(html);
    $("#dialog").dialog({
      title : "이용약관",
      width: 500,
      height: 600,
      resizable: false,
      bgiframe: false,
      closeOnEscape: true,
      stack: false
    });
  });
  $('.viewShopInfo').click(function(){
    var html ='<div id="dialog" title="" style="width:1024px;height:721px;"><iframe id="webzine" src="../kor/_ext/template/new_kerker/etc/_shopInfo.php?uid='+$(this).attr('uid')+'" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="270px" scrolling="no"></iframe></div>';
    $("#pageWrap").append(html);
    $("#dialog").dialog({
      title : $(this).attr('subject'),
      //width: 730,
      //height: 320,
      width: 730,
      height: 325,
      resizable: false,
      bgiframe: false,
      closeOnEscape: true,
      stack: false
    });
  });

  /*tab*/
  $('#tabContent1').css('display','none');
  $('#tabContent2').css('display','none');
  $('#tabContent3').css('display','none');
  $('#rTap1 > li').click(function(){
    $index = $('#rTap1 > li').index(this);
    for(var i=0; i<4; i++)
    {
      $('#rTap1 > li').eq(i).attr('class','');
      $('#tabContent'+i).css('display','none');
    }
    $('#rTap1 > li').eq($index).attr('class','active');
    $('#tabContent'+$index).css('display','');
  });

  /*google map*/
  $('.gmap').click(function(){
    var $addUrl = $(this).attr('data');
    window.open("../../../../../kor/_ext/skin/_skin/shopinfo/gmap.php"+$addUrl, "gmap", "menubar=no,toolbar=no,location=no,,status=no,scrollbars=no,width=600,height=600");
  });


  /*Maun Menu*/
  $('#gnb li').mouseenter(function(){
    $thismenu = $('#gnb li').index($(this))+1;
    if ($thismenu < 8)
    {
      $('.gnbsub').css('display','none');
      $('#gnbsubWrap div.shadow').css('display','none');
      $('.gnbsub.sub'+$thismenu).css('display','block');
      $('#gnbsubWrap div.sub'+$thismenu).css('display','block');
    }
    else if ($thismenu == 8)
    {
      $('.gnbsub').css('display','none');
      $('#gnbsubWrap div.shadow').css('display','none');
    }
  });

  $('#searchBar').mouseenter(function(){
    $('.gnbsub').css('display','none');
    $('#gnbsubWrap div.shadow').css('display','none');
  });

  $('#bodyWrap').mouseenter(function(){
    $('.gnbsub').css('display','none');
    $('#gnbsubWrap div.shadow').css('display','none');
  });

  $('#gnb .sec8 a').click(function(){
    $('.gnbsub').css('display','none');
    $('#gnbsubWrap div.shadow').css('display','none');
    $('#gnb li a').attr('class','');
    $(this).attr('class','active');
  });


  $('.map1').click(function(){
    $('.minimap1').jqprint({ operaSupport: true });
  });
  $('.map2').click(function(){
    $('.minimap2').jqprint({ operaSupport: true });
  });

});

