function openCenter(id, url, width, height, properties)
{
  if (screen)
  {
    x = (screen.availWidth - width) / 2;
    y = (screen.availHeight - height) / 2;
  }
  r = window.open(url, id, properties+',width='+width+',height='+height+',screenX='+x+',screenY='+y+',left='+x+',top='+y);
}

function toonProfiel(id){
	openCenter ('profiel', '/profile/?'+id, 520, 630, 'scrollbars=no,status=no,toolbar=no')
}

function _oldToonProfiel(id)
{
  toonProfiel(id);
}

function toonMatch(id){
	openCenter ('profiel', '/profiel/match.php?'+id, 488, 560, 'scrollbars=no,status=no,toolbar=no')
}

function userSelect(){
        openCenter ('user', '/profiel/msg/popup.php?', 700, 640, 'scrollbars=no,status=no,toolbar=no')
}

function mailpopUp(id){
	window.open ('mail.php?id='+id, 'email', 'scrollbars=no,status=no,toolbar=no,width=300,height=240')
}

function favpopUp(id){
	window.open ('fav.php?id='+id, 'email', 'scrollbars=no,status=no,toolbar=no,width=300,height=240')
}

function ConfigCam(){
  openCenter ('cam', 'configcam.php', 400, 200, 'scrollbars=no,status=no,toolbar=no')
}

function ConfigMood(){
  openCenter ('moo', 'configmood.php', 400, 200, 'scrollbars=no,status=no,toolbar=no')
}

function addFav(id)
{
  if (confirm("Deze foto toevoegen aan je favorieten?"))
  window.open('/toon/fav.php?id='+id+'&add=1', 'fav', 'scrollbars=auto,status=no,toolbar=no,width=1,height=1');
}

function DoConfirm(url, text)
{
  if (confirm(text))
    location.href=url;
}


function regpopUp(){
	window.open ('/profiel/reg.php', 'reg', 'scrollbars=no,status=no,toolbar=no')
}
function nieuws(){
        window.open ('nieuws.php', 'nws', 'scrollbars=no,status=no,toolbar=no,width=500,height=400')
}
function privee(){
        window.open ('privee.php', 'privee', 'scrollbars=no,status=no,toolbar=no,width=256,height=256')
}

function toonProfielFoto(id){
	window.open ('/profiel/toon_profielfoto.php?'+id, 'profielfoto','scrollbars=auto,status=no,toolbar=no,width=680,height=500')
}

function toonExtraFoto(id){
	window.open ('/profiel/toon_extrafoto.php?'+id, 'extrafoto','scrollbars=auto,status=no,toolbar=no,width=640,height=480')
}

function openChat(){
	window.open ('/profiel/chat/chat.php', 'fdchat','scrollbars=auto,status=no,toolbar=no,width=650,height=510')
}

function openOnline(){
	window.open ('/profiel/online/index.php', 'online','scrollbars=auto,status=no,toolbar=no,width=220,height=210')
}

function delextraconfirm(id, type){
if (confirm("Deze extra optie verwijderen? Je krijgt maar drie kwart van de sterren terug!"))
 window.open('/profiel/bewerken/go_delextra.php?id='+id+'&t='+type,'delextra', 'scrollbars=auto,status=no,toolbar=no,width=650,height=450');
}

function deliconconfirm(id, type){
if (confirm("Dit icoon verwijderen?"))
 window.open('/profiel/bewerken/go_delextra.php?id='+id+'&t='+type,'delextra', 'scrollbars=auto,status=no,toolbar=no,width=650,height=450');
}

function submitSerieFeest(){
var form = document.fotoserie;
var optie=form.t.options[form.t.options.selectedIndex].value
if(optie) document.location.href='/dossier/?type='+optie;
}

function submitSerieJaar(){
var form = document.fotoserie;
var optie=form.j.options[form.j.options.selectedIndex].value
if(optie) document.location.href='/lijst/index.php?j='+optie;
}

function submitSerieAnders(){
var form = document.fotoserie;
var optie=form.a.options[form.a.options.selectedIndex].value
if(optie) document.location.href='/lijst/index.php?'+optie;
}

function jumpMaand(j)
{
  form = document.filter.mnd;
  var mnd=form.options[form.options.selectedIndex].value;
  if(mnd) document.location.href='/lijst/index.php?j='+j+'&mnd='+mnd;
}

function jump(url, p, e)
{
 var e = document.getElementById(e);
 var waarde = e.options[e.options.selectedIndex].value;
 if (waarde) document.location.href=url+'&'+p+'='+waarde;
}

function addFriend(id){
  if (confirm("Dit profiel toevoegen aan je vriendenlijst?"))
  document.location.href='/profiel/addfriend.php?'+id;
}


function delFriend(id){
if (confirm("Dit profiel verwijderen uit je vriendenlijst?"))
 document.location.href='/profiel/delfriend.php?'+id;
}

function pInfo(event, userId, moodstr, username)
{
  username = escape(username);
  (moodstr) ? moodstr = moodstr.split(/\\/) : moodstr = '';
   Xget('/p/xml/pinfo.php?user_id=' + userId + '&moodimg=' + moodstr[0] + '/' + moodstr[1] + '&moodtxt=' + moodstr[2] + '&username='+username, 'pInfo', function(){});
  openMenu(event, 'pInfo');
}

function stealEmo(id)
{
  _extraChild = openCenter('extra', '/p/popup/extra.php?type=ico&id='+id, 640, 420, 'scrollbars=auto,status=no,toolbar=no');
}
