
		/*************************************
			Web site design and development by
			Imaginary Designs, 2004
			ALL RIGHTS RESERVED

			dave@imaginary-designs.com
		*************************************/

function normWhat()
       {document.nav_what.src = "images/img_what.gif"}
function rollWhat()
       {document.nav_what.src = "images/img_what_roll.gif"}

function normWhy() 
       {document.nav_why.src = "images/img_why.gif"}
function rollWhy() 
       {document.nav_why.src = "images/img_why_roll.gif"}

function normHowmuch()
       {document.nav_howmuch.src = "images/img_howmuch.gif"}
function rollHowmuch()
       {document.nav_howmuch.src = "images/img_howmuch_roll.gif"}

function normGetstarted() 
       {document.nav_getstarted.src = "images/img_getstarted.gif"}
function rollGetstarted() 
       {document.nav_getstarted.src = "images/img_getstarted_roll.gif"}



function normBIO() 
       {document.nav_bio.src = "images/img_nav_bio.gif"}
function rollBIO() 
       {document.nav_bio.src = "images/img_nav_bioRoll.gif"}

function normRESULTS() 
       {document.nav_results.src = "images/img_nav_results.gif"}
function rollRESULTS() 
       {document.nav_results.src = "images/img_nav_resultsRoll.gif"}

function normSPONSORS() 
       {document.nav_sponsors.src = "images/img_nav_sponsors.gif"}
function rollSPONSORS() 
       {document.nav_sponsors.src = "images/img_nav_sponsorsRoll.gif"}

function normREPORTS() 
       {document.nav_reports.src = "images/img_nav_reports.gif"}
function rollREPORTS() 
       {document.nav_reports.src = "images/img_nav_reportsRoll.gif"}

function normSCHEDULE() 
       {document.nav_schedule.src = "images/img_nav_schedule.gif"}
function rollSCHEDULE() 
       {document.nav_schedule.src = "images/img_nav_scheduleRoll.gif"}

function normGALLERY() 
       {document.nav_gallery.src = "images/img_nav_gallery.gif"}
function rollGALLERY() 
       {document.nav_gallery.src = "images/img_nav_galleryRoll.gif"}

function normCONTACT() 
       {document.nav_contact.src = "images/img_nav_contact.gif"}
function rollCONTACT() 
       {document.nav_contact.src = "images/img_nav_contactRoll.gif"}



//--------------------------
function mangleEmail(inEmail, inUrl)
{
	var encodedEmail = new String(inEmail);
	var decodedEmail = "";

	//starts on the 2nd index value, then takes 
	//ever other value after that to create
	//email address.
	for (var i=1; i <= encodedEmail.length; i++ )
	{
		//is the number odd?
		if ((i % 2) != 0)
		{
			decodedEmail += encodedEmail.charAt(i);
		}
	}

	var email_string = '<a href="mailto:';
		email_string+= decodedEmail;
		email_string+= '@'+inUrl+'">';
		email_string+= decodedEmail;
		email_string+= '@'+inUrl+'</a>';

	document.write(email_string);
}

//---------------------------------------
function addTag(elemID, tagName)
{
	/* mozilla */
	if (window.getSelection)
	{
		the_text = document.getElementById(elemID)
		old_text = the_text.value;
		selected_start = the_text.selectionStart;
		selected_stop = the_text.selectionEnd;
		txt = old_text.substr(selected_start, selected_stop - selected_start);
		
		if (txt == "") { alert("Please select some text first."); }
		else
		{
			the_text.value = the_text.value.substr(0, selected_start)+ "<"+tagName+">"+txt+"</"+tagName+">"+ the_text.value.substring(selected_stop);
		}

	}
	else if (document.selection) /* IE */
	{
		strSelection = document.selection.createRange().text;
		if (strSelection == "") { alert("Please select some text first."); }
		else { document.selection.createRange().text = "<"+tagName+">" +  strSelection + "</"+tagName+">"; }
	}
	else { alert("Sorry - Please update your browser to something like Mozilla to use this feature."); }
}


//------------------------------------------
function popReportWindow( reportId, dbNum )
{
	var width=525;
	var height=525;
	
	raceReportsWindow = window.open("viewRacePhoto.php?reports_id="+reportId+"&dbNum="+dbNum,"raceReport","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height );

}
			
//------------------------------------------
function popSponsorImageWindow()
{
	var width=525;
	var height=525;
	
	raceReportsWindow = window.open("viewSponsorImages.php","SponsorImages","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height );
}




