

var cMessage = "wow. you are nosey, aren't you?\n\nOK, here is some more information...";

//------------------
function hilite(ptr)
{
	ptr.style.fontWeight="bold";
}
//------------------	
function dim(ptr)
{	
	ptr.style.fontWeight="100";
}
//------------------
function showDiv(inDiv)
{
	var details = 'At some point in the very near future, there is going to be more race related '
				+ 'information than you can shake a stick at.<br><br><br>'
				+ '<i>Email <a href=mailto:62@boogieracing.com>62@boogieracing.com</a></i>';		

	var ele = document.getElementById(inDiv);
	ele.innerHTML = details;
}



//--------------------------
function mangleEmail(inEmail)
{
	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+= '@TeamMorseRacing.com">';
		email_string+= decodedEmail;
		email_string+= '@TeamMorseRacing.com</a>';

	document.write(email_string);
}


//------------------------------------------
function popProductWindow( image )
{
	var width=525;
	var height=525;
	productWindow = window.open("store/productimage.php?i=../"+image,"productWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height );
}

//---------------------------------------
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."); }
}



/* roll over functions - uses name element (which happens to be the name of the file */
function norm(ele)
{
	var name = new String( ele.name );
	var pre = name.substring( 0, name.length-4 );
	ele.src = "images/store/"+pre+".gif";
}

function roll(ele)
{
	var name = new String( ele.name );
	var pre = name.substring( 0, name.length-4 );
	ele.src = "images/store/"+pre+"_roll.gif";
}




