


// these two allow background color rollover changes for td tags
function mOvr(src,clrOver) {
	if (typeof(src) == 'undefined') return;
	src.style.cursor = 'pointer';
	src.bgColor = clrOver;
}
function mOut(src,clrOut) {
	if (typeof(src) == 'undefined') return;
	src.style.cursor = 'default';
	src.bgColor = clrOut;
}

// Get the URL of the parent window
function getParentLocation() {
	var parentURL = '';
	if(typeof(opener.document) != "unknown") parentURL = window.opener.location;
	return parentURL;
}

// Get the Title of the parent window (or return the empty string)
function getParentTitle() {
	var parentTitle = '';
	if(typeof(opener.document) != "unknown" && window.opener.thisTitle) parentTitle = window.opener.thisTitle;
	return parentTitle;
}

// Reload the opener window
function refreshParentWindow() {
	if(typeof(opener.document) != "unknown") {
		var idx = opener.location.toString().indexOf("#");
		if (idx != -1) var parent_address = opener.location.toString().substring(0, idx);
		else var parent_address = opener.location.toString();
		opener.location = no_local_cache(parent_address);
	}
}

// Reload the opener window and put it in focus
function updateParentWindow() {
	var idx = opener.location.toString().indexOf("#");
	if (idx != -1) var parent_address = opener.location.toString().substring(0, idx);
	else var parent_address = opener.location.toString();
	opener.location = no_local_cache(parent_address);
	opener.focus();
}

// Reload the opener window and put it in focus
function parentRedirect(destination) {
	opener.location = no_local_cache(destination);
	opener.focus();
}

// create a new main window for external links
function externalLink(destination) {
	var popupName = 'extlnk' + (new String(Math.random()*100000000)).replace(/\./,'');
	var position = centeredPopupCoords(700,500);
	eval('var '+popupName+'=window.open(\''+destination+'\',\''+popupName+'\',\''+position+',location=1,status=1,directories=1,toolbar=1,menubar=1,resizable=1,scrollbars=1,width=700,height=500\');');
}

// make an inconsequential change to a blink url to avoid local caching
function no_local_cache(old_url) {
	var new_url = old_url;
	var re0 = /\/0,/;
	var re1 = /\/1,/;
	if (old_url.match(re0) == null) {
		new_url = old_url.replace(re1, "/0,");
	} else {
		new_url = old_url.replace(re0, "/1,");
	}
	return new_url;
}


function setStatus(text) {
	text = text.replace(/\'/g, "\\'");
	var statusSet = 'window.status=\''+text+'\'';
	setTimeout(statusSet,1);
	return true;
}

function centeredPopupCoords(x,y) {
	return opener.centeredPopupCoords(x,y);
}

var loading = false;
function standBy(message) {
	window.loading = true;
	var standByURL = "/Blink/StandBy/1,2498,,00.html?msg="+escape(message);
	var xsize = 200;
	var ysize = 100;
	var standByOptions = centeredPopupCoords(xsize, ysize);
	standByOptions += "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+xsize+",height="+ysize;
	window.open(standByURL,'standByWin',standByOptions);
	return true;
}
	
