var slide_why_help;
var slide_why_hope;
var slide_about_us;
var menu_delay = 3000;
var menus;

window.onload = function() {
	slide_why_help = new Fx.Styles('menu_why_help_box', {duration: 300});
	slide_why_hope = new Fx.Styles('menu_why_hope_box', {duration: 300});
	slide_about_us = new Fx.Styles('menu_about_us_box', {duration: 300});
	menus = new Array( slide_why_help, slide_why_hope, slide_about_us );
	if( typeof sIFR == "function" ) {
		sIFR.replaceElement(named({sSelector:"h3", sFlashSrc:"assets/scripts/sifr/blockhead.swf", sColor:"#FF7F00", sLinkColor:"#000000", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:'' ,sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"#content2 p", sFlashSrc:"assets/scripts/sifr/blockhead.swf", sColor:"#FF7F00", sLinkColor:"#000000", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:'' ,sWmode:"transparent"}));
		  console.log("sifr should fire");
		} else {
		  console.log("sifr not a function");
		};
	}

function menu_open( menu, this_slider, height ) {
	if(/MSIE (5|6|7|8)/.test(navigator.userAgent)) { /* msie 6 */
		document.getElementById( menu ).style.height = height + 'px';
		return;
		}
	if( document.getElementById( menu ).style.height == '0px' ) {
		menus[this_slider].start(		{ 'opacity':1, 'height' : [ 0, height ]	} );
		menus[this_slider].start.pass(	{ 'opacity':1, 'height' : 0				}, menus[this_slider] ).delay( menu_delay );
		for( var i = 0; i < menus.length; i++ )
			if( i != this_slider )
				menus[i].start(	{ 'opacity':1, 'height' : 0 } );
		}
	}

function menu_close( menu ) {
	if(/MSIE (5|6|7|8)/.test(navigator.userAgent)) /* msie 6 */
		window.setTimeout("menu_close_close( '" + menu + "' )", menu_delay );
	}
function menu_close_close( menu ) {
	document.getElementById( menu ).style.height = '0px';
	}

function process_form() {
	var pass = 1;
	if( !document.getElementById('name').value ) {
		alert( 'Please enter your name.' );
		$('name').focus();
		return false;
		}
	if( !document.getElementById('pet_name').value ) {
		alert( 'Please enter your pet’s name.' );
		$('pet_name').focus();
		return false;
		}
	if( !document.getElementById('story').value ) {
		alert( 'Please tell us your pet’s cancer survival story.' );
		document.getElementById('story').focus();
		return false;
		}
	return true;
	}

function show_bubble( dog ) {
	document.getElementById( dog ).style.background = "url('/assets/images/" + dog + ".png') no-repeat";
	if(/MSIE (5|6)/.test(navigator.userAgent)) 
		document.getElementById( dog ).style.behavior = 'url(/assets/scripts/iepngfix.htc)';
	}

function launch_video( video_file, width, height ) {
	height = height + 15;
	window.open( '/videos/' + video_file, 'Cure Canine Cancer', 'scrollbars=no,resizable=yes,width=' + width + ',height=' + height );
	}