﻿var xp = -60
var yp = 20
var ie = document.all
var ns6 = document.getElementById && !document.all
var enabletip = false
if (ie || ns6)
    var oTT = document.all ? document.all["ttSme"] : document.getElementById ? document.getElementById("ttSme") : ""


function popUpWindow(url, w, h) {
    window.open(url, 'w', 'width=' + w + ',height=' + h + ',directories=0,status=1,location=0,toolbar=0,scrollbars=1,resizable=0,menubar=0,copyhistory=0'); // modified
}

function popUpWindow2(url, wName, width, height, resizable) {
    var popup = window.open(url, wName, 'width=' + width + ',height=' + height + ',directories=0,status=1,location=0,toolbar=0,scrollbars=1,resizable=' + resizable + ',menubar=0,copyhistory=0,left=50,top=50');
    popup.focus();
}

function openModalDialog(url, width, height, top, resize, scroll) {
    window.showModalDialog(url, window, 'center:yes;dialogwidth:' + width + 'px;dialogheight:' + height + 'px;dialogtop:' + top + 'px;resizable:' + resize + ';scroll:' + scroll + ';');
}


function exTB() {
    return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
}

function showTT(theText) {
    if (ns6 || ie) {
        if (typeof theWidth != "undefined") oTT.style.width = theWidth + "px"
        if (typeof theColor != "undefined" && theColor != "") oTT.style.backgroundColor = theColor
        oTT.innerHTML = "<table style='border-collapse:collapse;'><tr><td>" + theText + "</td></tr></table>"
        enabletip = true
        return false
    }
}

function pT(e) {
    if (enabletip) {
        var curX = (ns6) ? e.pageX : event.clientX + exTB().scrollLeft;
        var curY = (ns6) ? e.pageY : event.clientY + exTB().scrollTop;
        var rightedge = ie && !window.opera ? exTB().clientWidth - event.clientX - xp : window.innerWidth - e.clientX - xp - 20
        var bottomedge = ie && !window.opera ? exTB().clientHeight - event.clientY - yp : window.innerHeight - e.clientY - yp - 20
        var leftedge = (xp < 0) ? xp * (-1) : -1000

        if (rightedge < oTT.offsetWidth)
            oTT.style.left = ie ? exTB().scrollLeft + event.clientX - oTT.offsetWidth + "px" : window.pageXOffset + e.clientX - oTT.offsetWidth + "px"
        else if (curX < leftedge)
            oTT.style.left = "5px"
        else
            oTT.style.left = curX + xp + "px"

        if (bottomedge < oTT.offsetHeight)
            oTT.style.top = ie ? exTB().scrollTop + event.clientY - oTT.offsetHeight - yp + "px" : window.pageYOffset + e.clientY - oTT.offsetHeight - yp + "px"
        else
            oTT.style.top = curY + yp + "px"
        oTT.style.visibility = "visible"
    }
}

function hideshowTT() {
    if (ns6 || ie) {
        enabletip = false
        oTT.style.visibility = "hidden"
        oTT.style.left = "-1000px"
        oTT.style.backgroundColor = ''
        oTT.style.width = ''
    }
}

document.onmousemove = pT



function gotoPage() {

    var mCatID;
    mCatID = 0;
    var DropDownList3 = document.getElementById("ctl00_DropDownList3");
    var DropDownList4 = document.getElementById("ctl00_DropDownList4");

    if (DropDownList4.options[DropDownList4.selectedIndex].value == '') {
        mCatID = DropDownList3.options[DropDownList3.selectedIndex].value;
    }
    else {
        mCatID = DropDownList4.options[DropDownList4.selectedIndex].value;
    }

    var theString = "../managermain/managerContainerMain.aspx?mCatID=";
    var newlocation = theString + mCatID;
    document.location.href = newlocation;
}

function gotoGroup() {

    var DropDownList2 = document.getElementById("ctl00_DropDownList2");
    var theString = DropDownList2.options[DropDownList2.selectedIndex].value;
    var newlocation = theString;
    document.location.href = newlocation;
}

