var image_resizer	= '';
var isLoading		= true;
var line_break		= '\n<br />\n';

var timeout;
var timeout_pending	= false;
var current_cam		= null;
var cams;

// adds a listener to the current browsers "on load" event to create/setup the slideshows
if (window.attachEvent) {
	window.attachEvent('onload', initCams);
} else if (window.addEventListener) {
	window.addEventListener('load', initCams, false);
} else {
	document.addEventListener('load', initCams, false);
}

function clear_timeouts() {
	clearTimeout(timeout);
}

/* INIT CAMS */
function initCams(){
	if(typeof(cams) == 'undefined') return;
	
	//get random cam
	var rnd = Math.floor(Math.random() * cams.length);
	
	//display the cam
	displayCam(rnd);
}

/* MASTER FUNCTION TO DISPLAY CAM */
function displayCam(which){
	//set the current cam
	current_cam = which;
	
	//clear the timeouts
	clear_timeouts();

	//display the loading
	display_loading();

	//call the cams function
	window[cams[which].display_function](which);
	
	//set the captions
	displayCaptions(which);
}

/* AXIS CAMS */
function displayAxisCam(which){
	//get the content to display
	document.getElementById('webcam_container').innerHTML = getAxisCam(cams[which].cam);
}

/* AXIS APPLETS */
function displayAxisApplet(which){	
	//get the content to display
	document.getElementById('webcam_container').innerHTML = getAxisApplet(cams[which].cam);	
}

/* FLASH CAMS */
function displayFlashCam(which) {
	//get the flash vars
	var arVars = (typeof(cams[which].flashvars) != 'undefined') ? cams[which].flashvars : Array();
	
	//create a new element to hold the flash
	appendSwfContainer();
	
	//load the flash
	write_flash(cams[which].cam, 300, 240, "webcam_container_swf", "webcam_container_swf", null, null, "high", "transparent", null, null, null, null, true, arVars);
}

function displayImageCam(which){
	//load the image
	loadImageCam(cams[which].cam,which);
}

function displayCaptions(which){
	// display the current cam's title
	document.getElementById('webcam_title').innerHTML			= (cams[which].title != null)		? cams[which].title+line_break : '';
	// display the current cam's location
	document.getElementById('webcam_location').innerHTML		= (cams[which].address != null)		? cams[which].address+line_break : '';
	
	//set the url if it is available
	if (cams[which].url != null){
		document.getElementById('webcam_caption').innerHTML		= (cams[which].title != null)		? '<a href="'+cams[which].url+'" target="_blank">'+cams[which].title+'</a>'+line_break : '';
	} else {
		document.getElementById('webcam_caption').innerHTML		= (cams[which].title != null)		? cams[which].title+line_break : '';
	}
}

function getAxisCam(BaseURL){
	// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
	// You may change these numbers, the effect will be a stretched or a shrunk image
	var DisplayWidth = "352";
	var DisplayHeight = "240";
	
	// This is the path to the image generating file inside the camera itself
	var File = "axis-cgi/mjpg/video.cgi?resolution=704x480";
	
	// No changes required below this point
	var output = "";
	
	//if its ie do the object else do the image
	if ((navigator.appName == "Microsoft Internet Explorer") &&(navigator.platform != "MacPPC") && (navigator.platform != "Mac68k")){
		// If Internet Explorer under Windows then use ActiveX 
		output = '<OBJECT ID="Player" width='
		output += DisplayWidth;
		output += ' height=';
		output += DisplayHeight;
		output += ' CLASSID="CLSID:DE625294-70E6-45ED-B895-CFFA13AEB044" ';
		output += 'CODEBASE="';
		output += BaseURL;
		output += 'activex/AMC.cab#version=3,32,14,0">';
		output += '<PARAM NAME="MediaURL" VALUE="';
		output += BaseURL;
		output += File + '">';
		output += '<param name="MediaType" value="mjpeg-unicast">';
		output += '<param name="ShowStatusBar" value="0">';
		output += '<param name="ShowToolbar" value="0">';
		output += '<param name="AutoStart" value="1">';
		output += '<param name="StretchToFit" value="1">';
		output += '<BR><B>Axis Media Control</B><BR>';
		output += 'The AXIS Media Control, which enables you ';
		output += 'to view live image streams in Microsoft Internet';
		output += ' Explorer, could not be registered on your computer.';
		output += '<BR></OBJECT>';
	} else {
		// If not IE for Windows use the browser itself to display
		theDate = new Date();
		output = '<IMG SRC="';
		output += BaseURL;
		output += File;
		output += '&dummy=' + theDate.getTime().toString(10);
		output += '" HEIGHT="';
		output += DisplayHeight;
		output += '" WIDTH="';
		output += DisplayWidth;
		output += '" ALT="Camera Image">';
	}
	
	//return the output
	return output;
}

function getAxisApplet(BaseURL){
	// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
	// You may change these numbers, the effect will be a stretched or a shrunk image
	var DisplayWidth = "352";
	var DisplayHeight = "240";

	// This is the path to the image generating file inside the camera itself
	var File = "axis-cgi/mjpg/video.cgi?resolution=CIF&compression=10";

	// No changes required below this point
	var output = "";
	var AppletDir = BaseURL + "java/ama";
	var VideoPath = "axis-cgi/mjpg/video.cgi?resolution=";
	var restOfPath = "&compression=10";
	var VideoURL = BaseURL + VideoPath;

	//setup output
	output  = '<APPLET archive="ama.jar" codeBase="';
	output += AppletDir + '"';
	output += ' code="ama.MediaApplet" height=';
	output += DisplayHeight;
	output += ' width=';
	output += DisplayWidth;
	output += '>';
	output += '<PARAM NAME="code" VALUE="ama.MediaApplet">';
	output += '<PARAM NAME="archive" VALUE="ama.jar">';
	output += '<PARAM NAME="codebase" VALUE="';
	output += AppletDir + '">';
	output += '<PARAM NAME="ama_cgi-path" VALUE="axis-cgi">';
	output += '<PARAM NAME="cache_archive" VALUE="ama.jar, ptz.jar">';
	output += '<PARAM NAME="cache_version" VALUE="1.0.0.0, 1.2.1.0">';
	output += '<PARAM NAME="ama_plugins" VALUE="ptz.PTZ">';
	output += '<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">';
	output += '<PARAM NAME="ama_url" VALUE="';
	output += VideoURL;
	output += DisplayWidth + 'x' + DisplayHeight;
	output += restOfPath +'">';
	output += '</APPLET>'

	//return the output
	return output;
}

function loadImageCam(url,which){
	// load the specified image and when it's done loading, display it
	var image	= new Image();
	
	//when image is loaded
	image.onload = function() {
		if(which == current_cam){
			//add the image container
			if(!document.getElementById('webcam_image')){
				document.getElementById('webcam_container').innerHTML	= '<img src="images/image.gif" width="300" height="240" alt="Webcam" id="webcam_image" />';
			}
			
			//put the image as the source
			document.getElementById('webcam_image').src	= image.src;
		
			//set the timeout
			timeout = setTimeout('loadImageCam("'+url+'",'+which+', false)', 500);
		}
	}
	
	//set the source of the image
	image.src	= image_resizer+url+'?'+Math.random();
}

function display_loading() {
	//append the swf container
	appendSwfContainer();
	
	// display the loading swf's div container
	write_flash('flash/loading_webcam.swf', 300, 240, 'webcam_container_swf','webcam_container_swf');
	isLoading = true;
}

function appendSwfContainer(){
	document.getElementById('webcam_container').innerHTML = '<div id="webcam_container_swf"></div>';
}

/*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_content(content){
	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	= content;
}

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;
}

function sunset_display_cam(){
	// clear the timeouts so that they dont overlap
	clear_timeouts();
	
	//display the loading
	display_loading();
	
	//get the sunset cam
	display_content(getSunsetCam());
	//document.getElementById('webcams').appendChild(new_ele);
	
	// display the captions
	display_captions('Sunset Marina', 'Presented By: Sunset Marina', '', 'http://www.ocsunsetmarina.com/');
}

function getSunsetCam(){
	var BaseURL = "http://70.88.152.30:9999/";

	// The two following lines are for AXIS 2400/2400+:
	
	var Camera = ""; // If you use an AXIS 2400/2400+, comment away this line by inserting "//"
	// var Camera = "n"; // Change n to the Video source used in the AXIS 2400/2400+ and remove "//"
	
	// Go to the camera used and remove the "//" in front of the ImageResolution to be used.
	// Note that only one can be enabled.
	
	// AXIS 2100
	// var ImageResolution = "320x240";var DisplayWidth = "320";var DisplayHeight = "240";
	// var ImageResolution = "640x480";var DisplayWidth = "640";var DisplayHeight = "480";
	
	// AXIS 2120/2400/2400+/2401/2401+/2420 PAL
	// var ImageResolution = "352x288";var DisplayWidth = "352";var DisplayHeight = "288";
	// var ImageResolution = "704x576";var DisplayWidth = "704";var DisplayHeight = "576";
	
	// AXIS 2120/2400/2400+/2401/2401+/2420 NTSC
	// var ImageResolution = "352x240";var DisplayWidth = "352";var DisplayHeight = "240";
	var ImageResolution = "704x480";var DisplayWidth = "300";var DisplayHeight = "240";
	
	
	// No changes required below this point
	var File = "axis-cgi/mjpg/video.cgi?resolution=" + ImageResolution;
	if (Camera != "") {File += "&camera=" + Camera;}
	var output = "";
	if ((navigator.appName == "Microsoft Internet Explorer")&&(navigator.platform != "MacPPC")&&(navigator.platform != "Mac68k"))
	{
		// If Internet Explorer for Windows then use ActiveX
		output = "<OBJECT ID=\"CamImage\" WIDTH="
		output += DisplayWidth;
		output += " HEIGHT=";
		output += DisplayHeight;
		output += " CLASSID=CLSID:917623D1-D8E5-11D2-BE8B-00104B06BDE3 ";
		output += "CODEBASE=\"";
		output += BaseURL;
		output += "activex/AxisCamControl.cab#Version=1,0,2,15\">";
		output += "<PARAM NAME=\"URL\" VALUE=\"";
		output += BaseURL;
		output += File;
		output += "\"> <BR><B>Axis ActiveX Camera Control</B><BR>";
		output += "The AXIS ActiveX Camera Control, which enables you ";
		output += "to view live image streams in Microsoft Internet";
		output += " Explorer, could not be registered on your computer.";
		output += "<BR></OBJECT>";
	}
	else
	{
		// If not IE for Windows use the browser itself to display
		output = "<IMG SRC=\"";
		output += BaseURL;
		output += File;
		output += "&dummy=garb\" HEIGHT=\"";
		// The above dummy cgi-parameter helps some versions of NS
		output += DisplayHeight;
		output += "\" WIDTH=\"";
		output += DisplayWidth;
		output += "\" ALT=\"Moving Image Stream\">";
	}
	return output;
}



function ocfishing_display_cam(){
	// clear the timeouts so that they dont overlap
	clear_timeouts();
	
	//display the loading
	display_loading();
	
	//get the sunset cam
	display_content(getOcFishing());
	
	// display the captions
	display_captions('OC Fishing Center', 'Presented By: OC Fishing Center', 'Weighing Station', 'http://www.ocfishing.com/');
}


function getOcFishing(){
	// Set the BaseURL to the URL of your camera
	var BaseURL = "http://70.91.79.226:8888/";
	
	// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
	// You may change these numbers, the effect will be a stretched or a shrunk image
	var DisplayWidth = "300";
	var DisplayHeight = "240";
	
	// This is the path to the image generating file inside the camera itself
	var File = "axis-cgi/mjpg/video.cgi?resolution=CIF";
	// No changes required below this point
	var output = "";
	if ((navigator.appName == "Microsoft Internet Explorer") &&
	(navigator.platform != "MacPPC") && (navigator.platform != "Mac68k"))
	{
	// If Internet Explorer under Windows then use ActiveX 
	output = '<OBJECT ID="Player" width='
	output += DisplayWidth;
	output += ' height=';
	output += DisplayHeight;
	output += ' CLASSID="CLSID:DE625294-70E6-45ED-B895-CFFA13AEB044" ';
	output += 'CODEBASE="';
	output += BaseURL;
	output += 'activex/AMC.cab#version=3,32,14,0">';
	output += '<PARAM NAME="MediaURL" VALUE="';
	output += BaseURL;
	output += File + '">';
	output += '<param name="MediaType" value="mjpeg-unicast">';
	output += '<param name="ShowStatusBar" value="0">';
	output += '<param name="ShowToolbar" value="0">';
	output += '<param name="AutoStart" value="1">';
	output += '<param name="StretchToFit" value="1">';
	// Remove the '//' for the ptz settings below to use the code for click-in-image. 
	// output += '<param name="PTZControlURL" value="';
	// output += BaseURL;
	// output += '/axis-cgi/com/ptz.cgi?camera=1">';
	// output += '<param name="UIMode" value="ptz-relative">'; // or "ptz-absolute"
	output += '<BR><B>Axis Media Control</B><BR>';
	output += 'The AXIS Media Control, which enables you ';
	output += 'to view live image streams in Microsoft Internet';
	output += ' Explorer, could not be registered on your computer.';
	output += '<BR></OBJECT>';
	} else {
	// If not IE for Windows use the browser itself to display
	theDate = new Date();
	output = '<IMG SRC="';
	output += BaseURL;
	output += File;
	output += '&dummy=' + theDate.getTime().toString(10);
	output += '" HEIGHT="';
	output += DisplayHeight;
	output += '" WIDTH="';
	output += DisplayWidth;
	output += '" ALT="Camera Image">';
	}
	
	//document.Player.ToolbarConfiguration = "play,+snapshot,+fullscreen"
	
	return output;
	// document.Player.UIMode = "MDConfig";
	// document.Player.MotionConfigURL = "/axis-cgi/operator/param.cgi?ImageSource=0"
	// document.Player.MotionDataURL = "/axis-cgi/motion/motiondata.cgi";

}

function parkplace_display_cam(){
	// clear the timeouts so that they dont overlap
	clear_timeouts();
	
	//display the loading
	display_loading();
	
	//get the sunset cam
	display_content(getParkPlaceCam());
	//document.getElementById('webcams').appendChild(new_ele);
	
	// display the captions
	display_captions('Park Place Jewelers', 'Presented By: Park Place Jewelers', '', 'http://www.parkplacejewelers.com/');
}

function getParkPlaceCam(){
	var BaseURL = "http://75.145.11.161:8080/";

	// The two following lines are for AXIS 2400/2400+:
	
	var Camera = ""; // If you use an AXIS 2400/2400+, comment away this line by inserting "//"
	// var Camera = "n"; // Change n to the Video source used in the AXIS 2400/2400+ and remove "//"
	
	// Go to the camera used and remove the "//" in front of the ImageResolution to be used.
	// Note that only one can be enabled.
	
	// AXIS 2100
	// var ImageResolution = "320x240";var DisplayWidth = "320";var DisplayHeight = "240";
	// var ImageResolution = "640x480";var DisplayWidth = "640";var DisplayHeight = "480";
	
	// AXIS 2120/2400/2400+/2401/2401+/2420 PAL
	// var ImageResolution = "352x288";var DisplayWidth = "352";var DisplayHeight = "288";
	// var ImageResolution = "704x576";var DisplayWidth = "704";var DisplayHeight = "576";
	
	// AXIS 2120/2400/2400+/2401/2401+/2420 NTSC
	// var ImageResolution = "352x240";var DisplayWidth = "352";var DisplayHeight = "240";
	var ImageResolution = "704x480";var DisplayWidth = "300";var DisplayHeight = "240";
	
	
	// No changes required below this point
	var File = "axis-cgi/mjpg/video.cgi?resolution=" + ImageResolution;
	if (Camera != "") {File += "&camera=" + Camera;}
	var output = "";
	if ((navigator.appName == "Microsoft Internet Explorer")&&(navigator.platform != "MacPPC")&&(navigator.platform != "Mac68k"))
	{
		// If Internet Explorer for Windows then use ActiveX
		output = "<OBJECT ID=\"CamImage\" WIDTH="
		output += DisplayWidth;
		output += " HEIGHT=";
		output += DisplayHeight;
		output += " CLASSID=CLSID:917623D1-D8E5-11D2-BE8B-00104B06BDE3 ";
		output += "CODEBASE=\"";
		output += BaseURL;
		output += "activex/AxisCamControl.cab#Version=1,0,2,15\">";
		output += "<PARAM NAME=\"URL\" VALUE=\"";
		output += BaseURL;
		output += File;
		output += "\"> <BR><B>Axis ActiveX Camera Control</B><BR>";
		output += "The AXIS ActiveX Camera Control, which enables you ";
		output += "to view live image streams in Microsoft Internet";
		output += " Explorer, could not be registered on your computer.";
		output += "<BR></OBJECT>";
	}
	else
	{
		// If not IE for Windows use the browser itself to display
		output = "<IMG SRC=\"";
		output += BaseURL;
		output += File;
		output += "&dummy=garb\" HEIGHT=\"";
		// The above dummy cgi-parameter helps some versions of NS
		output += DisplayHeight;
		output += "\" WIDTH=\"";
		output += DisplayWidth;
		output += "\" ALT=\"Moving Image Stream\">";
	}
	return output;
}*/
