$(document).ready(function() {
		
		hideMedia();
		hideButtons();
		$('#productsDiv').hide();
		$('#projectsDiv').hide();
		$('#studiosDiv').hide();
		$('#infosDiv').hide();
		$('#home').show();
		$('#facebook').show();
		$('#youtube').show();
			
			$("#pokertroniclogo").click(function(){
			hideContentDivs();
			hideMedia();
			hideButtons();
			
			$('#home').show();
			});
			
// ************************************Mouseover*****************************  	

//          MainMenue		
			$("#products").mouseover(function(){
				if(document.getElementById('products').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('products');
			}).mouseout(function(){
				if(document.getElementById('products').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('products');
			});
			
			$("#projects").mouseover(function(){
				if(document.getElementById('projects').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('projects');
			}).mouseout(function(){
				if(document.getElementById('projects').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('projects');
			});
			
			$("#pokertronictv").mouseover(function(){
				if(document.getElementById('pokertronictv').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('pokertronictv');
			}).mouseout(function(){
				if(document.getElementById('pokertronictv').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('pokertronictv');
			});
			
			$("#studios").mouseover(function(){
				if(document.getElementById('studios').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('studios');
			}).mouseout(function(){
				if(document.getElementById('studios').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('studios');
			});
			
			$("#infos").mouseover(function(){
				if(document.getElementById('infos').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('infos');
			}).mouseout(function(){
				if(document.getElementById('infos').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('infos');
			});
			
			
			
//          SubMenueButtons
			$("#buttonProducts1").mouseover(function(){
				if(document.getElementById('buttonProducts1').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProducts1');
			}).mouseout(function(){
				if(document.getElementById('buttonProducts1').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProducts1');
			});
			$("#buttonProducts2").mouseover(function(){
				if(document.getElementById('buttonProducts2').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProducts2');
			}).mouseout(function(){
				if(document.getElementById('buttonProducts2').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProducts2');
			});
			$("#buttonProducts3").mouseover(function(){
				if(document.getElementById('buttonProducts3').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProducts3');
			}).mouseout(function(){
				if(document.getElementById('buttonProducts3').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProducts3');
			});
			$("#buttonProducts4").mouseover(function(){
				if(document.getElementById('buttonProducts4').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProducts4');
			}).mouseout(function(){
				if(document.getElementById('buttonProducts4').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProducts4');
			});
			
			
			$("#buttonProjects1").mouseover(function(){
				if(document.getElementById('buttonProjects1').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProjects1');
			}).mouseout(function(){
				if(document.getElementById('buttonProjects1').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProjects1');
			});
			$("#buttonProjects2").mouseover(function(){
				if(document.getElementById('buttonProjects2').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProjects2');
			}).mouseout(function(){
				if(document.getElementById('buttonProjects2').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProjects2');
			});
			$("#buttonProjects3").mouseover(function(){
				if(document.getElementById('buttonProjects3').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonProjects3');
			}).mouseout(function(){
				if(document.getElementById('buttonProjects3').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonProjects3');
			});
			

			$("#buttonStudios1").mouseover(function(){
				if(document.getElementById('buttonStudios1').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonStudios1');
			}).mouseout(function(){
				if(document.getElementById('buttonStudios1').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonStudios1');
			});
			$("#buttonStudios2").mouseover(function(){
				if(document.getElementById('buttonStudios2').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonStudios2');
			}).mouseout(function(){
				if(document.getElementById('buttonStudios2').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonStudios2');
			});
			
			
			$("#buttonInfos1").mouseover(function(){
				if(document.getElementById('buttonInfos1').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonInfos1');
			}).mouseout(function(){
				if(document.getElementById('buttonInfos1').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonInfos1');
			});
			$("#buttonInfos2").mouseover(function(){
				if(document.getElementById('buttonInfos2').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonInfos2');
			}).mouseout(function(){
				if(document.getElementById('buttonInfos2').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonInfos2');
			});
			$("#buttonInfos3").mouseover(function(){
				if(document.getElementById('buttonInfos3').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonInfos3');
			}).mouseout(function(){
				if(document.getElementById('buttonInfos3').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonInfos3');
			});
			$("#buttonInfos4").mouseover(function(){
				if(document.getElementById('buttonInfos4').style.backgroundPosition != "0px -100px")
			hoverMenuBtn('buttonInfos4');
			}).mouseout(function(){
				if(document.getElementById('buttonInfos4').style.backgroundPosition != "0px -100px")
			deactivateMenuBtn('buttonInfos4');
			});
			
			
//************ Onclicks *******************

//       	MeuneButtons
			$("#products").click(function(){
			hideContentDivs();
			hideMedia();
			hideButtons();
			activateFirstOnes();
			$('#buttonProducts1').show();
			$('#buttonProducts2').show();
			$('#buttonProducts3').show();
			$('#buttonProducts4').show();
			$('#productsDiv').show();
			$('#rfid').show();
			$('#body_content').show();
			});
			
			
			$("#projects").click(function(){
			hideContentDivs();
			hideMedia();
			hideButtons();
			activateFirstOnes();
			$('#buttonProjects1').show();
			$('#buttonProjects2').show();
			$('#buttonProjects3').show();
			$('#projectsDiv').show();
			$('#casino').show();
			$('#body_content').show();
			});
			
			$("#pokertronictv").click(function(){
				showPokertronicTv();
				});
			
			$("#studios").click(function(){
			hideContentDivs();
			hideMedia();
			hideButtons();
			activateFirstOnes();
			$('#buttonStudios1').show();
			$('#buttonStudios2').show();
			$('#studiosDiv').show();
			$('#berlin').show();
			$('#body_content').show();
			});
			
			
			$("#infos").click(function(){
			hideContentDivs();
			hideMedia();
			hideButtons();
			activateFirstOnes();
			$('#buttonInfos1').show();
			$('#buttonInfos2').show();
			$('#buttonInfos3').show();
			$('#buttonInfos4').show();
			$('#infosDiv').show();
			$('#wer').show();
			$('#body_content').show();
			});
			
//       	SubMeuneButtons
			$("#buttonProducts1").click(function(){
				hideMedia();
				$('#rfid').show();
				});
			$("#buttonProducts2").click(function(){
				hideMedia();
				$('#livestream').show();
				});
			$("#buttonProducts3").click(function(){
				hideMedia();
				$('#onsite').show();
				});
			$("#buttonProducts4").click(function(){
				hideMedia();
				$('#tracking').show();
				});
			$("#buttonProjects1").click(function(){
				hideMedia();
				$('#casino').show();
				});
			$("#buttonProjects2").click(function(){
				hideMedia();
				$('#events2').show();
				});
			$("#buttonProjects3").click(function(){
				hideMedia();
				$('#pelopoker').show();
				});
			$("#buttonStudios1").click(function(){
				hideMedia();
				$('#berlin').show();
				});
			$("#buttonStudios2").click(function(){
				hideMedia();
				$('#regensburg').show();
				});
			$("#buttonInfos1").click(function(){
				hideMedia();
				$('#wer').show();
				});
			$("#buttonInfos2").click(function(){
				hideMedia();
				$('#jobs').show();
				});
			$("#buttonInfos3").click(function(){
				hideMedia();
				$('#kontakt').show();
				});
			$("#buttonInfos4").click(function(){
				hideMedia();
				$('#referenzen').show();
				});	
			
			setBodyBackground();
			makeHeaders();


// ************************************Konfigurator-Mouseover***************************** 				
				
document.getElementById('Fobtn').style.backgroundPosition = "0px 0px";
	
$("#Fobtn").mouseover(function(){
	
				if(document.getElementById('Spbtn').style.backgroundPosition == "-103px -22px")
					document.getElementById('Fobtn').style.backgroundPosition = "0px -132px";
				else if(document.getElementById('Fobtn').style.backgroundPosition != "0px 0px")
					document.getElementById('Fobtn').style.backgroundPosition = "0px -110px";
			}).mouseout(function(){
				if(document.getElementById('Spbtn').style.backgroundPosition == "-103px -22px")
					document.getElementById('Fobtn').style.backgroundPosition = "0px -22px";
				else if(document.getElementById('Fobtn').style.backgroundPosition != "0px 0px")
			        document.getElementById('Fobtn').style.backgroundPosition = "0px -44px";
			});
			
$("#Spbtn").mouseover(function(){
	
				if(document.getElementById('Tbbtn').style.backgroundPosition == "-195px -44px")
					document.getElementById('Spbtn').style.backgroundPosition = "-103px -132px";
				else if(document.getElementById('Spbtn').style.backgroundPosition != "-103px -22px")
					document.getElementById('Spbtn').style.backgroundPosition = "-103px -110px";
			}).mouseout(function(){
				if(document.getElementById('Tbbtn').style.backgroundPosition == "-195px -44px")
					document.getElementById('Spbtn').style.backgroundPosition = "-103px -44px";
				else if(document.getElementById('Spbtn').style.backgroundPosition != "-103px -22px")
			        document.getElementById('Spbtn').style.backgroundPosition = "-103px 0px";
			});		
			
$("#Tbbtn").mouseover(function(){
	
				if(document.getElementById('Armbtn').style.backgroundPosition == "-287px -66px")
					document.getElementById('Tbbtn').style.backgroundPosition = "-195px -132px";
				else if(document.getElementById('Tbbtn').style.backgroundPosition != "-195px -44px")
					document.getElementById('Tbbtn').style.backgroundPosition = "-195px -110px";
			}).mouseout(function(){
				if(document.getElementById('Armbtn').style.backgroundPosition == "-287px -66px")
					document.getElementById('Tbbtn').style.backgroundPosition = "-195px -66px";
				else if(document.getElementById('Tbbtn').style.backgroundPosition != "-195px -44px")
			        document.getElementById('Tbbtn').style.backgroundPosition = "-195px 0px";
			});	
					
$("#Armbtn").mouseover(function(){
	
				if(document.getElementById('Aubtn').style.backgroundPosition == "-379px -88px")
					document.getElementById('Armbtn').style.backgroundPosition = "-287px -132px";
				else if(document.getElementById('Armbtn').style.backgroundPosition != "-287px -66px")
					document.getElementById('Armbtn').style.backgroundPosition = "-287px -110px";
			}).mouseout(function(){
				if(document.getElementById('Aubtn').style.backgroundPosition == "-379px -88px")
					document.getElementById('Armbtn').style.backgroundPosition = "-287px -88px";
				else if(document.getElementById('Armbtn').style.backgroundPosition != "-287px -66px")
			        document.getElementById('Armbtn').style.backgroundPosition = "-287px 0px";
			});	
			
$("#Aubtn").mouseover(function(){
	
				if(document.getElementById('Kabtn').style.backgroundPosition == "-379px -88px")
					document.getElementById('Aubtn').style.backgroundPosition = "-287px -132px";
				else if(document.getElementById('Aubtn').style.backgroundPosition != "-379px -88px")
					document.getElementById('Aubtn').style.backgroundPosition = "-287px -110px";
			}).mouseout(function(){
				if(document.getElementById('Kabtn').style.backgroundPosition == "-379px -88px")
					document.getElementById('Aubtn').style.backgroundPosition = "-287px -88px";
				else if(document.getElementById('Aubtn').style.backgroundPosition != "-379px -88px")
			        document.getElementById('Aubtn').style.backgroundPosition = "-287px 0px";
			});	
						
$("#Kabtn").mouseover(function(){
				if(document.getElementById('Kabtn').style.backgroundPosition != "-379px -88px")
			document.getElementById('Kabtn').style.backgroundPosition = "-379px -110px";
			}).mouseout(function(){
				if(document.getElementById('Kabtn').style.backgroundPosition != "-379px -88px")
			document.getElementById('Kabtn').style.backgroundPosition = "-379px -0px";
			});				
												
});

function showPokertronicTv()
{
	hideContentDivs();
	hideMedia();
	hideButtons();
	activateFirstOnes();
	$('#pokertronictvMedia').show();
	$('#body_content').hide();
	$('#facebook').show();
	$('#youtube').show();
	showFirstVideo();
}
