


// onload checkers! 
// FastInit.addOnLoad();

/*
function onLoadCheckers(){
	if ($(document.getElementById('clutchFinderSubmitRow'))!=null) {
		document.getElementById('clutchFinderSubmitRow').style.display='none';
	}

}
*/


Event.observe(window, 'load', function() {

	// flash the distro results 
	if ($(document.getElementById('distributorSearchResultsInner'))!=null) {
			new Effect.Highlight('distributorSearchResultsInner', {duration:1});
	}
	
	// slideshow
	initSlide();
	
	initAccordion();
	
	// pulsate wordlwide
	doTheMap();
	
	// do the printable page thing
	if ($(document.getElementById('printThePageStyliez'))!=null) {
		window.print();
	}

});
// end load



// these guys are in the footer!

function footerBoxFun(element){

	if (element == 'footy'){
		var elon = 'footyTippingPoppy';
		var eloff = 'subscribeFooterPoppy';
	}
	
	if (element == 'subscribe'){
		var elon = 'subscribeFooterPoppy';
		var eloff = 'footyTippingPoppy';
	}
	
	
	// both
	if ((element == 'footy' || 'subscribe') && (Element.visible('subscribeFooterPoppy')) || (Element.visible('footyTippingPoppy')))
	{ 
		// do them both at once.
		new Effect.Parallel([
		  new Effect.Appear(elon, { sync: true}), 
		  new Effect.Fade(eloff, { sync: true})
		], { duration: 0.4});
	
	} else {
	
		// otherwise just do one:
		new Effect.BlindDown(elon, {duration:0.3});

	}
	
	
// end footer box fun
}


function closePoppy(thing){
	var closeme = thing.parentNode.id;
	new Effect.DropOut(closeme, {duration:0.2});
}



// check the footer subscribe box

function checkSubscribeFooter(){
var footSubError = false;
var form = document.getElementById('footerSubscribeForm');
	if (document.getElementById('footerFirst_Name').value == 'Your first name' || ''){footSubError = true;}
	if (document.getElementById('footerEmail_Address').value == 'Your email address' || ''){footSubError = true;}
		
	if (footSubError){
		 new Effect.Shake('footerSubscribeForm');	
	} else{
			submit.form();

	}
}




document.observe('dom:loaded', function(){

		$$('a[rel]').each(function(element){
		var tipDynamicContent = $(element.rel).cloneNode(true).show();
		tipDynamicContent.insert({ top: '<ul>' });
		tipDynamicContent.insert({ bottom: '</ul>' });
	
		
			new Tip(element, tipDynamicContent, {
			title : '<div class="megaTitle">' + element.title + '</div>',
				  hideOn: { element: 'tip', event: 'mouseout'},
				  hideAfter: 1.5,
				offset: { x: 10, y: 10 },
			className: 'megaTip'
			});
		
		});

	
	});

	
function doTheMap(){
if ($(document.getElementById('ewwAustralia'))!=null) {
		
	document.getElementById('locationItems').style.display = 'none';



	
	
}
	
}
	