$(document).ready(function() {
	$("#menu_acts").click(function(){return false;});
	$("#menu_acts").hover(function(){showSubMenu('submenu_acts');}, function(){hideSubMenu('submenu_acts');});
	$("#submenu_acts").hover(function(){showSubMenu('submenu_acts');}, function(){hideSubMenu('submenu_acts');});
	});

function showSubMenu(menuItemId)
	{
	$("#"+menuItemId).stop(true);
	$("#"+menuItemId).show().css({'opacity':'1'});
	}

function hideSubMenu(menuItemId)
	{
	$("#"+menuItemId).delay(750).fadeOut(400);
	}

function showBio(name)
	{
	switch (name)
		{
		case 'both':
			$('#bio_pic').attr('src', 'img/bioside.png');
			$('#bio_text_both').show();
			$('#bio_text_nicky').hide();
			$('#bio_text_jamie').hide();
			break;
		case 'jamie':
			$('#bio_pic').attr('src', 'img/bioside_jamie.png');
			$('#bio_text_both').hide();
			$('#bio_text_note').hide();
			$('#bio_text_nicky').hide();
			$('#bio_text_jamie').show();
			break;
		case 'nicky':
			$('#bio_pic').attr('src', 'img/bioside_nicky.png');
			$('#bio_text_both').hide();
			$('#bio_text_note').hide();
			$('#bio_text_nicky').show();
			$('#bio_text_jamie').hide();
			break;
		default:
			break;
		}
	}

function showPic(whichpic, credit)
	{
	$('#act_video_container').hide(); // Hide the video
	$('#act_photo_container').show(); // Show the pictures

	var newPhoto = new Image();
	newPhoto.onload = function()
		{
		$('#placeholder').css('marginTop', (250 - (this.height) / 2) + 'px');
		$('#placeholder').css('marginLeft', (318 - (this.width) / 2) + 'px');
		$('#placeholder').attr('src', "photos/" + whichpic + '.jpg');
		$('#credit').html(credit == '' ? '' : 'Photo Credit: ' + credit);
		}
	newPhoto.src = 'photos/' + whichpic + '.jpg';
	}

function showGallery(target)
	{
	$('.photos_gallery').hide();
	$('#'+target).show();
	$('#'+target).find('a:first').click();
	$('.current').removeClass('current');
	$('#photos_link_'+target).addClass('current');
	}

function switchToVideo(whichvid)
	{
	$('#act_photo_container').hide(); // Hide the pictures
	$('#act_video_container').show(); // Show the video

	$('.act_video').hide(); // Hide all videos on the page
	$('#' + whichvid).show(); // Show the appropriate video
	}

function showVideo(videoName)
    {
	var videoHeight;
	switch (videoName)
		{
		case 'duotrap1':
		case 'duotrap2':
		case 'web':
		case 'showreel':
		case 'showreeljamie':
		case 'duosilks':
		default:
			videoHeight = 328;
			break;
		}

	var videoHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450" height="' + videoHeight + '" id="FLVPlayer"><param name="movie" value="FLVPlayer_Progressive.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="scale" value="noscale" /><param name="salign" value="lt" /><param name="FlashVars" value="&amp;MM_ComponentVersion=1&amp;skinName=Corona_Skin_3&amp;streamName=video/' + videoName + '&amp;autoPlay=true&amp;autoRewind=false" /><param name="swfversion" value="8,0,0,0" /><!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you dont want users to see the prompt. --><param name="expressinstall" value="scripts/expressInstall.swf" /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>--><object type="application/x-shockwave-flash" data="FLVPlayer_Progressive.swf" width="450" height="' + videoHeight + '"><!--<![endif]--><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="scale" value="noscale" /><param name="salign" value="lt" /><param name="FlashVars" value="&amp;MM_ComponentVersion=1&amp;skinName=Corona_Skin_3&amp;streamName=video/' + videoName + '&amp;autoPlay=true&amp;autoRewind=false" /><param name="swfversion" value="8,0,0,0" /><param name="expressinstall" value="scripts/expressInstall.swf" /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div><!--[if !IE]>--></object><!--<![endif]--></object>';
	$('#video_container').html(videoHTML);
	swfobject.registerObject("FLVPlayer");
	$('#FLVPlayer').css('visibility', 'visible');

	$('.current').removeClass('current');
	$('#video_link_' + videoName).addClass('current');
	}


// Below here, vanilla JS, above jQuery
function showSubGallery(target)
	{
	$('.subgallery').each(function()
		{
		if (this.id().substr(0,5) == target.substr(0,5))
			this.hide();
		});
	$('#' + target).show();

	if (target == 'costumes_1')
		document.getElementById('costumes_arrows').innerHTML = '<img class="gallery_arrowl" src="img/gall_arrowl_disabled.png" alt="No Previous Gallery" width="30" height="21" /><a href="javascript:showSubGallery(\'costumes_2\');"><img class="gallery_arrowr" src="img/gall_arrowr.png" alt="Next Gallery" width="30" height="21" /></a>';
	if (target == 'costumes_2')
		document.getElementById('costumes_arrows').innerHTML = '<a href="javascript:showSubGallery(\'costumes_1\');"><img class="gallery_arrowl" src="img/gall_arrowl.png" alt="Previous Gallery" width="30" height="21" /></a><img class="gallery_arrowr" src="img/gall_arrowr_disabled.png" alt="No Next Gallery" width="30" height="21" />';
	if (target == 'modelling_1')
		document.getElementById('modelling_arrows').innerHTML = '<img class="gallery_arrowl" src="img/gall_arrowl_disabled.png" alt="No Previous Gallery" width="30" height="21" /><a href="javascript:showSubGallery(\'modelling_2\');"><img class="gallery_arrowr" src="img/gall_arrowr.png" alt="Next Gallery" width="30" height="21" /></a>';
	if (target == 'modelling_2')
		document.getElementById('modelling_arrows').innerHTML = '<a href="javascript:showSubGallery(\'modelling_1\');"><img class="gallery_arrowl" src="img/gall_arrowl.png" alt="Previous Gallery" width="30" height="21" /></a><img class="gallery_arrowr" src="img/gall_arrowr_disabled.png" alt="No Next Gallery" width="30" height="21" />';
	}
