var myAccordion;
var stretchers;

var j = jQuery.noConflict();

j(document).ready(function(){

	//These 2 lines are new CW
	

		stretchers = document.getElementsByClassName('stretcher'); //div that stretches
		var toggles = document.getElementsByClassName('stretchtoggle'); //h3s where I click on

		//accordion effect
		myAccordion = new fx.Accordion(
			toggles, stretchers, {opacity: true, duration: 400}
		);
		


		//hash function
		
		function checkHash(){
			var found = false;
			toggles.each(function(h3, i){
				if (window.location.href.indexOf(h3.title) > 0) {
					myAccordion.showThisHideOpen(stretchers[i]);
					found = true;
				}
			});
			return found;
		}
		
		if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);
	
	
	function help(id){
		alert(id.parentNode.title);
	}
	
	 j("a[@href=#]").each(function(i){
	
		j(this).click(function(){
			return false;
		});
		
								   
	 });
	 
	 /*
	 j("#contactForm").submit(function(){
	
		var fields = j(":input", this).serialize();
	
	
		j("#ajax-response").load("mailer.php?" + fields, null, function(){
			j(this).fadeTo("slow", 0.9);	
			j("#contactForm :input").attr("disabled", "disabled");
		});
	
		return false;
		
	 });
	 */
	
});