// JavaScript Document

function searchSite() {
	if (document.siteSearch.homesearch.value.length < 2) {
		alert("Your search must be at least two characters long.");
		return false;
	}else{
		document.siteSearch.submit()
		return true;
	}
}

function swapImg(id,path,img){
	document.getElementById(id).src = path + img;
}

function swapTopNav(id,path,img,btwnImg){
	try {
		document.getElementById('c'+id).src = path + img;
	}catch(e){
	}
	
	try {
		document.getElementById('spaces_between_'+id).src = path + btwnImg;
		
	}catch(e){
	}
	
	try {
		document.getElementById('spaces_between_'+(parseInt(id) + 1)).src = path + btwnImg;	
	}catch(e){
		
	}
}

function addSheet(path){
	var ss = document.createElement("link");
	ss.type = "text/css";
	ss.rel = "stylesheet";
	ss.href = path;
	document.getElementsByTagName("head")[0].appendChild(ss);
}