//********************************
// Disable the right mouse click *
//********************************
function disableRightClick()
{
	var message = 'De rechter muisknop is uitgeschakeld.';
	
	// NS events
	if (document.layers)
	{
		document.captureEvents(Event.MOUSEDOWN);
		
		document.onmousedown = function(e)
		{
			if (document.layers||document.getElementById&&!document.all)
			{
				if (e.which==2||e.which==3)
				{
					//alert(message);
					
					return false;
				}
			}
		}
	}
	
	// IE events
	else if (document.all && !document.getElementById)
	{
		document.onmousedown = function()
		{
			if (event.button==2)
			{
				//alert(message);
				
				return false;
			}
		}
	}
	
	// document event
	document.oncontextmenu = function()
	{
		//alert(message);
		
		return false;
	}
}

//***************
// Popup window *
//***************
function openWindow(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 url_complete	= !param_string ? url : url+'?'+param_string;
		
		// open window
		var new_window	= window.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;
}

//******************
// Format currency *
//******************
Number.prototype.formatCurrency = function(c, d, t)
{
	var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
	return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
};

//*********************
// Delete input value *
//*********************
function deleteInputValue(field, value)
{
	if (field.value == value)
	{
		field.value = '';
	}
}
