// JavaScript Document

//swapper
function swap(active_tab)
		{
			var swap_tabs=document.getElementById("swapper_tabs").childNodes;
			var swap_content=document.getElementById("swapper_content").childNodes;
			for (i=0;i<=swap_tabs.length-1;i++)
			{
				//alert(swap_tabs[i].id);
				if(swap_tabs[i].id == active_tab){
					$(swap_tabs[i]).animate({ color: window.swapper_tab_active_color }, { queue:false, duration:125 });
					swap_tabs[i].className = "swapper_tab_active";
				}else{
					$(swap_tabs[i]).animate({ color: window.swapper_tab_inactive_color }, { queue:false, duration:125 });
					swap_tabs[i].className = "swapper_tab_inactive";
				};
			};
			for (i=0;i<=swap_tabs.length-1;i++)
			{
				if(swap_content[i].id == active_tab){
					swap_content[i].className = "swapper_content_active";
				}else{
					swap_content[i].className = "swapper_content_inactive";
				};
			};
		};
		
$(document).ready(function () {
	// button hover
	$(".button").animate({ opacity:0.65 }, { queue:false, duration:1 });
	$(".player").hover(
		function () {
			$(".button").animate({ opacity:1 }, { queue:false, duration:"normal" });
		},
		function () {
			$(".button").animate({ opacity:0.65 }, { queue:false, duration:"normal" });
		}
	);
	// menu hover
	$(".menu_item_inactive").hover(
		function () {
			$(this).animate({ color: "#d9d9d9" }, { queue:false, duration:"fast" });
		},
		function () {
			$(this).animate({ color: "#999" }, { queue:false, duration:"fast" });
		}
	);
	// swapper hover
	$(".swapper_tab_active").hover(
		function () {
			if($(this).attr('class')=="swapper_tab_inactive"){$(this).animate({ color:window.swapper_tab_inactive_hovercolor }, { queue:false, duration:"fast" });};
		},
		function () {
			if($(this).attr('class')=="swapper_tab_inactive"){$(this).animate({ color:window.swapper_tab_inactive_color }, { queue:false, duration:"fast" });};
		}
	);
	$(".swapper_tab_inactive").hover(
		function () {
			if($(this).attr('class')=="swapper_tab_inactive"){$(this).animate({ color:window.swapper_tab_inactive_hovercolor }, { queue:false, duration:"fast" });};
		},
		function () {
			if($(this).attr('class')=="swapper_tab_inactive"){$(this).animate({ color:window.swapper_tab_inactive_color }, { queue:false, duration:"fast" });};
		}
	);
});

// flowplayer 3
//flowplayer("player", "flowplayer/flowplayer.swf",{
//		clip: {
//			scaling: 'fit'
//		},
//		plugins: { 
//   			controls: { 
//				url: 'flowplayer.controls.swf',
//				autoHide: 'always',
//				borderRadius: '0px',
//				durationColor: '#b3b3b3',
//				backgroundColor: '#000000',
//				bufferGradient: 'none',
//				buttonColor: '#474747',
//				progressGradient: 'medium',
//				bufferColor: '#000000',
//				backgroundGradient: 'low',
//				buttonOverColor: '#363636',
//				progressColor: '#0f0f0f',
//				timeColor: '#ffffff',
//				sliderColor: '#171717',
//				sliderGradient: 'none',
//				backgroundColor:'transparent'
//				//opacity:0.7
//			}
//		},
//		canvas: {
//			backgroundGradient: 'none',
//			backgroundColor:'#000000',
//		}
//	});

// flowplayer 2
var agent=navigator.userAgent.toLowerCase();
var is_iphone = (agent.indexOf('iphone')!=-1);
 $(function() {
			if(!is_iphone) {
			$("a.player").flowembed({src: '../flowplayer/FlowPlayerDark.swf', wmode: 'transparant'},  {fullScreenScriptURL: '../js/fullscreen.js',
			initialScale: 'scale',
			initialVolumePercentage: 100,
			bufferLength: 500,
			startingBufferLength: 5,
			showMenu: false,
			controlsOverVideo: 'ease',
			controlBarBackgroundColor: 'black',
			backgroundColor: -1,
			timeDisplayFontColor: 0xbfbfbf,
			useNativeFullScreen: true
			}, {fallback: 'flv'});		
			}
		});  
