/* Tabs are an amalgamation of n number of jquery plugins
the blind is from
the accordion is from
idtabs is from
comments is from 
*/
var HELP_HIGHLIGHT="red";

var ACCORDION_MENU = ".blind-accordion-menu ul a.blind-menu";
var ACCORDION_ROOT = ".blind-accordion-menu ul ";
var LOGIN_SELECTOR = "#login-inner";

var HELP_ACCORDION = "#helpAccordion";
var HELP_ACCORDION_ONE = "#blind1";
var HELP_ACCORDION_TWO = "#blind2";
var HELP_ACCORDION_THREE = "#blind3";
var HELP_ACCORDION_FOUR = "#blind4";

var HELP_ACCORDION_BOX_ONE = "#box";
var HELP_ACCORDION_BOX_TWO = "#box2";
var HELP_ACCORDION_BOX_THREE = "#box3";
var HELP_ACCORDION_BOX_FOUR = "#box4";
var HELP_ACCORDION_SPEED = "medium";

$(document).ready(function()
{
	$(ACCORDION_ROOT).idTabs(0); 

	/* from an example at ... */
	//The three state blind toggle has made the blind code more complicated than I would like
	//With two states it can all be handled with CSS. Couldn't get that to work with
	//three states - specifically open/selected, closed/selected and not selected
	//what follows is too complicated and can be cleaned up.
	//The solution is to use css for everything but the selected element
	/* bind each menu  button to event */
	$(ACCORDION_MENU).mouseover(function(){tabOnMouseOver(this)}); 
	$(ACCORDION_MENU).mouseout(function(){tabOnMouseOut(this)});
	$(".comments-tab-menu a").mouseup(function(){$.bm_comments.commentsTabOnMouseUp(this)});

	document.getElementById("comments-add-button").value = $.bm_comments.COMMENTS_SUBMIT_BUTTON; //initialize comments for database use.
	
	var $box = $(HELP_ACCORDION_BOX_ONE)
		//.wrap('<div id="box-outer"></div>');
	  $(HELP_ACCORDION_ONE).click(function() {
	    $box.blindToggle(this,HELP_ACCORDION_SPEED);
	  }) 


 	var $box2 = $(HELP_ACCORDION_BOX_TWO)
		  $(HELP_ACCORDION_TWO).click(function() {
		    $box2.blindToggle(this,HELP_ACCORDION_SPEED);  
		  }) 


		  var $box3 = $(HELP_ACCORDION_BOX_THREE)
		  $(HELP_ACCORDION_THREE).click(function() {
		    $box3.blindToggle(this,HELP_ACCORDION_SPEED);  
			// exception handling for comments 
			//document.getElementById("your-comments").focus();
		  })

		  var $box4 = $(HELP_ACCORDION_BOX_FOUR)
		  $(HELP_ACCORDION_FOUR).click(function() {
		    $box4.blindToggle(this,HELP_ACCORDION_SPEED);
		  })

	//NB Brian - to do - the accordion appears elongated and then properly compresses. This looks ugly when loading on slow computers.

	/*accordion - from iTools ... */
	$(HELP_ACCORDION).Accordion(
		{
			headerSelector	: 'dt',
			panelSelector	: 'dd',
			activeClass		: 'helpAccordionActive',
			hoverClass		: 'helpAccordionHover',
			panelHeight		: 365, //height of accordion panel
			speed			: 100
		}
	);


	//NB Brian - used in blindtoggle, perhaps. I suspect this may be vestigal code.
	$.bm_tab.lasttab="Help"; 

	tabSelectedAndOpen($(HELP_ACCORDION_ONE));

	//store which object has the focus in a variable.
	//this eliminates the need for all the flags that i'm carrying.
	//alternatively - use class values
	$('.edit-control').focus( function() {
	    $.bm_main.current_focus = this;
	}).blur( function() {
	    $.bm_main.current_focus = null;
	});

	tabSetDefaults();

});
setNewUserFlagToOvercomeFireFoxCachingBug = function()
{
	// fix caching problem with FireFox.
	document.getElementById("checkbox-new-user").checked=false;
}
function tabSetDefaults()
{
	$.bm_ui.formatInputEnabled(".tab-input");
	//setTimeout('setNewUserFlagToOvercomeFireFoxCachingBug();',2000);
	setTimeout('document.getElementById("checkbox-new-user").checked=false;',1000);
	$.bm_ui.formatInputDisabled(".new-user-input");
}

//jQuery.fn.blindToggle = function(speed, easing, callback) {
jQuery.fn.blindToggle = function(e,speed, easing, callback) {	

	
	if (!$.bm_main.page_loaded){return};
	//alert("in blindtoggle");
	var h = this.height() +Number(parseInt(this.css('paddingTop'))) + Number(parseInt(this.css('paddingBottom'))+30);//30 is ajustment for login. its a hack.
	//adjustment for a one pixel bug!! Try to fix the math - somehow the flipping process is off by 1 which screws up the conditional logic in the return statement, below. Likely due to padding or margin changes/settings
	var tempVar = parseInt($(e).css("marginTop"));
	if (tempVar==-1)
	{
		e.css({marginTop:0});
	}
	if ($.bm_tab.lasttab == $(e).text())	
	{
		//Clicking on already selected tab//
		//hide
		if (Number(parseInt(this.css("marginTop"))>=0))  //open, so close
		{
			//hide
			tabReset();
			//NB callback not working under firefox, hence use of setTimeout
			return this.animate({marginTop:-h}, speed, easing, setTimeout("tabSelectedAndClosed('"+e+"')",speed));
		}else
		{
			//show.
			tabSelectedAndOpen(e);
			return this.animate({marginTop:0}, speed, easing, callback);
		}
	} else
	{
		//show or do nothing
		$.bm_tab.lasttab = $(e).text();
		if (Number(parseInt(this.css("marginTop")))<0) //blind is closed
		{
			//show
			return this.animate({marginTop: 0}, speed, easing, callback);  
		} else 
		{
			//already showing.ensure color is selected.
			tabReset();
			tabSelectedAndOpen(e);
			return  false;
		}
  		//orig code. return this.animate({marginTop: parseInt(this.css('marginTop')) < 0 ? 0 : -h}, speed, easing, callback);  
	}
};

switchLoginTab = function(piWhichTab)
{
	//NB Brian - hard-wired selectors. better to make prefs separate tab perhaps and switch visibility
	$(LOGIN_SELECTOR+" .selected").removeClass("selected");
	$(LOGIN_SELECTOR).children("div").eq(piWhichTab).addClass("selected");
	//NB To do - switch to jQuery and use constant HELP_ACCORDION_TWO
	if (piWhichTab==1){
		document.getElementById("blind2").innerHTML = "Prefs";
	} else
	{
		document.getElementById("blind2").innerHTML = "Login";		
	}
}


function tabOnMouseOver(e)
{
	//There are six states that the tab can be in
	//selected open - same as box background
	//selected hover - mouse pointer changes. same as selected open
	//selected closed - same as unselected closed
	//unselected closed - transparent
	//unselected hover dark version of tab background
	//unselected open - never happens.
	return;
	if ($.bm_tab.colorscheme=="BLACK")
	{
	}
	if ($.bm_tab.colorscheme=="WHITE")
	{
		//Hover always has a border
		$(e).css({border: "1px solid "+$.bm_ui.BOX_COLOR_DARK});
		//if margintop of selected >=0 make background white
		//get margin of the accordion "box" from the href property of the blind-menu button
		if (Number(parseInt($($(ACCORDION_MENU+".selected").attr("href")+ " div").children("div.box").css("marginTop")))>=0)
		{
			tabSelectedAndOpen($(ACCORDION_MENU+".selected"));
		} else {
			if ($(e)==$(ACCORDION_MENU+".selected"))
			{
				tabSelectedAndHoverClosed(e);
			}
		}
	}
}
function tabOnMouseOut(e)
{
	return;
}
function tabSelectedAndOpen(e)
{
	$(".blind-menu").removeClass("closed");
	return;
}
function tabSelectedAndHoverClosed(e)
{	//NB Brian to do - this can be handled by swapping classes
	return;
}
function tabSelectedAndClosed(e)
{
	$(".blind-menu").removeClass("closed");
	$(e).addClass("closed");
	$(".menu-tab a").removeClass("selected");
	return;
}
function tabReset()
{
	return;
}
/********* END OF BLIND TOGGLE AND ACCORDION CODE **********/
/********* BEGINNING OF EVENT CODE ****************/
function tabEventHandler()
{
	try
	{
		e = document.getElementById('help'); 
		e.onmouseover = function(event) {helpOnMouseOver("help");}
		e.onmouseout = function(event) {helpOnMouseOut("help");}
		e = document.getElementById('login');
		e.onmouseover = function(event) {loginOnMouseOver("login");}
		e.onmouseout = function(event) {loginOnMouseOut("login");}
	} catch(err)
	{
		errorHandler("tabEventHandler ",err);
	}
}
function helpEventHandler()
{
	var e; 
	try
	{

		e = document.getElementById('help-nav-arrows');
		e.onmouseover = function(event) {highlight("content-header-right-next-img");highlight("content-header-left-next-img");highlight("content-header-right-previous-img");highlight("content-header-left-previous-img");}
		e.onmouseout = function(event) {unhighlight("content-header-right-next-img");unhighlight("content-header-left-next-img");unhighlight("content-header-right-previous-img");unhighlight("content-header-left-previous-img");}

		e = document.getElementById('help-next');
		e.onmouseover = function(event) {highlight("content-header-right-next-img");highlight("content-header-left-next-img");}
		e.onmouseout = function(event) {unhighlight("content-header-right-next-img");unhighlight("content-header-left-next-img");}

		e = document.getElementById('help-previous');
		e.onmouseover = function(event) {highlight("content-header-right-previous-img");highlight("content-header-left-previous-img");}
		e.onmouseout = function(event) {unhighlight("content-header-right-previous-img");unhighlight("content-header-left-previous-img");}
		
		e = document.getElementById('help-header');
		e.onmouseover = function(event) {highlight("content-header");}
		e.onmouseout = function(event) {unhighlight("content-header");}
		e = document.getElementById('help-content');
		e.onmouseover = function(event) {highlight("content");}
		e.onmouseout = function(event) {unhighlight("content",1);}

		
		//e = document.getElementById('help-gutter');
		//e.onmouseover = function(event) {highlight("help-gutter","gutter");}
		//e.onmouseout = function(event) {unhighlight("help-gutter","gutter",100);}
		
		e = document.getElementById('help-gutter-2');
		e.onmouseover = function(event) {highlight("gutter");}
		e.onmouseout = function(event) {unhighlight("gutter",100);}

		e = document.getElementById('help-gutter-3');
		e.onmouseover = function(event) {highlight("gutter");}
		e.onmouseout = function(event) {unhighlight("gutter",100);}
		

		//NB  bug that i've commented out for now bm.

		e = document.getElementById('help-tab');
		e.onmouseover = function(event) {highlight("tab");}
		e.onmouseout = function(event) {unhighlight("tab");}

		e = document.getElementById('help-header-2');
		e.onmouseover = function(event) {highlight("content-header");}
		e.onmouseout = function(event) {unhighlight("content-header",1);}
	
		e = document.getElementById('help-table-of-contents');
		e.onmouseover = function(event) {highlight("toc-navbar",300)}
		e.onmouseout = function(event) {unhighlight("toc-navbar",101);}			

		e = document.getElementById('help-table-of-contents-2');
		e.onmouseover = function(event) {highlight("toc-navbar",300)}
		e.onmouseout = function(event) {unhighlight("toc-navbar",101);}
		
		e = document.getElementById('help-icon-dock');
		e.onmouseover = function(event) {highlight("icon-dock");}
		e.onmouseout = function(event) {unhighlight("icon-dock")}
		
		e = document.getElementById('help-icon-dock-2');
		e.onmouseover = function(event) {highlight("icon-dock");}
		e.onmouseout = function(event) {unhighlight("icon-dock")}
		
		e = document.getElementById('help-home');
		e.onmouseover = function(event) {highlight("dock-img0");}
		e.onmouseout = function(event) {unhighlight("dock-img0");}

		e = document.getElementById('help-writing');
		e.onmouseover = function(event) {highlight("dock-img6");highlight("dock-img7");highlight("dock-img8");}
		e.onmouseout = function(event) {unhighlight("dock-img6");unhighlight("dock-img7");unhighlight("dock-img8");}


		e = document.getElementById('help-photographs');
		e.onmouseover = function(event) {highlight("dock-img1");highlight("dock-img2");highlight("dock-img3");highlight("dock-img4");}
		e.onmouseout = function(event) {unhighlight("dock-img1");unhighlight("dock-img2");unhighlight("dock-img3");unhighlight("dock-img4");}

		e = document.getElementById('help-video');
		e.onmouseover = function(event) {highlight("dock-img5");}
		e.onmouseout = function(event) {unhighlight("dock-img5");}
	} catch(err)
	{
		errorHandler("Error in help event handler ",err);
	}
}




function setPreferences(piPreferenceArray)
{
	try
	{
		// NB Brian This needs to by synced with login.php database->getPreferences
		// To start change value to checked.
		$.bm_login.current_user_key=piPreferenceArray[2];
		document.getElementById("show-editor").checked = integerToBoolean(piPreferenceArray[10]);
		document.getElementById("show-navigation-arrows").checked = integerToBoolean(piPreferenceArray[3]);
		document.getElementById("first-name").value = piPreferenceArray[13];
		document.getElementById("last-name").value = piPreferenceArray[14];
		document.getElementById("city").value = piPreferenceArray[11];
		document.getElementById("email").value = piPreferenceArray[12];
		return;
		document.getElementById("wide-text-columns").checked = integerToBoolean(piPreferenceArray[4]);
		document.getElementById("show-footer").checked =integerToBoolean(piPreferenceArray[5]);
		document.getElementById("show-help").checked = integerToBoolean(piPreferenceArray[6]);
		document.getElementById("show-comments").checked = integerToBoolean(piPreferenceArray[7]);
		document.getElementById("show-preferences").checked = integerToBoolean(piPreferenceArray[8]);
		document.getElementById("show-ratings").checked = integerToBoolean(piPreferenceArray[9]);

	} catch(err)
	{
		errorHandler("setPreferences",err);
	}
}

/* END OF LOGIN USER PREFERENCES */
/* COMMENTS */


/* BEGINNING OF old code */
/*
/*
function firstNameOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function firstNameOnFocus()
{
	document.getElementById("first-name").select();
	$.bm_main.current_edit_mode = EDITING_FIRST_NAME;
}	
function lastNameOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function lastNameOnFocus()
{
	document.getElementById("last-name").select();
	$.bm_main.current_edit_mode = EDITING_LAST_NAME;
}
function editControlOnFocus(e)
{
}
function editControlOnBlur(e)
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function emailOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function emailOnFocus()
{
	document.getElementById("email").select();
	$.bm_main.current_edit_mode = $.bm_main.EDITING_EMAIL;
	var e;
	e = document.getElementById("email");
	if (e.value == $.bm_main.DEFAULT_EMAIL)
	{
		e.value = "";
	}
}
function cityOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function cityOnFocus()
{
	document.getElementById("city").select();
	$.bm_main.current_edit_mode = $.bm_main.EDITING_CITY;
	var e;
	e = document.getElementById("city");

	if (e.value == $.bm_main.DEFAULT_CITY)
	{
		e.value = "";
	}
}
function cityOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function existingPasswordOnFocus()
{
	try
	{
		document.getElementById("existing-password").select();
		$.bm_main.current_edit_mode = EDITING_EXISTING_PASSWORD;
	} catch(err)
	{
		errorHandler("existingPasswordOnFocus",err);
	}
}
function existingPasswordOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function newPasswordOnFocus()
{
	document.getElementById("new-password").select();
	$.bm_main.current_edit_mode = EDITING_NEW_PASSWORD;
}
function newPasswordOnBlur()
{
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function confirmNewPasswordOnFocus()
{
	document.getElementById("confirm-new-password").select();
	$.bm_main.current_edit_mode = EDITING_CONFIRM_NEW_PASSWORD;
}
function confirmNewPasswordOnBlur()
{
	// was a tab key hit?
	// if so go to save button
	$.bm_main.current_edit_mode = $.bm_main.EDITING_NOTHING;
	//if (getKeystroke(evt) == KEY_TAB)
	//{document.getElementById("preferences-save-button").focus();}
}
*/
/*
function tabWideNarrowMouseOver()
{
	try
	{
		gsPreviousCursorStyle = document.body.style.cursor;
		document.body.style.cursor = "pointer";
	} catch(err)
	{
		errorHandler("tabWideNarrowMouseOver",err);
	}
}
function tabWideNarrowMouseOut()
{
	try
	{		
		document.body.style.cursor = gsPreviousCursorStyle;
	} catch(err)
	{
		errorHandler("tabWideNarrowMouseOut",err);
	}
}
function tabWideNarrowEventHandler()
{
	var e = document.getElementById('tab-wide-narrow-img');
	e.style.display = "block";
	e.onmouseup = function() {setColumnWidthEvent()};
	e.onmouseover = function() {tabWideNarrowMouseOver()};
	e.onmouseout = function() {tabWideNarrowMouseOut()};
}
*/
/*
function helpOnMouseOver()
{
	try
	{
		var e;
		e = document.getElementById("help");
		if ($.bm_tab.colorscheme=="WHITE")
		{	e.style.color = "black";}
		else
		{	e.style.color = "white"};
	} catch(err)
	{
		errorHandler("Error in helpMouseOver ",err);
	}
}
function helpOnMouseOut()
{
	var e;
	e = document.getElementById("help");
	e.style.color = "gray";	
}
function loginOnMouseOver()
{
	try
	{
		var e;
		e = document.getElementById("login");
		if ($.bm_tab.colorscheme=="WHITE")
		{	e.style.color = "black";}
		else
		{	e.style.color = "white"};
	} catch(err)
	{
		errorHandler("loginMouseOver ",err);
	}
}
function loginOnMouseOut()
{
	try
	{
		var e;
		e = document.getElementById("login");
		e.style.color = "gray";	
	} catch(err)
	{
		errorHandler("loginOnMouseOut "+err);
	}
}
*/
/*
function preferencesOnMouseOver()
{
	try
	{
		var e;
		e = document.getElementById("preferences");
		if ($.bm_tab.colorscheme=="WHITE")
		{	e.style.color = "black";}
		else
		{	e.style.color = "white"};
	} catch(err)
	{
		errorHandler("Error in preferencesOnMouseOver ",err);
	}
}
function preferencesOnMouseOut()
{
	try
	{
		var e;
		e = document.getElementById("preferences");
		e.style.color = "gray";	
	} catch(err)
	{
		errorHandler("Error in preferencesOnMouseOut ",err);
	}
}
*/
/*
function commentsOnMouseOver()
{
	try
	{
		var e;
		e = document.getElementById("comments");
		if ($.bm_tab.colorscheme=="WHITE")
		{	e.style.color = "black";}
		else
		{	e.style.color = "white"};
	} catch(err)
	{
		errorHandler("Error in commentsOnMouseOver ",err);
	}
}
function commentsOnMouseOut()
{
	try
	{
		var e;
		e = document.getElementById("comments");
		e.style.color = "gray";	
	} catch(err)
	{
		errorHandler("Error in commentsOnMouseOut ",err);
	}
}
*/
/*
function commentsShow()
{
	return;
	try
	{
		tabsNormal();

		var e =  document.getElementById("comments");	
		e.style.zIndex = TAB_ZINDEX_SHOW;
		e.style.display = "block";

		e =  document.getElementById("comments-title");	
		e.style.zIndex = TAB_ZINDEX_SHOW;
		e.style.color = "black";
		e =  document.getElementById(OPT_COMMENT);
		e.innerHTML = "Hide comments";
		addTabToList(TAB_COMMENTS);
	} catch(err) 
	{
		errorHandler("commentsShow ",err);
	}
}
function commentsHide()
{
	return;
	var e =  document.getElementById("comments");	
	e.style.display = "none";
	e =  document.getElementById(OPT_COMMENT);
	e.innerHTML = "Comments";
	removeTabFromList(TAB_COMMENTS);
}
*/

/*
function preferencesShow()
{
	try
	{
		return;
		tabsNormal();
		footerRightHideShow("none");
		var e =  document.getElementById("help");	
		e.style.zIndex = TAB_ZINDEX_SHOW;

		e.style.display = "block";
		e =  document.getElementById("help-title");	
		e.style.zIndex = TAB_ZINDEX_SHOW;
		e.style.display = "block";
		e.style.color = "black";

		//addTabToList(TAB_HELP);

		//e.style.top = "8%";
		//e.style.left = "0%";

		//e =  document.getElementById(OPT_HELP);
		//e.innerHTML = "Hide help";
	} catch(err) 
	{
		errorHandler("helpShow",err);
	}
}
*/
/*
function preferencesEventHandler()
{
	try
	{
		var sElementName="first-name";
		var e = document.getElementById('first-name');
		e.onfocus = function() {firstNameOnFocus();}
		e.onblur = function() {firstNameOnBlur();}
		e = document.getElementById('last-name');
		e.onfocus = function() {lastNameOnFocus();}
		e.onblur = function() {lastNameOnBlur();}
		e = document.getElementById('city');		
		e.onfocus = function() {cityOnFocus();}
		e.onblur = function() {cityOnBlur();}
		sElementName = "email";
		e = document.getElementById('email');
		e.onfocus = function() {emailOnFocus();}
		e.onblur = function() {emailOnBlur();}


		sElementName = "existing-password";
		e = document.getElementById('existing-password');
		e.onfocus = function() {existingPasswordOnFocus();}
		e.onblur = function() {existingPasswordOnBlur();}

		sElementName = "new-password";
		e = document.getElementById('new-password');
		e.onfocus = function() {newPasswordOnFocus();}
		e.onblur = function() {newPasswordOnBlur();}

		sElementName = "confirm-new-password";
		e = document.getElementById('confirm-new-password');
		e.onfocus = function() {confirmNewPasswordOnFocus();}
		e.onblur = function() {confirmNewPasswordOnBlur();}

		sElementName = "preferences-save-button";
		e = document.getElementById('preferences-save-button');
		e.onfocus = function() {preferencesSaveOnFocus();}
		e.onblur = function() {preferencesSaveOnBlur();}
		e.onmouseover = function() {preferencesSaveOnMouseOver();}		
		e.onmouseout = function() {preferencesSaveOnMouseOut();}
		e.mouseup = function() {preferencesUpdate();}

		sElementName = "preferences-update-password-button";
		e = document.getElementById('preferences-update-password-button');
		e.onfocus = function() {preferencesUpdatePasswordOnFocus();}
		e.onblur = function() {preferencesUpdatePasswordOnBlur();}
		e.onmouseover = function() {preferencesUpdatePasswordOnMouseOver();}		
		e.onmouseout = function() {preferencesUpdatePasswordOnMouseOut();}
		e.mouseup = function() {preferencesUpdatePassword();}


		document.getElementById('preferences-personal-button').onmouseup = function(event) {preferencesShowSection(PREFERENCES_PERSONAL);}	
		document.getElementById('preferences-interface-button').onmouseup = function(event) {preferencesShowSection(PREFERENCES_INTERFACE);}					
		document.getElementById('preferences-change-password-button').onmouseup = function(event) {preferencesShowSection(PREFERENCES_UPDATE_PASSWORD);}					

	} catch(err)
	{
		errorHandler("preferencesEventHandler "+sElementName,err);
	}
}
function preferencesSaveOnFocus()
{
	var e = document.getElementById("preferences-save-button");
	e.borderColor = "red";
}
function preferencesSaveOnBlur()
{
	var e = document.getElementById("preferences-save-button");	
	e.color = "red";
}
function preferencesSaveOnMouseOut()
{
	var e = document.getElementById("preferences-save-button");
	e.color = "white";	
}
function preferencesSaveOnMouseOver()
{
	var e = document.getElementById("preferences-save-button");
	e.color = "red";	
	e.borderColor = "red";
}
function preferencesUpdatePasswordOnFocus()
{
	var e = document.getElementById("preferences-update-password-button");
	e.borderColor = "red";
	$.bm_main.current_edit_mode = EDITING_PREFERENCES_UPDATE_PASSWORD_BUTTON;
}
function preferencesUpdatePasswordOnBlur()
{
	var e = document.getElementById("preferences-update-password-button");	
	e.color = "red";
	$.bm_main.current_edit_mode = EDITING_NOTHING;
}
function preferencesUpdatePasswordOnMouseOut()
{
	var e = document.getElementById("preferences-update-password-button");
	e.color = "white";	
}
function preferencesUpdatePasswordOnMouseOver()
{
	var e = document.getElementById("preferences-update-password-button");
	e.color = "red";	
	e.borderColor = "red";
}

*/
