

function popitup(url) {
	newwindow=window.open(url,'name','height=450,width=445,left=200,top=250,scrollbars=yes,status=no,menu=no,resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

// create a variable to record the last time a smartpop cell was clicked
var lastClickTime;

// these function is called by the calendar cells
function dblpop(element) {
	popupByElement(element,1024)
}

function pop(element) {
	if (top.storePosition) {
		// do nothing if in pocketEdit mode
	} else {
		popupByElement(element,445)
	}
}

function popupByElement(element,width) {
	// calculate a unique page param from the page URL and the cell ID
	pagePath = window.location + ''
	pageSnippet = pagePath.substring(pagePath.indexOf('.php')-8,pagePath.indexOf('.php'));
	url = 'new_popUp.php?page=' + pageSnippet + element.id
	newwindow=window.open(url,'name','height=450,width='+width+',left=200,top=250,scrollbars=yes,status=no,menu=no,resizable=yes');
	if (window.focus) {newwindow.focus()}
	return true;
}

