var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
var is_mac = (agt.indexOf("mac")!=-1);

//cookie function
function setCookie(name, value, expires) {
	document.cookie = name + "=" + escape(value) + "; path=/" +
	((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

function changeGallery(pic,title) {
	document.getElementById('galleryCont').innerHTML='<img alt="'+title+'" title="'+title+'" src="/pics/photogallery/'+pic+'" class="center">';
	return;
}

//
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
	  bob = new String(pair[1]);
	  bob = bob.replace(/\+/g," ");
	  return bob;
    }
  } 
}

// pop
function pop(url) {
	window.open(url,'');
	return;
}

// Page select function
function pageSelect(dis){
	window.location = (dis.value);
}

// JavaScript Document
startList = function() {
	if ( is_ie6 || ( is_ie5 && !is_mac ) || ( is_ie5_5 && !is_mac ) ) {
		navRoot = document.getElementById("nav");
		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", "");
				}
			}
		}
	}
}