// Targets the link in a popup window to the original opener window and closes the popup.
function SendOpenerToLocation(loc) {
	setDocumentLocation(window.opener.document, loc); 
	window.opener.focus; 
	window.close(); 
	return false;
}

// Changes the url in  .location,  if necc
function setDocumentLocation(doc, url) {
	if ( url != "" && url != " ") {
		url = AlterURL(url);
		doc.location = url;
	}
}

// Changes the url in .href, if necc
function setLocationHref(loc, url, popUp) {
	if ( url != "" && url != " ") {
		url = AlterURL(url, popUp);
		loc.href = url;
	}
}

// Changes the url in .action, if necc
function setAction(form, url, popUp) {
	if ( url != "" && url != " ") {
		url = AlterURL(url, popUp);
		form.action = url;
	}
}

// Changes the url in window.open , if necc
function openWindow(url, windowName, config, popUp) {	
	if (url == '') { url = '/help/Blank.html'; }	// don't open an window with no url... you get the home page
	url = AlterURL(url, popUp);
	return window.open(url, windowName, config);
}

// function to alter the url, used in all the functions below
function AlterURL(url, popUp)
{
	if (popUp && (url.indexOf("http://") == -1 ))
	{
		url = "http://" + document.location.host + url;
	}
	return url;
}

