
// Include function to position logo here intead of calling positionlogo.js on INDEX pages only 
// All other pages that don't have webcam use positionlogo.js
$(document).ready(function(){
	// Your code here
	$.get("http://www.rcradionetwork.com/getliveimagedate.php",{ camera: whichcamera}, function(data){
		//alert("Data Loaded: " + data);
		var lastModif = data;
		document.getElementById('image_modified_date').innerHTML = lastModif;			
	});
	positionLogo();
});
// JAVACRIPT FOR LIVE CAM
myTimer = setInterval('rotateLiveImage()',15000);
var i_counter = 1;
var whichcamera = 1;		// specifies the camera 1 or 2
function rotateLiveImage() {
	var randomnumber=Math.floor(Math.random()*100000000)		
	live_image_object = document.getElementById("webcam");
	
	if(whichcamera == 1)	{
		live_image_object.src = "/images/live_images/webcam1.jpg?mtime=" + randomnumber;
		whichcamera = 2;
	} else {
		live_image_object.src = "/images/live_images/camera2.jpg?mtime=" + randomnumber;
		whichcamera = 1;
	}
	$.get("http://www.rcradionetwork.com/getliveimagedate.php",{ camera: whichcamera}, function(data){
			//alert("Data Loaded: " + data);
			var lastModif = data;
			document.getElementById('image_modified_date').innerHTML = lastModif;
	});
}

// Function to position logo in center of page on load and resize
function positionLogo()	{
	//logo.style.display = "none";
	var logo = document.getElementById("mainlogo");
	var x  = (document.body.clientWidth/2) - 112;
	var y = 72;     // spacing from top of page         
	logo.style.top = y;
	logo.style.left = x;
	logo.style.display = "block";
	
	// set hot area for home page click on house image in top banner
	var homelink = document.getElementById("homehotarea");
	var x  = (document.body.clientWidth/2) + 414;
	var y = 142;     // spacing from top of page         
	homelink.style.top = y;
	homelink.style.left = x;
}

window.onresize = function() { 
	positionLogo();
}