function showlink(f,h){if(testSessionCookie()){writeSessionCookie("obj",f);writeSessionCookie("strUrl",h)}var c=document.getElementById("NumberofCategories");var g=0;if(c!=null){g=c.value}var b="";if(f!=null&&f!="undefined"){b=f.split("$")}for(i=1;i<=g;i++){var a=document.getElementById("activelink"+i);var e=document.getElementById("link"+i);var d=document.getElementById("activesublink"+b[1]);if(b[0]==i){if(h!=null&&h!="undefined"&&h.length==0){window.location.href=a}if(a!=null&&e!=null){if(e.style.display=="block"){if(h!=""){window.location.href=h}}}ResetActiveSubLinks(b[0]);if(a!=null){a.style.color="black"}if(a!=null){a.style.fontWeight="bold"}if(e!=null){e.style.display="block"}if(d!=null){d.style.color="black"}}else{if(a!=null){a.style.color="#E30175"}if(a!=null){a.style.fontWeight="normal"}if(e!=null){e.style.display="none"}if(d!=null){a.style.color="#E30175"}}}return false}function writeSessionCookie(b,a){document.cookie=escape(b)+"="+escape(a)+"; path=/"}function getCookieValue(b){var a=new RegExp(escape(b)+"=([^;]+)");if(a.test(document.cookie+";")){a.exec(document.cookie+";");return unescape(RegExp.$1)}else{return false}}function testSessionCookie(){document.cookie="testSessionCookie=Enabled";if(getCookieValue("testSessionCookie")=="Enabled"){return true}else{return false}}function restoreLeftMenu(){var a=getCookieValue("obj");var b=getCookieValue("strUrl");if(a&&b){showlink(a,b)}else{if(a){showlink(a)}else{showlink()}}}function ResetActiveSubLinks(b){var a=document.getElementsByTagName("a");for(var c=0;c<a.length;c++){if(a[c].id.indexOf("activesublink"+b)!=-1){a[c].style.color="#E30175"}}};