
//--------------------------------------
  // Configuration
//--------------------------------------
var domain = ".ligb2b.com";
var appserver = "www"; 
var pubserver = "www";
//--------------------------------------
function setCookie_naz( name, value, expiredays )
{
  var todayDate = new Date();
  todayDate.setDate( todayDate.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function setCookie1(name, value) {
	document.cookie = name + "=" + escape(value) + 
		";DOMAIN=" + domain + 
		";PATH=/";
}
function getCookie(Name) {
	var search = Name + "=";
	if (document.cookie.length>0){
		offset = document.cookie.indexOf(search);
		if (offset != -1){
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		}
	}
}	
var appprotocol = "http";   
var pubprotocol = "http";
var appurl = appprotocol + "://" + appserver + domain;
var puburl = pubprotocol + "://" + pubserver + domain;
var conntype = getCookie("lgins_connect_type");
if( conntype == null || conntype == "" || conntype == "undefined" )  conntype = "lgins/id";
var memburl = appprotocol + "://" + appserver + domain + "/" + conntype;

function connect_to_corp(){
   goto_url = getCookie("goto");
   if ( goto_url == null || goto_url == "" ) goto_url = "/CargoCont?go=start";
   request_url = appprotocol + "://" + appserver + domain + "/corp" + goto_url;
   location = request_url;
}
function connect_to_corp_auth(){
   goto_url = getCookie("goto");
   if ( goto_url == null || goto_url == "" ) goto_url = "/CargoCont?go=start";
   request_url = appprotocol + "://" + appserver + domain + "/corp" + goto_url;
   XecureNavigate( request_url, "_self", "" );
}
function go_corp(u1, u2){
   isLogin = getCookie("logon_btob");
   if ( isLogin == "on_btob") {
      location_url = appprotocol + "://" + appserver + domain + "/corp" + u1;
   }
   else {
          setCookie1("goto", u1);
          location_url = pubprotocol + "://" + pubserver + domain + "/btob/member/btob_login_guide.html";
   }

   window.open( location_url, u2 , "" );  
}


function go_service(url){
   location_url = appprotocol + "://" + appserver + domain + "/corp" + url;
   location = location_url;
}
function getPath(){
   location_url = appprotocol + "://" + appserver + domain + "/corp";
   return location_url;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function popUp(url) {
  sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=650,height=500');
  self.name = "mainWin";
}

function go_auth( form ) {
      XecureSubmit( form );
}

function go_auth_blank( form ) {
      XecureSubmit_Blank( form ); 
}

function go2_auth(u1, u2){	
   isLogin = getCookie("logon_btob");
   setCookie1("goto", u1);
 
   if ( isLogin == "on_btob" ) 
   {
      location_url = appprotocol + "://" + appserver + domain + "/corp"  + u1;
   }
   else 
   {
      setCookie1("goto", u1);
      location_url = pubprotocol + "://" + appserver + domain + "/corp" + u1;
//      location_url = pubprotocol + "://" + pubserver + domain + "/corp/corpjsp?jsp=/b2b/common/member/login_auth.jsp";
//      window.location = location_url;
//      return;
   }
   
   XecureNavigate( location_url, "_self", "" );
}


//°Ë»ö¿¡¼­¸¸ »ç¿ë
function go2_auth_search(u1){	
   isLogin = getCookie("logon_btob");
   setCookie1("goto", u1);
   winopts = "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0";
   
   if ( isLogin == "on_btob" ) 
   {
	   	location_url = appprotocol + "://" + appserver + domain + "/corp"  + u1;
	    XecureNavigate( location_url, "_blank" , winopts);
   }
   else 
   {
		setCookie1("goto", u1);
		location_url = pubprotocol + "://" + pubserver + domain + "/corp/corpjsp?jsp=/b2b/common/member/login_auth.jsp";
		window.open(location_url,"search",winopts);  
		return;
   }
}

function go_auth_login()
{
//   alert("btob_top / go_auth_login / ¿©±â¿É´Ï´Ù.");
//   alert("cookie  => " + getCookie("goto"));
   if ( getCookie("goto") != null && getCookie("goto") != "" )
   {
      location_url = appprotocol + "://" + appserver + domain + "/corp" + getCookie("goto");
//     alert("location_url  => " + location_url);
      XecureNavigate( location_url, "_self", "" );
   }
}

function go2(u1, u2){
   isLogin = getCookie("logon_btob");
   loginType = "corp";

   setCookie1("goto", u1);
   if ( isLogin == "on_btob" ) {
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
      setCookie1("goto", u1);
      location_url = pubprotocol + "://" + appserver + domain + "/" + loginType + u1;
//      location_url = pubprotocol + "://" + pubserver + domain + "/corp/corpjsp?jsp=/b2b/common/member/login.jsp";
//      window.location = location_url;
//      return;
   }
   location = location_url;
}

 function getLogonTop2(Name) {
        var search = Name + "=";

        if (document.cookie.length > 0)
        {
            offset = document.cookie.indexOf(search);

            if (offset != -1)
            {
                offset += search.length;
                end = document.cookie.indexOf(";", offset);
                if (end == -1)
                    end = document.cookie.length;
                return unescape(document.cookie.substring(offset, end));
            }
        }
      }  
      
function top_login()   
    {
        setCookie1("goto", "");
        location = "/corp/corpjsp?jsp=/b2b/common/member/login.jsp";
    }
function top_logout()
    {
        form = document.logoutform;
        form.go.value = "out";
        form.action = appprotocol + "://" + appserver + domain + "/corp/BtobAuthLogin";
        form.target = "_top";  
        go_auth( form );
        
      
    }          

function updateMemb()
{
    form = document.updateform;
    form.action = appprotocol + "://" + appserver + domain + "/corp/BtobMemberUpdate";
    form.target = "_top"; 
    go_auth( form );
    
}    

//¸ÞÀÎÇÃ·¡½¬
function IndexFlash() {	
document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='459' HEIGHT='190' id='#' ALIGN=''>");
document.write("<PARAM NAME=movie VALUE='/image/main/b2b/pass.swf'>");
document.write("<PARAM NAME=quality VALUE='high'>");
document.write("<PARAM NAME=bgcolor VALUE='#FFFFFF'>");
document.write("<PARAM NAME=wmode VALUE='transparent'>");
document.write("<EMBED src='/image/main/b2b/pass.swf' quality='high' bgcolor='#FFFFFF' WIDTH='459' HEIGHT='190' NAME='#' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>");
document.write("</OBJECT>");
}

