var myrand;
var popupWidth=650;
var popupHeight=400;

function getProperties() {
 return 'scrollbars=yes,resizable=yes, width='+popupWidth+', height='+popupHeight+', top=0, left=0';
}

function getRand() {
 myrand=Math.random();
 myrand=parseInt(myrand*100000000000,10).toString();
}

function new_mail(mbx,to) {
 getRand();
 window.open('/send.php?to='+to+'&mbx='+mbx,myrand,getProperties());
}

function reply(mbx,msg) {
 getRand();
 window.open('/forward.php?mbx='+mbx+'&msg='+msg+'&what=reply',myrand,getProperties());
}

function forward(mbx,msg) {
 getRand();
 window.open('/forward.php?mbx='+mbx+'&msg='+msg,myrand,getProperties());
}

function replyToAll(mbx,msg) {
 getRand();
 window.open('/forward.php?mbx='+mbx+'&msg='+msg+'&what=replytoall',myrand,getProperties());
}

function addBookmark(theUrl) {
 getRand();
 window.open('/bookmarks.php?template=send&form_submitted=1&mode=add&name='+theUrl+'&url='+theUrl,myrand,getProperties());
}

function addContact(theContact) {
 getRand();
 window.open('/addressbook.php?template=send&mode=newcontact&nickname='+theContact+'&form_submitted=1&email_address='+theContact,myrand,getProperties());
}