if (document.images) {
	preloadImage = new Image();
	preloadImage.src = "/img/nav_homeo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_showteamo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_riderprofileso.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_mareso.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_stallionso.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_historyo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_galleryo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav_contacto.gif";
}

function gSetup() {
	var img, sh, sn, thelink
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute) {

			sn = img.getAttribute("src");
			sh = img.getAttribute("id");

			if (sn != "" && sn != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				
				if (sh != "" && sh != null && sh != "heightadjust") {
					img.h = new Image();
					img.h.src = '/nav/'+sh+'o.gif';
					img.onmouseover = soopaSwapOn
					img.onmouseout  = soopaSwapOff
				}

			}
		}
	}

	for (var i = 0; (thelink = document.links[i]); i++) {
		if (thelink.getAttribute) {
			thelink.onmouseover = rollover;
			thelink.onfocus = rollover;
			thelink.onmouseout  = rolloff;
			thelink.onblur  = rolloff;
		}
	}
}

function soopaSwapOn() {
	this.src = this.h.src;
}

function soopaSwapOff() {
	this.src  = this.n.src;
}

function rollover() {
	thehref=this.href;
	endhref=thehref.length;
	if(thehref.substr((endhref-1), endhref)=="/"){
		thehref=thehref.substr(0,(endhref-1));
	}
	thehref=thehref.replace("http://","");
	thehref=thehref.replace("https://","");
	theid=this.id;
	window.status="[ "+thehref+" ]     "+this.title;
	return true;
}

function rolloff(){
	window.status=" ";
	return true;
}

function validcomments(comments){

	if(comments.name.value==""|comments.name.value=="Your name"){
		comments.name.focus();
		document.images.namee.src = "img/error.gif";
		document.getElementById("error").innerHTML="Please enter your name <img src='img/error.gif' width='9' height='9' id='texte' />";
		return false;
	}else{
		document.images.namee.src = "img/spacer.gif";
	}

	if(comments.comment.value==""|comments.comment.value=="Your message/comments"){
		comments.comment.focus();
		document.images.commente.src = "img/error.gif";
		document.getElementById("error").innerHTML="Please enter your comments <img src='img/error.gif' width='9' height='9' id='texte' />";
		return false;
	}else{
		document.images.commente.src = "img/spacer.gif";
	}

	if(comments.email.value==""){
		comments.email.focus();
		document.images.emaile.src = "img/error.gif";
		document.getElementById("error").innerHTML="Please enter your email <img src='img/error.gif' width='9' height='9' id='texte' />";
		return false;
	}else{
		document.images.emaile.src = "img/spacer.gif";
	}
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
	if(!re.test(comments.email.value)){
		comments.email.focus();
		document.images.emaile.src = "img/error.gif";
		document.getElementById("error").innerHTML="Please enter a valid email <img src='img/error.gif' width='9' height='9' id='texte' />";
		return false;
	}else{
		document.images.emaile.src = "img/spacer.gif";
	}
}

function rolloveremail(email,title){
	window.status='[ '+email+' ]     '+title;
}

function rolloff(){
	window.status=' ';
}

function addresser(username,domain,name){
	var atsign = "&#64;";
	var addr = username + atsign + domain;
	document.write("<"+"a"+" "+"href="+"mail"+"to:"+addr+" title=\"Email: "+name+"\">"+addr+"<\/a>");
}


// place footer at bottom
window.onresize = dofooter;

function dofooter() {
	var myHeight=0;
	if(typeof(window.innerHeight)=='number'){
		//Non-IE
		myHeight = window.innerHeight;
	}else if(document.documentElement&&document.documentElement.clientHeight){
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	}else if(document.body&&(document.body.clientHeight)){
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}
	
	if(myHeight>495){
		document.getElementById("heightadjust").innerHTML="<img src=\"img/blank.gif\" width=\"1\" height=\""+eval(myHeight-169)+"\" alt=\"\" />";
	}
}