/**
* The following variables may be adjusted
*/
var active_color = '#000'; // Colour of user provided text
var inactive_color = '#ccc'; // Colour of default text

/**
* No need to modify anything below this line
*/

$(document).ready(function() {
  $("input.default-value").css("color", inactive_color);

  var default_values = new Array();

  $("input.default-value").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });

  $("select.coloronset").css("color", inactive_color);
  $("select.coloronset").focus(function() {
   	this.style.color = active_color;
  });

});

//*****************************************************************


function CheckLogin(loginform) {
	if (document.forms[loginform].username.value == "" || document.forms[loginform].password.value == "") {
		$("#LoginWarn").html("Please enter your username and password to login.");
		return false;
	}
	else {
		return true;
	}
}

//*** Restore submit on enter behaviour for IE for loging form that is hidden on load
$(function(){
    $('input').keydown(function(e){
        if (e.keyCode == 13) {
            $(this).parents('form').submit();
            return false;
        }
    });
});
