
//--------------------------------------
  // Configuration
//--------------------------------------
var domain = ".lgcargo.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 go2(u1, u2){   
   isLogin = getCookie("logon");
   loginType = getCookie("lgins_connect_type");

   if ( isLogin == "on" ) {
      if ( loginType == null || loginType == "" ) loginType = "lgins/id";
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
      if ( u2 == "login" ) {
          setCookie1("goto", u1);
          location_url = pubprotocol + "://" + pubserver + domain + "/btob/member/login_corp.shtml";
      }
      else {
          location_url = pubprotocol + "://" + pubserver + domain + u2;
      }
   }
   top.location = location_url;
}
function go3(u1, u2){
   isLogin = getCookie("logon");
   loginType = getCookie("lgins_connect_type");
   if ( isLogin == "on" ) {
      if ( loginType == null || loginType == "" ) loginType = "lgins/id";
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
      if ( u2 == "login" ) {
          setCookie1("goto", u1);
          location_url = pubprotocol + "://" + pubserver + domain + "/member/login_guide.shtml";
      }
      else {
          location_url = appprotocol + "://" + appserver + domain + "/lgins" + u2;
      }
   }
   top.location = location_url;
}

function go_service(url){
   isLogin = getCookie("logon");
   loginType = getCookie("lgins_connect_type");
   if ( isLogin == "on" ) {
      if ( loginType == null || loginType == "" ) loginType = "lgins/id";

      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + url;
   }
   else {
      location_url = appprotocol + "://" + appserver + domain + "/lgins" + url;
   }
   location = location_url;
}
function go(url){

    document.pt.jsp.value = url;
    document.pt.action = "corpjsp";
    document.pt.submit();
}
function call(url){

   location_url = pubprotocol + "://" + pubserver + domain + url;
   alert( location_url );
   location = location_url;
}
function go2_pt(u1, pt){
   isLogin = getCookie("logon");
   loginType = getCookie("lgins_connect_type");

   if ( isLogin == "on" ) {
      if ( loginType == null || loginType == "" ) loginType = "lgins/id";
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
          setCookie1("goto", u1);
          location_url = appprotocol + "://" + appserver + domain + "/lgins/view?jsp=/login_guide.jsp" + pt;
   }
   top.location = location_url;
}
function go_corp_pt(u1, pt){
   isLogin = getCookie("logon_corp");
   loginType = getCookie("lgins_connect_type");

   if ( isLogin == "on_corp" ) {
      if ( loginType == null || loginType == "" ) loginType = "corp";
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
          setCookie1("goto", u1);
          location_url = pubprotocol + "://" + pubserver + domain + "/btob/member/login_corp.html";
   }
   location = location_url;
}

function getPath(){
   isLogin = getCookie("logon");
   loginType = getCookie("lgins_connect_type");
   if ( isLogin == "on" ) {
      if ( loginType == null || loginType == "" ) loginType = "lgins/id";

      location_url = appprotocol + "://" + appserver + domain + "/" + loginType;
   }
   else {
      location_url = appprotocol + "://" + appserver + domain + "/lgins";
   }
   return location_url;
}


/* mod Author : Jung Y.h -- ÀûÇÏ°ü·Ã 
	top_js.inc ¿¡¼­ ÂüÁ¶
*/
function go_corp(u1, u2){
   isLogin = getCookie("logon_corp");
   loginType = getCookie("corp_connect_type");
   if ( isLogin == "on_corp") {
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
      if ( u2 == "login" ) {
          setCookie1("goto", u1);
          location_url = pubprotocol + "://" + pubserver + domain + "/btob/member/login_corp.html";
      }
      else {
          location_url = pubprotocol + "://" + pubserver + domain + u2;
      }
   }
   location = location_url;
}

function go_corp_auth(u1, u2){
   isLogin = getCookie("logon_corp");
   loginType = getCookie("corp_connect_type");
   if ( isLogin == "on_corp") {
      location_url = appprotocol + "://" + appserver + domain + "/" + loginType + u1;
   }
   else {
      if ( u2 == "login" ) {
          setCookie1("goto", u1);
          location_url = pubprotocol + "://" + pubserver + domain + "/btob/member/login_corp_auth.html";
      }
      else {
          location_url = pubprotocol + "://" + pubserver + domain + u2;
      }
   }
   location = location_url;
}

function go_auth( form ) {
   XecureSubmit( form );
}

function namosw_exchange_src() 
{ 
  str = namosw_exchange_src.arguments[0];
  str = (navigator.appName == 'Netscape') ? 'document.' + str : 'document.all.' + str;
  img = eval(str);
  if (img) {
    if (img.ori_src == null) {
      img.ori_src = img.src;
      img.src     = namosw_exchange_src.arguments[1];
    } else {
      var temp    = img.src;
      img.src     = img.ori_src;
      img.ori_src = temp;
    }
  } 
}

function namosw_preload_img()
{ 
  var img_list = namosw_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i];
  } 
}
function go_smartca(){
   isLogin = getCookie("logon");
   loginType = getCookie("lgins_connect_type");
   if ( isLogin == "on" ) {
      if ( loginType == null || loginType == "" ) loginType = "lgins-id";
      if ( loginType == "lgins-cert" )
         location_url = appprotocol + "://" + appserver + domain + "/smartca/docs/smartca-cert.html";
      else
         location_url = appprotocol + "://" + appserver + domain + "/smartca/docs/smartca-id.html";
   }
   else {
      setCookie1("goto", "smartca");
      location_url = pubprotocol + "://" + pubserver + domain + "/member/login_guide.shtml";
   }
   top.location = location_url;
}
    
function overmenu( img ){
   document.images[img].src = "/images/menu/" + img + "_on.gif";
}

function outmenu(img ){
   document.images[img].src = "/images/menu/" + img + "_off.gif";
}


function overimg( subname, dir ){

   inx = dir.lastIndexOf( "/" );
   img = dir.substring( inx + 1 );

   if( document.all ) {
      if ( document.images[img] == null ) return;
      document.images[img].src =  dir +  "_on.gif";
   }
   else if( document.layers ) {
      if ( document.layers[subname] == null || document.layers[subname].document.images[img] == null ) return;
      document.layers[subname].document.images[img].src =  dir  + "_on.gif";
   }
}

function outimg( subname, dir){
   inx = dir.lastIndexOf("/" );
   img = dir.substring( inx + 1 );

   if( document.all ) {
      if ( document.images[img] == null ) return;
      document.images[img].src =  dir + "_off.gif";
   }
   else if( document.layers ) {
      if ( document.layers[subname] == null || document.layers[subname].document.images[img] == null ) return;
      document.layers[subname].document.images[img].src = dir +  "_off.gif";
   }
}

function overicon( subname, dir, name ){

   inx = dir.lastIndexOf( "/" );
   img = dir.substring( inx + 1 );

   if( document.all ) {
      if ( document.images[name] == null ) return;
      document.images[name].src =  dir +  "_on.gif";
   }
   else if( document.layers ) {
      if ( document.layers[subname] == null || document.layers[subname].document.images[name] == null ) return;
      document.layers[subname].document.images[name].src =  dir  + "_on.gif";
   }
}

function outicon( subname, dir, name ){
   inx = dir.lastIndexOf("/" );
   img = dir.substring( inx + 1 );

   if( document.all ) {
      if ( document.images[name] == null ) return;
      document.images[name].src =  dir + "_off.gif";
   }
   else if( document.layers ) {
      if ( document.layers[subname] == null || document.layers[subname].document.images[name] == null ) return;
      document.layers[subname].document.images[name].src = dir +  "_off.gif";
   }
}
function preload() {
}
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 Winpopup(url,name,option) {
  sealWin=window.open(url,name,option);
}
