jQuery(document).ready(function(){
	jQuery("#email").focus(function(){
		if(jQuery(this).val()==="enter your email address"){
			jQuery(this).val("");
		}
	});
	jQuery("#print").click(function(){
		window.print();
		return false;
	});
	if((jQuery.browser.msie)&&(parseInt(jQuery.browser.version,10) < 7)){
		jQuery("ul#menu > li").hover(function(){
			jQuery(this).addClass("sfhover");
		},function(){
			jQuery(this).removeClass("sfhover");
		});
	}
	jQuery("a.tracklink").live("click",function(){
		var therel = jQuery(this).attr("rel");
		if(therel.length>0){
			if(typeof pageTracker==="object"){
				pageTracker._trackPageview(therel);
			}
		}
	});
	ECOOLING.ecoolingslider({
		fireWhen: 'now',
		widthOnUl: 'yes',
		rotateSpeed: 6000
	});
	jQuery("select",jQuery("form.ecoolvalidatetablenew")).each(function(){																//iterate through all select fields
		if(jQuery.trim(jQuery("option:selected",jQuery(this)).text())=='Other (please specify):') {				//if the last option is selected
			jQuery('#' + jQuery(this).attr('name') + '_other').addClass("showingoption").removeClass("hidingoption").show();	//add the showingoption class to the span around the text field
		}else{
			jQuery('#' + jQuery(this).attr('name') + '_other').removeClass("showingoption").addClass("hidingoption").hide();  //if it is not selected add teh hidingoption class
		}
		jQuery(this).change(function(){															//attach a change listener
			if(jQuery.trim(jQuery("option:selected",jQuery(this)).text())=='Other (please specify):') {			//if the last option is selected
				jQuery('#' + jQuery(this).attr('name') + '_other').addClass("showingoption").removeClass("hidingoption").show();  //show the span with the text field in it
			}else{
				jQuery('#' + jQuery(this).attr('name') + '_other').removeClass("showingoption").addClass("hidingoption").hide()	//if not seletected, hide the text field
				.find("span.error").remove();
			}
		});
	});
	jQuery("form.ecoolvalidatetablenew").each(function(){
		var validID=jQuery(this).attr("id");
		ECOOLING.validatenew({
			formId:validID,
			emailClass: 'validateemail',
			phoneClass: 'validatephone',
			numericClass: 'validatenumeric',
			fireWhen: 'now',
			labelOutsideDiv: true,
			errorTag: 'span',
			errorClass: 'instructionserror',
			bigAlertClass:'error-alert',
			language: 'english',
			requiredClass: "required"
		});
	});
});
Cufon.replace('h1');
Cufon.replace("ul#menu-mainnav > li > a", { hover: true }); 
Cufon.replace('#sidebar h3');
//Cufon.replace('.home #featuredbox .promo a', { hover: true }); 
Cufon.replace(".breadcrumb ul > li > a", { hover: true }); 
Cufon.replace("#footer h3"); 

