function detailsWin(iFile,x,y) {
	var imagewindow=window.open(""+iFile+"","Details","width="+x+",height="+y+",menubar=no,toolbar=no,scrollbars=yes,resizable");
	imagewindow.resizeTo(x,y);
	imagewindow.focus();
}
function roll(state,imagename){ 
	document.images[imagename].src="/images/"+imagename+"_"+state+".gif"; 
}
function roll2(at,state,imagename){ 
	document.images[at].src="/images/"+imagename+"_"+state+".gif"; 
}
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;
if (document.getElementById) { isID = 1; isDHTML = 1; }
else {
	if (document.all) { isAll = 1; isDHTML = 1; }
	else {
		browserVersion = parseInt(navigator.appVersion);
	if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) { isLayers = 1; isDHTML = 1; }
	}
}

function findDOM(objectID, withStyle) {
	if (withStyle == 1) {
		if (isID) {return (document.getElementById(objectID).style); }
		else { if (isAll) {return (document.all[objectID].style); }
		else { if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) {return (document.getElementById(objectID)); }
		else { if (isAll) {return (document.all[objectID]); }
		else { if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}

function changeStyle(objectID,styleName,newValue) {
	var dom = findDOM(objectID,1);
	if(dom){
		dom[styleName] = newValue;
	}
	
}
function setClass(objectID,newClass) {
	var dom = findDOM(objectID,0);
	if(dom){
		dom.className = newClass;
	}
}

function doPop(topVal,leftVal,y,pageY,objectID) {
	if(isDHTML) {
		var browserWidth = findBrowserWidth();
		var livePageWidth = findLivePageWidth();
		var domStyle = findDOM(objectID,1);
		var dom = findDOM(objectID,0);
		var state = domStyle.visibility;
		var elemWidth;
		if(dom.offsetWidth) {
			elemWidth = dom.offsetWidth;
		} else { 
			if(dom.clip.width) { 
				elemWidth = dom.clip.width;
			}
		}
		if(state == "visible" || state == "show") { 
			domStyle.visibility = "hidden"
		} else {
				//var topVal = 0;
				//var leftVal = 0;
			if(pageY==1) {
				topVal = parseInt(topVal) +4;
				leftVal = parseInt(leftVal) - (elemWidth/2);
			} else {
				if(y==1) {
					topVal = parseInt(topVal) + 4 + document.body.scrollTop;
					leftVal = parseInt(leftVal) - (elemWidth/2) + document.body.scrollLeft;
				}
			}
			if((leftVal + elemWidth) > livePageWidth) {
				leftVal = leftVal - (elemWidth/2);
			}
		domStyle.top = topVal-40;
		domStyle.left = leftVal;
		
		domStyle.visibility = "visible";
		}
	}
}

// Sneaky Email Function
function sef(domain,name) {
	parent.location=	'm'+'ai'+'lto:'+name+'@'+domain;
}

function delay(r,g,b,element) {
	setTimeout("fadetext("+r+","+g+","+b+",'"+element+"'),2000");
}
function fadetext(r,g,b,element){
var rdone=false;
var bdone=false;
var gdone=false;
if(g<198){ g+=2;}else{g=198;gdone=true;
	if(b>63){b-=2}else{b=63;bdone=true;
		if(r<141){r+=2;}else{r=141;rdone=true;}
	}
}
	document.getElementById(element).style.borderColor="rgb("+r+","+g+","+b+")";
	document.getElementById(element).style.color="rgb("+r+","+g+","+b+")";
	if(rdone==true && bdone==true && gdone==true){
		return;
	}else{
		setTimeout("fadetext("+r+","+g+","+b+",'"+element+"'),500");
	}
}

function checkContact(){
	if(document.contact.realname.value=='') { 
		alert('Some required information was missing from the form.\n Please include your name.');
		document.contact.realname.focus();
		return false;
	}
	if(document.contact.email.value=='') { 
		alert('Some required information was missing from the form.\n Please include your email address.');
		document.contact.email.focus();
		return false;
	}
	if(document.contact.message.value=='') { 
		alert('Some required information was missing from the form.\n Please include your message.');
		document.contact.message.focus();
		return false;
	}
	if(document.contact.origin.value=='12') { 
		alert('Some required information was missing from the form.\n Please include your state.');
		document.contact.origin.focus();
		return false;
	}
	document.contact.submit();
}

function updateField(){document.contact.origin.value='34';}