﻿<!--

 function doClear(theText) {

     if (theText.value == theText.defaultValue) {

         theText.value = ""

     }

 }

//-->
   

  var time = 0; // Save the time setting for later  

 function rp (pTime) 

 {  

  time = pTime; // Store time in global variable   

  var uniq = new Date();   

  uniq = uniq.getTime(); // Generate time string   

  newImage.src = "cam.jpg?" + uniq; // generate unique URL   

  // The unique time URL parameter in the path ensures that the   

  // browser always goes for a new image and ignores the cached copy  

  }  

  function showImg () {   // Put the image on the page   

  document.images.webpicture.src = newImage.src;   

  // Set the timer for the reload function, which will be time   

  // seconds after the image was last reloaded, so it won't fall   

  // behind on slow connections   

  setTimeout("rp(" + time + ");", time * 1000); //   

  }

function movepic(img_name,img_src) 

{

  check_stall(img_src);

if (!document.images.webpicture || document.all.lowerpaddockimagemap)

{

document.all.hrefimagemap.innerHTML = "<img border='0' src='http://greentreehorsefarm.com/webcam/paddock.jpg' width='320' height='240' name='webpicture'>";

document.all.movetext.innerHTML = "<a href='#webcam' onclick='showimagemap();return false;'>" +

"<img border='0' src='images/rotate_paddock_cams.jpg' alt='Move the paddock camera'></a>" +

"<a href='#webcam' onclick='showbarnimagemap();return false;'>" +

"<img border='0' src='images/Move_the_barn_cams.jpg'></a>" +

"<br><font color=red><span id=countdowntimer></span></font>";

}

showImg;

var uniq = new Date();   

  uniq = uniq.getTime();

 document[img_name].src=img_src + "?" + uniq;

 }

	function sleep(ms)
	{
		var dt = new Date();
		dt.setTime(dt.getTime() + ms);
		while (new Date().getTime() < dt.getTime());
	}




// End -->



var xmlhttp=false;

/*@cc_on @*/

/*@if (@_jscript_version >= 5)

// This script is used to move the cameras. JScript gives us Conditional compilation, we can cope with old IE versions.

// and security blocked creation of the objects.

 try {

  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

 } catch (e) {

  try {

   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

  } catch (E) {

   xmlhttp = false;

  }

 }

@end @*/

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {

	try {

		xmlhttp = new XMLHttpRequest();

	} catch (e) {

		xmlhttp=false;

	}

}

if (!xmlhttp && window.createRequest) {

	try {

		xmlhttp = window.createRequest();

	} catch (e) {

		xmlhttp=false;

	}

}
