<!--
//* Country ID
var SiteCode = "SE"

//* Variables formally web parameters
var DnBCopyRight = "© Dun & Bradstreet Inc., 2000-2006. All Rights Reserved"
var DnBCompanies = "109"
var DnBTradeTel = "+46 (0)8-5190 1350"
var DnBMarketingTel = "+46 (0)8-5190 1350"
var DnBCustomerServiceTel = "+46 (0)8-5190 1350"

//* e-mail addresses
var CustServEmail = "kundservice.sweden@dnbnordic.com" ;
var MarketingEmail = "kundservice.sweden@dnbnordic.com" ;
var UserAdminEmail = "kundservice.sweden@dnbnordic.com" ;
var HelpDeskEmail = "kundservice.sweden@dnbnordic.com" ;

//* Country Lietrals
var cntryEN = "Sweden";
var cntrySE = "Sverige";

var cntryaEN = "Swedish";
var cntryaSE = "Svenska";

var mthEN = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var mthSE = new Array("Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","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, tradeTel 
//*************************************************************
function copyRight() {
  document.write(DnBCopyRight);
}

function companies() {
  document.write(DnBCompanies);
}

function tradeTel() {
  document.write(DnBTradeTel);
}

function MarketingTel() {
  document.write(DnBMarketingTel);
}

function CustomerServiceTel() {
  document.write(DnBCustomerServiceTel);
}

//*************************************************************
//* Button Stuff
//*************************************************************
buttgCol="dddddd"
buttfCol="444444"


function MakeButton(text,id,link,target,wid,colStem,align){
  linkText = ""
  if (link != null){
    linkText = "'" + link + "'" ;
  }
  tgtText = "location.href=" + linkText;
  if (target != null){
    if (target == "_top"){
      tgtText = "top.location.href=" + linkText;
    }
    else if (target == "_blank"){
      tgtText = "window.open(" + linkText + ")";
    }
    else if (target != "") { 
      tgtText = "parent." + target + ".location.replace(" + linkText + ")";
    }
  }
  widText = ""
  if (wid != null && wid != ''){
    wid = wid - 12;
    widText = 'width="' + wid + '" ' ;
  }
  colText = "'butt'"
  if (colStem != null && colStem != ''){
    colText = "'" + colStem + "'";
  }
  alignText = "center"
  if (align != null){
    alignText = align ;
 }
 //alert('onmouseover="ShowBOver(this,' + colText + ')"')
  document.write('<table cellspacing="0" cellpadding="5" border="0" style="border-collapse: collapse" bordercolor="#cccccc">') ;
  document.write('<tr class="' + eval(colText) + '" onclick="' + tgtText + '" onmouseover="ShowBOver(this,' + colText + ')" onmouseout="HideBOver(this)">') ;
  document.write('<td class="butt" align="' + alignText + '"' + widText + 'id="' + id + '" style="cursor:pointer;">') ;
  document.write('<nobr><font face="Arial">&#9658;</font> ' + text + '</nobr></td>') ;
  document.write('</tr></table>') ;
}


function ShowBOver(sectionnumber,col) {
//alert(col);
  sectionnumber.style.backgroundColor=eval(col + 'gCol');
  sectionnumber.style.color=eval(col + 'fCol');
}
function HideBOver(sectionnumber) {
  sectionnumber.style.backgroundColor='';
  sectionnumber.style.color='';
}

//*************************************************************
//* 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 functions pops up the OLA search window for Sweden
//***************************************************************
function OlaPopup(Lang, Search) {

   olalink = "http://dnb" + Lang + ".custhelp.com/cgi-bin/dnb"+ Lang + ".cfg/php/enduser/std_alp.php" ;
 if (Lang=="en") {
   olalink = olalink + "?p_new_search=1&p_scf_c_country_" + Lang + "=35&" ;
  } 

 if (Lang=="se") {
   olalink = olalink + "?" ;
  } 


 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);
}
// -->

