/* Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
 */
jQuery.extend({
/**
* Returns get parameters.
*
* If the desired param does not exist, null will be returned
*
* @example value = $.getURLParam("paramName");
*/ 
 getURLParam: function(strParamName){
	  var strReturn = "";
	  var strHref = window.location.href;
	  var bFound=false;
	  
	  var cmpstring = strParamName + "=";
	  var cmplen = cmpstring.length;

	  if ( strHref.indexOf("?") > -1 ){
	    var strQueryString = strHref.substr(strHref.indexOf("?")+1);
	    var aQueryString = strQueryString.split("&");
	    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
	      if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
	        var aParam = aQueryString[iParam].split("=");
	        strReturn = aParam[1];
	        bFound=true;
	        break;
	      }
	      
	    }
	  }
	  if (bFound==false) return null;
	  return strReturn;
	}
});

$(document).ready(function(){

  		$('.profildiv').attr('style','display: none; height:1px; width: 1px; left: -100px;');
  		$('.impressum_pop').attr('style','display: none; height:1px; width: 1px; left: -100px;');

  		$('.first_text').children().hide();
  		$('.second_text').children().hide();
  		$('.third_text').children().hide();
  		$('.fourth_text').children().hide();
  		
  		$("a").click(function (){
  			$('#first_logo').css({'background-position': 'left bottom'});
	  		$('.first_text').children().hide();
	  		$('#second_logo').css({'background-position': 'left bottom'});
	  		$('.second_text').children().hide();
	  		$('#third_logo').css({'background-position': 'left bottom'});
	  		$('.third_text').children().hide();
	  		$('#fourth_logo').css({'background-position': 'left bottom'});
	  		$('.fourth_text').children().hide();
  		});

  		
  		
		  $('.logos_firstcolumn').hover(
				  function() {
			  		$('#first_logo').css({'background-position': 'left top'});
			  		$('.first_text').children().show();
				   },
				   function() {
				  		$('#first_logo').css({'background-position': 'left bottom'});
				  		$('.first_text').children().hide();
						}
		  );

		  $('.first_text').hover(
				  function() {
			  		$('#first_logo').css({'background-position': 'left top'});
			  		$('.first_text').children().show();
		  },  
				  function() {
				  		$('#first_logo').css({'background-position': 'left bottom'});
				  		$('.first_text').children().hide();
						});
		 
		  //2.logo und text
		  	
		  $('.logos_secondcolumn').hover(
				  function() {
			  		$('#second_logo').css({'background-position': 'left top'});
			  		$('.second_text').children().show();
					 },
				   function() {
				  		$('#second_logo').css({'background-position': 'left bottom'});
				  		$('.second_text').children().hide();
					}
		  );

		  $('.second_text').hover(
				  function() {
			  		$('#second_logo').css({'background-position': 'left top'});
			  		$('.second_text').children().show();
		  },  
				  function() {
				  		$('#second_logo').css({'background-position': 'left bottom'});
				  		$('.second_text').children().hide();
						});


		//3.logo und Text
		
		  $('.logos_thirdcolumn').hover(
				  function() {
			  		$('#third_logo').css({'background-position': 'left top'});
			  		$('.third_text').children().show();
					},
				   function() {
				  		$('#third_logo').css({'background-position': 'left bottom'});
				  		$('.third_text').children().hide();
					}
		  );
		  $('.third_text').hover(
				  function() {
			  		$('#third_logo').css({'background-position': 'left top'});
			  		$('.third_text').children().show();
		  },  
				  function() {
				  		$('#third_logo').css({'background-position': 'left bottom'});
				  		$('.third_text').children().hide();
						});

			//4.logo und Text
			
		  $('.logos_fourthcolumn').hover(
				  function() {
			  		$('#fourth_logo').css({'background-position': 'left top'});
			  		$('.fourth_text').children().show();
					},
				   function() {
				  		$('#fourth_logo').css({'background-position': 'left bottom'});
				  		$('.fourth_text').children().hide();
					}
		  );
		  $('.fourth_text').hover(
				  function() {
			  		$('#fourth_logo').css({'background-position': 'left top'});
			  		$('.fourth_text').children().show();
		  },  
				  function() {
				  		$('#fourth_logo').css({'background-position': 'left bottom'});
				  		$('.fourth_text').children().hide();
						});		
			
		//karriere klick funct.
		  $(".karriere a").click(function(){
			  	//$("body").css("background", "grey");
			  	
		    	$("#fadebg").fadeIn('fast');
		    	$(".profildiv").attr('style','display: none; top: 10px; left: 50%; margin-left: -470px; width: 950px; height: 600px;');
		    	$(".profildiv").fadeIn('slow');
		    	return false;
		    });

		    $("#close").click(function(){
		    	$("#fadebg").fadeOut('fast');
		    	$(".profildiv").fadeOut('slow');
		        });
		    
		    //impressum klick funct.
		    $(".footer_text a").click(function(){
				  	//$("body").css("background", "grey");
				  	
			    $("#fadebg").fadeIn('fast');
			    $(".impressum_pop").attr('style','display: none; top: 10px; left: 50%; margin-left: -470px; width: 950px; height: 600px;');
			    $(".impressum_pop").fadeIn('slow');
			    return false;
			 });
		    
			$("#imp_close").click(function(){
			    $("#fadebg").fadeOut('fast');
			    $(".impressum_pop").fadeOut('slow');
			       });
			       
			if ($.getURLParam("karriere")==null) {

			}else{
			
				$("#fadebg").fadeIn('fast');
		    	$(".profildiv").attr('style','display: none; top: 10px; left: 50%; margin-left: -470px; width: 950px; height: 600px;');
		    	$(".profildiv").fadeIn('slow');
		    	return false;
		}       

  });


