// JavaScript Document
/* ............................................*/
/* to toggle the list style */
/* ............................................*/

	function setFocus(v){
		if(document.getElementById(v).className != "p_current")
		document.getElementById(v).className = "p_on";

		/* now set the map points style */
		currPt = v + "pt";
		if (document.getElementById(currPt).className != "current")
			document.getElementById(currPt).className = "on";
	}
	function setBlur(v){
		if(document.getElementById(v).className != "p_current")
		document.getElementById(v).className = "p_off";

		/* now set the map points style */
		currPt = v + "pt";
		if (document.getElementById(currPt).className != "current")
			document.getElementById(currPt).className = "off";
	}
	function setCurrent(v, pic){
		last_Property = currentProperty;
		document.getElementById(currentProperty).className = "p_off";
		document.getElementById(v).className = "p_current";
		currentProperty = document.getElementById(v).id;
//alert(parent.frames['first'].location.href);
//alert("v:"+v + " currentProperty:" +currentProperty);
 		parent.frames['first'].location.href= 'http://www.valleyfarmland.org/wordpress/wp-content/themes/farm/map/iFrame2.htm?prop='+currentProperty;
//alert(parent.frames['first'].location.href);
//		parent.frames['first'].window.location.reload(true);
setTimeout("reloadFrame();",500);
		/* now set the map points style */
		last = get(3,last_Property);
		curr = get(3,currentProperty);
		document.getElementById(last).className = "off";
		document.getElementById(curr).className= "current";

	}
function reloadFrame(){
		parent.frames['first'].window.location.reload(true);
}
/* ............................................*/
/* to toggle the map point style */
/* ............................................*/
	function setCurrentPt(v, pic) {
		curr = get(3,currentProperty);
		document.getElementById(curr).className = "off";
		document.getElementById(v).className= "current";
		currProp = parseInt(v);
		setCurrent(currProp, pic);
	}
	function setFocusPt(v) {
		curr = get(3,currentProperty);
		if (document.getElementById(curr).className != "current")
			document.getElementById(curr).className = "off";
		if (document.getElementById(v).className != "current")
			document.getElementById(v).className= "on";
		currProp = parseInt(v);
		setFocus(currProp);
	}
	function setBlurPt(v) {
		curr = get(3,currentProperty);
		if (document.getElementById(curr).className != "current")
			document.getElementById(curr).className = "off";
		if (document.getElementById(v).className != "current")
			document.getElementById(v).className= "off";
		currProp = parseInt(v);
		setBlur(currProp);
	}
/* ............................................*/
/* to fade the image */
/* ............................................*/
function initImage() {
  imageId = 'thephoto';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}
function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}
function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}
