﻿
function MM_preloadImages() { //v3.0 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); 
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) 
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} 
}
window.name = 'tallgrass';
            
function new_win(url, winWidth, winHeight) {
	var attrs = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+winWidth+',height='+winHeight+',left=30,top=30,screenX=30,screenY=30';
	window.open(url, '', attrs);

	return;
}

function checkAll() {
for (var j = 0; j <= 9; j++) {
box = eval("document.emailtofriend.related" + j); 
if (box.checked == false) box.checked = true;
   }
}

function uncheckAll() {
for (var j = 0; j <= 9; j++) {
box = eval("document.emailtofriend.related" + j); 
if (box.checked == true) box.checked = false;
   }
}

function switchAll() {
for (var j = 0; j <= 9; j++) {
box = eval("document.emailtofriend.related" + j); 
box.checked = !box.checked;
   }
}

function MM_openBrWindow(theURL, winWidth, winHeight) { //v2.0
	var features = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+winWidth+',height='+winHeight+',left=30,top=30,screenX=30,screenY=30';

  window.open(theURL,"email",features);
}

var submitted = 0;
function validate() {
	if (submitted == 0) {
		submitted++;
		return true;
	}
	else if (submitted == 1) {
		submitted++;
		return false;
	}
	else {
		alert("Your comment is being posted, please do not hit the button more than once.");
		return false;
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

var isNav4, isNav6, isIE4;
/*
 * Browser version snooper; determines your browser
 * (Navigator 4, Navigator 6, or Internet Explorer 4/5)
 */
function setBrowser(){
	if (navigator.appVersion.charAt(0) == "4"){
		if (navigator.appName.indexOf("Explorer") >= 0){
			isIE4 = true;
		}else{
			isNav4 = true;
		}
	}else if (navigator.appVersion.charAt(0) > "4"){
		isNav6 = true;
	}
}
function nav( divNum,divTot ){
	var id = 0;
	var i = divTot;
	
	while (i > 0){
		setIdProperty("sub" + i, "display", "none");
		i--;
	}
	setIdProperty("sub" + divNum, "display", "block");
	
}
function navi( divNum,divTot ){
	var id = 0;
	var display = "";
	var i = divTot;
	var j = divTot;
	
	while (i > 0){
		setIdProperty("sub" + i, "display", "none");
		i--;
	}
	while (j > 0){
		if(j != divNum){
			setIdProperty("headi" + j, "display", "inline");
			setIdProperty("headpi" + j, "display", "none");			
		}else{
			setIdProperty("headpi" + divNum, "display", "inline");
			setIdProperty("headi" + divNum, "display", "none");			
		}
		j--;
	}		

	setIdProperty("sub" + divNum, "display", "block");
	
}
function setIdProperty(id, property, value){
	if (isNav6){
		var styleObject = document.getElementById( id );
		if (styleObject != null){
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}else if (isNav4){
		document[id][property] = value;
	}else if (isIE4){
		document.all[id].style[property] = value;
	}
}

function isEMailAddr(elem){
	var	str	= elem.value;
	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	if (!str.match(re)) {
		alert("The e-mail address you typed is not valid.");
		setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
		return false;
	} else {
		return true;
	}
}

function fixImgs(whichId, maxW) {
var pix=document.getElementById(whichId).getElementsByTagName('img');
  for (i=0; i<pix.length; i++) {
    w=pix[i].width;
    h=pix[i].height;
    if (w > maxW) {
      f=1-((w - maxW) / w);
      pix[i].width=w * f;
      pix[i].height=h * f;
    }
  }
}

function stat(varobjdummy)
{
	return;
}

function drop()
{
	return;
}

