


function gotourl(link){
	window.location.href =link;
}


$(document).ready(function() {
	
	
	if (navigator.language.indexOf("en") > -1) {
		  $("#fbiframe").css("width","50px");
		} else if (navigator.language.indexOf("de") > -1) {
		  $("#fbiframe").css("width","80px");
		}

	$('.select_small').easySelectBox( {className: 'select_small'} );
	$('.select_size').easySelectBox( {className: 'select_size'} );
	$('.select_amount').easySelectBox( {className: 'select_amount'} );
	
	
	  $('.select_small ul li a').click(function() {
			if($(this).attr('rel') != '') {
				gotourl('/'+$(this).attr('rel'));
			}
		  });
	  
	  $('.artboxDS').click(function() {
		  gotourl($(this).find('.title').attr("href"));
	  });
	  
	  
	  var count = 0;
	  $(".select_size option").each(function(i) {
		  count++;
	  });
	  //alert(count);
	  $('.PseudoPrice').show();
	  $('.select_size ul li a').click(function() {
		  
		  if(count==1){
			  
		  }else		  
			  if($(this).attr('rel') != '') {
					var ordernumber = jQuery.trim($(this).attr('rel'));
					if(ordernumber) {
						ordernumber = ordernumber.replace(/\./g, '\\.');
					}
					// Change informations
					$('#article_details').html($('#' + ordernumber).html());
					//Set basket button to active
					$('#basketButton').css('opacity', '1.0');
					$('#basketButton').css('cursor', 'pointer');
					$('#basketButton').removeAttr('disabled');
					
					$('.PseudoPrice').show();
					
				}else{
					$('#basketButton').css('opacity', '0.5');
					$('#basketButton').css('cursor', 'default');
					$('#basketButton').attr('disabled', 'disabled');
					$('.PseudoPrice').show();
				}
		  });
	  
	  $('.delivery_container').show();
   
});


