/* Navigation Button Rollovers */

nav_home_on = new Image();
nav_home_off = new Image();
nav_schedule_on = new Image();
nav_schedule_off = new Image();
nav_video_on = new Image();
nav_video_off = new Image();
nav_episodes_on = new Image();
nav_episodes_off = new Image();
nav_characters_on = new Image();
nav_characters_off = new Image();
nav_features_on = new Image();
nav_features_off = new Image();
nav_community_on = new Image();
nav_community_off = new Image();
nav_downloads_on = new Image();
nav_downloads_off = new Image();
nav_alerts_on = new Image();
nav_alerts_off = new Image();
nav_shop_on = new Image();
nav_shop_off = new Image();

nav_home_on.src = "/site/tara/season1/image-panel/navigation/home_on.jpg";
nav_home_off.src = "/site/tara/season1/image-panel/navigation/home_off.jpg";
nav_schedule_on.src = "/site/tara/season1/image-panel/navigation/schedule_on.jpg";
nav_schedule_off.src = "/site/tara/season1/image-panel/navigation/schedule_off.jpg";
nav_video_on.src = "/site/tara/season1/image-panel/navigation/video_on.jpg";
nav_video_off.src = "/site/tara/season1/image-panel/navigation/video_off.jpg";
nav_episodes_on.src = "/site/tara/season1/image-panel/navigation/episodes_on.jpg";
nav_episodes_off.src = "/site/tara/season1/image-panel/navigation/episodes_off.jpg";
nav_characters_on.src = "/site/tara/season1/image-panel/navigation/characters_on.jpg";
nav_characters_off.src = "/site/tara/season1/image-panel/navigation/characters_off.jpg";
nav_features_on.src = "/site/tara/season1/image-panel/navigation/features_on.jpg";
nav_features_off.src = "/site/tara/season1/image-panel/navigation/features_off.jpg";
nav_community_on.src = "/site/tara/season1/image-panel/navigation/community_on.jpg";
nav_community_off.src = "/site/tara/season1/image-panel/navigation/community_off.jpg";
nav_downloads_on.src = "/site/tara/season1/image-panel/navigation/downloads_on.jpg";
nav_downloads_off.src = "/site/tara/season1/image-panel/navigation/downloads_off.jpg";
nav_alerts_on.src = "/site/tara/season1/image-panel/navigation/alerts_on.jpg";
nav_alerts_off.src = "/site/tara/season1/image-panel/navigation/alerts_off.jpg";
nav_shop_on.src = "/site/tara/season1/image-panel/navigation/shop_on.jpg";
nav_shop_off.src = "/site/tara/season1/image-panel/navigation/shop_off.jpg";

/* Character Images */
character0 = new Image();
character1 = new Image();
character2 = new Image();
character3 = new Image();
character4 = new Image();

character0.src = "/site/tara/season1/image-panel/character_art/random_flowers.jpg";
character1.src = "/site/tara/season1/image-panel/character_art/random_deer.jpg";
character2.src = "/site/tara/season1/image-panel/character_art/random_doodle.jpg";
character3.src = "/site/tara/season1/image-panel/character_art/random_whisk.jpg";
character4.src = "/site/tara/season1/image-panel/character_art/random_tupperware.jpg";


function showOverState(button_name) {

	$(button_name).src = eval ( button_name + "_on.src" );
}

function hideOverState(button_name) {

	$(button_name).src = eval ( button_name + "_off.src" );	
}

/* Slide a div in and out */
function toggleSlide(id) {

	if ($(id).visible()) {
		Effect.BlindUp(id);
	}
	else {
		Effect.BlindDown(id); 
	}
}

/* Show/hide a div and change image */
function toggleShow(id, img) {

	if ($(id).visible()) {
		$(id).hide();
		$(img).src = '/site/tara/season1/image-panel/small_arrow.gif';
	}
	else {
		$(id).show();
		$(img).src = '/site/tara/season1/image-panel/small_arrow_down.gif';
	}
}

/* Tracking code for episodic video clips */
function getEpisodeElements() {
	var video_clips = $$('div#episode_content p.episodic_clips a');
		
	for (var i = 0; i < video_clips.length; i++) {
		video_clips[i].setAttribute("onclick", "OmniHelp.tc('video:" + (i+1) + "')");
	}
}

/* Open up membership data */
function membership_pop(location) {

	this.window.name = "save_params";
	membership=window.open(location,"membership","toolbar=no,scrollbars=yes,directories=no,resizable=yes,menubar=no,width=800,height=600,top=20,left=200,screeny=20,screenx=200");
	membership.focus();
}

/* Replaces membership_pop - allows you to specify a return page for after user registration occurs */
function addSeriesNewsletter( a, rtn, ttl )
{
	var _return = rtn;
	var _title = ttl;
	var _submit = a.getAttribute('href');
	var _params = [ '',
		_submit, '&returnurl=', _return,
		'&returntitle=', escape(_title) 
	]; document.location = _params.join('');
}

