/*
* Afhandeling zoekfunctie voor CMS gestuurde sites
* Author: Colin Myerscough
*/

function doSearch()
{
    if (document.getElementById('zoekquery').value.length > 2)
    {
    	document.getElementById('zoekform').action = '/zoeken.php';
    	document.getElementById('zoekform').submit();
    }
	else
    {
        alert('Zoekterm is te kort, minimaal 3 tekens nodig');
    }
}

function submitSearch()
{
    if (document.getElementById('zoekquery').value.length > 2)
    {
        document.getElementById('zoekform').action = '/zoeken.php';
         return true;
    } else
    {
        alert('Zoekterm is te kort, minimaal 3 tekens nodig');
        return false;
    }
}

function doSearch1()
{
    if (document.getElementById('zoekquery1').value.length > 2)
    {
    	document.getElementById('zoekform1').action = '/zoeken.php';
    	document.getElementById('zoekform1').submit();
    }
	else
    {
        alert('Zoekterm is te kort, minimaal 3 tekens nodig');
    }
}

function submitSearch1()
{
    if (document.getElementById('zoekquery1').value.length > 2)
    {
        document.getElementById('zoekform1').action = '/zoeken.php';
         return true;
    } else
    {
        alert('Zoekterm is te kort, minimaal 3 tekens nodig');
        return false;
    }
}

function printElement(strid)
{
	var prtContent = document.getElementById(strid);
	var WinPrint =
	window.open('','','left=0,top=0,width=1,height=1,t oolbar=0,scrollbars=0,status=0');
	WinPrint.document.write(prtContent.innerHTML);
	WinPrint.document.close();
	WinPrint.focus();
	WinPrint.print();
	WinPrint.close();
	prtContent.innerHTML=strOldOne;
}

$(document).ready(function(){
	var fullsize = $(this).height();
	
	var n = 4;
	
	var divs=new Array(n);
	divs[0] = '#menu';
	divs[1] = '#content';
	divs[2] = '#right_menu';
	divs[3] = '#right_shadow';
	
	var pads = new Array(n);
	pads[0] = 0;
	pads[1] = 48;
	pads[2] = 0;
	pads[3] = 0;

	var others = new Array(n);
	others[0] = 156;
	others[1] = 130;
	others[2] = 130;
	others[3] = 130;
	
	var useheight = fullsize;
	
	for( i=0; i<n; i++) {
		useheight = Math.max(useheight, $(divs[i]).height() + others[i]);
	}	
	
	for( i=0; i<divs.length; i++) {
		$(divs[i]).height(useheight-others[i]-pads[i]);
	}

	$('#news 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);
		});

	$('table').each(function() {
			if ($(this).attr('align') == 'right') $(this).css('float', 'right');
		});

	$('img').each(function() {
			if ($(this).attr('align') == 'right') $(this).css('float', 'right');
		});

});

