<!--
//* Country ID
var SiteCode = "FI"

//* Variables formally web parameters
var DnBCopyRight = "© Dun & Bradstreet Inc., 2000-2009. All Rights Reserved"
var DnBTradeTel = "+ 358 9 2534 4400"
var DnBMarketingTel = "+ 358 9 2534 4400"
var DnBCustomerServiceTel = "+ 358 9 2534 4400"

//* e-mail addresses
var CustServEmail = "asiakaspalvelu@dnbnordic.com" ;
var MarketingEmail = "asiakaspalvelu@dnbnordic.com" ;
var UserAdminEmail = "asiakaspalvelu@dnbnordic.com" ;
var HelpDeskEmail = "asiakaspalvelu@dnbnordic.com" ;

//* Country Lietrals
var cntryEN = "Finland";
var cntryFI = "Suomi";

var cntryaEN = "Finnish";
var cntryaFI = "suomeksi";

var mthEN = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var mthFI = new Array("tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu")

//*************************************************************
//* 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, tradeTel 
//*************************************************************
function copyRight() {
  document.write(DnBCopyRight);
}

function companies() {
//  document.write(DnBCompanies);  
 var cmp = eval("DR1");
 document.write(cmp);
}

function tradeTel() {
  document.write(DnBTradeTel);
}

function MarketingTel() {
  document.write(DnBMarketingTel);
}

function CustomerServiceTel() {
  document.write(DnBCustomerServiceTel);
}

//*************************************************************
//* 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=="cs") {
    document.write('<a href="mailto:' + CustServEmail + '?Subject=' + subj + '">' + CustServEmail + '</a>');
  } 

  if (typ=="mk") {
    document.write('<a href="mailto:' + MarketingEmail + '?Subject=' + subj + '">' + MarketingEmail + '</a>');
  } 

  if (typ=="ua") {
    document.write('<a href="mailto:' + UserAdminEmail + '?Subject=' + subj + '">' + UserAdminEmail + '</a>');
  } 

  if (typ=="hd") {
    document.write('<a href="mailto:' + HelpDeskEmail + '?Subject=' + subj + '">' + HelpDeskEmail + '</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');");
}

function popUpTitle(heading, imgDir){
  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
  document.write('  <tr height="75">');
  document.write('    <td width="175" class="headnav" align="center" valign="top">');
  document.write('    <img border="0" src="' + imgDir + '/images/dnb_web_signature.gif" width="135" height="75"></td>');
  document.write('    <td width="100%" class="headnav">');
  document.write('    <h1>' + heading + '</h1>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('</table>');
}

//*************************************************************
//* 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) { 
    selector.selectedIndex = 0 ;
    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)
}

//*************************************************************
//* This function takes a value from a pull down combo box and
//* then drives that page into specified target.
//*************************************************************
function changePageNews(selector) {
  var s = selector.options[selector.selectedIndex].value;
  sArray = s.split(",")
  if (sArray[0]) { 
    selector.selectedIndex = 0 ;
    if (sArray[1] == "_top") {
      parent.location = sArray[0] ;
    }
    else {
      if (sArray[1] == "_blank") {
        window.open(sArray[0]);
      }
      else {
        parent.main.location.href = sArray[0] ;
      }
    }
  }
}
//***************************************************************
//* This functions pops up the OLA search window for Finland
//***************************************************************
function OlaPopup(Lang, Search) {

//   olalink = "http://dnb" + Lang + ".custhelp.com/cgi-bin/dnb"+ Lang + ".cfg/php/enduser/std_alp.php"; 
  olalink = 'http://dnb'+ Lang + '.custhelp.com/cgi-bin/dnb'+ Lang + '.cfg/php/enduser/std_alp.php?p_new_search=1&p_scf_' ;

// if (Lang=="en") {
//   olalink = olalink + "?p_new_search=1&p_scf_c_country_" + Lang + "=26&" ;

//  } 
// if (Lang=="fi") {
   olalink = olalink + "3=26" ;
//  } 
  
 if (Search != null) {
    strSearch = ""
    for (i=0; i<Search.length; i++) {
      t = Search.charAt(i);
      if (t == '+') {
        t='%2B'
      }
      strSearch = strSearch + t
    }
    olalink = olalink + 'p_search_text=xSTA %2B' + strSearch ;
  }

  window.open(olalink);
}
// -->