            /*
$Id: main_functions.js,v 1.24 2008-08-11 14:13:21 typo3kk Exp $
*/

var yPos, xPos;

$(document).ready(function(){
	


	$(".link_pic").fancybox({
			'overlayShow': true,
			'overlayOpacity': 0.75,
			'zoomOpacity': false,
			'centerOnScroll': true
	});
	
	
	$(".link_url").fancybox({
			'overlayShow': true,
			'overlayOpacity': 0.9,
			'frameHeight': '600',
			'frameWidth': '950',
			'easingIn': true,
			'easingOut': true,
			'centerOnScroll': true						
	});	
		
	
	$(".gallery_pics_link").fancybox({
			'overlayShow': true,
			'overlayOpacity': 0.75
	
	}); 	
	

	
	//$.ifixpng('fileadmin/enermax/img/icons/pixel.gif');
	//$('img[@src$=.png]').ifixpng(); 
	

	//News-Navigation 
	if($('#news_nav').length>=1)
	{
			$("#news_nav").accordion({
				active: false,
				header: '.news_nav_link',
          			event: 'click',
          			animated: false,
   				clearStyle: true,
				autoHeight: false,
   				navigation: true,
   				navigationFilter: function() {
          		 		
      					return this.href.toLowerCase() == location.href.toLowerCase();
      
    				}	
			});
	}
	
	
	
	$("#product_nav").accordion({
			active: false,
			header: '.product_nav_title',
           		 autoHeight: true,
          		 navigation: true
          			
			});
			
			
	
	
	
		
	if($('#product_content').length>=1)
	{
	    $("#product_content > ul").tabs();
	    $(".product_detail_nav li a").click(function(){
	    				changeContentHeight();
			}
		);
	 }
	changeContentHeight()
	// Anpassung der Hoehe Award Teaser rechts / MAincontent bei unterschiedlichen Werten  
	if($('#latest_awards').length>=1)
	{
		if ( $('#latest_awards').height() < $('#maincontent').height())
		{
			$('#latest_awards .teaser_content').height($('#maincontent').height()-45);
		}
	}
	
	if ( (navigator.platform == 'MacPPC' || navigator.platform == 'MacIntel') ){
	
		jQuery.each(jQuery.browser, function(i, val) {
		  if(i=="mozilla" && jQuery.browser.version.substr(0,3)=="1.9")
		    $('#product_nav li').css('padding', '2px 0px' );
		    $('#product_nav li .product_nav_content li').css('padding', '0 0 0 20px');
			
		});
	}
	
	if($('.product_nav_content .current').size()>=1)
	{
	
	$('.product_nav_content .current').parent().addClass("theone");
	}
	
	
	
		 
	
	
});

// Anpassung der Hoehe Linker Teaser / MAincontent bei unterschiedlichen Werten
function changeContentHeight()
{
    /*
	if ( $('#info_teaser').height() > $('#maincontent').height())
	  {
	  	window.setTimeout(
	  	    function(){
	  	        $('#empty_teaser .teaser_content').height($('#maincontent').height()-$('#info_teaser').height());
	  	        
	  	    } 	 ,1000);
	  	$('#maincontent .teaser_content:last').css('min-height',$('#info_teaser').height()-80)
	  	if($.browser.msie && $.browser.version <= 6)	{
				$('#maincontent .teaser_content:last').css('height',$('#info_teaser').height()-106)
	   }	  	
	  }
	  else if($('#info_teaser').height() < $('#maincontent').height()){
	       window.setTimeout(
            function(){
                $('#empty_teaser .teaser_content').height($('#maincontent').height()-$('#info_teaser').height());
                
            }    ,1000);
	           
	  }
	  else if ( $('#info_teaser').height() == $('#maincontent').height()){
	        window.setTimeout(
            function(){
                $('#empty_teaser .teaser_content').height($('#maincontent').height()-$('#info_teaser').height());
                
            }    ,1000);
	  }*/
	  window.setTimeout(function(){
		  //console.debug($('#info_teaser').height(),$('#maincontent').height(),$('#empty_teaser .teaser_content').height());
		  if ( $('#info_teaser').height() > $('#maincontent').height() && $('#empty_teaser .teaser_content').height()<25 ) {
	        $('#maincontent .teaser_content:last').css('min-height',$('#info_teaser').height()-80);
	        if($.browser.msie && $.browser.version <= 6)    {
	                $('#maincontent .teaser_content:last').css('height',$('#info_teaser').height()-106)
	       }        
	      }
	      else if ( $('#info_teaser').height() < $('#maincontent').height()) {
	          $('#empty_teaser .teaser_content').height($('#maincontent').height()-$('#info_teaser').height());
	      }
	       else if ( $('#info_teaser').height() > $('#maincontent').height() && $('#empty_teaser .teaser_content').height()>25 ) {
	           $('#empty_teaser .teaser_content').height(0);
	      } 		  
	  },50);
}



// Einfacher Hover fuer parent
function add_hover(dies){
    $(dies).parent().addClass("hover");
}

// Einfacher De-Hover fuer parent
function remove_hover(dies){
    $(dies).parent().removeClass('hover'); 
}