//jQuery.noConflict();
jQuery.fn.hoverClass = function(c) {
    return this.each(function(){
        jQuery(this).hover( 
            function() { jQuery(this).addClass(c);  },
            function() { jQuery(this).removeClass(c); }
        );
    });
};

function goToPage(page)
{
	window.location.href = page;
}

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

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

	$('#sfeer').cycle({ 
	    fx:    'fade', 
	    timeout:  3500,
	    speed: 500 
	});

	jQuery(".album-photos a").fancybox();    
	jQuery("a.photobox").fancybox({
		'zoomSpeedIn':	0, 
		'zoomSpeedOut':	0,
		'overlayColor': '000',
		'overlayShow': true,
		'overlayOpacity': 0.7
	});    
	jQuery("a.youtube").fancybox({
		'zoomSpeedIn':	100, 
		'zoomSpeedOut':	100,
		'width': 425,
		'height': 344,
		'overlayColor': '000',
		'overlayShow': true,
		'overlayOpacity': 0.7
	});    
	$("a.popup").fancybox({
		'width': 650,
		'height':550,
		'zoomSpeedIn':500,
		'hideOnContentClick': false,
		'overlayColor': '000',
		'overlayShow': true,
		'overlayOpacity':0.7,
		'type': 'iframe'
	}); 

	function updateTitle() {
   	 $('#application-image-description').html(this.alt);
	}
	// toepassingen
	$('#applications-gallery').cycle({ 
	    fx:    'fade',
	    timeout: 0,
	    speed: 250,
	    after: updateTitle,
	    pager:  '#applications-thumbnails', 
	    pagerEvent: 'mouseover',
    	pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#applications-thumbnails li:eq(' + idx + ') a'; 
    	} 
	});
    $("#product-filter-menu select").change(function() {
    	window.location.href = $(this).val();
    });
    
});

function printPage() {
	window.print();
}
function switchLanguage(lang) {
    u = location.href.split('/');
    u[5] = lang;
    location.href = u.join('/');
}
