(function ($) {
$(document).ready(function () {
	//$('.decorate ul li, .decorate td, .decorate tr').decorate();
	// wraps hr in divs so that they can be more creatively styled
	//$("hr").decorate();
	
	$(".cycle.hide").removeClass("hide");
	
	// changes the search label on click
	(function searchlabel() {
		var searchb = $('#CAT_Search');
		var defaultText = "search";
		searchb.onblur = function () { 
			if (this.value == '') { this.value = defaultText; }
		}
		searchb.onfocus = function () {
			if (this.value == defaultText) { this.value = ''; }
		}
		if (searchb.value == "") {
			searchb.value = defaultText;
		}
	}) ();
	
	$("#event-tabs").tabs();
});

// remove bc base mouse events
$(window).load(function () {
	$('.decorate ul li').each(function () {
		this.onmouseover = null;
		this.onmouseout  = null;
		
		var ob = $(this);
	
		ob.hover(
			function () { ob.addClass('hover') },
			function () { ob.removeClass('hover') }
		);
	});
	
	if (window.location.pathname.indexOf("signup.htm") != -1) {
		// is the signup page
		var product = window.location.search.replace("?", "").split("&");
		var p = product[1].replace("p=","");
		product = product[0].replace("product=","");
		product = unescape(product).replace(/%40/g,"@").replace(/%2F/g,"/").replace(/%2A/g,"*").replace(/\+/g," ").replace(/%2B/g,"+");
		if (document.forms.catwebformform69147.CAT_Custom_111337) {
			document.forms.catwebformform69147.CAT_Custom_111337.value = product;
		}
		if (document.forms.catwebformform69147.Amount) {
			document.forms.catwebformform69147.Amount.value = p;
		}
	}
});
})(jQuery);

function BuyNow(product,p) {
	product = escape(product).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
	window.location = "/services-and-fees/signup.htm?product=" + product + "&p="+p;
}

