var Timeout = 2000;var refresh = 2000;var imgURL = parent.url;var eURL = "testpattern.gif";var pURL = "testpattern2.gif";var nTime = 0;var gTime = 0;var cur_img = 0;var vid_playing = true;var tot_live = 0;function global_timer() {	get_time();	if (vid_playing) {		for (i=0;i<tot_live;i++) {			if (eval("live"+i)) {				if(eval("time"+i+"<gTime")) {					if (eval("loaded"+i)) {						eval("count"+i+"=0")						eval("my_refresh=refresh"+i);						eval("time"+i+"=gTime+my_refresh")						eval("loaded"+i+"=false");						this_url = eval("imgURL"+i);						eval("document.images.imagerefresh_"+i+".src='"+this_url+"&"+gTime+"'");					} else {						if (eval("count"+i+">5")) {							eval("count"+i+"=0")							eval("loaded"+i+"=true")						} else {							eval("count"+i+"++")						}					}				}			}		}	}	window.setTimeout("global_timer()", Timeout);}function get_time() {	nTime = new Date();	gTime = nTime.getTime();}function imgError(who) {	if (eval("ecount"+who+">5")) {		eval("ecount"+who+"=0")		eval("live"+who+"=false");		eval("document.images.imagerefresh_"+who+".src='"+eURL+"'");	} else {		eval("ecount"+who+"++")		eval("loaded"+who+"=true")	}	}function switchVid_feed(who) {	if (eval("live"+who)) {		eval("live"+who+"=false");		eval("document.images.imagerefresh_"+who+".src='"+pURL+"'");	}	else { 		eval("live"+who+"=true");	}}function switchVid() {	if (vid_playing) {		//vid_playing = false;		//eval("document.images.imagerefresh_"+cur_img+".src='"+pURL+"'");	}	else { 		//vid_playing = true;	}}function imgLoaded(who) {	eval("loaded"+who+"=true");}function change_feed(who) {	tmp_selected=eval("document.switch_video.cameras.selectedIndex");	eval("imgURL"+who+"=document.switch_video.cameras["+tmp_selected+"].value");	return false;}function createImage(imageURL,rfrsh,who,width,height) {	get_time();	//tmp_imageURL = "loading.jpg";	tmp_imageURL = imageURL;	eval("loaded"+i+"=false");	eval("imgURL"+who+"=imageURL");	eval("live"+who+"=true");	eval("time"+who+"=gTime+rfrsh");	eval("count"+who+"=0");	eval("ecount"+who+"=0")	eval("refresh"+who+"="+rfrsh);	document.write("<a href=\"javascript: switchVid_feed("+who+");\"><img src=\""+tmp_imageURL+"\" name=\"imagerefresh_"+who+"\" width=\""+width+"\" height=\""+height+"\" border=\"0\" onload=\"imgLoaded("+who+");\" onerror=\"imgError("+who+")\"></a>");	tot_live = tot_live+1;}global_timer();