$(function() {
	$('.popup').click(function(){
		var popup = window.open(this.href, "Dancing For Him", "menubar=no,width=450,height=400,scrollbars=yes,toolbar=no");
		if (window.focus) {
			popup.focus();
		}
		return false;
	});


	$('#horizontalNavigation').dropmenu();
	$('a[rel="lightboxLink"]').lightBox({useOverlayInIE:false, fixedNavigation:true, imageRoot:"/cirkuit/includes/"});

	if(location.host.indexOf(".cirkuit.net") == -1){ //dont run flowplayer in backend. wastes bandwith and slows things down
		flowplayer("player", "/cirkuit/includes/flash/flowplayer/3.1.5/flowplayer.swf", {
			clip: {
				autoBuffering: true,
				onStart: function() {
					this.mute();
				},
				scaling: "fit"
			},
			playlist: [{
					url: "/video/DFH-widescreen.flv",
					onBegin: function () {
						this.getPlugin("play").css({opacity: 1});
				  	}
				}, {
					url: "/video/end-widescreen.png",
					onBegin: function () {
						this.getPlugin("play").css({opacity: 0});
				  	}
				}
			],
			plugins:{
				controls: {
					all: false,
					mute: true,
					volume: false,
					scrubber: true,
					fullscreen: true,
					autoHide: 'always',
					timeColor: '#e2c7e2',
					bufferColor: '#eddced',
					progressColor: '#666666',
					hideDelay: 1000,
					backgroundColor: '#663366',
					backgroundGradient: 'none'
				}
			}
		});
	}
});
