jQuery(document).ready(function($){

// Open FAQ/CustomerInformation Page in LayerAdd
	$('#FAQ').click(function(){
		var url = $('a', this).first().attr('href')+'&ViewAction=ViewAjax';
		loadPageInLayerAdd(url, false);
		return false;
	});
	$('#CustomerInformation').click(function(){
		var url = $('a', this).first().attr('href')+'&ViewAction=ViewAjax';
		loadPageInLayerAdd(url, false);
		return false;
	});

// hide SocialWeb AcceptSocialSharePrivacyPolicyText
	if($('#SocialWeb').length){
		$('#AcceptSocialSharePrivacyPolicyText').hide();
	}

// hide label for moreInfo and show moreInfo
/*
 * onclick:	.ProductDetailsContent .InfoArea span.moreInfo
 *		->	show:	.ProductDetailsContent .moreInfoText
 *		->	hide:	.ProductDetailsContent span.moreInfo
*/
	$('span.moreInfo').show();
	$('.moreInfoText').hide();
	$('span.moreInfo').click(function() {
		$('.moreInfoText').fadeIn(500);
		$(this).hide();
		return false;
	});
	/* moreInfoText hide by onclick closeInfo */
	$('.closeInfo').click(function() {
		$('.moreInfoText').fadeOut(500);
		$('span.moreInfo').show();
		return false;
	});


	// hide and dynamize crossselling lists
	$(/*.Accessory ul, .CrossellingCount ul, */'.ComparisonTable ul, .FurtherProductInformation ul').hide();
	// show switch button
	$(/*.Accessory .switch, .CrossellingCount.switch, */'.ComparisonTable .switch, .FurtherProductInformation .switch').show();
	// toggle switch
	$(/*.Accessory h2, .CrossellingCount h2, */'.ComparisonTable h2, .FurtherProductInformation h2').click(function(){
		$(this).children('.switch').toggleClass("active");
		$(this).nextAll('ul').slideToggle();
	});


// hide and dynamize #CustomerOrderRatingForm
	// show switch button
	$('#CustomerOrderRatingForm .switch').show();
	// toggle switch
	$('#CustomerOrderRatingForm h2').click(function(){
		$(this).children('.switch').toggleClass("active");
		$(this).nextAll('fieldset').slideToggle();
	});


/*movie*/
	$('#movie').click(function(){
		addAjaxLayer();
		var videoMarkup="";
		videoMarkup = '<a id="flowPlayer_Product" class="flowPlayer" href="'+$(this).attr('href')+'" style="display:block;height:420px;"></a>';
/*		var videoMarkup="";
			videoMarkup = '<object id="Quicktime" type="video/quicktime" height="420" width="560" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\
								<param name="src" value="'+$(this).attr('href')+'" />\
								<param name="autoplay" value="true" />\
								<param name="cache" value="true" />\
								<param name="controller" value="true" />\
								<param name="aggressivecleanup" value="true" />\
								<param name="wmode" value="transparent" />\
								<param name="scale" value="tofit" />\
								<param name="saveembedtags" value="true" />\
								<param name="postdomevents" value="false" />\
								<embed src="'+$(this).attr('href')+'" controller="true" autoplay="true" type="video/quicktime" height="420" width="560" wmode="transparent" postdomevents="false" scale="tofit" pluginspage="http://www.apple.com/quicktime/download/"></embed>\
							</object>';
*/
		$j('#ajaxContent').html(videoMarkup);
		viewMovie('flowPlayer_Product');
		$j('#ajaxLayerAdd, #ajaxLayerBG').fadeIn({queue: false, duration: effectDuration});
		return false;
	});


/*ConfigurationTable*/
	$('.ConfigurationTable').tableHover({
		colClass: 'hover',
		rowClass: 'hoverrow',
		cellClass: 'hovercell',
		clickClass: 'click',
		headCols: true,
		headRows: false,
		footCols: true,
		footRows: false,
		ignoreCols: [1]
	});

	$('#AddToBasketForm .Quantity').blur(function(){
		if( $(this).val() ) {
			$(this).addClass('hasValue');
			$(this).parent('td').addClass('hasValue');
		}
	});
	$('#AddToBasketForm .Quantity').each(function(){
		if( $(this).val() ) {
			$(this).addClass('hasValue');
			$(this).parent('td').addClass('hasValue');
		}
	});

	dojo.query("#AddToBasketForm th").connect("onclick", function(evt){
		dojo.stopEvent(evt);
	});


/* */
});


jQuery(function($){
	$.datepicker.regional['de'] = {
		closeText: 'schlie&szlig;en',
		prevText: '&laquo; zur&uuml;ck',
		nextText: 'Vor &raquo;',
		currentText: 'heute',
		monthNames: ['Januar','Februar','M&auml;rz','April','Mai','Juni',
		'Juli','August','September','Oktober','November','Dezember'],
		monthNamesShort: ['Jan','Feb','M&auml;r','Apr','Mai','Jun',
		'Jul','Aug','Sep','Okt','Nov','Dez'],
		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
		weekHeader: 'Wo',
		dateFormat: 'dd.mm.yy',
		showOn: 'focus',
		firstDay: 1,
		showOtherMonths : true,
		isRTL: false,
		minDate: '+0',
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['de']);
});



