// JavaScript Document

// Display the current date
function displayDate() 
{
	var d = new Date();
	// var weekday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var monthname = new Array("January","Febuary","March","April","May","June","July","August","September","October","November","December");
	// document.write(weekday[d.getDay()] + " ");
	document.write(monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear());
}

// Open window and then create and load HTML into it
function openAdWindow(w, h, imagePath, imgName, imgURL) {
	var adWindow = window.open(imagePath, 'adWindow', 'status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, scrollbars=0, width=' + w + ', height=' + h);

	// Create html code for new window
	newWinString = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
	newWinString += '<html xmlns="http://www.w3.org/1999/xhtml">';
	newWinString += '<head>';
	newWinString += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
	newWinString += '<script type="text/javascript" src="tdg_javascripts.js"></script>';
	newWinString += '<title>' + imgName + '</title>';
	newWinString += '</head>';
	newWinString += '<body style="margin: 0px; padding: 0px;"><img src="' + imagePath + '" title="' +  imgName + '" width="' + w + '" height="' + h + '" onclick="return targetOpener(\'' + imgURL + '\', true, false)" style="margin: 0px; padding: 0px; cursor: pointer;" /></a></body>';
	newWinString += '</html>';
		
	adWindow.document.write(newWinString);
	adWindow.document.close();
}

// Open URL into parent window (or window that created the popup) then close window
function targetOpener(mylink, closeme, closeonly)
{
	if (!(window.focus && window.opener))
		return true;
		
	window.opener.focus();
	
	if (!closeonly)
		
		window.opener.location.href=mylink;
		
	if (closeme)
		window.close();
		
	return false;
}

function addPrice(price) {
	document.registrationForm.amount.value = price;
}
