var map;

/*--------------------------------------------------------------------------------*/
function ShowYahooMap(street,zip)
	{
	// Display the map centered on given address 
	map.drawZoomAndCenter(street+' '+zip, 4); 

	map.addMarker(street+' '+zip); 

	map.addTypeControl();
	map.addPanControl(); 
	map.addZoomLong();

	// YAHOO_MAP_SAT YAHOO_MAP_HYB YAHOO_MAP_REG
	map.setMapType(YAHOO_MAP_REG);

	//Get valid map types, returns array [YAHOO_MAP_REG, YAHOO_MAP_SAT, YAHOO_MAP_HYB]
	var myMapTypes = map.getMapTypes();
	}
	

/*--------------------------------------------------------------------------------*/
function CreateYahooMap(street,zip)
	{
	map = new YMap(document.getElementById('myMapContainer'));
	
	ShowYahooMap(street,zip);
	
	s = new String(street);
	s.replace(" ","%20");

	document.entryform.taddr.value = s;
	}


/*--------------------------------------------------------------------------------*/
function CheckDirectionsForm()
	{
	myContent = document.entryform.newcsz.value;		
	if( myContent.length < 5)
		{
		alert('Please enter a valid starting address.');
		return false;
		}
	return true;
	}
	

/*--------------------------------------------------------------------------------*/
function loadFlashMovie( moviename, width, height) {

	output = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+width+"\" height=\""+height+"\" id=\"TV\" align=\"middle\">";
	output += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	output += "<param name=\"movie\" value=\""+moviename+"\" />";
	output += "<param name=\"quality\" value=\"high\" />";
	output += "<param name=\"bgcolor\" value=\"#333333\" />";
	output += "<embed src=\""+moviename+"\" quality=\"high\" bgcolor=\"#333333\" width=\""+width+"\" height=\""+height+"\" name=\"TV\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	output += "</object>";
	//output += "</object>";
	document.write(output);

}

/*--------------------------------------------------------------------------------*/
function getSize()
	{
	if ( parseInt( navigator.appVersion) > 3)
		{
		if ( navigator.appName == "Netscape")
			{
			winW = window.innerWidth;
			winH = window.innerHeight;
			}
		if ( navigator.appName.indexOf( "Microsoft") != -1)
				{
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
				}
		}
		
	document.getElementById( "tv_image_id").style.left = 445 + ( winW - 907)/2
	}

isNN = document.layers ? 1 : 0; 
        

/*--------------------------------------------------------------------------------*/
function noContext(){return false;}


/*--------------------------------------------------------------------------------*/
function noContextKey( e)
	{
	if(isNN){
	    if (e.keyCode == 96){ return (false);}
		} else {
	    if (event.keyCode == 96){ return (false);}
		}
	}

/*--------------------------------------------------------------------------------*/
function noClick( e)
	{
	if(isNN)
		{
	    if(e.which > 1) {return false;}
		} else { 
	    //if(e.button > 1){return false;}
		}
	}

/*--------------------------------------------------------------------------------*/
if(isNN)
	{ 
	 document.captureEvents( Event.MOUSEDOWN);
	}

/*--------------------------------------------------------------------------------*/
function winstat( sMsg)
	{
    window.status = sMsg;
    return true;
	}

/*--------------------------------------------------------------------------------*/
function IsANumber( entry)
	{
	validChar = '0123456789';				// characters allowed in hex
	strlen = entry.length;					// how long is test string
	if (strlen < 1) { return false;}		// no check!
	entry = entry.toUpperCase();			// in case of lowercase characters

	for (i=0; i < strlen; i++ )
		{
	    if (validChar.indexOf(entry.charAt(i)) < 0)
			{
			return false;
			}
	    } // end scanning loop
	    
	return true;
	}

/*--------------------------------------------------------------------------------*/
function CheckContactUsForm()
	{
	var itemsToEnter
	var formFailed
	var isValidEMail
	var foundAt, foundDot
	var temp
	
	temp = 0;
	formFailed = 0;
	isValidEMail = 0;
	foundAt = 0;
	foundDot = 0;
	itemsToEnter = "";
		
		
	myContent = document.ContactUs.phone.value;		
	if( myContent.length < 8)
		{
		if ( foundDot < 1 || foundAt < 1)
			{
			myContent = document.ContactUs.email.value;		
			foundDot = myContent.indexOf(".");
			foundAt = myContent.indexOf("@");

			isValidEMail = 0;
			formFailed = 1;
			itemsToEnter = itemsToEnter + "A valid phone or e-mail address\n(Such as Name@MyDomain.com)\n\n";
			}	
		}

	myContent = document.ContactUs.name.value;		
	if( myContent.length < 3)
		{
		formFailed = 1;
		itemsToEnter = itemsToEnter + "Your name\n";
		}

	if( formFailed == 1)
		{
		alert('Please enter the following information:\n\n' + itemsToEnter);
		return false;
		}

	document.ContactUs.Submitted.value='1';
	return true;
	}