// this is the way to set up a namespace
// to protect your code from conflicting with
// code from other libraries

// this first line reads as:
//    if wcr exists already, use the one that exists, 
//    otherwise create it by executing this function
var wcr = wcr ? wcr : function() {
	// private vars and functions go here
	// in normal var and function notation
	
	
	// return public vars and functions 
	// in object notation
	return {
		
		submitToFirstPage : function(theForm) {
			// remove pagination offset from form action

			// get action from form - if blank, get it from current href
			href = theForm.action || window.location.href;
			// clear trailing / and number if they exist			
			theForm.action = href.replace(/\/\d+$/,'');
			theForm.submit();
		}		
	}
}();

