/*   ************************************************************   */
/*   jquery protect email address 
	 - http://www.html-advisor.com/javascript/hide-email-with-javascript-jquery/
	 - http://plugins.jquery.com/project/Mailme   */
/*   ************************************************************   */
jQuery.fn.mailme = function() {
    var at = / at /;
    var dot = / dot /g;
    this.each( function() {
        var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
        var title = jQuery(this).attr('title')
        $(this)
            .after('<a href="mailto:'+addr+'" title="'+title+'">'+ addr +'</a>')
            .remove();
    });
};

/*   ******************************************************   */
/*   http://www.webmasterworld.com/forum91/1560.htm   */
/*   ******************************************************   */
//initial checkCount of zero
var checkCount=0;

//maximum number of allowed checked boxes
var maxChecks=5;

function setChecks(obj){
	//increment/decrement checkCount
	if(obj.checked){
		checkCount=checkCount+1
		document.thisform.prod.value = 1;
	}else{
		checkCount=checkCount-1
	}
	//if they checked a 6th box, uncheck the box, then decrement checkcount and pop alert
	if (checkCount>maxChecks){
		obj.checked=false
		checkCount=checkCount-1
		alert('You may only choose up to '+maxChecks+' gifts')
	}
} 

/*   ******************************************************   */
/*   http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml   */
/*   ******************************************************   */
function submitform()
{
	document.forms["thisform"].submit();
}


/*   ******************************************************   */
/*   http://www.psacake.com/web/js.asp   */
/*   ******************************************************   */
function EnforceMaximumLength(fld,len) {
	if(fld.value.length > len) { fld.value = fld.value.substr(0,len); }
}


$(document).ready(function() {

	/*   ******************************************************   */
	/*   http://jscrollpane.kelvinluck.com/   */
	/*   ******************************************************   */
	// works without calling class
	// $('.scroll-pane').jScrollPane({showArrows:true});


});
