function browser(){
	this.dom = (document.getElementById) ? true : false;
	this.ns4 = (document.layers) ? true : false;
	this.ie = (document.all) ? true : false;
	this.ns6 = this.dom && !this.ie
	this.ie4 = this.ie && !this.dom;
	this.opera = (navigator.userAgent.indexOf("Opera") != -1);
	this.mac = (navigator.appVersion.indexOf("Mac") != -1);
	this.macie4 = this.ie4 || this.mac;
	this.dhtml = (this.dom || this.ns4 || this.ie || this.ie4 || this.opera || !this.mac) ? true : false;
	this.dhtml = (this.mac)?false:true;
	return this;
}

pageLoaded = true;

function preloadImages( imagesPath ){
    plus = new Image();
    plus.src =  imagesPath + "plus.gif";
    
    minus = new Image();
    minus.src = imagesPath + "minus.gif";
    
    weblink_access_on = new Image();
    weblink_access_on.src = imagesPath + "weblink_access_on.gif"
    
    weblink_access_off = new Image();
    weblink_access_off.src = imagesPath + "weblink_access_off.gif"
    
    join_now_off = new Image();
    join_now_off.src = imagesPath + "join_now_off.gif"
    
    join_now_on = new Image();
    join_now_on.src = imagesPath + "join_now_on.gif"
    
    members_on = new Image();
    members_on.src = imagesPath + "members_on.gif"
    
    members_off = new Image();
    members_off.src = imagesPath + "members_off.gif"
    
    stsAd = new Image();
    stsAd.src = imagesPath + "sts_225x60.gif"
    
    earthlinkAd = new Image();
    earthlinkAd.src = imagesPath + "earthlink_225x60.gif"
    
    loudpcAd = new Image();
    loudpcAd.src = imagesPath + "loudpc_225x60.gif"
    
    lowdomAd = new Image();
    lowdomAd.src = imagesPath + "lowdom_225x60.gif"
    
    gotomypcAd = new Image();
    gotomypcAd.src = imagesPath + "gotomypc_225x60.gif"

    pageLoaded = true
}
var bw = new browser();
var image = "plusminus";
var pageLoaded = false;

function validateLoginForm(){
	if( document.login.username.value == "" ){
		alert( "Please Enter Your Email Address" );
		return false;
	} 

	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

	if (filter.test(document.login.username.value))
		testresults=true
	else{
		alert("Please input a valid email address!")
		return false;
	}
	return true;
}

function rollIn( name ){
   if( pageLoaded )
			document.images[name].src = eval(name + "_on.src")
	 else 
	 		return false
}

function rollOut( name ){
   if( pageLoaded )
	     document.images[name].src = eval(name + "_off.src")
	 else 
	 		 return false
}

function showAllDetails(imagePath, linkID,url,append){
	if( !document.getElementById ){
		if( append )
	  ( linkID.indexOf("showDetails") != -1 )?self.location = url + "&showDetails=1":self.location = url;
	  else
	  ( linkID.indexOf("showDetails") != -1 )?self.location = url + "?showDetails=1":self.location = url;
	} else {
			var attribs = new Array();
			var divs = document.getElementsByTagName("div");
			//This is the beginning of the image name for each of the
			//plus/minus.  In order to do an image swap a number must 
			//be tacked on to the end of this
			//Get all the layer id's for each of the divs
			for( i = 0; i<divs.length; i++ ){
				attribs[i] = divs[i].getAttribute("id");
			}
			
			textChange = document.getElementById(linkID);
	
			//The text "Show Details" and "Hide Details" are the reference to
			//what should happen once the link is clicked.  It's necessary to
			//do the loop twice because it will do a force on any layers that
			//are in the wrong state. (i.e. the user clicks on a plus opening 
			//a layer while the link text still display "Show Details" and vice
			//versa. 
			if( textChange.innerHTML == "Show Details" ){
				textChange.innerHTML = "Hide Details";
				//open up all layers here
				for( k = 0; k<attribs.length; k++ ){
					document.getElementById(attribs[k]).style.display = "block";
					//You can't just used 'k' as the image number because it's possible
					//that the feature isn't displayed which would result in an
					//image being undefined.
					imageNumber = attribs[k].slice(8,10);
					document.images[image + imageNumber].src = minus.src;
				}
				
			} else {
				textChange.innerHTML = "Show Details";
				for( k = 0; k<attribs.length; k++ ){
					//close all layers here
					document.getElementById(attribs[k]).style.display = "none";
					imageNumber = attribs[k].slice(8,10);
					document.images[image + imageNumber].src = plus.src;
				}
			}
			
	}
}

function showDetail( objectID, layerID, url){
  	if( !document.getElementById ){
  		self.location = url
  	} else { 
  			imageNumber = objectID.slice(8,10); 
  			if( document.getElementById(objectID).style.display == "block" ){
  				document.images[image + imageNumber].src = plus.src;
  				document.getElementById(objectID).style.display = "none";
  			} else {
  				document.images[image + imageNumber].src = minus.src;
  				document.getElementById(objectID).style.display = "block";
  			}
  	}
}

var ads = ["","earthlinkAd", "lowdomAd", "stsAd", "gotomypcAd", "loudpcAd"]
var names = ["earthlink", "lowdom", "sts", "gotomypc", "loudpc"]

var imageToUse = 0
var otherImgNumber = 0

function rotateAd(){

		for(i=0;i<names.length;i++){
	     if(document.images[names[i]] ){
			 	 var randomNum = Math.random()
				 var imageToUse = Math.ceil(randomNum * 5)
	
				 while( imageToUse==otherImgNumber || i == imageToUse ){
				 			var randomNum = Math.random()
				      var imageToUse = Math.ceil(randomNum * 5)
				 }
			
				 if( i != imageToUse ){
				 		if(bw.dom){
								imageId = document.getElementById(names[i])
								imageId.setAttribute("alt",ads[imageToUse].substring(0,ads[imageToUse].length-2).toUpperCase())
						}
						document.images[names[i]].src = eval(ads[imageToUse]+".src");
						otherImgNumber = imageToUse
				 }
			 }
		}
		setTimeout("rotateAd()", 5000);		
}

function HighLightRow(theRow, color, origColor){
		if( !document.getElementById ){
				return
		}
	
		theCells = theRow.getElementsByTagName("TD")
		for(i=0;i<theCells.length;i++){
		  if( i==0 ){
					pm = theCells[i].getElementsByTagName("IMG")
					imageId = pm[0].getAttribute("src")
			}
			
			if( imageId.indexOf("plus") != -1 ){
					theCells[i].style.backgroundColor = color;
			} else {
				  theCells[i].style.backgroundColor = origColor;
			}
		}
}

function countText(formElement, id){
		change = document.getElementById(id)
		change.innerHTML = 255 - formElement.value.length-1+ " characters left"
		if( formElement.value.length >= 255 ){
				alert("The maximum number of characters is 255  "+formElement.value.length)
				return false;
		}
}
