﻿var delaytime;
function DisplayResponse(a) {
  a = a.getElementsByTagName("search");
  var b = "";
  b += "<table border='0' width='600px' cellspacing='0' cellpadding='0'><tr><td><span class='headline'>Resultat af s\u00f8gningen</span></td></tr><tr><td colspan='3'>&nbsp;</td></tr></table><div>Din s\u00f8gning matchede ikke nogen produkter.<br /><br />Forslag:<br /><br /></div><div><a href='Search.aspx' target='_self' style='display: inline-block; color: DarkBlue; height: 14px;'>Anvend alfabetisk emneords-liste.</a><div style='padding-bottom: 10px; padding-top: 30px;'><table border='0' width='500px' cellspacing='0' cellpadding='0'><tr><td><span class='headline'>Mente du...?</span></td></tr></table></div></div>Forslag til s\u00f8gninger, der ligner det, du s\u00f8gte p\u00e5.";
  b += " <table border=0 cellpadding=2 cellspacing=1 class=gvTable >";
  if(a.length > 0)for(var c = 0;c < a.length;c++) {
    b += " <tr>";
    b += " <td class=gvItem >";
    b = b + "<a title='" + GetInnerText(a[c]) + "' href='kemidokumentation.aspx?searchword=" + GetInnerText(a[c]) + "' target='_self' >" + GetInnerText(a[c]) + "</a>";
    b += " </td>";
    b += "   </tr>"
  }else {
    b += "<tr>";
    b += "<td colspan=6 align=left>";
    b += "Ingen forslag til s\u00f8gningen!";
    b += "</td>";
    b += "</tr>"
  }b += " </table>";
  if (document.getElementById("gvSuggest") != null) { document.getElementById("gvSuggest").innerHTML = b }
}
function GetInnerText(a) {
  return a.textContent || a.innerText || a.text
}
function getmessagecontent() {
  messagecontent = "<table border=0 cellpadding=0 cellspacing=0 width=500px style='background-color:#E6E6E6;padding-left: 10px'><tr><td valign='top' ><div style='width: 120;text-decoration:none;text-align:left;cursor:default;background-color:#E6E6E6;color:black;font-size:1.0em;font-weight:bold'><b>Salgstekst:</b></div></td><td align=right><div style='width: 360px;text-decoration:none;text-align:right;cursor:default;background-color:#E6E6E6;color:black;font-size:1.0em;font-weight:bold' ><b>" + work_salgstekst + 
  "</b></div></td></tr></table>";
  messagecontent += "<table border=0 cellpadding=0 cellspacing=0 width=500px style='background-color:White;padding-left: 10px'><tr><td><div style='width: 240;text-decoration:none;text-align:left;cursor:default;background-color:white;color:black;font-size:1.0em;font-weight:bold'><b>Varenr.:</b></div></td><td align=right><div style='width: 240px;text-decoration:none;text-align:right;cursor:default;background-color:White;color:black;font-size:1.0em;font-weight:bold' ><b>" + work_matnr + "</b></div></td></tr></table>";
  messagecontent += "<table border=0 cellpadding=0 cellspacing=0 width=500px style='background-color:#E6E6E6;padding-left: 10px'><tr><td><div style='width: 240;text-decoration:none;text-align:left;cursor:default;background-color:#E6E6E6;color:black;font-size:1.0em;font-weight:bold'><b>Ordre tilv\u00e6kst:</b></div></td><td align=right><div style='width: 240px;text-decoration:none;text-align:right;cursor:default;background-color:#E6E6E6;color:black;font-size:1.0em;font-weight:bold' ><b>" + work_OrdreTilvaekst + 
  "</b></div></td></tr></table>";
  messagecontent += "<table border=0 cellpadding=0 cellspacing=0 width=500px style='background-color:white;padding-left: 10px'><tr><td><div style='width: 240;text-decoration:none;text-align:left;cursor:default;background-color:white;color:black;font-size:1.0em;font-weight:bold'><b>Mindste k\u00f8bsm\u00e6ngde:</b></div></td><td align=right><div style='width: 240px;text-decoration:none;text-align:right;cursor:default;background-color:White;color:black;font-size:1.0em;font-weight:bold' ><b>" + work_MinKvantum + 
  "</b></div></td></tr></table>";
  messagecontent += "<table border=0 cellpadding=0 cellspacing=0 width=500px style='background-color:#E6E6E6;padding-left: 10px'><tr><td><div style='width: 240;text-decoration:none;text-align:left;cursor:default;background-color:#E6E6E6;color:black;font-size:1.0em;font-weight:bold'><b>Salgsenhed:</b></div></td><td align=right><div style='width: 240px;text-decoration:none;text-align:right;cursor:default;background-color:#E6E6E6;color:black;font-size:1.0em;font-weight:bold' ><b>" + work_Salgsenhed + 
  "</b></div></td></tr></table>";
  messagecontent += "<table border=0 cellpadding=0 cellspacing=0 width=500px style='background-color:White;padding-left: 10px'><tr><td><div style='width: 240;text-decoration:none;text-align:left;cursor:default;background-color:white;color:black;font-size:1.0em;font-weight:bold'><b>EAN kode.:</b></div></td><td align=right><div style='width: 240px;text-decoration:none;text-align:right;cursor:default;background-color:White;color:black;font-size:1.0em;font-weight:bold' ><b>" + work_EANkode + "</b></div></td></tr></table>"
}
function delayCall(a, b, c, d, e, f, g, h, j) {
  delaytime = setTimeout(function() {
    doMouseOverAct(a, b, c, d, e, f, g, h, j)
  }, 500)
}
function doMouseOverAct(a, b, c, d, e, f, g, h, j) {
  work_matnr = b;
  work_descr = c;
  work_EANkode = d;
  work_Salgsenhed = e;
  work_MinKvantum = f;
  work_OrdreTilvaekst = g;
  work_PrisPr = h;
  work_salgstekst = j;
  getmessagecontent();
  newHTML = '<div style="padding: 5px; background-color: #FFF; border: 1px solid #888;">';
  newHTML = newHTML + "<table width=500px style='border-color: White; height: 49px;' border=0 cellspacing=0 cellpadding=0><tr valign=top style='height: 49px'><td style='width: 94px; height: 49px;' ><a href='http://www.wuerth.dk/web/da/home/Forside.html'><img src='App_Themes/wuerth/Images/wuerth-logo.gif' alt='' style='border: none'/></a></td><td style='height: 49px'><table cellpadding=0 cellspacing=0 border=0 width=405px><tr><td align=left valign=top ><table border=0 cellpadding=0 cellspacing=0 width=405px style='background-color:White'><tr><td align=right><div style='width: 240px; text-align: right; cursor: default; background-color: white;color: black; font-size: 8pt; font-weight: bold'><b>" + 
  work_matnr + "</b></div></td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=405px style='background-color:White'><tr><td align=right><div style='width: 405px; text-align: right; cursor: default; background-color: white;color: black; font-size: large; font-weight: bold'><b>" + work_descr + "</b></div></td></tr></table> </td></tr></table></td></tr></table><br/>";
  newHTML += messagecontent;
  newHTML = newHTML + '<div align="center" style="padding: 8px 2px 2px 2px;"><img src="' + a + '" border="0"></div>';
  newHTML += "</div>";
  a = document.getElementById("trailimageid");
  a.style.left = 0;
  a.style.top = 0;
  a.innerHTML = newHTML;
  a.style.visibility = "visible"
}
function delayCallExtra(a, b, c) {
  delaytime = setTimeout(function() {
    doMouseOverActExtra(a, b, c)
  }, 500)
}
function doMouseOverActExtra(a, b, c) {
  work_matnr = b;
  work_descr = c;
  newHTML = '<div style="padding: 5px; background-color: #FFF; border: 1px solid #888;">';
  newHTML = newHTML + "<table width=500px style='border-color: White; height: 49px;' border=0 cellspacing=0 cellpadding=0><tr valign=top style='height: 49px'><td style='width: 94px; height: 49px;' ><a href='http://www.wuerth.dk/web/da/home/Forside.html'><img src='App_Themes/wuerth/Images/wuerth-logo.gif' alt='' style='border: none'/></a></td><td style='height: 49px'><table cellpadding=0 cellspacing=0 border=0 width=405px><tr><td align=left valign=top ><table border=0 cellpadding=0 cellspacing=0 width=405px style='background-color:White'><tr><td align=right><div style='width: 240px; text-align: right; cursor: default; background-color: white;color: black; font-size: 8pt; font-weight: bold'><b>" + 
  work_matnr + "</b></div></td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=405px style='background-color:White'><tr><td align=right><div style='width: 405px; text-align: right; cursor: default; background-color: white;color: black; font-size: large; font-weight: bold'><b>" + work_descr + "</b></div></td></tr></table> </td></tr></table></td></tr></table><br/>";
  newHTML = newHTML + '<div align="center" style="padding: 8px 2px 2px 2px;"><img src="' + a + '" border="0"></div>';
  newHTML += "</div>";
  a = document.getElementById("trailimageid");
  a.style.left = 0;
  a.style.top = 0;
  a.innerHTML = newHTML;
  a.style.visibility = "visible"
}
function doMouseOutAct() {
  var a = document.getElementById("trailimageid");
  a.style.visibility = "hidden";
  a.innerHTML = "";
  clearTimeout(delaytime)
}
function ShowMList() {
  document.getElementById("ctl00_MainContents_divCheckBoxList").style.display = "block";
  document.getElementById("ctl00_MainContents_divCheckBoxListClose").style.display = "block"
}
function HideMList() {
  document.getElementById("ctl00_MainContents_divCheckBoxList").style.display = "none";
  document.getElementById("ctl00_MainContents_divCheckBoxListClose").style.display = "none"
}
function FindSelectedItems(a, b) {
  var c = document.getElementById(a.id);
  a = a.id + "_";
  c = c.rows.length;
  var d = "";
  for(i = 0;i < c;++i)if(document.getElementById(a + i).checked)d = d == "" ? document.getElementById(a + i).parentNode.innerText : d + "," + document.getElementById(a + i).parentNode.innerText;
  document.getElementById(b.id).value = d
}
function GetArticleImage(a, b) {
  a.onload = null;
  a.src = "http://www.wuerth.dk/produktinfo/ProductImageThumbnailer.ashx?ref=" + b + "&imagetype=Thumbnail"
}
function GetArticlePrimaryImage(a, b) {
  a.onload = null;
  a.src = "http://www.wuerth.dk/produktinfo/ImageThumbnailer.ashx?id=" + b + "&imagetype=Thumbnail"
}
function expandcollapseSubimglog(a, b) {
  b = document.getElementById(a);
  a = document.getElementById("img" + a);
  if(b.style.display == "none") {
    b.style.display = "block";
    a.src = "App_Themes/wuerth/Images/minus.gif"
  }else {
    b.style.display = "none";
    a.src = "App_Themes/wuerth/Images/plus.gif"
  }a.alt = ""
}
function expandcollapse(a, b) {
  b = document.getElementById(a);
  a = document.getElementById("img" + a);
  if(b.style.display == "none") {
    b.style.display = "block";
    a.src = "App_Themes/wuerth/Images/b_collapse.gif";
    a.alt = "";
    a.height = "16";
    a.width = "67"
  }else {
    b.style.display = "none";
    a.src = "App_Themes/wuerth/Images/b_expand.gif";
    a.alt = "";
    a.height = "16";
    a.width = "39"
  }
}
function expandcollapseSub(a, b) {
  b = document.getElementById(a);
  a = document.getElementById("img" + a);
  if(b.style.display == "none") {
    b.style.display = "block";
    a.src = "App_Themes/wuerth/Images/minus.gif"
  }else {
    b.style.display = "none";
    a.src = "App_Themes/wuerth/Images/plus.gif"
  }a.alt = ""
}

function expandcollapseSubvaerne(a, b) {
  b = document.getElementById("vaernediv" + a);
  a = document.getElementById("imgvaerne" + a);
  if(b.style.display == "none") {
    b.style.display = "block";
    a.src = "App_Themes/wuerth/Images/minus.gif"
  }else {
    b.style.display = "none";
    a.src = "App_Themes/wuerth/Images/plus.gif"
  }a.alt = ""
}
function IAmSelected(a, b) {
  document.getElementById("ctl00_MainContents_btnsearchbutton").click()
}
function KeyDownHandler() {
  document.getElementById("ctl00_MainContents_myAnimatedImage").src = "App_Themes/wuerth/Images/spinner.gif"
}
function KeyUpHandler() {
  var a = document.getElementById("ctl00_MainContents_searchTextBox"), b = document.getElementById("ctl00_MainContents_myAnimatedImage");
  if(a.value.length > 0)b.src = "App_Themes/wuerth/Images/clear.gif";
  else if(a.value.length == 0)b.src = "App_Themes/wuerth/Images/blind.gif"
}
function showDiv() {
  document.getElementById("myHiddenDiv").style.display = "";
  setTimeout('document.images["ctl00_MainContents_myAnimatedImage"].src="App_Themes/wuerth/Images/spinner.gif"', 100)
}
function clearAndFocus(a) {
  document.getElementById("ctl00_MainContents_myAnimatedImage").src = "App_Themes/wuerth/Images/blind.gif";
  a.value = "";
  a.focus()
}
function Left(a, b) {
  return b <= 0 ? "" : b > String(a).length ? a : String(a).substring(0, b)
}
function Right(a, b) {
  if(b <= 0)return"";
  else if(b > String(a).length)return a;
  else {
    var c = String(a).length;
    return String(a).substring(c, c - b)
  }
}
;
