/* JDSFA */
/* Functions
----------------------------------------------------------------------------- */


	$(window).load(function() {
	
		if (page == "index") {
	
			cameraOne();
		
		}
	

		// replace();

	
/* Tabs
----------------------------------------------------------------------------- */

	
	if (page == "index") {


		$('#panel-player > ul').tabs({ 
		
			fxFade: true, 
			load: function(ui) {

				if ( $('li.selected').children('a').attr('id') == "tab-cam-one") {
				
				$('#player_two embed').remove();
				$('#player_three embed').remove();		

				}
				
				if ( $('li.selected').children('a').attr('id') == "tab-cam-two") {
				
				$('#player_one embed').remove();
				$('#player_three embed').remove();
				
				}
				
				if ( $('li.selected').children('a').attr('id') == "tab-cam-three") {
				
				$('#player_one embed').remove();
				$('#player_two embed').remove();
				
				}				
		
  	  		},
			show: function(ui) {

				if ( $('li.selected').children('a').attr('id') == "tab-cam-one") {
				
				cameraOne();
				
				}
				
				if ( $('li.selected').children('a').attr('id') == "tab-cam-two") {
				
				cameraTwo();
				
				}
				
				if ( $('li.selected').children('a').attr('id') == "tab-cam-three") {
				
				cameraThree();
				
				}				
		
  	  		}
		
		});


		/* if ($('div.prompt').length > 0) {
		
			$('div.prompt').click(function() {
		
				$(this).siblings('object').remove();
				$(this).addClass('show');
				$(this).siblings('p.prompt').fadeIn();
			
			});
	
		} */
		
		/* CHAT PROMPT */

		if (logged_in == "false") {

			$('#dim').click(function() {

				$('#chat .prompt.chat').show();

			});

		}
		

	}


/* Mailing List Text
----------------------------------------------------------------------------- */

	
	$("#mailing-list #mailing_list_entry_email").val("Enter your e-mail address to download the track 'Got Money'.").attr("title", "Enter your e-mail address to download the track 'Got Money'.");
	$("#mailing-list input[type=text]").click(function() {
				
		var label = $(this).attr("title");
		if (label == $(this).val()) {
					
			$(this).val("");
					
		}
					
	});
	
	$("#mailing-list input[type=text]").blur(function() {
			
		var label = $(this).attr("title");
		if ($(this).val() == "") {
				
			$(this).val(label);
				
		}
				
	});
	

/* Track Analytics
----------------------------------------------------------------------------- */
		
	
	$('ul.tracks a').click(function() {
	
		var download = $(this).attr('id');
		pageTracker._trackPageview(download);

	});
	

/* End Load Function
----------------------------------------------------------------------------- */	
	
	
	});
	

/* Functions
----------------------------------------------------------------------------- */
	
	
	function cameraOne()  {
	
		var cam_one = new SWFObject( "http://www.ustream.tv/flash/live/255676", "instance_one", "400", "320", "9", "#000000" );
		cam_one.addParam( "allowScriptAccess", "always" );
		cam_one.addParam( "allowFullScreen" , "true" );
		cam_one.addVariable( "playerID", "instance_one" );
		cam_one.addVariable( "brand", "embed" );
		cam_one.addVariable( "autoPlay", "false" );
		cam_one.write( "player_one" );
					
	}
	
	function cameraTwo() {
	
		var cam_two = new SWFObject( "http://www.ustream.tv/flash/live/257080", "instance_two", "400", "320", "9", "#000000" );
		cam_two.addParam( "allowScriptAccess", "always" );
		cam_two.addParam( "allowFullScreen" , "true" );
		cam_two.addVariable( "playerID", "instance_two" );
		cam_two.addVariable( "brand", "embed" );
		cam_two.addVariable( "autoPlay", "false" );
		cam_two.write( "player_two" );
		
	}

	function cameraThree() {
	
		var cam_three = new SWFObject( "http://www.ustream.tv/flash/live/257083", "instance_three", "400", "320", "9", "#000000" );
		cam_three.addParam( "allowScriptAccess", "always" );
		cam_three.addParam( "allowFullScreen" , "true" );
		cam_three.addVariable( "playerID", "instance_three" );
		cam_three.addVariable( "brand", "embed" );
		cam_three.addVariable( "autoPlay", "false" );
		cam_three.write( "player_three" );
		
	}

