// JavaScript Document


function loadRandomImage() {				

var picture_list  = new Array() ;

picture_list[0] = "images/random/elliptical_bench.jpg" ;
picture_list[1] = "images/random/hooks_hangers.jpg" ;
picture_list[2] = "images/random/nv_hangers.jpg" ;
picture_list[3] = "images/random/vz_perch.jpg" ;

var random_num = Math.floor(Math.random() * picture_list.length)

var image_obj ; 

if ((image_obj = document.getElementById("bannerpic")) != null ) {
//	if (image_obj.style) {
//		image_obj = image_obj.style
//	}
	image_obj.src = picture_list[random_num] ; 
	}
}							


function breadcrumbs() {
	var fileName = "" ;
	
	var href = document.location.pathname
	var href = href.slice(1,href.length)
	
	var splitArray = href.split("/");
	
	var linkpath = "" ;
	var displaypath = "" ;
	var filename = ""
		
	for (var i=0; i<(splitArray.length); i++) {
		
		linkpath = linkpath + "/" + splitArray[i] ;
		
		if (splitArray[i].indexOf(".") > 0 ) {
			filename = splitArray[i].split(".")[0] ;
			filename = filename.replace(/_/g, " ") ;
			filename = filename.replace(/-/g, " ") ;
		}
		
		if (filename == "")  {
			if (splitArray[i].length > 0 ) {
				if 	(displaypath == "") {   
					displaypath = "&raquo; <a href=\"" + linkpath + "\">" +  splitArray[i] + "</a>"  ;
				}
				else {
					displaypath = displaypath +  " &raquo; <a href=\"" + linkpath + "\">" +  splitArray[i] + "</a>"  ;
				}
			}
		}
		else {
			if (filename != "index"){
				displaypath = displaypath +  " &raquo; <a href=\"" + linkpath + "\">" +  filename + "</a>"  ;
			}			
		}
						
	}
	displaypath =  "<a href=\"/\">Home</a> "  + displaypath  ;
	
	document.writeln(displaypath);
}





function breadcrumbs_old(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a href=\"/\">Home</a> &nbsp;&raquo;&nbsp; ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a> &nbsp;&raquo;&nbsp; ";
  }
 document.write(output + document.title);
//     document.write(output);

}




function getObjectName(nameOfObject){

	Obj = null;

	if (is.ie) Obj = document.all[nameOfObject];
	else if (is.dom) Obj = document.getElementById(nameOfObject);
	else if (is.ns4) findLayer(window,nameOfObject);

	if (!Obj || ( is.ns4 && Obj == window ) ) Obj = "Object not found"
	
	return Obj;
}

function getObjectStyle(nameOfObject){
	Obj = null;
	
	if (is.ie) Obj = document.all[nameOfObject].style;
	else if (is.dom) Obj = document.getElementById(nameOfObject).style;
	else if (is.ns4) findLayer(window,nameOfObject);
	
	return Obj;
}

function validateContact(){
	f = document.forms.contactform;
	curObj = getObjectName('errDiv');
	if(f.firstname.value=="" || f.lastname.value=="" || f.emailaddress.value==""){
		curObj.innerHTML='<strong>ERROR</strong><br/>please ensure that the required fields, shown in <strong class="requiredField">bold</strong>, are completed to send your request.';
	}else{
		curObj.innerHTML='&nbsp;';
		f.submit();
	}
	
}