﻿/*
$(document).ready(function()
 {
  $("#loadLogin").click(function()
   {
   $("swapContainer").hide();
    $("#loginWait").text("...One Moment Please...");
     $("#rightColumn").append('<div id="intranetMenu"></div>')
                    .children("#intranetMenu").hide()
                    .load("js/loginMenu.html div#intranetMenu", function(){
                      $("#loginWait").remove();
                      $("#intranetMenu").slideDown("normal");
                     });
   return false;
   });
});
*/

/*--------------jQuery for sliding------------------*/
/*
$(document).ready(function() {$(".loadLogin").click(function(){ $("#swapContainer:hidden").slideDown("slow"); });
$(".loadLogout").click(function(){ $("#swapContainer:visible").slideUp("slow"); });
	}
);
*/

/*--------------Login/out Button colors--------------*/
function goLite(FRM,BTN){window.document.forms[FRM].elements[BTN].style.color = "#990000";}
function goDim(FRM,BTN){window.document.forms[FRM].elements[BTN].style.color = "#FFFFFF";}

/*--------------Login Checkform--------------*/
function checkForm(formDiv,btn) {
	var login='<input type="button" name="Login" class="loadLogin" value="Login" title="Login" style="font-size: 10px; height: 18px; width: 60px; color: #ffffff; background: none; border: none;" onmouseover="goLite(this.form.name,this.name)" onmouseout="goDim(this.form.name,this.name)" onmouseup="checkForm(this.form.id,this.name)"/>';
	var logout='<input type="button" name="Logout" class="loadLogout" value="Logout" title="Logout" style="font-size: 10px; height: 18px; width: 60px; color: #ffffff; background: none; border: none;" onmouseover="goLite(this.form.name,this.name)" onmouseout="goDim(this.form.name,this.name)" onmouseup="checkForm(this.form.id,this.name)" />';
	if (btn == 'Login') {
		document.getElementById("intranet").innerHTML=logout;
		$("#swapContainer:visible").slideUp(400, function(){
			$("#rightColumn").append('<div id="intranetMenu"></div>')
                    .children("#intranetMenu").hide()
                    .load("includes/loginMenu.html div#intranetMenu", function(){
                      $("#loginWait").remove();
                      $("#intranetMenu").slideDown(400);
                     })});
		}
	else if (btn == 'Logout') {
		document.getElementById('intranet').innerHTML=login;
		$("#intranetMenu:visible").slideUp(400, function(){
			$("#swapContainer:hidden").slideDown(400)});
		}
	}
	
/*-------------- Page Changer --------------*/
function goToPage() {
	document.getElementById('centerColumn').innerHTML="";
			$("#centerColumn").append('<div id="filler"></div>')
                    .children("#filler").hide()
                    .load("includes/" + window.name + ".html div", function(){
                      $("#filler").slideDown(400)
                      });
}

function closePage(page1, page2) {
	if (page1 != page2) {
		$("#filler:visible").slideUp(400, function (){
			window.name = page2;
			location.replace("home.html#about");
			goToPage();
		}		
		);
        }
}


/*
function goTo(page) {
	if (page == "Home" ) {
	$("#filler").append('<div id="Home"></div>')
                    .children("#Home").hide()
                    .load("includes/home.html div#Home", function(){
                      $("#Home").slideDown(400);
                    });
	}
}
*/