﻿
// 엔터키 막기
function checkCR(evt) {
	var evt  = (evt) ? evt : ((event) ? event : null);
	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	if ((evt.keyCode == 13) && (node.type=="text") ) {return false;}
}
		
document.onkeypress = checkCR;

// 미니몰 팝업 창연결
function fcPopMinimall(estId){
	if ( estId != "" )
	{
		var eStore =window.open("/StoreWeb/mall.aspx?ESTID="+estId,"eStore","width=1000,height=664,left=10,top=10");
	}
}

function fcPopMinimall(estId, params){
	if ( estId != "" )
	{
		var eStore =window.open("/StoreWeb/mall.aspx?ESTID="+estId+"&"+params,"eStore","width=1000,height=664,left=10,top=10");
	}	
}


//미니몰 체크 팝업 
function fcPopMakeMall(){	
		var eStore =window.open("/CommonWeb/Aspx/pop_minimallCheck.aspx","eStorechk","width=400,height=140,left=200,top=200");	
}

//배송정보 팝업 
function fcPopDeliveryInfo(ordid){
	if ( ordid != "" )
	{
		var Delivery =window.open("/CommonWeb/Aspx/pop_deliveryReservation.aspx?ORDID="+ordid,"Delivery","width=550,height=300,left=100,top=100");
	}	
}


//이용약관
function fcPopAgreement(){	
		var Agreement =window.open("/CustomerWeb/Membership/pop_agreement.aspx","Agreement","width=680,height=550,left=200,top=200,scrollbars=yes");	
}


///개인정보보정책
function fcPopPrivacy(){	
		var Privacy =window.open("/CustomerWeb/Membership/pop_privacy.aspx","Privacy","width=680,height=400,left=200,top=200,scrollbars=yes");	
}


//이메일주소무단수집거부
function fcPopRefuse(){	
		var Refuse =window.open("/CustomerWeb/Membership/pop_refuse.aspx","Refuse","width=458,height=164,left=200,top=200");	
}

// 메뉴 관련


//1. 메뉴레이어 드랍다운
function fcMenuToggle(menuId)
{
	var menu = document.getElementById("subMenu_"+menuId);
	
	if ( menu.style.display == "" )
	{
		menu.style.display = "none";
	}
	else
	{
		menu.style.display = "";
	}
}

//2. 메뉴링크
function fcGoUrl(url)
{
	document.location.href = "/CommonWeb/Aspx/clearCookie.aspx?rUrl="+url;
}

//3. 통합검색
function fcGoSearch(searchObj)
{
	if ( searchObj.value != "" )
	{
		self.location.href= "/Search/search.aspx?sText="+escape(searchObj.value);
	}
	else
	{
		alert("검색어를 입력하세요.");
		searchObj.focus();
	}
}

//4. 바다마을 통합검색 

function fcGoSearch_BD(searchObj)
{
	if ( searchObj.value != "" )
	{
		self.location.href= "/mallIndex.aspx?sText="+escape(searchObj.value);
	}
	else 
	{
		alert("검색어를 입력하세요.");
		searchObj.focus();
	}
}

// 미니몰 샘플보기 팝업
function fcPopMallSample()
{
	window.open('/StoreWeb/Popup/pop_ResizeView.aspx?IMG='+escape("/CommonWeb/common/images/kfb2b/img/main/sample.jpg"),'실사이즈뷰어','width=1000,height=664,left=30,top=30');
}

//로그아웃
function fcLogOut()
{
	//로그아웃 페이지로 이동
	document.location.href = "/LogOut.aspx";
	//return false;	
}


// Flash Embed ( IE 패치 )
function setEmbed()
{
  var obj = new String;
  var parameter = new String;
  var embed = new String;
  var html = new String;
  var allParameter = new String;
  var clsid = new String;
  var codebase = new String;
  var pluginspace = new String;
  var embedType = new String;
  var src = new String;
  var width = new String;
  var height = new String;

   
  this.init = function( getType , s ,w , h ) {
     
      if ( getType == "flash")
      {

        clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";       
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
        pluginspage = "http://www.macromedia.com/go/getflashplayer";
        embedType = "application/x-shockwave-flash";
      }
      
      /* type 추가 할수 있음.. 현재는 플래쉬만
      else if ( )
      {
      }
      */
           
      parameter += "<param name='movie' value='"+ s + "'>\n"; 
      parameter += "<param name='quality' value='high'>\n";   
     
      src = s;
      width = w;
      height = h;
  }
 
  this.parameter = function( parm , value ) {     
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";       
      allParameter += " "+parm + "='"+ value+"'";
  } 
 
  this.show = function() {
      if ( clsid )
      {
        obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n";
      }
     
      embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" ></embed>\n";
     
      if ( obj )
      {
        embed += "</object>\n";
      }
     
      html = obj + parameter + embed;
     
      document.write( html ); 
  }
 
} 

function getCookie(keyName)
{
	tmp = document.cookie + ";";
	index1 = tmp.indexOf(keyName, 0);
	if(index1 != -1){
		tmp = tmp.substring(index1, tmp.length);
		index2 = tmp.indexOf("=", 0) + 1;
		index3 = tmp.indexOf(";",index2);
		return (unescape(tmp.substring(index2, index3)));
	}
	return "";				
}

/// 작성자 : 이주용 /// 작성일 : 2006-05-17
/// 용  도 : 특정 서버 동작이 존재하면 모든 요청을 거부한다.
function fctIsComplete()
{
	if(document.readyState == "complete" || document.readyState == "interactive")
	{	
		return true;
	}
	else
	{	
		alert('특정 동작이 진행 중입니다.');		
		return false;
	}
}
