/*var image_resizer	= '';
var loading_image	= '';
var isLoading		= true;
var line_break		= '\n<br />\n';

var timeout;
var timeout_pending	= false;
var current_cam		= new String();

function clear_timeouts() {
	clearTimeout(timeout);
}

//--MISC Cam Feeds (image only, no refresh)--\\
var misc			= new make2D(2, 3); // [0] = cam name; [1] = title; [2] = location
//--
misc[0][0]		= 'http://70.88.152.30:9999/axis-cgi/mjpg/video.cgi?resolution=704x480&amp;dummy=garb';
misc[0][1]		= 'Sunset Marina';
misc[0][2]		= 'Weighing Station';
misc[0][3]		= 'http://www.ocsunsetmarina.com/';
//--
misc[1][0]		= 'http://70.91.79.226:8888/axis-cgi/mjpg/video.cgi?resolution=CIF&amp;dummy=1213214061060';
misc[1][1]		= 'OC Fishing Center';
misc[1][2]		= 'Weighing Station';
misc[1][3]		= 'http://www.ocfishing.com/';

function misc_display_cam(which_cam) {
	// clear the timeouts so that they dont overlap
	clear_timeouts();

	if (misc[which_cam][1] != current_cam)
		current_cam = misc[which_cam][1];
	
	display_loading();

	// load the image
	misc_load_image(misc[which_cam][0], which_cam);
	// display the captions
	if (misc[which_cam][1] == current_cam)
		display_captions(misc[which_cam][1], 'Presented By: '+misc[which_cam][1], misc[which_cam][2], misc[which_cam][3]);
}
//--
function misc_load_image(url, which_cam) {
	// load the specified image and when it's done loading, display it
	var image	= new Image();
	timeout_pending = true;
	image.onload = function() {
		if (misc[which_cam][1] == current_cam) {
			display_image(image);
			isLoading = false;
			timeout_pending = false;
		}
	}
	image.src	= image_resizer+url;
}
//--MISC Cam Feeds (image only, no refresh--\\

//--Earthcam Cam Feeds--\\
var earthcam		= new make2D(2, 3); // [0] = cam name; [1] = title; [2] = location; [3] = url
//--
earthcam[0][0]		= 'http://images.earthcam.com/ecnetwork/delmarva.jpg,50,1000';
earthcam[0][1]		= 'Paradise Plaza Inn';
earthcam[0][2]		= '9th St on the Boardwalk';
earthcam[0][3]		= 'http://www.paradiseplazainn.com/';
//--
function earthcam_display_cam(which_cam) {
	// clear the timeouts so that they dont overlap
	clear_timeouts();
	
	if (earthcam[which_cam][1] != current_cam)
		current_cam = earthcam[which_cam][1];
	
	display_loading();
	
	// load the image
	earthcam_load_flash(earthcam[which_cam][0], which_cam);
	// display the captions
	display_captions(earthcam[which_cam][1], 'Presented By: '+earthcam[which_cam][1], earthcam[which_cam][2], earthcam[which_cam][3]);
}
//--
function earthcam_load_flash(cam_name, which_cam) {
	write_flash("http://www.earthcam.com/swf/dotcom_live_viewer_320x240.swf?"+cam_name, 300, 240, "webcam_container", 'webcam_container', null, null, "high", "transparent");
}
//--Earthcam Cam Feeds--\\


//--Surfline Cam Feeds--\\
var surfline		= new make2D(2, 3); // [0] = cam name; [1] = title; [2] = location; [3] = url
//--
surfline[0][0]		= 'oceancitymdcam';
surfline[0][1]		= 'Malibu\'s Surf Shop';
surfline[0][2]		= '7th St on the Boardwalk';
surfline[0][3]		= 'http://www.malibus.com/';
//--
function surfline_display_cam(which_cam) {
	// clear the timeouts so that they dont overlap
	clear_timeouts();
	
	if (surfline[which_cam][1] != current_cam)
		current_cam = surfline[which_cam][1];
	
	display_loading();
	
	// load the image
	surfline_load_flash(surfline[which_cam][0], which_cam);
	// display the captions
	display_captions(surfline[which_cam][1], 'Presented By: '+surfline[which_cam][1], surfline[which_cam][2], surfline[which_cam][3]);
}
//--
function surfline_load_flash(cam_name, which_cam) {
	var arVars = new Array(
						Array("allowScriptAccess", 'sameDomain'),
						Array("varGateway", "www.surfline.com:80"),
						Array("varCamName", cam_name),
						Array("varTimeOut", "1800"),
						Array("varDebug", 0),
						Array("varPlay", "live"),
						Array("varUserID", 0),
						Array("varSize", 0)
				  );
	write_flash("http://www.surfline.com/flashcam2/slviewer2.swf", 300, 240, "webcam_container", 'webcam_container', null, null, "high", "transparent", null, null, null, null, true, arVars);
}
//--Surfline Cam Feeds--\\



//--NetCam Cam Feeds--\\
var netcam			= new make2D(4, 3); // [0] = domain; [1] = title; [2] = location; [3] = url
//--
netcam[0][0]		= 'http://70.91.158.125:81/netcam.jpg';
netcam[0][1]		= 'Howard Johnson Oceanfront Plaza Hotel';
netcam[0][2]		= '12th St on the Boardwalk';
netcam[0][3]		= 'http://www.hjoceanfrontplaza.com/';
//--
netcam[1][0]		= 'http://75.150.29.178:8085/netcam.jpg';
netcam[1][1]		= 'Clarion Resort Hotel';
netcam[1][2]		= '101st St Oceanfront';
netcam[1][3]		= 'http://www.clarionoc.com/';
//--
netcam[2][0]		= 'http://74.53.195.98:8080/netcam.jpg';
netcam[2][1]		= 'The Kite Loft';
netcam[2][2]		= '5th St on the Boardwalk';
netcam[2][3]		= 'http://www.kiteloft.com/';
//--
netcam[3][0]		= 'http://12.110.116.85:8090/jpeg.cgi?0';
netcam[3][1] 		= 'Carousel Hotel';
netcam[3][2]		= '118th Street on the Ocean';
netcam[3][3]		= 'http://www.carouselhotel.com/';


function netcam_display_cam(which_cam, loading) {
	// clear the timeouts so that they dont overlap
	clear_timeouts();

	if ((netcam[which_cam][1] != current_cam) && (loading != false))
		current_cam = netcam[which_cam][1];

	if (loading != false) {
		// show the loading animation
		display_loading();
	}
	// load the image
	netcam_load_image(netcam[which_cam][0] + '?' + Math.random(), which_cam);

	
	// display the captions
	if (netcam[which_cam][1] == current_cam)
		display_captions(netcam[which_cam][1], 'Presented By: '+netcam[which_cam][1], netcam[which_cam][2], netcam[which_cam][3]);
}
//--
function netcam_load_image(url, which_cam) {
	// load the specified image and when it's done loading, display it
	var image	= new Image();
	timeout_pending = true;
	image.onload = function() {
		if (netcam[which_cam][1] == current_cam) {
			display_image(image);
			isLoading = false;
			timeout_pending = false;
			timeout = setTimeout('netcam_display_cam('+which_cam+', false)', 500);
		}
	}
	image.src	= image_resizer+url;
}
//--NetCam Cam Feeds--\\



//--OC Ocean Cam Feeds--\\
var ococean			= new make2D(10, 2); // [0] = subdomain; [1] = title
var ococean_url		= 'http://www.ococean.com/';
var ococean_caption	= 'Presented by Town of Ocean City';
var ococean_cgi_url	= 'SnapshotJPEG?Resolution=640x480&Quality=Standard&Count=';
var ococean_counter = new Number(0);
//--
ococean[0][0]		= 'http://worcestercam.ococean.com/';
ococean[0][1]		= 'Worcester Street';
//--
ococean[1][0]		= 'http://divisioncam.ococean.com/';
ococean[1][1]		= 'Division Street';
//--
ococean[2][0]		= 'http://9thcam.ococean.com/';
ococean[2][1]		= '9th Street';
//--
ococean[3][0]		= 'http://27thcam.ococean.com/';
ococean[3][1]		= '27th Street';
//--
ococean[4][0]		= 'http://rt1cam.ococean.com/';
ococean[4][1]		= 'Route 1';
//--
ococean[5][0]		= 'http://rt90cam.ococean.com/';
ococean[5][1]		= 'Route 90';
//--
ococean[6][0]		= 'http://wicomicocam.ococean.com/';
ococean[6][1]		= 'Wicomico Street';
//--
ococean[7][0]		= 'http://carolinecam.ococean.com/';
ococean[7][1]		= 'Caroline Street';
//--
ococean[8][0]		= 'http://9thcam.ococean.com/';
ococean[8][1]		= 'Boardwalk';
//--
ococean[9][0]		= 'http://www.clarionoc.com/netcamI.php';
ococean[9][1]		= 'Clarion Resort Hotel';
//--


function ococean_display_cam(which_cam, loading) {
	// clear the timeouts so that they dont overlap
	clear_timeouts();
	
	if ((ococean[which_cam][1] != current_cam) && (loading != false))
		current_cam = ococean[which_cam][1];
	
	if (loading != false) {
		// show the loading animation
		display_loading();
	}
	// load the image
	ococean_load_image(ococean[which_cam][0] + ococean_cgi_url + ococean_counter, which_cam);
	
	// display the captions
	if (ococean[which_cam][1] == current_cam)
		display_captions(ococean[which_cam][1], ococean_caption, null, ococean_url);

	ococean_counter++;
}
//--
function ococean_load_image(url, which_cam) {
	// load the specified image and when it's done loading, display it
	var image	= new Image();
	timeout_pending = true;
	image.onload = function() {
		if (ococean[which_cam][1] == current_cam) {
			display_image(image);
			isLoading = false;
			timeout_pending = false;
			timeout = setTimeout('ococean_display_cam('+which_cam+', false)', 3000);
		}
	}
	image.src	= image_resizer+url;
}
//--OC Ocean Cam Feeds--\\




function display_captions(title, caption, location, url) {
	// display the current cam's title
	document.getElementById('webcam_title').innerHTML			= (title != null)			? title+line_break : '';
	// display the current cam's location
	document.getElementById('webcam_location').innerHTML		= (location != null)		? location+line_break : '';
	if (url != null)
		document.getElementById('webcam_caption').innerHTML		= (caption != null)			? '<a href="'+url+'" target="_blank">'+caption+'</a>'+line_break : '';
	else
		document.getElementById('webcam_caption').innerHTML		= (caption != null)			? caption+line_break : '';
}

function display_image(image) {
	// display the image
	//$('#webcam_container').replaceWith('<div id="webcam_container" style="border:red solid 1px">HELLO</div>');
	var new_div = document.createElement("div");
	new_div.style.visibility = 'visible';
	new_div.setAttribute("id", "webcam_container")
	document.getElementById("webcams").replaceChild(new_div, document.getElementById('webcam_container'))	
	document.getElementById('webcam_container').innerHTML	= '<img src="images/image.gif" width="300" height="240" alt="Webcam" id="webcam_image" />';
	document.getElementById('webcam_image').src				= image.src;
}

function display_loading() {
	// display the loading swf's div container
	write_flash('flash/loading_webcam.swf', 300, 240, 'webcam_container', 'webcam_container');
	//alert('settting loading image to' + loading_image);
	//document.getElementById('webcam_container').innerHTML = loading_image;
	isLoading = true;
}

function make2D(rows, cols) {
	// loop thru the number of rows provided and create a new array
	// for each with the number of columns set, thus creating
	// a 2d array =]
	var array	= new Array(rows);
	
	for (i=0; i<array.length; ++i) {
		array[i] = new Array(cols);
	}
	
	return array;
}*/
