/* CVSINFO: $Author: ccx305 $ $Date: 2006/08/07 15:25:50 $ $Source: /opt/cvsroot/cmsroot/shared/js/b
readcrumb.js,v $ $Revision: 1.4 $ */

/*
 * Copyright Coventry University
 *
 * Description: provides a simple javascript popup window
 */

var popupWin = null;

function closeChildWindow(){
	if(popupWin != null){
		if(! popupWin.closed){
			popupWin.close();
		}
		popupWin = null;
	}
}

function popUp(myPage, w, h, scroll){
	closeChildWindow();
	var useScrollbars = 'no';
	if (scroll) {
	   	useScrollbars = 'yes';
	}
	popupWin = window.open(myPage, 'popupWin', 'width=' + w + ',height='+  h + ',top=30,left=30,scrollbars=' +useScrollbars+ ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes,titlebar=no');
	popupWin.focus();
}

/*
 * if we have an external link open this in a new window
 */
function quicklinkAction(url){
	if(url!='selected' && url != ""){
		if(url.indexOf("http",0) == 0){
			w=window.open(url);
			w.focus();
		}else{
			self.location=url;
		}
	}
}

