
var closebutton = "../_images/close.gif";
var raampje, xtra, ytra;

function sleepen(){if (event.button!=1)return;	
raampje = eval("maildiv");temp1=raampje.style.posLeft;
temp2=raampje.style.posTop;xpos=event.clientX;
ypos=event.clientY;xtra = temp1-xpos;
ytra = temp2-ypos;document.onmousemove=plaats;}

function plaats(){if (event.button==1){
raampje.style.pixelLeft=event.clientX+xtra;
raampje.style.pixelTop=event.clientY+ytra;return false;}}

function raam(inside,color,width,height,title,sl,st,background){		
titlecolor = 'black'; 						
opacitytitle = 100;   						
if(!width){
width = 300;            					
height = 225;}								
if(inside.indexOf(".html") > inside.length -6)
inside = '<iframe frameborder="0" name="raampje" width="'+(width-20)+'" height="'+(height-20)+'" src="'+inside+'" scrolling="yes"></iframe>'; 
if(!color)
color = 'black';
if(!title)
title = '';
if(!sl)
sl = '380';
if(!st)
st = '172';
var thisspan = eval("maildiv.style") 
//thisspan.pixelLeft = document.body.scrollLeft + sl;		
//thisspan.pixelTop =  document.body.scrollTop + st;
thisspan.visibility="visible";
output = '<table style="width:'+(width-20)+'px" cellpadding="0" cellspacing="0"><tr>';
output += '<td class="popupTitle" style="width:'+(width-20)+'px" onmousedown="sleepen()" style="cursor:hand" onmouseup="JavaScript:document.onmousemove=\'\'" bgcolor="'+titlecolor+'" style="filter:alpha(opacity=\''+opacitytitle+'\');">';
output += '&nbsp; &nbsp; '+title+'</td><td style="width:20px" bgcolor="'+titlecolor+'">';
output += '<input type="image" alt="Close" onclick="closeraam()" src="'+closebutton+'"></td></tr>';
output += '<tr><td width="100%" colspan="2"><table ';   
if(background)
output += 'style="background-image:url(\'' + background +'\')" ';
output += 'width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="'+color+'" style="filter:alpha(opacity=\''+opacitytitle+'\');"><tr><td bgcolor="'+color+'" height=100% width=100% >'+ inside+'</td></tr></table></td></tr></table>';
maildiv.innerHTML = output;
}

function closeraam(){maildiv.style.visibility="hidden";}

function openWindow(page,title)
{
raam(page,"#BABCBB",330,260,title,380,172);
}
function openWindowLg(page,title)
{
raam(page,"#BABCBB",412,320,title,398,204);
}