function openTerms()
{
	newwin = window.open("terms.html","terms","width=505,height=400,scrollbars=yes");
}

function openPrivacy()
{
	newwin = window.open("privacy.html","terms","width=505,height=400,scrollbars=yes");
}

function openMap()
{
	newwin = window.open("map.html","terms","width=476,height=479,scrollbars=no");
}


function navOver(imgName)
{
 var theImage = document.getElementById(imgName);
 if(theImage.src.indexOf("_off.gif") != -1)
 {
  theImage.src = theImage.src.replace("_off.gif","_on.gif");
 }
 else
 {
  theImage.src = theImage.src.replace("_on.gif","_off.gif");
 }
}


// Flash test
var isDOM = (document.getElementById) ? true : false;
var isIE = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isNetscape = (!isOpera && (navigator.appName.indexOf("Netscape") != -1 && navigator.userAgent.indexOf("4.") != -1)) ? true : false;
var isMac = (navigator.userAgent.indexOf("Mac") != -1) ? true : false;

var bUsedHTML = ((isDOM || isIE || isNetscape) && !isMac) ? true : false
var iLatestFlashVersion = 7;
var iMinimumFlashVersion = 6;
var iFlashVersion = -1;

// Variable must be global for VBScript to work correctly.
var thisFlashVersion;
function flash_getIEVersion() {

	var thisMaxVersion = false;
	for(var currentVersion=iMinimumFlashVersion; currentVersion<=iLatestFlashVersion; currentVersion++) 
	{
		document.write('<SCR'+'IPT LANGUAGE="VBScript">\n');
		document.write('on error resume next\n');
		document.write('thisFlashVersion = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+currentVersion+'")))\n');
		document.write('</SCR'+'IPT>\n');

		if(thisFlashVersion) 
		{
			thisMaxVersion = currentVersion;
		}

	}
	return thisMaxVersion;
}

function flash_setVersion() {
	if (navigator.plugins.length > 0) {
		// Plugin detect, no VBScript support
		navigator.plugins.refresh(false);
		numPlugins = navigator.plugins.length;
		for(var i=0; i<numPlugins; i++)	{
			plugDesc = navigator.plugins[i].description;
			iFlashVersion = (plugDesc.indexOf("Flash") != -1) ? parseInt(plugDesc.charAt(parseInt(plugDesc.indexOf("Flash"))+6)) : 0;
			if(iFlashVersion > 0) {
				return;
			}
		}
	} else if(!isMac && (isIE || isOpera)) {
		// No plugin detect, VBScript support
		iFlashVersion = flash_getIEVersion();
	} else {
		// No plugin detect, no VBScript support
		iFlashVersion = iLatestFlashVersion;
	}
}

// Set Flash Version
flash_setVersion();

function printFlash(flashSRC, imageSRC, width, height, map)
{
	var pntStr;
	if(iFlashVersion >= iMinimumFlashVersion)
	{
		pntStr = "<object width=" + width + " height=" + height + " VIEWASTEXT>";
		pntStr += "<param name='movie' value='" + flashSRC + "'>";
		pntStr += "<param name='quality' value='high'>";
		pntStr += "<embed src='" + flashSRC + "' quality='high' " + 'bgcolor=#ffffff"';
		pntStr += "type='application/x-shockwave-flash' width=" + width + " height=" + height + ">";
		pntStr += "</embed></object>";
	}
	else
	{
		pntStr = "<img usemap='#" + map + "' src='" + imageSRC + "' width=" + width + " height=" + height + " alt='' border=0>";
	}
	document.write(pntStr);
}

/* start validation */
function validateForm(theForm)
{
valid = true;
message = "Please provide the following details:\n\n";
 
if(theForm.elements["name"].value == "") {  message += "Your name\n";  valid = false; }
if(theForm.elements["email"].value == "") {  message += "Your email address\n";  valid = false; }
  
if(theForm.elements["email"].value != "")
{ 
	var supEmail = theForm.elements["email"].value;
	var emLen = supEmail.length;
	var posAt = supEmail.indexOf('@')
	var posDot = supEmail.lastIndexOf('.')
 	if((emLen < 7) || (posAt < 1) || (posDot <= (posAt + 1)) || (posDot >= (emLen - 1)))
 	{
 	 message += "Valid email address\n";
 	 valid = false;
 	}
}
	 if(valid)
	 {
	  return true;
	 }
	 else
 	{
 	 alert(message);
 	 return false;
 	}

 
 
}
/* end validation */
