function asEmailAddy( userName, realName ){
  var emailserver = 'TrendZ.dk';

  document.write('<a href="mailto:' + userName + '@' + emailserver + '" ');
  document.write('tooltip="<nobr><b>Kontakt ' + realName + '</b></nobr><br>Tryk på linket, og send en mail direkte til ' + realName + '">' + userName + '@' + emailserver + '</a>');
}
  
function writeFooter(){
  document.writeln('    <table bgcolor="white" align="center" width="772" height="32" border="0" cellpadding="0" cellspacing="0" style="Border-right: solid black 1px;Border-left: solid black 1px;Margin-right:20px">');
  document.writeln('      <tr>');
  document.writeln('        <td width="640" align="left" style="Background: Url(\'/images/copyright.gif\') center center no-repeat">');
  document.writeln('          <div style="position:relative">');
  document.writeln('            <iframe src="printPage.htm" id="printFrame" height="0" border="0" frameborder="0" framespacing="0" hspace="0" marginheight="0" marginwidth="0" noresize scrolling="no" width="0"></iframe>');
  document.writeln('            <div style="position:absolute;top:-7px;left:175px;z-index:3"><a href="javascript:void(0);" onClick="makeHomePage(); return true;"><img name="image1" src="/images/home.gif" border="0" style="filter:alpha(opacity=0)" onMouseover="high1(this)" onMouseout="low1(this)"></a></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:215px;z-index:3"><a href="javascript:void(0);" onClick="addBookmark(); return true;"><img name="image2" src="/images/favorites.gif" border="0" style="filter:alpha(opacity=0)" onMouseover="high2(this)" onMouseout="low2(this)"></a></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:440px;z-index:3"><a href="mailto:Info@TrendZ.dk"><img name="image3" src="/images/mail.gif" border="0" style="filter:alpha(opacity=0)" onMouseover="high3(this)" onMouseout="low3(this)"></a></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:480px;z-index:3"><a href="javascript:void(0);" onClick="DocPrint(); return false;"><img name="image4" src="/images/print.gif" border="0" style="filter:alpha(opacity=0)" onMouseover="high4(this)" onMouseout="low4(this)"></a></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:175px;z-index:2"><img src="/images/home0.gif"></a></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:215px;z-index:2"><img src="/images/favorites0.gif"></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:440px;z-index:2"><img src="/images/mail0.gif"></div>');
  document.writeln('            <div style="position:absolute;top:-7px;left:480px;z-index:2"><img src="/images/print0.gif"></div>');
  document.writeln('          </div>');
  document.writeln('        </td>');
  document.writeln('        <td width="130" align="center"><img src="/images/language.gif" style="filter:alpha(opacity=25)"></td>');
  document.writeln('      </tr>');
  document.writeln('    </table>');
  image1.filters.alpha.opacity = 0;
  image2.filters.alpha.opacity = 0;
  image3.filters.alpha.opacity = 0;
  image4.filters.alpha.opacity = 0;  
}

function DropACookie(name1, name2, value) {
  if ((name1 != '') && (name2 != ''))
    cookieJar.location.href = 'include/DropACookie.asp?name1=' + name1 +'&name2='+ name2 +'&value='+ value;
}

var hasMenu = false;
var refreshCount = 0;

function clickIE() {
  if (document.all) {
    return false;
  }
}

function clickNS(e) {
  if (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {
      return false;
    }
  }
}

if (document.layers) {
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS;
}else{
  document.onmouseup=clickNS;
  document.oncontextmenu=clickIE;
}

function disableselect(e){
  return false
}

function reEnable(){
  return true
}

document.onselectstart=new Function ("return false")

if (window.sidebar){
  document.onmousedown=disableselect
  document.onclick=reEnable
}

function ajustContent(){
  contentLayer.style.height = document.body.clientHeight-190;
  contentTable.style.height = document.body.clientHeight-189;
  contentLayer.style.left = (document.body.clientWidth-780)/2;
  contentTable3.height = document.body.clientHeight-189;
  contentTable2.height = document.body.clientHeight-189;
  contentTable.height = document.body.clientHeight-189;  
}

function checkUP(){
  contentLayer.style.left = (document.body.clientWidth-780)/2;
  contentLayer.style.height = document.body.clientHeight-190;
  contentTable3.height = document.body.clientHeight-189;
  contentTable2.height = document.body.clientHeight-189;
  contentTable.height = document.body.clientHeight-189;
}

var NS4 = (document.layers);    // Which browser?
var IE4 = (document.all);

var win = self;    // window to search.
var n   = 0;

function findInPage(str) {
  var txt, i, found;
  if (str == "")
    return false;
  if (IE4) {
    document.onselectstart = "";
    txt = document.body.createTextRange();
    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }
    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      n++;
    } else {
      if (n > 0) {
        n = 0;
        findInPage(str);
      } else {
        alert("Ingen Match Fundet.");
      }
      pSearch.SearchFor.focus();
      pSearch.SearchFor.select();                  
    }
  }
  document.onselectstart=new Function ("return false")
  return false;
}

function DocPrint(){
  var watchTxt = watchCell.innerHTML;
  watchCell.innerHTML = '';
  printFrame.document.title = document.title;
  printFrame.printContent.innerHTML = ThisIsIt.innerHTML;
  printFrame.focus();
  printFrame.print();
  watchCell.innerHTML = watchTxt;
}

function high1(which1){
  theobject1=which1;
  if (window.low1lighting)
    clearInterval(low1lighting);
  high1lighting=setInterval("high12(theobject1)",1);
}

function high2(which2){
  theobject2=which2;
  if (window.low2lighting)
    clearInterval(low2lighting);
  high2lighting=setInterval("high22(theobject2)",1);
}

function high3(which3){
  theobject3=which3;
  if (window.low3lighting)
    clearInterval(low3lighting);
  high3lighting=setInterval("high32(theobject3)",1);
}

function high4(which4){
  theobject4=which4;
  if (window.low4lighting)
    clearInterval(low4lighting);
  high4lighting=setInterval("high42(theobject4)",1);
}

function low1(lwhich1){
  thelobject1=lwhich1;
  if (window.high1lighting)
    clearInterval(high1lighting);
  low1lighting=setInterval("low12(thelobject1)",1);
}

function low2(lwhich2){
  thelobject2=lwhich2;
  if (window.high2lighting)
    clearInterval(high2lighting);
  low2lighting=setInterval("low22(thelobject2)",1);
}

function low3(lwhich3){
  thelobject3=lwhich3;
  if (window.high3lighting)
    clearInterval(high3lighting);
  low3lighting=setInterval("low32(thelobject3)",1);
}

function low4(lwhich4){
  thelobject4=lwhich4;
  if (window.high4lighting)
    clearInterval(high4lighting);
  low4lighting=setInterval("low42(thelobject4)",1);
}

function high12(hcur1){
  if (hcur1.filters.alpha.opacity<100)
    hcur1.filters.alpha.opacity+=10;
  if (hcur1.filters.alpha.opacity>99 && window.high1lighting) {
    clearInterval(high1lighting);
  }
}

function high22(hcur2){
  if (hcur2.filters.alpha.opacity<100)
    hcur2.filters.alpha.opacity+=10;
  if (hcur2.filters.alpha.opacity>99 && window.high2lighting) {
    clearInterval(high2lighting);
  }
}

function high32(hcur3){
  if (hcur3.filters.alpha.opacity<100)
    hcur3.filters.alpha.opacity+=10;
  if (hcur3.filters.alpha.opacity>99 && window.high3lighting) {
    clearInterval(high3lighting);
  }
}

function high42(hcur4){
  if (hcur4.filters.alpha.opacity<100)
    hcur4.filters.alpha.opacity+=10;
  if (hcur4.filters.alpha.opacity>99 && window.high4lighting) {
    clearInterval(high4lighting);
  }
}
        
function low12(lcur1){
  if (lcur1.filters.alpha.opacity>0)
    lcur1.filters.alpha.opacity-=5;
  if (lcur1.filters.alpha.opacity<5 && window.low1lighting) {
    clearInterval(low1lighting);
  }
}

function low22(lcur2){
  if (lcur2.filters.alpha.opacity>0)
    lcur2.filters.alpha.opacity-=5;
  if (lcur2.filters.alpha.opacity<5 && window.low2lighting) {
    clearInterval(low2lighting);
  }
}

function low32(lcur3){
  if (lcur3.filters.alpha.opacity>0)
    lcur3.filters.alpha.opacity-=5;
  if (lcur3.filters.alpha.opacity<5 && window.low3lighting) {
    clearInterval(low3lighting);
  }
}

function low42(lcur4){
  if (lcur4.filters.alpha.opacity>0)
    lcur4.filters.alpha.opacity-=5;
  if (lcur4.filters.alpha.opacity<5 && window.low4lighting) {
    clearInterval(low4lighting);
  }
}
        
var ThisUrl="http://www.Trend-Z.dk";
var ThisTitle='www.Trend-Z.dk';
            
var HomeUrl="http://www.Trend-Z.dk/";
var HomeTitle='www.Trend-Z.dk';

function addBookmark(){
  if (document.all)
    window.external.AddFavorite(ThisUrl,ThisTitle);
  else if (window.sidebar&&window.sidebar.addPanel)
    window.sidebar.addPanel(ThisTitle,ThisUrl,"");
  else
    alert('Denne funktion understøttes kun af Internet Explorer 4+ og Netscape 6\nAndre brugere bør trykke "Ctrl + D".\nVi beklager ulejligheden.');
}

function makeHomePage(){
  if (document.all){
    document.body.style.behavior='url(#default#homepage)';document.body.setHomePage(ThisUrl);
  }else{
    alert('Denne funktion understøttes kun af Internet Explorer 4+.\nNetscape brugere skal vælge "Edit -> Preferences..." og klikke på knappen "Use current page".');
  }
}

function SetCookie (name, value) {
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +
  ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  ((path == null) ? "" : ("; path=" + path)) +
  ((domain == null) ? "" : ("; domain=" + domain)) +
  ((secure == true) ? "; secure" : "");
}

function SetMultiCookie (name1, name2, value) {
  if (name1 == '')
    return
  if (name2 == '')
    return
  if (value == undefined)
    return

  var argv = SetMultiCookie.arguments;
  var argc = SetMultiCookie.arguments.length;
  var expires = (argc > 3) ? argv[3] : null;
  var path = (argc > 4) ? argv[4] : null;
  var domain = (argc > 5) ? argv[5] : null;
  var secure = (argc > 6) ? argv[6] : false;
  var oldCookie = GetCookie (name1)
  var AnotherTestvar1,AnotherTestvar2 = '';
  
  if (oldCookie == null) {
    document.cookie = name1 + "=" + name2 + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
  } else {
    if (oldCookie.indexOf("&") < 1) {
      
      document.cookie = name1 + "=" + oldCookie + "&" + name2 + "=" + escape (value) +
      ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
    } else {
      var i = 0;
      oldCookie = oldCookie.split("&");
      for (i=0 ; i < oldCookie.length ; i++) {
        AnotherTestvar1 = oldCookie[i].split("=");
        if ((AnotherTestvar1[0] != name2) && (AnotherTestvar1[1] != ''))
          AnotherTestvar2 += AnotherTestvar1[0] + "=" + escape(AnotherTestvar1[1]) + "&"
      }
      if (value != '')
        AnotherTestvar2 += name2 + "=" + escape(value)
      document.cookie = name1 + "=" + AnotherTestvar2 +
      ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
    }
  }
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }  
  return null;
}

function DeleteCookie (name) {
  var exp = new Date();
  exp.setTime (exp.getTime() - 1);
  // This cookie is history
  var cval = GetCookie (name);
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var expDays = 30;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));