//********************
// Open video window *
//********************
function openVideoWindow(url, width, height, left, top, scrollbars, param_string)
{
	if (url)
	{
		// set properties
		var width         = !width ? 250 : width;
		var height        = !height ? 250 : height;
		var left          = !left ? 0 : left;
		var top           = !top ? 0 : top;
		var scrollbars    = !scrollbars ? 'no' : scrollbars;
		var param_string  = param_string.replace('http://www.matson.nl/', '../');
		var url_complete  = !param_string ? url : url+'?'+param_string;
		
		// open window
		var new_window = document.open(url_complete, 'window', 'height='+height+',width='+width+',left='+left+',top='+top+',scrollbars='+scrollbars+',titlebar=no,toolbar=no,location=no,menubar=no');
		
		// focus window
		if (window.focus) {new_window.focus();}
	}
	else
	{
		alert('No URL specified.');
	}
	
	return false;
}

//*************************************
// Static function delete input value *
//*************************************
function deleteInputValue(field,value)
{
	if (field.value == value)
	{
		field.value = '';
	}
}

function showForm()
{
	var currentForm	= document.getElementById('currForm');
	var buttons_1	= document.getElementById('buttons_1');
	var buttons_2	= document.getElementById('buttons_2');

	if (currentForm.style.display == 'none'){
		currentForm.style.display	= 'block';
		buttons_1.style.display		= 'block';
		buttons_2.style.display		= 'none';
	}
	else {
		currentForm.style.display	= 'none';
		buttons_1.style.display		= 'none';
		buttons_2.style.display		= 'block';
	}
}

function setPrintingVersion()
{
	var style		= document.getElementById('style');
	style.href		= 'www.matson.nl/html/css/print.css';
	
	// print page
	window.print();
	
	// reset page
	window.setTimeout('resetPage()', 5000);
}

function resetPage()
{
	var style		= document.getElementById('style');
	style.href		= 'www.matson.nl/html/css/view.css';
}

//***************************
// Static Function findPosX *
//***************************
function findPosX(obj)
{	
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
		
	}
	else if (obj.x)
	{
		curleft += obj.x;
	}
	
	return parseInt(curleft);
}

//***************************
// Static Function findPosY *
//***************************
function findPosY(obj)
{	
	var curtop = 0;
	if (obj.offsetParent)
	{	
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
		
	}
	else if (obj.y)
	{
		curtop += obj.y;
	}
	
	return parseInt(curtop);
}

//*********************************
// Static function cancelBubbling *
//*********************************
function cancelBubbling(evt)
{	
    var e = (window.event) ? window.event : evt;
	e.cancelBubble = true;
}