 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS6 = (bName == "Netscape" && bVer >= 5);
 var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 window.onerror = null;
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var timeOn = null // LAYER SWITCHING CODE
 if (NS4 || IE4 || NS6) {
	 if (navigator.appName == "Netscape" && !document.getElementById){
	 layerStyleRef="layer.";
	 layerRef="document.layers";
	 styleSwitch="";
	 layerVis="show";
	 layerHid="hide";
	 }
	 else if (!document.all && document.getElementById) {
	 layerStyleRef="layer.style.";
	 layerRef="document.getElementById";
	 styleSwitch=".style";
	 layerVis="visible";
	 layerHid="hidden";
	 }
	 else {
	 layerStyleRef="layer.style.";
	 layerRef="document.all";
	 styleSwitch=".style";
	 layerVis="visible";
	 layerHid="hidden";
	 }
 }
// SHOW MENU
function shLayer(layerName){
 img = getImage("imgTabs");
 x = getImagePageLeft(img);
 y = getImagePageTop(img);
 menuTop = y + 20 ; // LAYER TOP POSITION
 EvntsL = x - 45 ;  
 NewsL = x + 55 ; 
 FeatL = x + 155 ; 
 TechL = x + 255 ; 
 ComL = x + 355 ; 
 ConL = x + 455 ;     
if (NS4 || IE4 || NS6) {
 if (timeOn != null) {
 clearTimeout(timeOn)
 hideLayer(onLayer)
 }
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 onLayer = layerName
 }
}// HIDE MENU
function hideadLayer(layerName){
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
 }
}

function hideLayer(layerName){
 if (menuActive == 0) {
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 }
}// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000)
}// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}// MENU MOUSE OVER 
function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
}// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 
 timeOn = setTimeout("hideLayer(onLayer)", 400)

 }// SET BACKGROUND COLOR 
function setBgColor(layer, color) {
  if (NS6){
    eval('document.getElementById("'+layer+'").style.backgroundColor="'+color+'"');
  }
  else if (NS4){
    eval('window.document.layers["'+layer+'"].document.bgColor="'+color+'"');
	eval('window.document.layers["'+layer+'"].saveColor="'+color+'"');
  }
  else if (IE4){
    eval('document.all.'+layer+'.style.backgroundColor="'+color+'"');
  }
}

function getImage(name) {
  if (NS4 || NS6) {
    return findImage(name, document);
  }
  if (IE4 || NS6)
    return eval('document.all.' + name);
  return null;
}

function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageX + img.x - 1;
    else
      return img.x - 1;
  }
  if (IE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}


var js = 1.0;

Version = parseInt(navigator.appVersion);

if (navigator.appName == "Netscape")
    js = ((Version >= 4) ? 1.2 : ( (Version == 3) ? 1.1 : 1.0 ));
else
    if (navigator.appVersion.indexOf('MSIE') != -1) 
        js = ((Version >= 4) ? 1.1 : 1.0);

function changeImagemap(newImage) {
    if (js > 1.0) document ['boxImage'].src = eval(newImage + ".src");
}

if (js > 1.0) {
    tabs3 = new Image();
    tabs3.src  = "/ur3images/tabs3.jpg";

    tabs4 = new Image();
    tabs4.src  = "/ur3images/tabs4.jpg";

}

function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	alert("Email address seems incorrect")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

if (user.match(userPat)==null) {
    alert("The username doesn't seem to be valid.")
    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Destination IP address is invalid!")
		return false
	    }
    }
    return true
}

var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("The domain name doesn't seem to be valid.")
    return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   alert("The address must end in a three-letter domain, or two letter country.")
   return false
}

if (len<2) {
   var errStr="This address is missing a hostname!"
   alert(errStr)
   return false
}

return true;
}

function popup1(image, width, height)
{
	var n=open( image + '.asp','glossary','width=' + width + ',height=' + height + ',menubar=no,scrollable=auto,resizable=no,scrollbars=no');
}


function popup2(image, width, height)
{
	var n=open( image,'glossary','width=' + width + ',height=' + height + ',menubar=no,scrollable=auto,resizable=no,scrollbars=yes,screenX=10,screenY=20,top=10,left=20');
}

function popup(image, width, height)
{
	var n=open( '/features/popup.asp?pic='+image,'glossary','width=' + width + ',height=' + height + ',menubar=no,scrollable=auto,resizable=no,scrollbars=yes');
}

function evntpop()
{
window2=window.open('http://www.urbanracer.com/includes/winners.asp','messageWindow2','scrollbars=no,width=425,height=530,menubar=no,scrollable=auto,resizable=no,screenX=10,screenY=10,top=10,left=210')
//window1=window.open('etown_tix.asp','messageWindow1','scrollbars=no,width=550,height=500,menubar=no,scrollable=auto,resizable=no,scrollbars=no,screenX=0,screenY=0,top=0,left=0')
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//evntpop();

function launch(url) {
	self.name = "opener";
	remote = open(url, "remote", "width=400,height=300,left=100,top=100");}
	
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}	