jQuery.noConflict();

jQuery(document).ready(function() {

	if(jQuery('#tooltip', '#shadow-wrapper').length) {

		jQuery('#menu a:contains("Products"), #menu a:contains("Produkte")', '#shadow-wrapper').mouseover(function() {

			jQuery('#tooltip', '#shadow-wrapper').animate({height: "443px"}, 500);

			jQuery(this).addClass('hovered').css('cursor','default');

			jQuery(this).attr('href','javascript:void(0);');

			jQuery('#menu .active').addClass('softed');

		});
		
 
  var url = location.pathname;
 
 if(url.indexOf('produkte') > -1) { 
		jQuery('#menu .active').addClass('unsofted');
}
 

		jQuery('#tooltip').mouseout(function(obj){

			if(obj.target == this){

				jQuery('#tooltip', '#shadow-wrapper').animate({height: "1px"}, 500);

				jQuery('#menu .active').removeClass('softed');

			}

		});

	}



	jQuery('.csc-textpic-intext-left-nowrap .csc-textpic-text a', '#left-content').each(function() {

		jQuery(this).addClass('button-animation');

	});



	jQuery(".icebox_container").accordion({ 

		header: 'h3', 

		collapsible: true,

		active: false

		});



	if(jQuery('#googlemap').length){

		initialize();

	}

	

	jQuery('h3.accordionheader').each(function() {

		jQuery(this).append("<img border='0' class='accordion-down' src='/fileadmin/template/img/accordion-down.png'/>");

	});



	// Optimized position of products-layer

	jQuery('.overlay-box:first').css('margin-left','-8px');



	// Hover-effect for learn more-buttons (IE6)

	jQuery(".box-more").each(function() {

		jQuery(this).bind("mouseover", function() {

			jQuery(this).css("backgroundImage", "url(/fileadmin/template/img/learn_more_over.png)");

			jQuery(this).find("a").css({color: "#8F8F8F"});

		});

		jQuery(this).bind("mouseout", function() {

			jQuery(this).css("backgroundImage", "url(/fileadmin/template/img/learn_more.png)");

			jQuery(this).find("a").css({color: "#FFFFFF"});

		});

	});



	// Hover-Effect for language-selectbox (IE6)

	jQuery("#language-select").each(function() {

		jQuery(this).bind("mouseover", function() {

			jQuery(this).css({backgroundImage: "url(/fileadmin/template/img/bg-language_3.gif)", backgroundRepeat: "no-repeat"});

			jQuery(this).find("a").css({color: "#605f61", visibility:"visible"});

		});

		jQuery(this).bind("mouseout", function() {

			jQuery(this).css({background: "none"});

			jQuery(this).find("a").css({color: "#292929", visibility:"hidden"});

		});

	});



	jQuery('.ui-accordion h3:last').css({

   		 background: 'url(/fileadmin/template/img/accordion-bgfl_og.png) no-repeat',

  		 height:'25px'

	});
	
	jQuery('.ui-accordion .csc-textpic-text').each(function(){
		jQuery(this).find('a:eq(1)').css('margin-top', '0px');
	});
	
	
	jQuery('.AccordionPanel .prod-headline:last').css({

   		 background: 'transparent',

  		 height:'25px'

	});
	

});





function initialize() {

	if (GBrowserIsCompatible()) {

		var map = new GMap2(document.getElementById("googlemap"));

		map.setCenter(new GLatLng(37.4419, -122.1419), 13);



		// Add 10 markers to the map at random locations

		var bounds = map.getBounds();

		var southWest = bounds.getSouthWest();

		var northEast = bounds.getNorthEast();

		var lngSpan = northEast.lng() - southWest.lng();

		var latSpan = northEast.lat() - southWest.lat();

		for (var i = 0; i < 10; i++) {

      			var latlng = new GLatLng(southWest.lat() + latSpan * Math.random(),

				southWest.lng() + lngSpan * Math.random());

			map.addOverlay(new GMarker(latlng));

		}

	}

}
