function swapLanguage(f) { var d = location.toString(); if (d.toLowerCase().indexOf("/" + info.lang + "/") > -1) { var c = new RegExp("/" + info.lang + "/", "i"); var a = d.replace(c, "/" + f + "/"); window.open(a, "_self") } else { window.open(d.replace(".html", "/" + f + "/index.html"), "_self") } } function printToday() { var a = new Date(); document.write(WriteDateFormat(a)) } function WriteDateFormat(a) { var c = DisplayLongDateFormat; return c.replace("%yyyy", a.getFullYear()).replace("%MMMM", MonthLongMapping[a.getMonth()]).replace("%d", a.getDate()).replace("%WWWW", WeekLongMapping[a.getDay()]) } function RedirectHome() { location = "/" + info.lang + "/home.html" } function removeClass(c, a) { $(c).removeClassName(a) } function addClass(c, a) { $(c).addClassName(a) } function isEmpty(a) { return $(a).value.blank() } function displaySearchTypeDropBoxList(a) { if (collapseSearchType != null) { clearInterval(collapseSearchType) } if (a != null) { $("searchTypeDropBoxList").style.top = getY(a) + 20 + "px" } $("searchTypeDropBoxList").style.display = "block" } var collapseSearchType = null; function collapseSearchTypeDropBoxList() { if (collapseSearchType != null) { clearInterval(collapseSearchType) } collapseSearchType = setInterval(function() { $("searchTypeDropBoxList").style.display = "none" }, 500) } function SearchTypeselectItem(d, a, c) { if (c == null) { c = "" } $("searchTypeContent").innerHTML = d.innerHTML; $("mainSearchForm").t.value = a; $("mainSearchForm").s.value = c; if (collapseSearchType != null) { clearInterval(collapseSearchType) } $("searchTypeDropBoxList").style.display = "none" } function getY(c) { var a = 0; while (c != null) { a += c.offsetTop; c = c.offsetParent } return a } function getX(c) { var a = 0; while (c != null) { a += c.offsetLeft; c = c.offsetParent } return a } function getXY(a) { var d = 0; var c = 0; while (a != null) { d += a.offsetLeft; c += a.offsetTop; a = a.offsetParent } return { left: d, top: c} } var ScrollLightBox = true; var LightBoxOnHidden = null;
function displayLightBox(l, j, c, m, k, g,addOnCss) {
    if (c == null || c < 300) { c = 300 }
    if (m != null) { ScrollLightBox = m } else { ScrollLightBox = true } LightBoxOnHidden = k;
    if (g == null) { g = 5 } $("lightbox_title").innerHTML = l; $("lightbox_innerContent").innerHTML = j;
    $("lightbox_innerContent").style.margin = g + "px"; $("LightBox_Content").style.width = c + "px";

    if (addOnCss != null) { $("lightbox_innerContent").up().addClassName('addonLightBoxClass') } else 
    {$("lightbox_innerContent").up().removeClassName('addonLightBoxClass')}
    
    $("lightbox_innerContent").style.width = (c - g * 2) + "px"; $("LightBox_Content").style.display = "block";
    $("LightBoxcloseBox").style.display = "block"; CenterObject($("LightBox_Content"));
    var a = document;
    var d = Math.max(Math.max(a.body.scrollWidth, a.documentElement.scrollWidth),
     Math.max(a.body.offsetWidth, a.documentElement.offsetWidth), Math.max(a.body.clientWidth, a.documentElement.clientWidth));
    var i = getScreenDimension(); var f = $("lightBoxBackground"); f.style.top = "0px"; f.style.left = "0px"; f.style.height = i[0] + "px";
    f.style.width = i[1] + "px"; f.style.overflow = "hidden"; f.style.display = "block"; var h = $("lightBox_iframeBg");
    h.style.top = 0; h.style.left = 0; h.style.height = i[0]; h.style.width = d
}
        function getScreenDimension() { var f = document; var a = Math.max(Math.max(f.body.scrollHeight, f.documentElement.scrollHeight), Math.max(f.body.offsetHeight, f.documentElement.offsetHeight), Math.max(f.body.clientHeight, f.documentElement.clientHeight)); var c = 0; var d = 0; if (typeof window.innerWidth != "undefined") { c = window.innerHeight; d = window.innerWidth } else { if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) { c = document.documentElement.clientHeight; d = document.documentElement.clientWidth } else { c = document.getElementsByTagName("body")[0].clientHeight; d = document.getElementsByTagName("body")[0].clientWidth } } if ((a - c) <= 4) { a = c } return [a, d, c] } Event.observe(window, "load", function(a) { if ($("LightBox_Content") != null) { Event.observe(window, "resize", function(c) { if ($("LightBox_Content").style.display != "") { bDragingLayer = false; CenterObject($("LightBox_Content")) } }); Event.observe(window, "scroll", function(c) { if ($("LightBox_Content").style.display != "" && ScrollLightBox) { bDragingLayer = false; CenterObject($("LightBox_Content")) } }) } }); function hiddenLightBox() { if (LightBoxOnHidden != null) { if (LightBoxOnHidden()) { LightBoxOnHidden = null; $("LightBox_Content").style.display = "none"; $("lightBoxBackground").style.display = "none" } } else { $("LightBox_Content").style.display = "none"; $("lightBoxBackground").style.display = "none" } } function CenterObject(j) { $("lightbox_innerContent").style.height = "auto"; $("lightbox_innerContent").style.overflowY = "visible"; var c = document.viewport.getScrollOffsets(); var f = 0; var h = 0; if (typeof window.innerWidth != "undefined") { f = window.innerHeight; h = window.innerWidth } else { if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) { f = document.documentElement.clientHeight; h = document.documentElement.clientWidth } else { f = document.getElementsByTagName("body")[0].clientHeight; h = document.getElementsByTagName("body")[0].clientWidth } } var d = $(j).getHeight(); var g = $(j).getWidth(); var a = 0; if (d < f) { a = (f - d) / 2 } var i = 0; if (g < h) { i = (h - g) / 2 } $(j).setStyle({ top: (a + c.top) + "px" }); $(j).setStyle({ left: i + "px" }); $(j).style.zIndex = 1000; if (d > f) { $("lightbox_innerContent").style.overflowY = "scroll"; $("lightbox_innerContent").style.clear = "both"; $("lightbox_innerContent").style.height = (f - 100) + "px" } else { $("lightbox_innerContent").style.height = "auto"; $("lightbox_innerContent").style.overflowY = "visible" } }
        function Login(a, c) {
    if (a == null) { a = false }
    if (c == null) { c = false }
    var f = '<center><table wdith="145" border="0" class="LoginLightBox">';
    f += '<tr><td class="redirection">' + JsLabel["js.Login.Box.Redirection.Text"]
  + '</td><td><select id="redirection" class="redirection_input">';
    for (var d = 0; d < info.redirection.length; d++) {
        if (info.redirection[d].link == "currentPage" && c) { continue }
        else { f += '<option value="' + info.redirection[d].link + '">' + info.redirection[d].name + "</option>" } 
    }
    f += "</select></td></tr>"; f += '<tr><td class="username">' + JsLabel["js.Login.Box.LoginName.Text"]
   + '</td><td><input type="text" onkeypress="checkBtn2(event,13) && $(\'UserPassword_LB\').focus();"  id="UserName_LB" class="username_input"/></td></tr>';
    f += '<tr><td class="password">' + JsLabel["js.Login.Box.Password.Text"]
     + '</td><td><input type="password" onkeypress="checkBtn2(event,13) && loginCheck();" id="UserPassword_LB" class="password_input"/></td></tr>';
    f += '<tr><td></td><td class="forgotPassword"><a class="forgetpwd" href="/' + info.lang + '/forgetPassword.html">'
     + JsLabel["js.Login.Box.ForgetPassword.Text"] + "</a></td></tr>";
    f += '<tr><td class="loginError" id="LoginErrorMessage" colspan="2">&nbsp;</td></tr>';
    f += '<tr><td colspan="2"><div class="registerNow">' + JsLabel["js.Login.Box.NotYetRegistered.Text"] + "<br />";
    f += '<a href="javascript:Register()" style="color: #0472C1">' + JsLabel["js.Login.Box.RegisterNOW.Text"] + "</a></div>";
    f += '<div onclick="loginCheck()" class="loginbtn">' + JsLabel["js.Login.Box.Button.Login.Text"] + "</div></td></tr>";
    f += "</table></center>"; displayLightBox(JsLabel["js.Login.Box.Title.Text"], f); $("UserName_LB").focus();
    if (a) { $("LightBoxcloseBox").style.display = "none" } 
} 
      function Register() { window.location = "/" + info.lang + "/VisitorRegistration.html" } function LoginPage() { window.location = "/" + info.lang + "/Login.html" } var bDragingLayer = false; var pLeft, pTop, dragX, dragY; var currLayer = null; function startDragLayer(a, d, c) { currLayer = document.getElementById(a); bDragingLayer = true; pLeft = parseInt(currLayer.style.left); pTop = parseInt(currLayer.style.top); dragX = d; dragY = c } Event.observe(window, "load", function(c) { Event.observe(document, "mouseup", function(d) { bDragingLayer = false }); Event.observe(document, "mousemove", processMouseMoveEvent); if ($("lightBox_iframeBg") != null) { var a = $("lightBox_iframeBg").contentWindow || oIframe.contentDocument; if (a.document) { a = a.document } if (a) { Event.observe(a, "mouseup", function(d) { bDragingLayer = false }); Event.observe(a, "mousemove", processMouseMoveEvent); Event.observe(a, "click", hiddenLightBox) } } $$("[truncateContent]").each(function(g) { var f = g.readAttribute("truncateContent"); var d = g.readAttribute("truncateSize"); if (d == null) { d = 200 } else { d = parseInt(d) } g.innerHTML = TruncateString(f, d, g.readAttribute("ellipses"), g.readAttribute("suffix")) }) }); function processMouseMoveEvent(a) { e = a; if (bDragingLayer) { if (currLayer != null) { var d = pLeft + e.clientX - dragX; var c = pTop + e.clientY - dragY; currLayer.style.left = d + "px"; currLayer.style.top = c + "px" } } } function mainPosition(a) { var c = $("MainMenu"); if (c == null) { return } c.childElements().each(function(f) { var d = f.getElementsByTagName("div"); if (d.length > 0) { d[0].style.left = getX(f) + "px"; d[0].style.top = (getY(f) + 29) + "px" } }) } Event.observe(window, "load", function(a) { var c = $("MainMenu"); if (c == null) { return } c.childElements().each(function(f) { var d = f.getElementsByTagName("div"); if (d.length > 0) { d[0].style.left = getX(f) + "px"; d[0].style.top = (getY(f) + 29) + "px"; Event.observe(f, "mouseover", function(g) { if (f.readAttribute("timeout") != null && f.readAttribute("timeout") != "f") { clearInterval(f.readAttribute("timeout")); f.setAttribute("timeout", "f") } d[0].style.display = "block" }); Event.observe(f, "mouseout", function(g) { f.setAttribute("timeout", setInterval(function() { d[0].style.display = "none" }, 300)) }) } }) }); Event.observe(window, "resize", mainPosition); function ReplaceParam(j, g, a) { var f = getQueryVariable(); if (g == null) { f.unset(j) } else { f.set(j, g) } if (a != null && a.length != null) { for (var d = 0; d < a.length; d += 2) { if (a[d + 1] == null) { f.unset(a[d]) } else { f.set(a[d], a[d + 1]) } } } var c = f.toQueryString(); if (c[0] == "&") { c = c.substring(1) } location = location.pathname + "?" + c + location.hash }
function ReplacePath(k, a) {
    var g = getQueryVariable();
    var f = new Hash();
    for (var d = 0; d < a.length; d++) {
        var j = g.get(a[d]);
        if (j != null) { f.set(a[d], j) } 
    }
    g = getQueryVariable(k); var l = g.keys();
    for (var d = 0; d < l.length; d++) {
        f.set(l[d], g.get(l[d]))
    } k = k.split("?")[0]; var c = f.toQueryString(); if (c[0] == "&") {
    c = c.substring(1)
} location = k + "?" + c + location.hash
}
function getQueryVariable(g) { var d = ""; if (g == null) { d = info.QueryString } else { d = g.split("?")[1]; if (d == null) { return new Hash() } } return $H(d.gsub(/\+/, '%20').toQueryParams()) }
function Logout() {
    new Ajax.Request("/service/Logout.html", { method: "post", onSuccess: function(c) {
        try { location.href = location.pathname + location.search } catch (a) { alert(a); }
    }
});
}
function loginCheck() {
    var a = $("redirection").value;
    cusloginCheck("UserName_LB", "UserPassword_LB", a, "LoginErrorMessage",
  function(d) {
      var c = $("redirection").value;
      if (c == "currentPage") { location.href = location.pathname + location.search } else { location.replace(c) } 
  })
}
function cusloginCheck(h, c, a, f, g) {
    var h = $(h).value; var d = $(c).value; if (h.blank() && d.blank())
    { alert(JsLabel["js.Login.UsernamePassword.blank.Text"]); return }
    if (h.blank()) { alert(JsLabel["js.Login.Username.blank.Text"]); return }
    if (d.blank()) { alert(JsLabel["js.Login.Password.blank.Text"]); return }
    new Ajax.Request("/service/Login.html", { method: "post", parameters: { strLoginID: h, strPassword: d },
    onSuccess: function(m) {
        var j = m.responseText; try {
            var i = j.evalJSON(true);
            if (i.Status == "success") {
                hiddenLightBox();
                if (g != null) { g(a) } else { location.replace(a) } 
            }
            else {
                var l = JsLabel["js.Login." + i.Message];
                if (l == null) { l = i.Message }
                if (f != null) { $(f).innerHTML = l } else { alert(l) } $(c).focus()
            } 
        } catch (k) { } 
    } 
})
} 
     function checkBtn2(c, a) { var d = 0; if (window.event) { d = c.keyCode } else { if (c.which) { d = c.which } } if (d == a) { return true } return false } function RedirectToExecutiveCenter() { location.href = "/" + info.lang + "/ExecutiveCenter.html" } function ReloadPage() { location.href = location.pathname + location.search } function AddToFavourite() { var d = document.title; var a = JsLabel["js.CustomLink.AddFavourite.DefaultTitle.Text"]; if (d != null) { a = d } if (window.sidebar) { window.sidebar.addPanel(a, location.href, "") } else { if (window.external) { try { window.external.AddFavorite(location.href, a) } catch (c) { alert(JsLabel["js.CustomLink.AddFavouriteFail.Text"]) } } else { alert(JsLabel["js.CustomLink.AddFavouriteFail.Text"]) } } } function SendToFriend(g) { g = $(g); var d = g.readAttribute("subject"); var f = g.readAttribute("content"); var a = g.readAttribute("sender"); var c = '<div class="SendToFriends" id="SendToFriendsContainer"><table width="810" class="SendToFriends"><tr><td class="Title" style="width: 160px">' + JsLabel["js.CustomLink.SendToFriend.Email.Text"] + '</td><td class="Recipient" check="check_empty"><input id="RecipientEmail" check="check_empty check_email"  label="' + JsLabel["js.CustomLink.SendToFriend.Email.Text"] + '" style="width: 95%" /></td></tr><tr><td class="Title">' + JsLabel["js.CustomLink.SendToFriend.Subject.Text"] + '</td><td class="Subject">' + d.gsub("#SenderName#", a) + '</td></tr><tr><td class="Title">' + JsLabel["js.CustomLink.SendToFriend.EmailContent.Text"] + '</td><td class="Message">' + f.gsub("#Name#", '<input id="RecipientName" check="check_empty" label="' + JsLabel["js.CustomLink.SendToFriend.RecipientName.Text"] + '" />').gsub("#Link#", location.href).gsub("#Comment#", '<textarea id="EmailComment" check="check_empty"  label="' + JsLabel["js.CustomLink.SendToFriend.Comment.Text"] + '"></textarea>').gsub("#SenderName#", a) + '</td></tr><tr><td colspan="2"><input onclick="SendToFriends_SubmitEmail()" value="' + JsLabel["js.CustomLink.SendToFriend.Button.Send.Text"] + '" type="button" class="btn" /> <input onclick="hiddenLightBox()" value="' + JsLabel["js.CustomLink.SendToFriend.Button.Cancel.Text"] + '" type="button" class="btn" /></td></tr></table></div>'; displayLightBox(JsLabel["js.CustomLink.SendToFriend.Title.Text"], c, 850) } function SendToFriends_SubmitEmail() { var f = $("SendToFriendsContainer"); $$(".alert_field").invoke("removeClassName", "alert_field"); var g = f.select("input", "textarea"); var j = new Object(); j.link = location.href; for (var d = 0; d < g.length; d++) { try { var c = $(g[d]); if (c.id != null && !c.id.blank()) { j[c.id] = c.value; var a = c.readAttribute("check"); if (!(a == null || a == "")) { if (validation_check(c) == false) { return false } } } } catch (h) { alert(h) } } new Ajax.Request("/service/EmailToFriend.html?lang=" + info.lang, { method: "post", parameters: j, onSuccess: function(i) { s.linkTrackVars = 'events'; s.linkTrackEvents = 'event11'; s.events = 'event11'; s.tl(true, 'o', 'Forward to Friend'); alert(JsLabel["js.CustomLink.SendToFriend.SuccessfulMessage.Text"]); ReloadPage() } }) } function TruncateString(p, t, d, r) {
    var a = 0; var h = ""; var m; var n = new Array(); for (m = 0; m < p.length; ) {
        var o = p.charAt(m); if (o == "<") {
            var g = 1; var f = 1; var q = ""; while ((m + g) < p.length && p.charAt(m + g) != ">") { g++ } q = p.substring(m + 1, m + g); if (q.charAt(0) == "/") {
                var l = q.substring(1); if (q.indexOf(" ") > -1) { l = q.substring(1, q.indexOf(" ")) } if (n[n.length - 1] == l) { n.pop() }
else{/*alert("html syntax error")*/}}else{if(q.charAt(q.length-1)=="/"){}else{var l=q;if(q.indexOf(" ")>-1){l=q.substring(0,q.indexOf(" "))}n.push(l)}}m=m+g+1}else{a++;m++}if(a>=t){break}}html=p.substring(0,m);if(a>=t&&d!=null){html+=d}if(r!=null){html+=r}while(n.length>0){html+="</"+n.pop()+">"}return html}function getFlashMovieObject(a){if(window.document[a]){}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a]){return document.embeds[a]}}else{return document.getElementById(a)}}function SendDataToFlashMovie(c,g,a){var d=getFlashMovieObject(c);if(d[g]==null){setTimeout(function(){SendDataToFlashMovie(c,g,a)},300)}else{return d[g](a)}}function UpdateBreadcrumb(a){b=$("BreadCrumb");var c=b.select("a");c[c.length-1].innerHTML=a.escapeHTML()}function AddBreadcrumb(a){b=$("BreadCrumb");b.innerHTML+='&nbsp;>&nbsp;<a href="javascript:void(0)" onclick="ReloadPage()">'+a+"</a>"}function CatalogueUpdate(g,d,c,f){$$(".CatalogueHeadline").each(function(h){h.innerHTML=d});if(f==""){$$(".BrandContainer").each(function(h){h.hide()})}else{$$(".BrandContainer").each(function(h){h.show();h.select("span")[0].update(f)})}try{flashChangePage(g,d)}catch(a){}}function flashChangePage(c,d){
s.pageName="jnet:"+info.lang+":Showroom:"+info.ShowroomUserID+":"+info.Showroom+":Catalogues:"+c; 
s.channel="Showroom";
s.prop1=info.lang.toUpperCase();
s.prop2=info.ShowroomUserID+":"+info.Showroom;
s.prop3=info.ShowroomCountry;
s.prop11=info.UserLevel;
s.events="event14";
var a=s.t();
if(a) {document.write(a)}

} function DisplayErrorBox_ById(c) { var a = $(c).innerHTML.gsub(/\$tid/, ""); displayLightBox("", a, 400) } function DisplayConfirmBox(c, a, d) { displayLightBox(c, '<table class="ConfirmBox" width="100%"><tr><td class="title">' + a + '</td></tr><tr><td class="button"><input type="button" value="' + JsLabel["js.Inbox.ReportSpam.Button.Confirm.Text"] + '" class="btn blue-button" onclick="' + d + '" /><input type="button" value="' + JsLabel["js.Inbox.ReportSpam.Button.Cancel.Text"] + '" class="btn blue-button" onclick="hiddenLightBox();" /></td></tr></table>', 320) }
function regenImage(c) {
    var a = $(c).childElements()[0];
    new Ajax.Request("/service/regencaptcha.html", { method: "get"
, onSuccess: function(h) {
    var d = h.responseText.evalJSON(true);
    $(c).up("form").captchaHash.value = d.Hash;
    var g = "/captcha.aspx?k=" + d.Key;
    if (g.indexOf("&") != -1) {
        g = g.substring(0, g.indexOf("&"))
    }
    var f = '<img src="' + g + "&rand=" + Math.random() + '" border="0" />';
    c.innerHTML = ""; c.innerHTML = f
}
    })};
