if (top.location != self.location) { top.location = self.location }

filename = this.location.href.substring(this.location.href.lastIndexOf('/') + 1);
newname = filename.substr( 0, filename.lastIndexOf( "s" ) );
if (filename == "junque.htm") {newname = "write" }
if (filename == "search1.htm") {newname = "search" }
document.write("<style type='text/css'>")
document.write("#" + newname + " a img {background-position:bottom;}");
document.write("<\/style>")

if (newname == "club") { pageNum = 0; window.onload = setTitle }
if (newname == "place") { pageNum = 1; window.onload = setTitle }
if (newname == "race") { pageNum = 3; window.onload = setTitle }
if (newname == "result") { pageNum = 4; window.onload = setTitle }
if (newname == "write") { pageNum = 5; window.onload = setTitle }
if (newname == "search") { pageNum = 7; window.onload = setTitle }

function setTitle() { document.getElementById('runheader4').getElementsByTagName("a").item(pageNum).title = "This Page"}

if (navigator.appName == "Microsoft Internet Explorer") { window.onload = checkVersion; }

var counter = 0
var v = "mark"
var domain = "robertstech.com"
var w = "mai"
var x = "lto:"

	// Code in the HTML page passes two arguments (y,z) to this function: y is
	// the "username" part of the address (everything before the "@" sign), which is also the ID of the
	// anchor tag on the HTML page. z is the domain name part of the address.

	function sendmail(y,z) {	// Below are the domain names used in the final part of the email address function. Add more if necessary
	if (y == "webmaster") {	// This is for the "email webmaster" code at the bottom of every page
		y = v
		z = domain
		document.getElementById("webmaster").href = w + x + y + "@" + z
		}
	else {			// This is used for all other email addresses
		if (z == "1") {
			z = "robertstech.com" ;
		}
		document.getElementById(y).href = w + x + y + "@" + z
		}
	}

function getInternetExplorerVersion() // Returns the version of IE or a -1 if another browser
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function checkVersion() {
	var msg = "Not Internet Explorer.";
	var ver = getInternetExplorerVersion();
	if ( ver > -1 )
	{
		if ( ver >= 7.0 ) 
		{
			msg = "Internet Explorer 7 - no change"
		}
		else
		{
		}
	}
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}
