<!--
//* Country ID
var SiteCode = "EMC"

//* Variables formally web parameters
var DnBCopyRight = "&copy; Dun & Bradstreet Inc., 2000-2009. All Rights Reserved"

//* e-mail addresses
var EMCEmail = "emc@dnb.com" ;
var TracersEmail = "emctracers@dnb.com" ;

var mthEN = new Array("January","February","March","April","May","June","July","August","September","October","November","December")

//*************************************************************
//* Show DunsRight Number in right format
//*************************************************************
function ShowNumber(num, ch) {
 ch2 = "";
 n2 = eval("DR" + num);

 for (i = 0; i < n2.length; i++)
 if (n2.charAt(i) ==',')
  ch2 += ch;
 else
  ch2 += n2.charAt(i);

 document.write(ch2);
}

//* Language Page or default home page
var defLangPage = "ChkLang.htm";

//* Set expiry date for cookies. 
var today = new Date();
var exp = new Date(today.getTime() + 365 * 86400000);

//*************************************************************
//* CopyRight, companies
//*************************************************************
function copyRight() {
  document.write(DnBCopyRight);
}

function companies() {
//  document.write(DnBCompanies);  
// var cmp = Get_Cookie("Companies");
 var cmp = eval("DR1");
 document.write(cmp);
}

//*************************************************************
//* This function shows the specified layer
//*************************************************************
function showLayer(lName) {
  document.getElementById([lName]).style.visibility='visible';
}

//*************************************************************
//* This function hides the specified layer
//*************************************************************
function hideLayer(lName) {
  document.getElementById([lName]).style.visibility='hidden';
}

//*************************************************************
//* This function pops up a layer at a specifed to position.
//*************************************************************
function popLayer(lName, pos){
  document.getElementById([lName]).style.top=pos;
  showLayer(lName);
}

//*************************************************************
//* This function activates an image to replace another
//*************************************************************
  function img_act(imgName, imgBase) {
    if (document.images) {
      imgOn = eval(imgName + "on.src");
      document[imgBase].src = imgOn ;
    }
  } 
  
  function img_inact(imgName) {
    if (document.images) {
      imgOff = eval(imgName + "off.src");
      document[imgName].src = imgOff ;
    }
  }

//*************************************************************
//* This functions pops up the DMI interactive demo window
//* that is located in the DBAI web site. 
//*************************************************************
function dmiPopup(Lang) {
  dmilink = "https://www.dbai.dnb.com/decmak/popup.asp?Lang=" ;
  dmilink = dmilink + Lang ;
  window.open(dmilink,'','directories=0,location=0,menubar=0,scrollbars=0,status=0,toolbar=0,resizable=0,width=650,height=550');
}

//*************************************************************
//* Writes out the country name
//*************************************************************
function CtryName(typ, Lang) {
  if (typ == "N") {
    cStr = eval("cntry" + Lang);	
    document.write(cStr);
  }
  if (typ == "A") {
    cStr = eval("cntrya" + Lang);	
    document.write(cStr);
  }
}

//*************************************************************
//* Writes out the correct email string based on the type of
//* address required.  
//*************************************************************
function MailAddr(typ, subj) {
  if (subj == null) {
    subj = " " ; }

  if (typ=="emc") {
    document.write('<a href="mailto:' + EMCEmail + '?Subject=' + subj + '">' + EMCEmail + '</a>');
  } 

  if (typ=="trace") {
    document.write('<a href="mailto:' + TracersEmail + '?Subject=' + subj + '">' + TracersEmail + '</a>');
  } 

}


//*************************************************************
//* This function is driven from the real estate (Frame Main)
//* to fill the left navigation bar (Frame Contents)
//*************************************************************
function LinkLeft(Page) {
  if (parent.frames.length!=0) {
    parent.frames['contents'].location.replace(Page);
  }
}


//*************************************************************
//* This function is driven from the real estate (Frame Main)
//* to fill the top navigation bar (Frame SectionHeader)
//*************************************************************
function LinkTop(Page) {
  if (parent.frames.length!=0) {
    parent.frames['sectionheader'].location.replace(Page);
  }
  else {
    var URLTemp ;
    URLTemp = location.pathname ;
    window.location.href = "../default.htm?Loc=" + URLTemp;
  }
}

//*************************************************************
//* This function checks to see if the Loc parameter is 
//* specifed on the frame URL and then selects the correct
//* page.  It is used when a user calls a page in the web directly
//* so that the Frame environment can be loaded. 
//*************************************************************
function checkLoc() {
  if (parent.location.search) {
    sArray = parent.location.search.split("=") ;
    NewLoc = sArray[1] ;
    location.replace(NewLoc) ;
  }  
}

//*************************************************************
//* This replaces the page with the passed URL
//*************************************************************
function LinkNow(Page) {
  location.replace(Page) ;
}

//*************************************************************
//* This function pops up a new window with no toolbars etc.
//*************************************************************
function popUpN(URL, ScrollBars, ReSizable, Width, Height) {
  if (ScrollBars == null) { 
    ScrollBars = "yes" ;
  }
  if (ReSizable == null) { 
    ReSizable = "yes" ;
  }
  if (Width == null) { 
    Width = "640" ;
  }
  if (Height == null) { 
    Height = "400" ;
  }
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=no,scrollbars=" + ScrollBars + ",location=no,statusbars=no,menubar=no,resizable=" + ReSizable + ",width=" + Width + ",height=" + Height + ",left=100,top=100');");
}

//*************************************************************
//* This function pops up a new window with no toolbars etc.
//*************************************************************
function popUpDuns(URL, ScrollBars, ReSizable, Width, Height) {
  if (ScrollBars == null) { 
    ScrollBars = "yes" ;
  }
  if (ReSizable == null) { 
    ReSizable = "yes" ;
  }
  if (Width == null) { 
    Width = "640" ;
  }
  if (Height == null) { 
    Height = "400" ;
  }
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=no,scrollbars=" + ScrollBars + ",location=no,statusbars=no,menubar=no,resizable=" + ReSizable + ",width=" + Width + ",height=" + Height + ",left=450,top=400');");
}
//*************************************************************
//* This function takes a value from a pull down combo box and then 
//* calls the popUpN function to put that page into a new window.
//*************************************************************
function changePageTo(selector) {
  var s = selector.options[selector.selectedIndex].value;
  if (s) { popUpN(s)  }
}

//*************************************************************
//* This function takes a value from a pull down combo box and
//* then drives that page into the parent.
//*************************************************************
function changePage(selector) {
  var s = selector.options[selector.selectedIndex].value;
  if (s) { parent.location = s  }
}

//*************************************************************
//* This function takes the two letter country code from a 
//* pull down list, constructs the URL and drives that in the 
//* _Top frame. 
//*************************************************************
function countryPage(selector) {
  var s = "http://www.dnb.com/" + selector.options[selector.selectedIndex].value;
  if (s) { parent.location = s  }
}

//*************************************************************
//* This function checks to see if the preferred lanaguage has
//* already been set in a cookie - if so, the preferred home
//* page is displayed.  If not, the language selection page
//* is shown or a default language.
//*************************************************************
function checkLang() {
  var LangID = "pLang" + SiteCode ;
  var pLang = Get_Cookie(LangID);
  if (pLang == null) {
    window.location.replace(defLangPage)
  }
  else {
    var pPage = pLang + "/default.htm"  
    window.location.replace(pPage)
  }
}

//*************************************************************
//* This function sets the preferred langauge in a cookie and
//* then displays the correct home page - from the chklang.htm
//* page
//*************************************************************
function setLang(sLang) {
  var LangID = "pLang" + SiteCode ;
  if (document.frmLangSave.chkLangSave.checked == true){
    Delete_Cookie(LangID, '/') ;
    Set_Cookie(LangID, sLang, exp, '/') ;
  }
  var pPage = sLang + "/default.htm"  ;
  window.location.replace(pPage) ;
}

//*************************************************************
//* This function sets the preferred language in a cookie and
//* then displays the correct home page - from the main menu.
//*************************************************************
function setNLang(sLang) {
  var LangID = "pLang" + SiteCode ;
  var pLang = Get_Cookie(LangID);
  if (pLang != null) { 
    Delete_Cookie(LangID, '/') ;
    Set_Cookie(LangID, sLang, exp, '/') ;
  }
  var pPage = "../" + sLang + "/default.htm"  ;
  parent.location.replace(pPage) ;
}

//*************************************************************
//* This function gets a cookie value
//*************************************************************
function Get_Cookie(name) {
  var start = document.cookie.indexOf(name+"=");
  var len = start+name.length+1;
  if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
  if (start == -1) return null;
  var end = document.cookie.indexOf(";",len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}

//*************************************************************
//* This function sets a cookie value
//*************************************************************
function Set_Cookie(name,value,expires,path,domain,secure) {
  if (path == "undefined" || path == null) {
    path = "/" ;    	
  }
  document.cookie = name + "=" +escape(value) +
    ( (expires) ? ";expires=" + expires.toGMTString() : "") +
    ( (path) ? ";path=" + path : "") + 
    ( (domain) ? ";domain=" + domain : "") +
    ( (secure) ? ";secure" : "");
}

//*************************************************************
//* This function deletes a cookie value
//*************************************************************
function Delete_Cookie(name,path,domain) {
  if (Get_Cookie(name)) document.cookie = name + "=" +
    ( (path) ? ";path=" + path : "") +
    ( (domain) ? ";domain=" + domain : "") +
    ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}

//*************************************************************
//* This function checks to see if cookies are enabled. 
//*************************************************************
function isCookieEnabled() {
   if (document.all) return navigator.cookieEnabled;
   var today = new Date();
   Set_Cookie('testcookie',today.getTime());
   var tc = Get_Cookie('testcookie');
   Delete_Cookie('testcookie');
   return (tc == today.getTime());
}

//*************************************************************
//* This function is only used in Isabel to select the correct 
//* after the terms and conditions have been accepted. 
//*************************************************************
function AcceptTC(Lang) {
  if (Lang == 'EN') { location.href = "../Isabel2DBAI/servlet/Isabel2DBAI?Lang=English&Origin=TC" }
  if (Lang == 'DU') { location.href = "../Isabel2DBAI/servlet/Isabel2DBAI?Lang=Dutch&Origin=TC" }
  if (Lang == 'FR') { location.href = "../Isabel2DBAI/servlet/Isabel2DBAI?Lang=French&Origin=TC" }
}

//*************************************************************
//* This function is only used in Isabel to return to the
//* home page if the terms and conditions are rejected.
//*************************************************************
function DeclineTC(Lang) {
  eval(location.href = "../default.asp?Lang="+Lang)
}

// -->