// JavaScript Document

//if (window.location.href == "http://logicmanager.com") window.location.href = "http://www.logicmanager.com";


sfHover = function() {
var sfEls = document.getElementById("mainmenu").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function popup(url) {
MyWindow=window.open(url,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=950,height=650');
	
}


function popup2(url) {
MyWindow=window.open(url,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=300,height=300');
	
}



var prm = unescape(window.location.search);

function decodeUTF8(s) {
        var result = "";
        for (var i=0; i<s.length; i++) {
                var c = s.charCodeAt(i);
                if (c < 128) {
                        result += String.fromCharCode(c);
                }
                else {
                        var num_bytes = 0;
                        var rc = 0;
                        if ((c == 0xC0) || (c == 0xC1) ||
                            ((c >= 0xF5) && (c <= 0xFF))) {
                                return result;
                        }
                        if ((c & 0xC0) == 0xC0) {
                                num_bytes = 1;
                                rc = c & 0x1F;
                        }
                        if ((c & 0xE0) == 0xE0) {
                                num_bytes = 2;
                                rc = c & 0x0F;
                        }
                        if ((c & 0xF0) == 0xF0) {
                                num_bytes = 3;
                                rc = c & 0x07;
                        }
                        while ((num_bytes > 0) && (++i < s.length)) {
                                var sc = s.charCodeAt(i);
                                if ((sc & 0xC0) != 0x80) {
                                        return result;
                                }
                                rc = (rc << 6);
                                rc |= (sc & 0x3F);
                                num_bytes--;
                        }
                        result += String.fromCharCode(rc);
                }
        }
        return result;
}

function getValueByName(s, nm) {
        var nmeq=nm+"=";
        var nmIndex = s.indexOf(nmeq);
        if (nmIndex<0) return null;
        var rest = s.substr(nmIndex+nmeq.length)
        var ampIndex = rest.indexOf('&');
        if (ampIndex>-1) rest = rest.substr(0, ampIndex);
        for (var i=0; i<rest.length; i++) {
                if (rest.charAt(i) == '+') {
                var before = i==0 ? '' : rest.substring(0,i)
                var after = i==(rest.length-1)?'':
                                                rest.substr(i+1);
                                                rest = before + ' ' + after;
                }

        }
return decodeUTF8(rest);

}