
		    /**
	    * The following variables may be adjusted
	    */

	   // j$ = jQuery.noConflict();
	    

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function stripCharsInBag(s, bag)
{ var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}


$(document).ready(function() {
   	var active_color = '#000000'; // Colour of user provided text
    var inactive_color = '#828282'; // Colour of default text
    
	$("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];
	      }
	    });
	  });
	
	
  /*$("input.default-value").click(function() { alert('clicked') });*/
	
	//jQuery("div.scroll").mouseover(function() {  });
	

  
 /* jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
	    phone_number = phone_number.replace(/\s+/g, ""); 
		return this.optional(element) || phone_number.length > 9 &&
			phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
	}, "Please specify a valid phone number");
  */
  j$ = jQuery.noConflict();
  
  if (j$.validator)
  {
	  j$.validator.addMethod("phone", function(ph, element) {
		  if (ph == null) {
		  return false;
		  }
		  var stripped = ph.replace(/[\s()+-]|ext\.?/gi, "");
		  // 10 is the minimum number of numbers required
		  return ((/\d{10,}/i).test(stripped));
		  }, "Please enter a valid phone number");
  
  
 j$("#registerform").validate();
  }
  /*{
	 rules : {
	  phone: {
	  	required: true,
  		phoneUS: true
  	}
  }*/
  //});
  //j$("#registerform").validate();

});


