// ImgPreload:
//
function ImgPreload()
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=false,isN6=false,isIE=false;
  if (document.all && appVer >= 4) isIE=true; else
    if (document.getElementById && appVer > 4) isN6=true; else
      if (document.layers && appVer >= 4) isNC=true;
  if (isNC||isN6||isIE)
  {
    if (document.images)
    {
      var imgName = ImgPreload.arguments[0];
      var cnt;
      swImg[imgName] = new Array;
      for (cnt = 1; cnt < ImgPreload.arguments.length; cnt++)
      {
        swImg[imgName][ImgPreload.arguments[cnt]] = new Image();
        swImg[imgName][ImgPreload.arguments[cnt]].src = ImgPreload.arguments[cnt];
      }
    }
  }
}
// ImgFind:
//
function ImgFind(doc, imgName)
{
  for (var i=0; i < doc.layers.length; i++)
  {
    var img = doc.layers[i].document.images[imgName];
    if (!img) img = ImgFind(doc.layers[i], imgName);
    if (img) return img;
  }
  return null;
}
// ImgSwap:
//
function ImgSwap(imgName, imgSrc)
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=false,isN6=false,isIE=false;
  if (document.all && appVer >= 4) isIE=true; else
    if (document.getElementById && appVer > 4) isN6=true; else
      if (document.layers && appVer >= 4) isNC=true;
  if (isNC||isN6||isIE)
  {
    if (document.images)
    {
      var img = document.images[imgName];
      if (!img) img = ImgFind(document, imgName);
      if (img) img.src = imgSrc;
    }
  }
}
var swImg; swImg=new Array;


ImgPreload('INQ', 'img/h_inquiry.gif', 'img/h_inquiry_on.gif');
ImgPreload('HOME', 'img/h_home.gif', 'img/h_home_on.gif');

//
// Cookie : setCookie(keyword,val) & getCookie(keyword)
//
function setCookie(keyname,val) {
   var tmp = keyname+"="+escape(val)+";";
   document.cookie = tmp;
   }
function getCookie(keyname) {
   var tmp = document.cookie + ";";
   var index1 = tmp.indexOf(keyname,0);
   if(index1 != -1) {
      tmp = tmp.substring(index1,tmp.length);
      index2 = tmp.indexOf("=",0);
      index3 = tmp.indexOf(";",index2);
      return unescape(tmp.substring(index2+1,index3));
      }
   return "";
   }

