/* bc_navbuttons.js
* displays on states based on page title and section page is in
* biersma creative 2006
* relies on prototype because I'm checking it out (jen)
*/
//put the following in the file that includes this javascript to define the sections and then page names
//in the body tag, use <body onload="load_navigation">
//define arrays of page names using section names af the variables


//define the section names -- ideally i would just go through the arrays and grab the name of the array 
//instead of using an associative array, but don't see a way to do that in javascript (product_details.name)
var product_details = ['lead_management','referral_management','task_management','reports'];
var fanatical_support = [];
var our_clients = [];
var schedule_demo = [];
var corporate_solutions = [];
//define the section names
var section_names = ['product_details', 'fanatical_support', 'our_clients', 'schedule_demo', 'corporate_solutions'];
var sections = [product_details, fanatical_support, our_clients, schedule_demo, corporate_solutions];
var extension = ".asp";
var extention_off = "_nav.gif";
var extention_on = "_nav_on.gif";
var images_folder = "images/interior/";
var current_page = window.location.pathname.toLowerCase().replace("/leads/","");
var page_name = current_page.replace(extension, "");

function load_navigation(){

// sections.each( function(currentSection, ind)
// {
//  //if name of page is the name of a section , turn it on and exit
//    if(page_name == section_names[ind])
//    {   
//	  //turn page title on, can just put this before load navigation if every page has a navigation item - and remove from second loop as well
//      $(page_name).src = images_folder + page_name + extention_on;
//	  return;
//    }
//	//look in the array with the name matching the current value
//	
//	currentSection.each( function(section_page)
//	{
//	  if(section_page == page_name)
//	  {
//        //if the name of the page is in that array, make the section nav on and the page nav on and exit
//		$(section_names[ind]).src = images_folder + section_names[ind] + extention_on;
//        $(page_name).src = images_folder + page_name + extention_on;
//	    return;
//	  }	
//	});
//  });
}

/*putting this in here because i don't want to put it in every single page head */
function Verify(form) {
		var user = form.username.value;
		var pass = form.password.value;

		if ((user == "") && (pass == ""))
		{ 
			window.alert("Please enter your user name and password to sign in.");
			form.username.focus();
			return false;
		}
		else if (user == "")
		{
			window.alert("Please enter your user name.");
			form.username.focus();
			return false;
		}
		else if (pass == "")
		{
			window.alert("Please enter your password.");
			form.password.focus();
			return false;
		}
		else
		{
			return true;
		}
	}

	function init()
	{
		document.forms[0].elements["username"].focus()
	}