function initInputAlt() {
	/* show description layer for forms */
	$('input[type!=image][alt]').focus(function() {

		var position    = $(this).offset();
		var pv_top      = position.top;

		if($(this).attr('alt').length > 0) {

	//			$('.descwrapper').empty();

			$('body').append('\
				<div class="descwrapper" style="top: ' + pv_top + 'px;">\n\
					<div class="descr">'+
						$(this).attr('alt')
					+'</div>\n\
				</div>'
			);

			$('div.descwrapper').show();
		}

	});

	/* hide description layer for forms */
	$('input[alt]').blur(function() {
		$('div.descwrapper').remove();
	});
}

$(document).ready(function() {

	initInputAlt();

 	/* Tab loading */
	$('a.tabcontainer').click(function() {

 		$('#ladeAnimation').show();

 		// Define default product parameter
 		var productIdParameter = '';

 		// Check if actual product id set
 		if (typeof(flexFunctions.actualProductId) != 'undefined') {
			productIdParameter += '&productDetails=' + flexFunctions.actualProductId;
		}

 		var id = $(this).attr('id');
 		$.get(
 			$(this).attr('href') + productIdParameter,
 			{},
 			function(data){

 				$('ul.tabbed li').removeClass('active');
 				$('ul.tabbed li#li_' + id).addClass('active');
	 			$('#tabContent').html(data);
	 			$('#ladeAnimation').hide();
	 		}
	 	);
		return false;

 	});

	/* toogle delivery fieldsets */
	$('input[type="radio"][name="Lieferoption"]').focus(function() {
		switch(this.value) {
			case 'on':
				$("#deploymentAddressDHL").css('display','none');
				$("#deploymentAddress").css('display','none');
			break;
			case 'LieferadressePrivat':
				$("#deploymentAddressDHL").css('display','none');
				$("#deploymentAddress").css('display','block');
			break;
			case 'LieferadresseStation':
				$("#deploymentAddressDHL").css('display','block');
				$("#deploymentAddress").css('display','none');
			break;
		}
	});

	/* link tracking */
	$('.megadropdown a[rel!=""]').click(function() {
		pageTracker._trackEvent('Layer_Navigation', 'Click', $(this).attr('rel'));
	});

	$('.popup320250').click(function() {
		window.open($(this).attr('href'),$(this).val(),"width=320,height=250,scrollbars=yes,resizable=yes,statusbar");
		return false;
	});


	/**********************/
	/* Debugging Handling */
	/**********************/

	if (self.location.href.search(/[a-z]{2,3}\.dev\./) == -1) {
		if (typeof self.console == 'undefined' || typeof console.firebug == 'undefined') {
			var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
			self.console = {};
			for (var i = 0, len6 = names.length; i < len6; ++i) {
		    	self.console[names[i]] = function() {}
			}
		}
	}
	else {
		if (typeof self.console == 'undefined') {
			var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
			self.console = {};
			for (var i = 0, len7 = names.length; i < len7; ++i) {
				self.console[names[i]] = function() {
					for (var i = 0, len8 = arguments.length; i < len8; i++) {
						alert(arguments[i]);
					}
				}
			}
		}
	}
});
