$(document).ready(function() {

	/* product tabs */
	$('#product-information').tabs({
		fxAutoHeight: true,
        fxFade: true,
		fxSpeed: 'fast'
	});
	
	/* product comparison */
	$('a.comparison-popup').bind('click', function(e){
		var width = 900;
		var height = 600;
		var posX = (screen.width - width) / 2;
		var posY = (screen.height - height) / 2;
		window.open(this.href, "comparison", "width="+width+", height="+height+", scrollbars=yes, resizable=yes, location=no, menubar=no, toolbar=no, top="+posY+", left="+posX+"");
		return false;
	});
	
	/* product gallery */
	$('div#gallery-thumbnails a').bind('click', function(e){
		var requestedImage = this.href;
		var currentLink = this;
		currentLink.blur();
		$('div#gallery-thumbnails a').removeClass('active'); // remove class
		$(currentLink).addClass('active'); // set new image to active
		$('div#gallery-full img').attr('src', requestedImage); // switch image
		return false;
	});

	/* handle links to print doc */
	$('a.print-link').bind('click', function(e){
		window.print();
		return false;
	});

	/* handle links to close window */
	$('a.close-link').bind('click', function(e){
		window.close();
		return false;
	});
	
});

      function changeResult()
      {
        document.getElementById(document.result.product.value).style.display = "block";
        document.getElementById(lastResult).style.display = "none";
        lastResult=document.result.product.value;
      }
      lastResult="noSelection";



     function echk()
     {
       var basis = document.getElementById("product");

       for( var produkt in produktliste )
       {
         option = document.createElement("option")
         option.setAttribute("value", produkt)
         option.setAttribute("value", produkt)
         basis.appendChild(option)
         option.innerHTML = produkt;

       }
     }
     produktliste = new Array();
     

