$(function() {
	$('#projecten_tables table').each(function() { $(this).find('tr:odd').addClass('odd'); });
	$('#projecten_tables tr').mouseover(function() { var link=$(this).find('a').attr('href'); $(this).addClass('over') }).mouseout(function() { $(this).removeClass('over') })
	$('#projecten_tables tr').each(function() { $(this).find('td:eq(1)').addClass('bold'); });
	$('#projecten_tables tr').click(function() { var link=$(this).find('a').attr('href'); window.location.href=link; });
	$(':submit').addClass('submit');
	if($('.overlay_text').text().length < 1) $('.overlay').remove(); 
	if ($('#thumbs')) {
		$('#thumbs li').click(function() { 
			$('#thumbs li.active').removeClass('active');
			$(this).addClass('active');
			var source=$(this).find('a').attr('href');
			$('#bigpic img').attr('src', source);
			return false;
		});
	}
	
	/*
	//Scroller
	$('#scroller_container').serialScroll({
		items:'li',
		duration:3000,
		force:true,
		axis:'x',
		stop: 'true',
		easing:'linear',
                constant: 'false',
		lazy:true,// NOTE: it's set to true, meaning you can add/remove/reorder items and the changes are taken into account.
		interval:1, // yeah! I now added auto-scrolling
		step:1, // scroll 1 each time
		onAfter:function(elem){
			$(elem).clone().hide().appendTo($(elem).parent()).fadeIn('normal');
			width = $(elem).parent().width();
			$(elem).parent().width(width+250);
		}

	});
        $('#scroller_container')
             .mouseover(function(){ $('#scroller_container').trigger('stop'); })
             .mouseout(function(){ $('#scroller_container').trigger('start'); });
        */
        
        //Marquee like scroller
        //seems to be a lot more CPU friendly
	$('#scroller_container marquee').marquee('pointer').mouseover(function () {
            $(this).trigger('stop');
        }).mouseout(function () {
            $(this).trigger('start');
        }).mousemove(function (event) {
            if ($(this).data('drag') == true) {
                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
            }
        }).mousedown(function (event) {
            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
        }).mouseup(function () {
            $(this).data('drag', false);
        });

});

function PrintLink() {
	var url = document.location.href;  
	var newurl = url;
	if ( url.indexOf("?") > -1 ) newurl = newurl+'&typeP=1';
	else  newurl = newurl+'?typeP=1';
	window.open(newurl,'PrintPage','menubar=1,scrollbars=1,width=1000,height=620');
}
