var defaultBird		= 'woodduck-male';

var birdsDiv		= 'birds-audio';
var birdsAudio		= {
'woodduck-male':	{
						'title':	'Wood Duck',
						'desc':		'<i>Aix sponsa</i><br/>(Breeding Male)<br/>All calls wheezy. Flushing female gives rising <i>whoo-eek</i>, often repeated. Male call is thinner, more drawn-out than female: <i>schwuh-weeeeuh-weep</i>.',
						'photo':	'images/lg-woodduck-male.jpg',
						'swf1':		'woodduck_male_zeeps.mp3',
						'swfdesc1':	'Zeeps'
					},
'woodduck-female':	{	
						'title':	'Wood Duck',
						'desc':		'<i>Aix sponsa</i><br/>(Adult Female)<br/>All calls wheezy. Flushing female gives rising <i>whoo-eek</i>, often repeated. Male call is thinner, more drawn-out than female: <i>schwuh-weeeeuh-weep</i>.',
						'photo':	'images/lg-woodduck-female.jpg',
						'swf1':		'woodduck_female_stutter.mp3',
						'swf2':		'woodduck_female_oeeks.mp3',
						'swf3':		'woodduck_female_kureee.mp3',
						'swfdesc1':	'Stutter',
						'swfdesc2':	'Oeeks',
						'swfdesc3':	'Kureee'
					},
'bobwhite':	{
						'title':	'Northern Bobwhite',
						'desc':		'<i>Colinus virginianus</i><br/>(Adult Male)<br/>Male <i>erp whoyt!</i> (&quot;Bobwhite!&quot;) is well known in East and Midwest. Call sometimes preceded by soft <i>pwur</i> note, or shortened to a one-syllable <i>whoyt</i>.',
						'photo':	'images/lg-bobwhite.jpg',
						'swf1':		'bobwhite_calls.mp3',
						'swf2':		'bobwhite_songsOK.mp3',
						'swf3':		'bobwhite_songsFL.mp3',
						'swfdesc1':	'Calls',
						'swfdesc2':	'Songs',
						'swfdesc3':	'Songs'
					},
'loon':	{
						'title':	'Common Loon',
						'desc':		'<i>Gavia immer</i><br/>(Breeding Adult with Chick)<br/>Two songs: a short, maniacal laugh, <i>a hee a hiya heea yay</i>, heard year-round; evocative wailing (&quot;yodeling&quot;), <i>eeeee waaaaay ooooh</i>, given on breeding grounds.',
						'photo':	'images/lg-loon.jpg',
						'swf1':		'loon_yodelwail.mp3',
						'swf2':		'loon_yodel.mp3',
						'swf3':		'loon_wail.mp3',
						'swf4':		'loon_tremolo.mp3',
						'swf5':		'loon_flight.mp3',
						'swf6':		'loon_hoots.mp3',
						'swfdesc1':	'Yodel, Wail &amp; Tremolo',
						'swfdesc2':	'Yodel Closeups',
						'swfdesc3':	'Wail Closeups',
						'swfdesc4':	'Tremolo Duet',
						'swfdesc5':	'Flight Calling',
						'swfdesc6':	'Hoots'
					},
'yellowlegs':	{
						'title':	'Greater Yellowlegs',
						'desc':		'<i>Tringa melanoleuca</i><br/>(Breeding Adult)<br/>Calls loudly at the slightest provocation: a ringing, farcarrying <i>tee tee teeu!</i> or <i>tee tee tee teu</i>, typically with three or four syllables.',
						'photo':	'images/lg-yellowlegs.jpg',
						'swf1':		'yellowlegs_teeteetee.mp3',
						'swf2':		'yellowlegs_courtship.mp3',
						'swf3':		'yellowlegs_alarmcalls.mp3',
						'swfdesc1':	'Teeteetee &amp; Song',
						'swfdesc2':	'Courtship Calls &amp; Song',
						'swfdesc3':	'Alarm Calls'
					},
'woodpecker':	{
						'title':	'Red-headed Woodpecker',
						'desc':		'<i>Melanerpes erythrocephalus</i><br/>(Adult)<br/>Call a rising <i>queerv</i>; shriller than Red-bellied, suggests Graycheeked Thrush flight call. In social situations, gives stuttering series of <i>uh-chuh!</i> notes.',
						'photo':	'images/lg-woodpecker.jpg',
						'swf1':		'woodpecker_callsdrumflight.mp3',
						'swf2':		'woodpecker_callslouddrums.mp3',
						'swf3':		'woodpecker_highcallsweakdrums.mp3',
						'swf4':		'woodpecker_chattercall.mp3',
						'swfdesc1':	'Calls, Drums, Flight Churr',
						'swfdesc2':	'Call &amp; Loud Drums',
						'swfdesc3':	'High Calls &amp; Weak Drums',
						'swfdesc4':	'Chatter Call'
					},
'thrush':	{
						'title':	'Wood Thrush',
						'desc':		'<i>Hylocichla mustelina</i><br/>(Adult)<br/>Song consists of flute-like phrase and tremulous buzz: <i>eeolayeeeee</i> and <i>purpapeeta-peeeee</i>. Call explosive: <i>pit! pit! pit!</i> Flight call a buzzy <i>zeeerng</i>.',
						'photo':	'images/lg-thrush.jpg',
						'swf1':		'woodthrush_song.mp3',
						'swf2':		'woodthrush_song2.mp3',
						'swf3':		'woodthrush_countersinging.mp3',
						'swf4':		'woodthrush_buppitvolleys.mp3',
						'swf5':		'woodthrush_pitvolleys.mp3',
						'swf6':		'woodthrush_eekcalls.mp3',
						'swfdesc1':	'Song',
						'swfdesc2':	'Song',
						'swfdesc3':	'Countersinging',
						'swfdesc4':	'Bup &amp; Pit Volleys',
						'swfdesc5':	'Pit Volleys',
						'swfdesc6':	'Eek Calls &amp; Bup Volleys'
					},
'warbler':	{
						'title':	'Yellow Warbler',
						'desc':		'<i>Dendroica petechia</i><br/>(Breeding Male)<br/>Variable song consists of slurred opening notes and emphatic ending: <i>tswee tswee tswee tweesyweet!</i> Call a loud, bright <i>chip!</i> Flight call a scratchy <i>zziit</i>.',
						'photo':	'images/lg-warbler.jpg',
						'swf1':		'warbler_dawnsinging.mp3',
						'swf2':		'warbler_song.mp3',
						'swf3':		'warbler_song2.mp3',
						'swf4':		'warbler_alarmchips.mp3',
						'swf5':		'warbler_interactioncalls.mp3',
						'swfdesc1':	'Dawn Singing with Song Switches',
						'swfdesc2':	'Song',
						'swfdesc3':	'Song',
						'swfdesc4':	'Alarm Chips',
						'swfdesc5':	'Pair Interaction Calls'
					},
'sparrow':	{
						'title':	'Song Sparrow',
						'desc':		'<i>Melospiza melodia</i><br/>(Adult)<br/>Song variable; most have clear opening whistles, followed by buzz or trill, then a few short notes. Call note a nasal <i>chemp</i>; flight call a high <i>seeet</i>.',
						'photo':	'images/lg-sparrow.jpg',
						'swf1':		'sparrow.mp3',
						'swf2':		'sparrow2.mp3',
						'swf3':		'sparrow3.mp3',
						'swf4':		'sparrow_chimpcalls.mp3',
						'swf5':		'sparrow_tinkchimp.mp3',
						'swf6':		'sparrow_immature.mp3',
						'swfdesc1':	'Stereo',
						'swfdesc2':	'Stereo',
						'swfdesc3':	'Song (Binaural)',
						'swfdesc4':	'Chimp Calls',
						'swfdesc5':	'Tink and Chimp calls',
						'swfdesc6':	'Immature Zeee'
					},
'dickcissel':	{
						'title':	'Dickcissel',
						'desc':		'<i>Spiza americana</i><br/>(Breeding Male)<br/>Song usually with two distinct parts: <i>chip chip wisss wisss wisss</i> (whence &quot;Dickcissel&quot;). Flight call, given by nocturnal migrants, a harsh, flatulent buzz.',
						'photo':	'images/lg-dickcissel.jpg',
						'swf1':		'dickcissel_song.mp3',
						'swf2':		'dickcissel_song2.mp3',
						'swf3':		'dickcissel_song3.mp3',
						'swf4':		'dickcissel_chickcalls.mp3',
						'swfdesc1':	'Song',
						'swfdesc2':	'Song',
						'swfdesc3':	'Song',
						'swfdesc4':	'Chick Calls'
					},
'meadowlark':	{
						'title':	'Western Meadowlark',
						'desc':		'<i>Sturnella neglecta</i><br/>(Adult Male)<br/>Very loud song more complex than Eastern; mix of low gurgles and high whistles. Call notes a short <i>terp</i> and slow rattle; flight call a rising, nasal <i>sween</i>.',
						'photo':	'images/lg-meadowlark.jpg',
						'swf1':		'meadowlark_song.mp3',
						'swf2':		'meadowlark_song2.mp3',
						'swf3':		'meadowlark_song3.mp3',
						'swf4':		'meadowlark_dawn.mp3',
						'swf5':		'meadowlark_flight.mp3',
						'swf6':		'meadowlark_churts.mp3',
						'swf7':		'meadowlark_churtschatter.mp3',
						'swfdesc1':	'Song',
						'swfdesc2':	'Song',
						'swfdesc3':	'Song',
						'swfdesc4':	'Dawn Chorus',
						'swfdesc5':	'Flight Song',
						'swfdesc6':	'Churts',
						'swfdesc7':	'Churts, Chatter &amp; Rattle'
					},
'oriole':	{
						'title':	'Baltimore Oriole',
						'desc':		'<i>Icterus galbula</i><br/>(Adult Male)<br/>Song a series of rich whistles, delivered slowly. Call note a rising rattle; flight call a short, rising <i>weert?</i> Calls often incorporated into song.',
						'photo':	'images/lg-oriole.jpg',
						'swf1':		'oriole_song.mp3',
						'swf2':		'oriole_song2.mp3',
						'swf3':		'oriole_song3.mp3',
						'swf4':		'oriole_harshsongs.mp3',
						'swf5':		'oriole_encountercalls.mp3',
						'swf6':		'oriole_nasalbegging.mp3',
						'swf7':		'oriole_chatter.mp3',
						'swfdesc1':	'Song',
						'swfdesc2':	'Song',
						'swfdesc3':	'Songs &amp; Calls',
						'swfdesc4':	'Harsh Songs &amp; Calls',
						'swfdesc5':	'Encounter Calls',
						'swfdesc6':	'Nasal begging Calls',
						'swfdesc7':	'Chatter of Immatures'
					}

					
};

function getAudio( id )
{
	var html	=	'';
	if ( birdsAudio[id] )
	{
		html		+= '<div id="full-image">';
		html		+= '<img src="'+ birdsAudio[id].photo +'"/>';
		html		+= '</div>';
		html		+= '<div id="image-details">';
		html		+= '<h2>'+ birdsAudio[id].title +'</h2>';
		html		+= '<p>'+ birdsAudio[id].desc +'</p>';
		html		+= '<p class="listen">Click to listen this bird:</p>';
		html		+= '<div class="audioswfs">';
		for (var i = 1; i <= 10; i++)
		{
			if (birdsAudio[id]['swf'+ i])
			{
				var swf = birdsAudio[id]['swf'+ i];
				html	+= '<object type="application/x-shockwave-flash" data="audio/player.swf" id="audioplayer'+ i +'" height="24" width="240">';
				html	+= '<param name="movie" value="audio/player.swf">';
				html	+= '<param name="FlashVars" value="playerID='+ i +'&amp;bg=0xf8f8f8&amp;leftbg=0x000000&amp;lefticon=0xffffff&amp;rightbg=0x41682a&amp;rightbghover=0x6a8f54&amp;righticon=0xffffff&amp;righticonhover=0xffffff&amp;text=0x000000&amp;slider=0x666666&amp;track=0xFFFFFF&amp;border=0x666666&amp;loader=0x41682a&amp;loop=no&amp;autostart=no&amp;soundFile=audio/'+ swf +'">';
				html	+= '<param name="quality" value="high">';
				html	+= '<param name="menu" value="false">';
				html	+= '<param name="wmode" value="transparent">';
				html	+= '</object>';
				html	+= '<div class="audiodesc">'+ birdsAudio[id]['swfdesc'+ i] +'</div>';
			}
		}
		html		+= '</div>';
		html		+= '</div>';
		html		+= '<br class="clear"/>';
	}
	return html;
}

function showAudio( id )
{
	document.write( getAudio( id ) );
}

function swapAudio( id )
{
	$( birdsDiv ).innerHTML = getAudio( id );
}
