// JavaScript code for tierneystarrmusic.com


// Create global variable for new window
var popWindow;


// Close window and load link in calling window, if possible. Otherwise, open new window for link.

function zapto(link) {
   		
	// Check if calling window is still open
   	if (typeof(opener) != "undefined" && !opener.closed)

		// Calling window available: process link
		{opener.document.location.href=link}

   	else
   	
		// Calling window apparently closed: open link in new window
		{window.open(link)};

	// Close current window
	self.close();  		

	}


// Open popup window named of size w x h that displays the page whose name is pgname.
// If such a window is already open, it is first closed to assure a window of the proper size is created.

function popup(pgname,w,h) {

	// Close existing window. This may not work if such a window exists that was not opened from the current window.
	// Actually, this line is useful only for very old browsers because of the lines that follow. (See below.)
	if (typeof(popWindow) != "undefined" && !popWindow.closed){popWindow.close()};

	// Create new window. If the window is not new, its size and position may not be set by this statement,
	// depending upon the browser.
	popWindow = window.open(pgname,"popWin", "resizable=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,top=40,left=40,copyhistory=0,width="+w+",height="+h);

	// Assure proper size, position, and visibility. The top two statements may not work for very old browsers.
	popWindow.resizeTo(w,h);
	popWindow.moveTo(40,40);
	popWindow.focus();

	}

// Create properly addressed mail message by replacing * in parameter with @.
// Copyright 2001 William Bontrager -- WillMaster.com
// Used with permission.

	function ToMailer(a) {

		// Regular express
		RE = /^(.+)\*(.+)$/;

		// Set launch to mailto string
		var launch = a.replace(RE,"mailto:$1@$2");

		// Launch mail program
		window.location = launch;

		}
