// JavaScript Document


function CenteredPopup(path) {
	var w = 700;
	var h = 500;
	var l = Math.floor((screen.width-w)/2);
	var t = Math.floor((screen.height-h)/2);
	window.open(path,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
}

function getPageCoords (element) { // thanks to 'Martin Honnen' for this function 
	var coords = {x: 0, y: 0}; 
	while (element) { 
		coords.x += element.offsetLeft;
		coords.y += element.offsetTop;
		element = element.offsetParent;
 
	}
	return coords; 
} 
function carica_calend(coord,id,id2,format){
    Calendar.setup({
        inputField     :    id2,           //*
        ifFormat       :    format,
        showsTime      :    false,
        button         :    id,        //*
        step           :    1,
		position       :    [coord.x+33,coord.y]
    });
}
