// This is a set of commonly used scripts

function im_win(url, win_width, win_height, win_name) {
    win_opt = "top=25,left=25,height="+win_height+",width="+win_width+",scrollbars=no,status=no,menubars=no,toolbars=no,resizable=no,location=no";		
    newwindow = window.open(url,win_name,win_opt);
    if (!newwindow.opener) newwindow.opener = self;

    if (window.focus) {newwindow.focus()}
    return true;
}
function pop_win(url, win_width, win_height, win_name) {
	var win_top = (screen.height-win_height)/2;
	var win_left = (screen.width-win_width)/2;

	if (win_top < 0) win_top = 0;
	if (win_left < 0) win_left = 0;
		
	win_opt = "top="+win_top+",left="+win_left+",height="+win_height+",width="+win_width+",scrollbars=yes,status=yes,menubars=no,toolbars=no,resizable=no,location=no";		
	newwindow = window.open(url,win_name,win_opt);
	if (!newwindow.opener) newwindow.opener = self;

	if (window.focus) {newwindow.focus()}
	return false;
	
}
function view_profile(pathURL){
	window.open(pathURL, "_blank");
}
function openComments(member_id) {
	pop_win("all_comments.php?action_to="+ member_id +"&action_by="+ member_id +"", 400, 600, 'all_comments');
}
function login_im(member_id, afterLogin){
	var tempurl = "/fdsim.php?member_id="+member_id;
	im_win(tempurl, 310, 460, 'fds_im');
	window.document.location.href = afterLogin;	
}