function pageX(element)
{
  var x = 0;
  do 
    x += element.offsetLeft;
  while ((element = element.offsetParent));
  return x; 
}

function pageY(element)
{
  var x = 0;
  do 
    x += element.offsetTop;
  while ((element = element.offsetParent));
  return x; 
}

function windowOpen(page,w,h)
{
	var l=(screen.availWidth-w)/2; 
	var t=(screen.availHeight-h)/2; 
	window.open(page,"windowname","top="+t+",left="+l+",toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,dependent,width="+w+",height="+h)
}

function showPrint(culture,pageId)
{
	var url="/print.aspx?culture="+culture+"&pageid="+pageId;
	windowOpen(url,600,600);
}

function search()
{
	var o=document.getElementById("Search");
	if(o.value=='')
	{
		o.focus();  
		return;
	}
	location.assign(searchUrl+o.value); 
}

function subscribeNewsletter()
{
	var o=document.getElementById("SubsEmail");
	if(o.value=='')
	{
		alert('The e-mail adress is missing');
		o.focus();  
		return;
	}
	location.assign(subscribeUrl+o.value); 
}		
function unsubscribeNewsletter()
{
	var o=document.getElementById("SubsEmail");
	if(o.value=='')
	{
		alert('The e-mail adress is missing');
		o.focus();  
		return;
	}
	location.assign(optoutUrl+o.value); 
}		
