
function openwincms(url,name,w,h) {

	norm_width = w;
	norm_height = h;
	screen_x = (screen.availWidth-norm_width)/2;
	screen_y = (screen.availHeight-norm_height)/2;
	window.open(url,name, 'status=yes,resizable=yes,toolbar=no,location=no,scrollbars=yes,width='+w+',height='+h+',resizable=yes,top='+screen_y+',left='+screen_x);
}

function ChangeLanguage (lang_id) 
{
  document.getElementById('language').value = lang_id;
  document.getElementById('lang_form').submit();
}

function openwin_noscroll($url,$name,$width,$height)
{
	// prevent window from opening larger, then screen resolution on user's computer (to Kostja)

	//	alert('openwin: name = ['+$name+']');
	var left = Math.round((screen.width - $width)/2);
	var top = Math.round((screen.height - $height)/2);

	cur_x = document.all ? window.screenLeft : window.screenX;
	cur_y = document.all ? window.screenTop : window.screenY;

//	alert('current X,Y: '+cur_x+','+cur_y+' target x,y: '+left+','+top);
	var $window_params = 'left='+left+',top='+top+',width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=no,toolbar=no';
	return window.open($url,$name,$window_params);
}

function redirect($url) {
	window.location.href = $url;
}


function GoToPage(calendar_date,replace_id)
{
  aCalendarManager.go_to_page(calendar_date,replace_id);
}
