function adLink(that){
	ad = new Image();
	ad.src= '/ad_track.php?ad_id='+that.id;
	return true;
}

function badLink(that){
	bad = new Image();
	bad.src= '/bad_track.php?c_id='+that.id;
	return true;
}

iplus = new Image();
iminus = new Image();
iplus.src = 'images/icon_plus.gif';
iminus.src = 'images/icon_minus.gif';

function shProfile(p_id) {
	pObj = document.getElementById('p_'+p_id);
	iObj = document.getElementById('pm_'+p_id);
	profileObj = document.getElementById('profile_'+p_id);
	if (profileObj.style.display == 'none') {
		profileObj.style.display = 'block';
		pObj.className = 'providerContainerSelected';
		iObj.src = iminus.src;
	} else {
		profileObj.style.display = 'none';
		pObj.className = 'providerContainer';
		iObj.src = iplus.src;
	}
}


var y=1;
function startClock() {
	x=x-y;
	document.form1.clock.value=x;
	timerID=setTimeout("startClock()", 1000);
}

function updateBeachCam() {
	var theCam = 'http://livecams.hamptons.com/getBeachCam.php';
	if (tObj = document.getElementById('beachCam')) {
		tObj.src = theCam + '?' + Math.random();
		x=11;
		xdisp='10';
		document.form1.clock.value=xdisp;
		setTimeout('updateBeachCam()',10000); // refresh every 10 secs
	}
}

function updateTrafficCam() {
	var theCam = 'http://livecams.hamptons.com/getMergeCam.php';
	if (tObj = document.getElementById('trafficCam')) {
		tObj.src = theCam + '?' + Math.random();
		x=11;
		xdisp='10';
		document.form1.clock.value=xdisp;
		setTimeout('updateTrafficCam()',10000); // refresh every 10 secs
	}
}

function updateBayCam() {
	var theCam = 'http://livecams.hamptons.com/camera2/camera2.jpg';
	if (tObj = document.getElementById('bayCam')) {
		tObj.src = theCam + '?' + Math.random();
		x=21;
		xdisp='21';
		document.form1.clock.value=xdisp;
		setTimeout('updateBayCam()',20000); // refresh every 10 secs
	}
}

function updateStreetCam() {
	var theCam = 'http://livecams.hamptons.com/camera3/camera3.jpg';
	if (tObj = document.getElementById('streetCam')) {
		tObj.src = theCam + '?' + Math.random();
		x=21;
		xdisp='21';
		document.form1.clock.value=xdisp;
		setTimeout('updateStreetCam()',20000); // refresh every 10 secs
	}
}
