﻿intImage = 2;
function swapImage() {
    switch (intImage) {
        case 1:
            IMG1.src = "skin/collapse.gif"
            intImage = 2
            return (false);
        case 2:
            IMG1.src = "skin/expand.gif"
            intImage = 1
            return (false);
    }
}

function toggle() {

  
    var ele = document.getElementById("loginiF");
    //var text = document.getElementById("MIJOnetLoginA");
    if (ele.style.display == "block") {
        ele.style.display = "none";
        //    text.innerHTML = "MIJOnet Login";
    }
    else {
        ele.style.display = "block";
        //    text.innerHTML = "MIJOnet Login";
    }
}


function gotorl(vurl) {

    var baseurl = location.href.substring(0, location.href.indexOf('/', 8));
    var fullurl = baseurl + vurl;
    //alert(fullurl);
    top.location = fullurl
    //document.location = 'www.google.ca';

}
function testest(gvar) {

    alert(gvar);
}
//function move() {

//    top.location = 'controls/TAC.aspx';


//}
function move() {
    var temp = top.location;
    var ind = temp.toString().lastIndexOf("index.aspx");
    var ing = temp.toString().lastIndexOf("intro.aspx");

    if ((ind > -1) || (ing > -1)) {
        top.location = 'controls/TAC.aspx';
    } else {
        top.location = '../controls/TAC.aspx';
    }



}

function gotoForgot() {
    var temp = top.location;
    var ind = temp.toString().lastIndexOf("index.aspx");
    var ing = temp.toString().lastIndexOf("intro.aspx");

    if ((ind > -1) || (ing > -1)) {
        window.open('ForgotPassword.aspx');
    } else {
        window.open('../ForgotPassword.aspx');
    }



}

function showHide(elementid) {
    if (document.getElementById(elementid).style.display == 'none') {
        document.getElementById(elementid).style.display = '';
    } else {
        document.getElementById(elementid).style.display = 'none';
    }
}


function popupWindow(url, name, width, height) {
    win = window.open(url, name, 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height);
    return (win);
}


function hideModal() {
    //__doPostBack('upanel', '');
    //var temp = getASPElm('form_div', "div");
    //temp.style.display = 'none';

    $find('mympf').hide();

}
function getASPElm(nm, tag) {
    if ($get(nm)) { return $get(nm); }
    if (!tag) { var tag = '*'; }
    var e = document.getElementsByTagName(tag);
    for (var i = 0; i < e.length; i++) {
        if (e[i].id) {
            if (e[i].id.indexOf(nm) != -1) {

                return e[i];
            }
        }
    }
    return null;
} // End of getASPElm (nm,tag)




function doBP() {

    var zemp = getASPElm('maindiv', 'div');
    zemp.style.display = 'block';
    var cemp = getASPElm('form_div', 'div');
    cemp.style.display = 'none';
}


function swapDisplay(panelunit) {
    var temp = getASPElm(panelunit, "div");


    if (temp.style.display == "none") {
        temp.style.display = "block";
    } else {
        temp.style.display = "block";
    }


}
function dostuff(myList) {
    //alert(myList.value);
    if (myList.value == 'Post - Cineplex') {
        window.open('http://www.mijo.com/mijonet_web/post/index.aspx');
    }
    if (myList.value == 'Post - Approvals') {
        window.open('http://rocket.mijonet.com/');
    }
}

function switchLaunch(ddvar) {
    var divL = getASPElm("launchDiv", "div");
    var divN = getASPElm("nonLaunch", "div");
    divL.style.display = "none";
    divN.style.display = "none";
    var divA = getASPElm(ddvar, "div");
    divA.style.display = "block";

}
function clickLaunch(inp) {

    var inparr = inp.split(",");
    //var un =  document.getElementById("username");
    //var pw =  document.getElementById("password");

    var un = document.getElementsByName("username")
    var pw = document.getElementsByName("password");

    var btn;
    if (inparr[2] == "Launchpad") {
        btn = getASPElm('btnLaunch', 'input');

    }
    else {

        btn = getASPElm('btnThunder', 'input');

    }
    un[0].value = inparr[0];
    pw[0].value = inparr[1];

    btn.click();

}
	   
	    