/* Autofocus on Domain Search */ $(document).bind('autofocus_ready', function() { if (!("autofocus" in document.createElement("input"))) { $("#domain").focus(); } }); /* Navigation Highlighter */ function extractPageName(hrefString) { var arr = hrefString.split('/'); return (arr.length < 2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase(); } function setActiveMenu(arr, crtPage) { for (var i=0; i < arr.length; i++) { if(extractPageName(arr[i].href) == crtPage) { if (arr[i].parentNode.tagName != "DIV") { arr[i].className = "current"; arr[i].parentNode.className = "current"; } } } } function setPage() { hrefString = document.location.href ? document.location.href : document.location; if (document.getElementById("nav-highlight") !=null ) setActiveMenu(document.getElementById("nav-highlight").getElementsByTagName("a"), extractPageName(hrefString)); } /* Handler for the Domain Name Availability */ var allvalidsuffixes = new Array('com.au','net.au','org.au','asn.au','id.au','co','mobi','tel','com','net','jobs','travel','org','biz','info','eu','asia','ac.nz','geek.nz','gen.nz','maori.nz','school.nz','co.nz','net.nz','org.nz','co.uk','org.uk','me.uk','org.tr','com.hk','ae','vn','hk','com.ph','net.ph','org.ph','ph','com.cn','net.cn','org.cn','cn','com.my','net.my','org.my','com.tw','org.tw','idv.tw','com.sg','net.sg','org.sg','sg','co.in','net.in','org.in','in','com.pk','net.pk','com.vn','jp','ws','co.kr','or.kr','co.id','co.th','in.th','me','co.at','net.vn','org.vn','af','com.ar','bz','com.br','org.br','cx','co.cr','cz','or.cr','cr','com.do','net.do','org.do','ht','com.ht','net.ht','org.ht','hn','com.hn','net.hn','org.hn','or.id','im','com.im','co.im','net.im','org.im','co.jp','kr','my','mu','co.mu','com.mu','net.mu','org.mu','md','pk','pe','com.pe','org.pe','pl','com.pl','net.pl','org.pl','ru','lc','se','tw','com.tr','us','ca','tv','cc','ch','at','be','de','dk','com.co','es','it','li','com.sb','net.sb','com.mx','nl'); function TidyInput(form) { if (form[domainFieldName].value.indexOf(".") > -1) { isSuffix = thisSuffixIsInList(form[domainFieldName].value,allvalidsuffixes); if (isSuffix > -1) { form[domainFieldName].value = form[domainFieldName].value.replace(('.' + allvalidsuffixes[isSuffix]),""); } } return true; } function thisSuffixIsInList(needle,haystack) { for (var w = 0; w < haystack.length; w++) { len = haystack[w].length + 1; if (('.' + haystack[w]) == needle.substr((len * -1),len)) { return w; } } return -1; } /* Slide Toggle */ $(document).ready(function(){ $(".toggle_container").hide(); $("h3.trigger").toggle(function(){ $(this).addClass("active"); }, function () { $(this).removeClass("active"); }); $("h3.trigger").click(function(){ $(this).next(".toggle_container").slideToggle("slow"); }); });