$(document).ready(function(){
/*
    $('#flash-video').flash({
        swf: '/swf/flvplayer.swf',
        width: 1003,
        height: 576,
        wmode: 'transparent',
		flashvars: {
			source: '/media/test.flv'
	    }
	});
	*/

	$("#unbenannt,#fernsehaufzeichnungen,#passion,#snapshots,#galerie,#ept,#bio").fancybox({
		'opacity'			: true,
		'overlayShow'		: true,
		'width'				: 920,
		'height'			: 520,
		'autoScale'			: false,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'speedIn'			: 200,
		'speedOut'			: 200,
		'type'				: 'iframe',
		'scrolling'			: 'yes'
	});
	

	$("#europeanpokerawards,#ept2009,#allin4kids,#pokerstars,#pokerface,#pressegalerie,#tvspots,#pokerem,#kolumnen").fancybox({
		'opacity'			: true,
		'overlayShow'		: true,
		'width'				: 920,
		'height'			: 520,
		'autoScale'			: false,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'speedIn'			: 200,
		'speedOut'			: 200,
		'type'				: 'iframe',
		'scrolling'			: 'yes'
	});

	$("#cover").fancybox({
		'opacity'			: true,
		'overlayShow'		: true,
		'width'				: 920,
		'height'			: 520,
		'autoScale'			: false,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'speedIn'			: 200,
		'speedOut'			: 200,
		'type'				: 'iframe',
		'scrolling'			: 'no'
	});

	$(".img001").mouseenter(function () {$(".img001_hover").fadeIn(400);});
	$(".img001_hover").mouseout(function () {$(".img001_hover").fadeOut(200);});
	$(".img001_hover").click(function () {$(".img001_hover").hide();});
	
	$(".img002").mouseenter(function () {$(".img002_hover").fadeIn(400);});
	$(".img002_hover").mouseout(function () {$(".img002_hover").fadeOut(400);});
	$(".img002_hover").click(function () {$(".img002_hover").hide();});
	
	$(".img003").mouseenter(function () {$(".img003_hover").fadeIn(400);});
	$(".img003_hover").mouseout(function () {$(".img003_hover").fadeOut(400);});
	$(".img003_hover").click(function () {$(".img003_hover").hide();});
	
	$(".img004").mouseenter(function () {$(".img004_hover").fadeIn(400);});
	$(".img004_hover").mouseout(function () {$(".img004_hover").fadeOut(400);});
	$(".img004_hover").click(function () {$(".img004_hover").hide();});

	$(".img005").mouseenter(function () {$(".img005_hover").fadeIn(400);});
	$(".img005_hover").mouseout(function () {$(".img005_hover").fadeOut(400);});
	$(".img005_hover").click(function () {$(".img005_hover").hide();});
	
	$(".img006").mouseenter(function () {$(".img006_hover").fadeIn(400);});
	$(".img006_hover").mouseout(function () {$(".img006_hover").fadeOut(400);});
	$(".img006_hover").click(function () {$(".img006_hover").hide();});
	
	$(".img007").mouseenter(function () {$(".img007_hover").fadeIn(400);});
	$(".img007_hover").mouseout(function () {$(".img007_hover").fadeOut(400);});
	$(".img007_hover").click(function () {$(".img007_hover").hide();});
	
	$(".img008").mouseenter(function () {$(".img008_hover").fadeIn(400);});
	$(".img008_hover").mouseout(function () {$(".img008_hover").fadeOut(400);});
	$(".img008_hover").click(function () {$(".img008_hover").hide();});

	$(".img009").mouseenter(function () {$(".img009_hover").fadeIn(400);});
	$(".img009_hover").mouseout(function () {$(".img009_hover").fadeOut(400);});
	$(".img009_hover").click(function () {$(".img009_hover").hide();});
	
	$(".img010").mouseenter(function () {$(".img010_hover").fadeIn(400);});
	$(".img010_hover").mouseout(function () {$(".img010_hover").fadeOut(400);});
	$(".img010_hover").click(function () {$(".img010_hover").hide();});

	$(".img011").mouseenter(function () {$(".img011_hover").fadeIn(400);});
	$(".img011_hover").mouseout(function () {$(".img011_hover").fadeOut(400);});
	$(".img011_hover").click(function () {$(".img011_hover").hide();});
	
	$(".img012").mouseenter(function () {$(".img012_hover").fadeIn(400);});
	$(".img012_hover").mouseout(function () {$(".img012_hover").fadeOut(400);});
	$(".img012_hover").click(function () {$(".img012_hover").hide();});

	$(".img013").mouseenter(function () {$(".img013_hover").fadeIn(400);});
	$(".img013_hover").mouseout(function () {$(".img013_hover").fadeOut(400);});
	$(".img013_hover").click(function () {$(".img013_hover").hide();});
	
	$(".img014").mouseenter(function () {$(".img014_hover").fadeIn(400);});
	$(".img014_hover").mouseout(function () {$(".img014_hover").fadeOut(400);});
	$(".img014_hover").click(function () {$(".img014_hover").hide();});

	$(".img015").mouseenter(function () {$(".img015_hover").fadeIn(400);});
	$(".img015_hover").mouseout(function () {$(".img015_hover").fadeOut(400);});
	$(".img015_hover").click(function () {$(".img015_hover").hide();});
	
	$(".img016").mouseenter(function () {$(".img016_hover").fadeIn(400);});
	$(".img016_hover").mouseout(function () {$(".img016_hover").fadeOut(400);});
	$(".img016_hover").click(function () {$(".img016_hover").hide();});	
	
	
	/*$(".img001").click(function () {
		$('#test').hide();
		$(".img001_pop").show("scale", {direction: 'both'}, 1000);
		var i = 1 - $("div").index(this);
		$(this).effect("transfer", { to: $("div").eq(i) }, 2000);
		$('#test').delay(1200).fadeIn(1500);
	});	*/


	
	$("#close").live('click', function(){
		$(".img001_pop").hide("scale", {direction: 'both'}, 1000);
		$('#test').hide();
	});
	
	$("#bgvideo").videoBG({
		mp4:"media/sandra.mp4",
		ogv:"media/sandra.ogv",
		webm:"media/sandra.webm",	
		scale:true,
		loop: false
	});
	
	var ua = $.browser;
	if ( ua.mozilla && ua.version.slice(0,3) == "2.0" ) {
		$('#bgvideoff').show();
		$('#bgvideo').hide();
	}

	showWidth("window", $(window).width()); 
			
	function showWidth(ele, w) {
	
		$(".siktepeng").text("The width for the " + ele + " is " + w + "px.");
		if(w<=1500){
		$("#bgvideo").css('margin-left','-110px');
		}
		if(w<=1280){
		$("#bgvideo").css('margin-left','-110px');
		}
		else{
		$("#bgvideo").css('margin-left','-245px');
		}
	
	}
	
});
