// JavaScript Document
/* THREE STEPS TO INSTALL RESOLUTION PAGE:

   1.  Paste the coding into the HEAD of your HTML document
   2.  Add the last code into the BODY of your HTML document
   3.  Be sure to update the resolution pages to ones on your site  */

/* STEP ONE: Copy this code into the BODY of your HTML document  */


function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") ) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
	  if(a.getAttribute("title") == 'default') a.disabled = false;
    }
  }
}

window.onload = function(e) {
	//var cookie = readCookie("style");
	//var title = cookie ? cookie : getPreferredStyleSheet();
	if ((screen.width <= 800)) {
		setActiveStyleSheet('small');
	}else if ((screen.width >= 1280)){
		setActiveStyleSheet('large');
	}else{
		//setActiveStyleSheet(title);
	}
}

/* Drop down JS for IE - used for style switcher
-----------------------------------------------*/
/*
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("style-switcher");
		navRoot = navRoot.childNodes[0];
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function(){ this.className+=" over";}
				node.onmouseout=function(){ this.className=this.className.replace(" over", ""); }
			}
		}
	}
}
window.onload=startList;
*/



// Swap Images and text on the home page
// --------------------------------------------------------------
function imageSwap(elmId, elmId2){
	document.getElementById('img1').style.display = "none";
	document.getElementById('txt1').style.display = "none";
	document.getElementById('img2').style.display = "none";
	document.getElementById('txt2').style.display = "none";
	document.getElementById('img3').style.display = "none";
	document.getElementById('txt3').style.display = "none";

	document.getElementById(elmId).style.display = "block";
	document.getElementById(elmId2).style.display = "block";
	return false;
}