function popUp(URL,width,height) {
day = new Date();
id = day.getTime();
var winLeft = (screen.width - width) / 2;
var winUp = (screen.height - height) / 2;
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left='+winLeft+',top='+winUp);");
}
function contact_by_mail(user, domain, suffix, content)
{
if (!content)
{
document.write('' + user + '@' + domain + '.' + suffix + '');
} else
{
document.write('' + content + '');
}
return true;
}
var interval;
var scrollTo;
var objDiv;
var objDivHeight;
var currentYPos;
var contentHeight;
var numPages;
function moveToPage(layerId, direction)
{
if (interval == undefined)
{
objDiv = document.getElementById(layerId);
objDivHeight = objDiv.offsetHeight;
// Get current scrollTop position
currentYPos = objDiv.scrollTop;
// Get total height of content
objDiv.style.height = "auto";
contentHeight = objDiv.offsetHeight;
objDiv.style.height = objDivHeight + "px";
// Get number of pages
numPages = Math.ceil(contentHeight/objDivHeight);
// Get current page
var currentPage = Math.ceil(currentYPos/objDivHeight)+1;
// Move page
if (currentPage1 && direction == -1)
{
//objDiv.scrollTop = currentYPos - objDivHeight;
scrollTo = (currentYPos - objDivHeight+16);
interval = window.setInterval("doScroll(-1)", 10);
} else
{
// Reset the scrollTop to the current position (otherwise resizing the div for content height will cause it to move back to the top in IE)
objDiv.scrollTop = currentYPos;
}
// Update page text
document.getElementById('jsPageNr').innerHTML = "Pagina " + (Math.ceil(objDiv.scrollTop/objDivHeight)+1) + "/" + numPages;
// Hide pageSelection if only one page
if (numPages > 1)
{
document.getElementById("jsPageScroll").style.display = "block";
}
}
}
function doScroll(direction)
{
objDiv.scrollTop = currentYPos + (direction*15);
currentYPos = objDiv.scrollTop;
// Update page text
document.getElementById('jsPageNr').innerHTML = "Pagina " + (Math.ceil(objDiv.scrollTop/objDivHeight)+1) + "/" + numPages;
if ((objDiv.scrollTop >= scrollTo && direction == 1) ||
(objDiv.scrollTop <= scrollTo && direction == -1) ||
(objDiv.scrollTop>=(contentHeight-objDivHeight) && direction == 1) ||
(objDiv.scrollTop<=0 && direction == -1)
)
{
window.clearInterval(interval);
interval = undefined;
}
}