var post_win = '';



function popup(fer , ww , wh) {
	if (!ww) ww=700;
	if (!wh) wh=500;
	var left = screen.availWidth / 2 - ww / 2;
	var top = screen.availHeight / 2 - wh / 2;

	window.open( fer , '', 'width=' + ww + ',height=' + wh + ',scrollbars=yes,status=yes,toolbars=no,menubar=no,resizable=yes,left=' + left + ',top=' + top);
}

function popup_c(fer , ww , wh) {
	if (!ww) ww=700;
	if (!wh) wh=500;
	var left = screen.availWidth / 2 - ww / 2;
	var top = screen.availHeight / 2 - wh / 2;

	window.open( fer , '', 'width=' + ww + ',height=' + wh + ',scrollbars=no,status=no,toolbars=no,menubar=no,resizable=yes,left=' + left + ',top=' + top);
}

function post_new(fer , ww , wh) {
	if (!ww) ww=700;
	if (!wh) wh=500;
	var left = screen.availWidth / 2 - ww / 2;
	var top = screen.availHeight / 2 - wh / 2;

	if (!post_win.closed && post_win.location) {
		post_win.focus();
	} else {
		post_win=window.open( fer , 'post', 'width=' + ww + ',height=' + wh + ',scrollbars=yes,status=yes,toolbars=no,menubar=no,resizable=yes,left=' + left + ',top=' + top);
	}
	if (window.focus) {post_win.focus()}

}

function delete_post (loc) {
	if (confirm('Are you sure you want to delete this post?')) {
		document.location.href=loc;
		//loadPage(loc);
	}
}

function edit_post (loc) {
	popup(loc);
}

function confirm_link (loc,msg) {
	if (confirm(msg)) {
		document.location.href=loc;
	}
}

function show_alert(info) {
	divObj=document.getElementById("message_notify");
	
	divObj.innerHTML='<table cellspacing=0 cellpadding=0 border=0 bgcolor="#cccccc" width="100%" height="100%" style="border:1px solid #ffffff;">\
					  <tr>\
					  	<td align="center">'+info+'</td>\
					  </tr>\
					  </table>';
					  
	divObj.style.width="100px";
	divObj.style.height="100px";
	divObj.style.left="650px";
	divObj.style.top = "-100px";
	
	moveDiv(-99);
	
	divObj.style.visibility="visible";
	
}

function moveDiv(ix) {
	divObj.style.top = ix+"px";
	if (ix<0) setTimeout("moveDiv("+(ix+1)+")" , 10);
}
