function FavePopup(action, type, id)
{
	var url = "favorites.php?action=" + action + "&type=" + type + "&id=" + id;
	
	var name = action + "_fave_" + type;
	
	new_win = window.open(url,name,"width=550,height=300,scrollbars=0,status=0,directories=0,resizable=0,location=0,toolbar=0");
	new_win.focus();
}

function MailPopup(user)
{
	var url = "send_mail.php?id=" + user;
	
	var name = "send_mail";
	
	new_win = window.open(url,name,"width=550,height=350,scrollbars=0,status=0,directories=0,resizable=0,location=0,toolbar=0");
	new_win.focus();
}

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
 vis = elem.style;
 
  // if the style.display value is blank we try to figure it out here
  if(vis.display=='' && elem.offsetWidth!=undefined && elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0 && elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display=='' || vis.display=='block')?'none':'block';
}