﻿// All this is for managing the Login textboxes. Since I couldn't write "Enter Password"
// into a Password type box I have to replace the characters that are typed in, 1 by 1... YaY!
function loadTextBoxes(which){
    var username = document.getElementById("ctl00_username");
    var password = document.getElementById("ctl00_password");
    if(which==null | which=="username"){
        username.value = "Enter Username";
        username.style.color = "#c9c9c9";
    }
    if(which==null | which=="password"){
        //password.value = "Enter Password";
        //password.style.color = "#c9c9c9";
    }
}
function boxFocus(text_box){
    if(text_box.value=="Enter Username" || text_box.value=="Enter Password"){
        text_box.style.color = "Black";
        text_box.value = "";
    }
}
function boxBlur(text_box){
    if(text_box.value=="") loadTextBoxes(text_box.id.replace("ctl00_",""));
}
function changeLetter(text_box){
    var text = "";
    for(i=0;i<text_box.value.length;i++){
        text += "*";
    }
    text_box.value = text;
}
function hotKey(e){
    if(e==null) e = window.event;
    if(e.keyCode=="13"){
        var un1 = document.getElementById("ctl00_Header1_Username");
        var pw1 = document.getElementById("ctl00_Header1_Password");
        var login1 = document.getElementById("ctl00_Header1_LoginButton");
        var un2 = document.getElementById("ctl00_PhonePowerOrder_ContentPlaceHolder_Username");
        var pw2 = document.getElementById("ctl00_PhonePowerOrder_ContentPlaceHolder_Password");
        var login2 = document.getElementById("ctl00_PhonePowerOrder_ContentPlaceHolder_Login");
        if(un1.value.length>0 && pw1.value.length>0){
            login1.click();
        }
        else if(un2.value.length>0 && pw2.value.length>0){
            login2.click();
        }
        //else alert("No Header Login!")
    }
}
function closeModule(){
    var help_div;
    for(i=0;i<document.getElementsByTagName("DIV").length;i++){
        if(document.getElementsByTagName("DIV")[i].id!=null && document.getElementsByTagName("DIV")[i].id.indexOf("HelpDiv")>-1){
            help_div = document.getElementsByTagName("DIV")[i];
        }
    }
	if(help_div.style.height != "2600px") help_div.style.height = "2600px";
	else help_div.style.height = "19px";
}