function createMapMenu(nform) {
var txt;

	nform = 5;
	txt = "";

	txt += "<div id='menu1title'></div>";

	txt += "<div class='menuItem' id=mnu1Attraction>";
	txt += strings[nform][6];  //"Place Point of Attraction"; 
	txt += "</div>";
	txt += "<div class='menuItem' id=mnu1Close>";
	txt += strings[nform][0];   //"Close";
	txt += "</div>";
	
	document.all.item("menu1").innerHTML = txt;
}


function createObjMenu(nform) {
var txt;

	nform = 5;
	txt ="";
	
	txt += "<div id='menu2title'></div>";
	txt += "<div class='menuItem' id=mnu2Assign>";
	txt += strings[nform][1];   //"Start following";   
	txt += "</div>";
	txt += "<div class='menuItem' id=mnu2Reset>";
	txt += strings[nform][2];   //"Stop following"; 
	txt += "</div>";
	txt += "<div class='menuItem' id=mnu2Delete>";
	txt += strings[nform][5];   //"Remove Floy"  
	txt += "</div>";	
	txt += "<div class='menuItem' id=mnu2Data>";
	txt += strings[nform][3];   //"Show Floy data";  
	txt += "</div>";
	if (v_admin == "true") {
		txt += "<div class='menuItem' id=mnu2Remote>";
		txt += strings[nform][4];   //"Test"; 
		txt += "</div>";	
	}	
	txt += "<div class='menuItem' id=mnu2Close>";
	txt += strings[nform][0];   //"Close";
	txt += "</div>";
	
	document.all.item("menu2").innerHTML = txt;

}

function putSmallMap() {
var txt;


	currentForm = "";
	txt = "<vml:group id='sidegroup' style='width: 153; height: 46' coordorigin='0 0' coordsize='153 46'>";
	txt += "<vml:image id='sidemap' style='position:absolute; top: 5; left: 5; width: 153; height: 46;z-index: 3' src='' o:doubleclicknotify='True'>";
	txt += "</vml:image>";
	txt += "</vml:group>";
	txt += "<div class='header' align='center'>by <a href='mailto:aridolan@netvision.net.il'>Ariel Dolan</a></div>"
	document.all.item("smallmap").innerHTML = txt;
	
	//document.all.sidemap.src = logoIcon;
	document.all.sidemap.src = "images/Game_of_Floys2.gif";
	
}

function createLegend() {
var txt;

	nform = 2;
	txt = "";
	txt += "<div id='msgicon'></div>";
	txt += "<hr>";
	
	txt += "<div id='firstmsg' class='header' align='center'></div>";
	
	txt += createLightButtons();
		
	txt += "<div id='smallmsg' class='header' align='left'></div>";
	txt += "<div id='secondmsg' class='header' align='left'></div>";
	txt += "<hr>";

	txt += "<img src='images/dot.jpg' width='1' height='15' border='0' alt=''>";
	txt += "<div align='center' class='header3'>";
	txt += strings[nform][0];   //"Legend";
	txt += "</div>";
	txt += "<img src='images/dot.jpg' width='1' height='3' border='0' alt=''>";
	txt += "<table cellspacing='2' cellpadding='2' border='0'>";
	txt += "<tr>";
	txt += "<td width='20%'><img src='";
	txt += "images/circle_" + params.color[0] + "_15.jpg";
	txt += "' width='15' height='15' border='0' alt='Local Floy'></td>";
	txt += "<td width='80%' class='header'>";
	txt += strings[nform][1];   //"Local Floy";  //
	txt += "</td>";
	txt += "</tr>";

	txt += "<tr>";
	txt += "<td><img src='images/circle_";
	txt += params.color[1];
	txt += "_15.jpg' width='15' height='15' border='0' alt='Stranger'></td>";
	txt += " <td class='header'>";
	txt += strings[nform][2];   //"Stranger Floy";    
	txt += "</td>";
	txt += "</tr>";

	txt += "<tr>";
	txt += "<td><img src='images/";
	txt += "target2.gif";
	txt += "' width='15' height='15' border='0' alt='Attraction Point'></td>";
	txt += " <td class='header'>";
	txt += strings[nform][3];   //"Attraction point"; 
	txt += "</td>";
	txt += "</tr>";	

	txt += "</table>";
	
	txt += "<hr>";

	return txt;

}




function createLightButtons() {
var txt,nform;

	txt = "";
	nform = 1;
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][7];   //Buttons
	txt += "</div>";
	txt += "<img src='images/dot.jpg' width='1' height='3' border='0' alt=''>";
	
	txt += "<div class='header' align='left' id='iflight'>"
	txt += "<a href='javascript:resetFloys()'>";
	txt += strings[nform][0];   //"Initialize (Reset)"; 
	txt += "</a></div>";
	txt += "<div class='header' align='left' id='stlight'>"
	txt += "<a href='javascript:startFloys(1)'>";
	txt += strings[nform][1];   //"Start (Resume)";  
	txt += "</a></div>";	
	txt += "<div class='header' align='left' id='pulight'>"	
	txt += "<a href='javascript:stopFloys()'>";
	txt += strings[nform][2];   //"Stop (Pause)"; 
	txt += "</a></div>";	
	txt += "<div class='header' align='left' id='steplight'>"
	txt += "<a href='javascript:startFloys(0)'>";
	txt += strings[nform][3];   //Step
	txt += "</a></div>";	
	/*
	txt += "<hr>";	
	
	txt += "<div class='header' align='left' id='pulight'>"	
	txt += "<a href='javascript:insertFloy(0)'>";
	txt += "Insert Local Floy";  //strings[nform][2];   //"Stop (Pause)"; 
	txt += "</a></div>";	
	txt += "<div class='header' align='left' id='steplight'>"
	txt += "<a href='javascript:insertFloy(1)'>";
	txt += "Insert Stranger Floy"; //strings[nform][3];   //Step
	txt += "</a></div>";	
	*/
	
	txt += "<hr>";	
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][8];   //Toggles
	txt += "</div>";
	
	txt += "<img src='images/dot.jpg' width='1' height='3' border='0' alt=''>";
	txt += "<div class='header' align='left' id='loglight'>"
	txt += "<a href='javascript:toggleLog()'>";
	txt += strings[nform][4];   //"Toggle logging"; 
	txt += "</a></div>";
	txt += "<div class='header' align='left' id='nalight'>"
	txt += "<a href='javascript:toggleTooltips()'>";
	txt += strings[nform][5];   //"Toggle tooltips"; 
	txt += "</a></div>";
	txt += "<div class='header' align='left' id='cilight'>"
	txt += "<a href='javascript:toggleCenterIcon()'>";
	txt += strings[nform][6];   //"Toggle Attraction"; 
	txt += "</a></div>";	
	
	return txt;
	
}



function createLightButtons_old() {
var txt,nform;

	txt = "";
	nform = 1;
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][0];   //Buttons
	txt += "</div>";
	txt += "<img src='images/dot.jpg' width='1' height='3' border='0' alt=''>";
	
	txt += "<div class='header' align='left' id='iflightid'><a href='javascript:resetFloys()' onmouseover=\"hoverinx2('iflight',0)\"  onmouseout=\"hoveroutx2('iflight',0)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='iflight'></a>";
	txt += " " + strings[nform][1];   //"Initialize (Reset)"; 
	txt += "</div>";
	txt += "<div class='header' align='left' id='stlightid'><a href='javascript:playFloys(1)' onmouseover=\"hoverinx2('stlight',1)\"  onmouseout=\"hoveroutx2('stlight',1)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='stlight'></a>";
	txt += " " + strings[nform][2];   //"Start (Resume)";  
	txt += "</div>";		
	txt += "<div class='header' align='left' id='pulightid'><a href='javascript:stopFloys()' onmouseover=\"hoverinx2('pulight',2)\"  onmouseout=\"hoveroutx2('pulight',2)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='pulight'></a>";
	txt += " " + strings[nform][3];   //"Stop (Pause)"; 
	txt += "</div>";	
	txt += "<div class='header' align='left' id='steplightid'><a href='javascript:playFloys(0)' onmouseover=\"hoverinx2('steplight',3)\"  onmouseout=\"hoveroutx2('steplight',3)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='steplight'></a>";
	txt += " " + strings[nform][4];   //Step
	txt += "</div>";		
	
	txt += "<hr>";	
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][5];   //Toggles
	txt += "</div>";
	txt += "<img src='images/dot.jpg' width='1' height='3' border='0' alt=''>";
	
	txt += "<div class='header' align='left' id='loglightid'><a href='javascript:toggleLog()' onmouseover=\"hoverinx2('loglight',4)\"  onmouseout=\"hoveroutx2('loglight',4)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='loglight'></a>";
	txt += " " + strings[nform][6];   //"Toggle logging"; 
	txt += "</div>";	
	txt += "</div>";	
	txt += "<div class='header' align='left' id='nalightid'><a href='javascript:toggleTooltips()' onmouseover=\"hoverinx2('nalight',5)\"  onmouseout=\"hoveroutx2('nalight',5)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='nalight'></a>";
	txt += " " + strings[nform][7];   //"Toggle tooltips"; 
	txt += "</div>";	
	txt += "<div class='header' align='left' id='cilightid'><a href='javascript:toggleCenterIcon()' onmouseover=\"hoverinx2('cilight',6)\"  onmouseout=\"hoveroutx2('cilight',6)\"><img src='images/ballgray1.gif' width='16' height='15' border='0' alt='' name='cilight'></a>";
	txt += " " + strings[nform][8];   //"Toggle Attraction"; 
	txt += "</div>";		
	
	return txt;
	
}


function createEmptyPanel() {
var txt;

	txt = "<br><hr>";
	txt += createLightButtons();
	txt += "<div id='smallmsg' class='header' align='left'></div>";
	txt += "<div id='secondmsg' class='header' align='left'></div>";
	txt += "<hr>";
	
	return txt;

}



function createFastButtons() {

	nform = 3;
	txt = "<br><hr>";

	txt += createLightButtons();
		
	txt += "<div id='smallmsg' class='header' align='left'></div>";
	txt += "<div id='secondmsg' class='header' align='left'></div>";
	txt += "<hr>";
	
	
	txt += "<div class='smalltext'>";
	txt += "<form action='' id='fastbuttons'>";
	txt += "<table width='150'>";
	
	txt += "<tr><td align='center'>";
	txt += "<input type='button' name='but1' value='";
	txt += strings[nform][0];   //"Restore defaults" 
	txt += "' onclick='javascript:restoreDefaultAttributess()' class='buttonCSS'  align='center'><br>";
	txt += "</td></tr>";	
	
	txt += "<tr><td align='center'>";
	txt += "<input type='button' name='but2' value='";
	txt += strings[nform][1];   //"Default Report";  
	txt += "' onclick='javascript:getDefaultReport()' class='buttonCSS'  align='center'><br>";

	txt += "<tr><td align='center'>";
	txt += "<input type='button' name='but4' value='";
	txt += strings[nform][2];   //"Log";  
	txt += "' onclick='javascript:showLog()' class='buttonCSS'  align='center'><br>";
	
	txt += "<tr><td align='center'>";
	txt += "<input type='button' name='but4' value='";
	txt += strings[nform][3];   //"Help";  
	txt += "' onclick='javascript:showHelp()' class='buttonCSS'  align='center'><br>";	
	txt += "</td></tr>";				
	
	txt += "</table>";
	txt += "</td></tr>";	

	txt += "</table></form></div>";

	return txt;
	
}


function createCustomGraphics() {

	nform = 15;
	txt = "<br><hr>";
	
	txt += createLightButtons();

	txt += "<div id='smallmsg' class='header' align='left'></div>";
	txt += "<div id='secondmsg' class='header' align='left'></div>";
	txt += "<br><hr>";
	
	txt += "<div id='smallmsg' class='header' align='center'>";
	txt += "<form name='picform'>";

	txt += "<input type='button' name='picbutton' id='picbutton' value='";
	txt += strings[nform][0];   //"Start";  
	txt += "' onclick='javascript:startPictures()' class='button0'  align='center'>";	
	txt += "<p>";

	/*
	txt += "<input type='button' name='butback' value='";
	txt += "<<<";
	txt += "' onclick='javascript:runPictures(2)' class='minibutton'  align='center'>";	

	
	txt += gapHorz(3);
	txt += "<input type='button' name='butstop' value='";
	txt += "stop";
	txt += "' onclick='javascript:stopPictures()' class='minibutton'  align='center'>";	
	
	txt += gapHorz(3);
	txt += "<input type='button' name='butfor' value='";
	txt += ">>>";
	txt += "' onclick='javascript:runPictures(1)' class='minibutton'  align='center'>";			
	
	txt += "<p>";
	*/
	
	imgfile = "images/dh01.jpg";
	txt += "<img id='picimage' src='";
	txt += imgfile;
	txt += "' width='150' height='100' border='0' alt=''>";
	txt += "</form>";
	txt += "</div>";

	return txt;
	
}


function startPictures() {

	nform = 15;
	
	if (document.all.picform.picbutton.value == strings[nform][0]) {
		document.all.picform.picbutton.value = strings[nform][1];
		runPictures();
	}
	else
	if (document.all.picbutton.value == strings[nform][1]) {
		document.all.picbutton.value = strings[nform][0];
		stopPictures()
	}	
	
}

function runPictures() {

	picnum++;
		
	if (picnum > 20) picnum = 1;
	if (picnum < 10)
		filnam = "dh0" + picnum;
	else
		filnam = "dh"+picnum;
	filnam = "images/" + filnam + ".jpg";
	document.all.picform.picimage.src = filnam;
	
	picTimer = setTimeout("runPictures()",2000);
	
}

function stopPictures() {

	clearTimeout(picTimer);
}


function setPreferences(nform,dir) {
var txt;
	
	nform = 6;
	currentForm = "frmSetPreferences";
		
	if (dir == "auto")
		dir = langDir;
		
	txt = "";
	txt += "<div class='smalltext'>";
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][0];   //"Preferences"; 
	txt += "</div>";
	txt += "<form name='prefs'>";
	
	txt += "<b>";
	txt += strings[nform][1];   //"Language";
	txt += "</b><br>";
	txt += "<select name='lstMenuVersion' class='smalltextb'>";
	for (i=0;i<numVersions;i++) {
		if (menuVersion == menus[i]) {
			txt += "<option value='0' selected>";
			txt += strings[14][i];   //" English ";
			txt += "</option>";
		}
		else {
			txt += "<option value='0'>";
			txt += strings[14][i];   //" Hebrew ";
			txt += "</option>";			
		}
	}
	txt += "</select>";
	txt += "<p>";
	
	txt += "<b>";
	txt += strings[nform][7];   //"Cycle Delay [ms]";
	txt += "</b><br>";	
	txt += "<select name='lstDelay' class='smalltextb'>";
	for (i=10;i<110;i+=10) {
		if (cycleDelay == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=100;i<550;i+=50) {
		if (cycleDelay == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<p>";			
	
	txt += "<b>";
	txt += strings[nform][9];   //"Initial Energy";
	txt += "</b><br>";	
	txt += "<select name='lstInitialEnergy' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (initialEnergy == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<55;i+=5) {
		if (initialEnergy == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<p>";			
		
	txt += "<b>";
	txt += strings[nform][10];   //"Bonus Energy";
	txt += "</b><br>";	
	txt += "<select name='lstBonusEnergy' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (bonusEnergy == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<55;i+=5) {
		if (bonusEnergy == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";			
			
	txt += "<p>";
	if (withText == true) {
		txt += "<input type='checkbox' name='chkWithText' value='' class='smalltext' checked>";
		txt += strings[nform][4];   //"Permanent Tooltips"; 
		txt += "<br>";	
	}
	else {
		txt += "<input type='checkbox' name='chkWithText' value='' class='smalltext'>";
		txt += strings[nform][4];   //"Permanent Tooltips"; 
		txt += "<br>";	
	}	

	txt += "<p>";
	if (withSound == true) {
		txt += "<input type='checkbox' name='chkWithSound' value='' class='smalltext' checked>";
		txt += strings[nform][8];   //"With Sounds"; 
		txt += "<br>";	
	}
	else {
		txt += "<input type='checkbox' name='chkWithSound' value='' class='smalltext'>";
		txt += strings[nform][8];   //"with Sounds"; 
		txt += "<br>";	
	}	
	
	txt += "<p><hr>";
				
	txt += "<input type='button' name='close' value='";
	txt += strings[nform][5];   //"Update";
	txt += "' onclick='javascript:updatePreferences();putSmallMap()' class='button0'  align='left'>";

	txt += "<input type='button' name='close' value='";
	txt += strings[nform][6];   //"Cancel";
	txt += "' onclick='javascript:putSmallMap()' class='button0'  align='right'><br>";

	txt += "</form>";
	txt += "<p><hr><p><div id='log'></div>";

	document.all.item("smallmap").innerHTML = txt;


}

	

	
function updatePreferences() {

	oldWithText = withText;

	mv = document.forms["prefs"].lstMenuVersion.selectedIndex;
	version = document.forms["prefs"].lstMenuVersion.options[mv].text;
	languageCode = getLanguageCodeByName(version);
	
	cycleDelay = parseInt(document.forms["prefs"].lstDelay.value);
	initialEnergy = parseInt(document.forms["prefs"].lstInitialEnergy.value);
	bonusEnergy = parseInt(document.forms["prefs"].lstBonusEnergy.value);

	if (document.forms["prefs"].chkWithText.checked)
		withText = true;
	else
		withText = false;	
		
	if (document.forms["prefs"].chkWithSound.checked)
		withSound = true;
	else
		withSound = false;	
				
	//menuVersion = menus[languageCode];
	//saveCookie("menuVersion",menuVersion,365);	
	saveCookie("languageCode",languageCode,365);
	saveCookie("cycleDelay",cycleDelay,365);
	saveCookie("initialEnergy",initialEnergy,365);
	saveCookie("bonusEnergy",bonusEnergy,365);
	saveCookie("withText",withText,365);
	saveCookie("withSound",withSound,365);

	updateLanguageVersion();
	updateLightButtons();
	currentForm = "frmUpdatePreferences";

}


function setLayout(nform,dir) {
		
	nform = 4;		
	if (dir == "auto")
		dir = langDir;
		
	txt = "<div class='smalltext'>";
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][0];   //"Layout";
	txt += "</div>";
	txt += "<form name='layout'>";
	
	txt += "<b>";
	//txt += strings[nform][1];   //"Right Panel - Bottom Section";
	txt += "</b><br>";
	if (rgtbot == 1) 
		txt += "<input type='radio' name='RightBot' checked>";
	else
		txt += "<input type='radio' name='RightBot'>";
	txt += strings[nform][2];   //"Legend";
	txt += "<br>";
	
	if (rgtbot == 2)
		txt += "<input type='radio' name='RightBot' checked>";
	else
		txt += "<input type='radio' name='RightBot'>";
	txt += strings[nform][3];   //"Fast Buttons";
	txt += "<br>";
	
	if (rgtbot == 3)
		txt += "<input type='radio' name='RightBot' checked>";
	else
		txt += "<input type='radio' name='RightBot'>";
	txt += strings[nform][4];   //"Custom Graphics";
	txt += "<br>";	
	
	if (rgtbot == 4)
		txt += "<input type='radio' name='RightBot' checked>";
	else
		txt += "<input type='radio' name='RightBot'>";
	txt += strings[nform][5];   //"Empty";	
	txt += "<br><hr><br>";	
	txt += "<p>";
		
	txt += "<div align='center'><input type='button' name='close' value='";
	txt += strings[nform][6];   //"close";
	txt += "' onclick='javascript:updateLayout()' class='buttonCSS'  align='center'></div>";
	txt += "</form>";

	document.all.item("smallmap").innerHTML = txt;	
	
}
	

function updateLayout() {
var rt,rb;

	/*
	if (document.forms["layout"].RightTop[0].checked) {
		rt = 1;
	}
	else {
		rt = 2;
	}
	*/

	if (document.forms["layout"].RightBot[0].checked) {
		rb = 1;
	}
	else 
	if (document.forms["layout"].RightBot[1].checked){
		rb = 2;
	}
	else 
	if (document.forms["layout"].RightBot[2].checked){
		rb = 3;
	}	
	else 
	if (document.forms["layout"].RightBot[3].checked){
		rb = 4;
	}		

	//rgttop = rt;
	rgtbot = rb;
	//saveCookie("rgttop",rt,365);
	saveCookie("rgtbot",rb,365);

	putSmallMap();
	getRightPanel();
		
}


function showTest(nform,dir) {
		
	nform = 8;		
	if (dir == "auto")
		dir = langDir;
	
	txt = "<div class='smalltext' align='center'>";
	
	txt += "<input type='button' name='togtimer' value='";
	txt += strings[nform][0];   //"Toggle Timer";
	txt += "' onclick='javascript:toggleTimer()' class='buttonCSS'><br>";

	txt += "<input type='button' name='test2' value='";
	txt += strings[nform][1];   //"Test #1";
	txt += "' onclick='javascript:gotest(1)' class='buttonCSS'><br>";
	
	txt += "<input type='button' name='test2' value='";
	txt += strings[nform][2];   //"Test #2";
	txt += "' onclick='javascript:gotest(2)' class='buttonCSS'><br>";
	
	
	txt += "<input type='button' name='test3' value='";
	txt += strings[nform][3];   //"Test #3";
	txt += "' onclick='javascript:gotest(3)' class='buttonCSS'><br>";

	txt += "<input type='button' name='test4' value='";
	txt += strings[nform][4];   //"Test #3";
	txt += "' onclick='javascript:gotest(4)' class='buttonCSS'><p>";	

	txt += "<input type='button' name='testClose' value='";
	txt += strings[nform][5];   //"Close";
	txt += "' onclick='javascript:putSmallMap()' class='buttonCSS'><br>";
	txt += "<p><hr><p><div id='log'></div>";

	document.all.item("smallmap").innerHTML = txt;

}


function setParametersPersonal(n) {
var txt;

	nform = 7;
	currentForm = "frmSetParametersPrimary";
	if (n == 0)
		group = "Locals";
	else
	if (n == 1)
		group = "Strangers";
	else
		group = "";
		
	txt = "";
	txt += "<div class='smalltext'>";
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][0];   //"Personal Parameters";
	txt += "<br> (" + group + ")";   
	txt += "</div>";
	txt += "<form name='params_personal'>";
	
	txt += "<b>";
	txt += strings[nform][1];   //"Number of Floys";  
	txt += "</b><br>";

	txt += "<select name='lstNf' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.nf[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<55;i+=5) {
		if (params.nf[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
	
	txt += "<b>";
	txt += strings[nform][2];   //"Maximum Speed";  
	txt += "</b><br>";
		
	txt += "<select name='lstMaxSpeed' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.maxspeed[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<55;i+=5) {
		if (params.maxspeed[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
	
	txt += "<b>";
	txt += strings[nform][3];   //"Acceleration";  
	txt += "</b><br>";
		
	txt += "<select name='lstAcceleration' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.acc[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}		
	for (i=10;i<55;i+=5) {
		if (params.acc[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
			
	txt += "<b>";
	txt += strings[nform][4];   //"Attraction to Center"; 
	txt += "</b><br>";
		
	txt += "<select name='lstAccToMid' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.acctomid[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}		
	for (i=10;i<55;i+=5) {
		if (params.acctomid[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
			
	txt += "<br><hr><br>";
				
	txt += "<b>";
	txt += strings[nform][5];   //"Size";  
	txt += "</b><br>";
		
	txt += "<select name='lstSize' class='smalltextb'>";
	for (i=1;i<31;i++) {
		if (params.size[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
							
	txt += "<b>";
	txt += strings[nform][6];   //"Color";  
	txt += "</b><br>";
		
	txt += "<select name='lstColors' class='smalltextb'>";
	for (i=0;i<colors.length;i++) {
		if (params.color[n] == colors[i]) 
			txt += "<option  class='smalltextb' style='background-color: " + colors[i] + ";font-weight: bold;color: " + "black" + "' value='" + colors[i] +"' selected>" + colors[i] + "</option>";
		else 
			txt += "<option  class='smalltextb' style='background-color: " + colors[i] + ";font-weight: bold;color: " + "white" + "' value='" + colors[i] +"'>" + colors[i] + "</option>";
	}
	txt += "</select>";	
	//txt += "Acceleration";   //strings[nform][28]; 
	txt += "<br>";
						
	txt += "<b>";
	txt += strings[nform][7];   //"Shape"; 
	txt += "</b><br>";
		
	txt += "<select name='lstShape' class='smalltextb'>";
	if (params.shape[n] == "oval")
		txt += "<option value='" + "circle" + "' selected>" + "Circle" + "</option>";
	else
		txt += "<option value='" + "circle" + "'>" + "Circle" + "</option>";
	if (params.shape[n] == "rect")
		txt += "<option value='" + "rect" + "' selected>" + "Square" + "</option>";
	else
		txt += "<option value='" + "rect" + "'>" + "Square" + "</option>";
	if (params.shape[n] == "oval")
		txt += "<option value='" + "oval" + "' selected>" + "Oval" + "</option>";
	else
		txt += "<option value='" + "oval" + "'>" + "Oval" + "</option>";		

	txt += "</select>";
	//txt += "Acceleration";   //strings[nform][28]; 
	txt += "<br>";
								
	txt += "<p><hr>";
				
	txt += "<input type='button' name='close' value='";
	txt += strings[nform][8];   //"Update";   
	txt += "' onclick='javascript:updateParametersPersonal(" + n + ");putSmallMap()' class='button0'  align='left'>";

	txt += "<input type='button' name='close' value='";
	txt += strings[nform][9];   //"Cancel";   
	txt += "' onclick='javascript:putSmallMap()' class='button0'  align='right'><br>";

	txt += "</form>";
	txt += "<p><hr><p><div id='log'></div>";

	document.all.item("smallmap").innerHTML = txt;

}


function updateParametersPersonal(n) {

	nf = parseInt(document.forms["params_personal"].lstNf.value);
	maxspeed = parseInt(document.forms["params_personal"].lstMaxSpeed.value);
	acc = parseInt(document.forms["params_personal"].lstAcceleration.value);
	acctomid = parseInt(document.forms["params_personal"].lstAccToMid.value);
	size = parseInt(document.forms["params_personal"].lstSize.value);
	color = document.forms["params_personal"].lstColors.value;
	shape = document.forms["params_personal"].lstShape.value;
	
	params.nf[n] = nf;
	params.maxspeed[n] = maxspeed;
	params.acc[n] = acc;
	params.acctomid[n] = acctomid;
	params.size[n] = size;
	params.color[n] = color;
	params.shape[n] = shape;
	
	txt = "nf="+nf+"&maxspeed="+maxspeed+"&acc="+acc;
	txt += "&acctomid="+acctomid+"&size="+size+"&color="+color+"&shape="+shape;
	saveCookie("paramper_"+n,txt,365);	
	addToLog("updateParametersPersonal. n= "+n+" data: "+txt,5);
	
	document.all.legend.innerHTML = createLegend();
	resetFloys();

}


function setParametersRelational(n) {
var txt;
	
	currentForm = "frmsetParametersRelational";
	nform = 9;
	if (n == 0)
		group = "Locals";
	else
	if (n == 1)
		group = "Strangers";
	else
		group = "";
		
	txt = "";
	txt += "<div class='smalltext'>";
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][0];  //"Relational Parameters <br> (" + group + ")"; 
	txt += "</div>";
	txt += "<form name='params_relational'>";
	
	txt += "<b>";
	txt += strings[nform][1];  //"Personal Distance";  
	txt += "</b><br>";

	txt += "<select name='lstRevdist' class='smalltextb'>";
	for (i=0;i<210;i+=10) {
		if (params.revdist[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
	
						
	txt += "<b>";
	txt += strings[nform][2];  //"Approaching Speed";  
	txt += "</b><br>";

	txt += "<select name='lstRevapproach' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.revapproach[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<55;i+=5) {
		if (params.revapproach[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
						
	txt += "<b>";
	txt += strings[nform][3];  //"Backoff Speed";  
	txt += "</b><br>";

	txt += "<select name='lstRevbackoff' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.revbackoff[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<55;i+=5) {
		if (params.revbackoff[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
					
	txt += "<b>";
	txt += strings[nform][4];  //"Chasing Speed";  
	txt += "</b><br>";

	txt += "<select name='lstRevchase' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.revchase[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<105;i+=5) {
		if (params.revchase[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";					
					
	txt += "<b>";
	txt += strings[nform][5];  //"Avoiding Speed";  
	txt += "</b><br>";

	txt += "<select name='lstRevavoid' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.revavoid[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<105;i+=5) {
		if (params.revavoid[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";
					
		
	txt += "<b>";
	txt += strings[nform][6];  //"Attacking Speed"; 
	txt += "</b><br>";

	txt += "<select name='lstRevattack' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.revattack[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<105;i+=5) {
		if (params.revattack[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";		
	
	txt += "<b>";
	txt += strings[nform][7];  //"Fleeing Speed";  
	txt += "</b><br>";

	txt += "<select name='lstRevflee' class='smalltextb'>";
	for (i=0;i<10;i++) {
		if (params.revflee[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}	
	for (i=10;i<105;i+=5) {
		if (params.revflee[n] == i)
			txt += "<option value='" + i + "' selected>" + i + "</option>";
		else
			txt += "<option value='" + i + "'>" + i + "</option>";
	}
	txt += "</select>";
	txt += "<br>";	
									
	txt += "<p><hr>";
				
	txt += "<input type='button' name='close' value='";
	txt += strings[nform][8];  //"Update";    
	txt += "' onclick='javascript:updateParametersRelational(" + n + ");putSmallMap()' class='button0'  align='left'>";

	txt += "<input type='button' name='close' value='";
	txt += strings[nform][9];  //"Cancel";  
	txt += "' onclick='javascript:putSmallMap()' class='button0'  align='right'><br>";

	txt += "</form>";
	txt += "<p><hr><p><div id='log'></div>";

	document.all.item("smallmap").innerHTML = txt;


}


function updateParametersRelational(n) {

	revdist = parseInt(document.forms["params_relational"].lstRevdist.value);
	revapproach = parseInt(document.forms["params_relational"].lstRevapproach.value);
	revbackoff = parseInt(document.forms["params_relational"].lstRevbackoff.value);
	revchase = parseInt(document.forms["params_relational"].lstRevchase.value);
	revavoid = parseInt(document.forms["params_relational"].lstRevavoid.value);
	revattack = document.forms["params_relational"].lstRevattack.value;
	revflee = document.forms["params_relational"].lstRevflee.value;
	
	params.revdist[n] = revdist;
	params.revapproach[n] = revapproach;
	params.revbackoff[n] = revbackoff;
	params.revchase[n] = revchase;
	params.revavoid[n] = revavoid;
	params.revattack[n] = revattack;
	params.revflee[n] = revflee;
	

	txt = "revdist="+revdist+"&revapproach="+revapproach+"&revbackoff="+revbackoff;
	txt += "&revchase="+revchase+"&revavoid="+revavoid+"&revattack="+revattack+"&revflee="+revflee;
	saveCookie("paramrel_"+n,txt,365);
	addToLog("updateParametersRelational. n= "+n+" data: "+txt,5);

	resetFloys();

}



function setBackground() {
var txt;

	nform = 10;
	currentForm = "setbackground";
		
	txt = "";
	txt += "<div class='smalltext'>";
	txt += "<div class='header3' align='center'>";
	txt += strings[nform][0];  //"Set Background";  
	txt += "</div>";
	txt += "<form name='setbackground'>";

	
	txt += "<b>";
	txt += strings[nform][1];  //"Background Type";  
	txt += "</b><br>";
	
	txt += "<select size='5' id='btype' name='btype' class='combofix' onchange='updateBackgroundDetail(100)'>";
	txt += "<option value='color'>Solid Color</option>";
	txt += "<option value='color'>Picture</option>";
	txt += "</select>";
	txt += "<br>";

	txt += "<p>";
	//txt += gapVert(10);
	txt += "<div id='backgrounddetail' class='smallcontrols'>";
	txt += "</div>";

	txt += "<p><hr>";
				
	txt += "<input type='button' name='close' value='";
	txt += strings[nform][2];  //"Update";   
	txt += "' onclick='javascript:saveBackground();putSmallMap()' class='button0'  align='left'>";

	txt += "<input type='button' name='close' value='";
	txt += strings[nform][3];  //"Cancel";    
	txt += "' onclick='javascript:putSmallMap()' class='button0'  align='right'><br>";

	txt += "</form>";
	txt += "<p><hr><p><div id='log'></div>";

	document.all.item("smallmap").innerHTML = txt;

}	

function updateBackgroundDetail(period) {
var txt, t,zid;

	t = "";
	txt = "";
	nform = 10;

	if (period == 100) {
		t = document.forms[currentForm].btype.options(document.forms[currentForm].btype.selectedIndex).text;
		n = document.forms[currentForm].btype.selectedIndex;
	}
	else
		n = period;

	txt += "<div class='smalltextb'>";

	if (n == 0) {   //Colors
		txt += "<select size='5' id='bpic' name='lstBackgroundSelect' class='combofix' onchange='updateBackgroundSelect()'>";
		txt += "<option value='images/rect_beige.jpg'>";
		txt += strings[nform][4];  //"Default"
		txt += "</option>";
		txt += "<option value='images/rect_gray.jpg'>";
		txt += strings[nform][5];  //"Gray"
		txt += "</option>";
		txt += "<option value='images/rect_white.jpg'>";
		txt += strings[nform][6];  //"White"
		txt += "</option>";
		txt += "<option value='images/rect_black.jpg'>";
		txt += strings[nform][7];  //"Black";
		txt += "</option>";
		txt += "<option value='images/rect_red.jpg'>";
		txt += strings[nform][8];  //"Red"
		txt += "</option>";
		txt += "</select>";
		txt += "<br>";	
	}
	else
	if (n == 1) {   //Pictures
		txt += "<select size='5' id = 'bpictype' name='bpictype' class='combofix' onchange='updateBackgroundSubgroup(100)'>";
		txt += "<option value='aquarium'>";
		txt += strings[nform][9];  //"Aquarium"
		txt += "</option>";
		txt += "<option value='tree'>";
		txt += strings[nform][10];  //"Trees"
		txt += "</option>";
		txt += "<option value='bush'>";
		txt += strings[nform][11];  //"Bushes"
		txt += "</option>";
		txt += "</select>";
		txt += "<br>";
		txt += "<p>";
		txt += "<div id='backgroundsubgroup' class='smallcontrols'>";
		txt += "</div>";
	}	

	document.all.item("backgrounddetail").innerHTML = txt;

}	


function updateBackgroundSubgroup(period) {
var txt, t,zid;

	t = "";
	txt = "";
	nform = 26;

	if (period == 100) {
		t = document.forms[currentForm].bpictype.options(document.forms[currentForm].bpictype.selectedIndex).text;
		n = document.forms[currentForm].bpictype.selectedIndex;
	}
	else
		n = period;

	txt += "<div class='smalltextb'>";

	if (n == 0) {   //aquarium
		txt += "<select size='5' id='bpic' name='lstBackgroundSelect' class='combofix' onchange='updateBackgroundSelect()'>";
		txt += "<option value='images/aquarium/aquarium1.jpg'>Aquarium #1</option>";
		txt += "<option value='images/aquarium/aquarium2.jpg'>Aquarium #2</option>";
		txt += "<option value='images/aquarium/aquarium3.jpg'>Aquarium #3</option>";
		txt += "<option value='images/aquarium/aquarium5.jpg'>Aquarium #4</option>";
		txt += "<option value='images/aquarium/aquarium6.jpg'>Aquarium #5</option>";
		txt += "<option value='images/aquarium/aquarium8.jpg'>Aquarium #6</option>";
		txt += "<option value='images/aquarium/aquarium11.jpg'>Aquarium #7</option>";
		txt += "<option value='images/aquarium/aquarium12.jpg'>Aquarium #8</option>";
		txt += "</select>";
		txt += "<br>";	
	}
	else
	if (n == 1) {   //trees	
		txt += "<select size='5' id='bpic' name='lstBackgroundSelect' class='combofix' onchange='updateBackgroundSelect()'>";
		txt += "<option value='images/trees/trees1.jpg'>trees #1</option>";
		txt += "<option value='images/trees/trees2.jpg'>trees #2</option>";
		txt += "<option value='images/trees/trees3.jpg'>trees #3</option>";
		txt += "<option value='images/trees/trees4.jpg'>trees #4</option>";
		txt += "<option value='images/trees/trees5.jpg'>trees #5</option>";
		txt += "<option value='images/trees/trees7.jpg'>trees #6</option>";
		txt += "<option value='images/trees/trees8.jpg'>trees #7</option>";
		txt += "<option value='images/trees/trees10.jpg'>trees #8</option>";
		txt += "<option value='images/trees/trees11.jpg'>trees #9</option>";
		txt += "<option value='images/trees/trees13.jpg'>trees #10</option>";		
		txt += "</select>";
		txt += "<br>";	
	}	
	else
	if (n == 2) {   //bushes	
		txt += "<select size='5' id='bpic' name='lstBackgroundSelect' class='combofix' onchange='updateBackgroundSelect()'>";	
		txt += "<option value='images/bushes/bushes1.jpg'>bushes #1</option>";
		txt += "<option value='images/bushes/bushes2.jpg'>bushes #2</option>";
		txt += "<option value='images/bushes/bushes3.jpg'>bushes #3</option>";
		txt += "<option value='images/bushes/bushes5.jpg'>bushes #5</option>";
		txt += "</select>";
		txt += "<br>";	
	}		
	
	document.all.item("backgroundsubgroup").innerHTML = txt;
	
}


function updateBackgroundSelect() {
var t;

	t = "";
	t = document.forms[currentForm].bpic.value;
	document.all.map.src = t;

}

function saveBackground() {
var background;

	background = document.all.map.src;
	saveCookie("background",background,365);
	
}


function getMinifloys() {
var txt;

	txt = "";
	txt += "<div align='center'>";
	txt += "<applet code='miniFloys.class' width=300 height=40>";
	txt += "<PARAM NAME=NF VALUE='15'>";
	//txt += "<PARAM NAME=AppletBackground VALUE='My'>";
	txt += "<PARAM NAME=SLEEP VALUE='100'>";
	txt += "<PARAM NAME=SEED VALUE='1234567890'>";
	txt += "</applet>";
	txt += "</div>";
	
	return txt;
}

function getAbout() {
var txt;
	
	//txt = "<table bgcolor='#f7efde' width='100%'>";
	txt = "<table bgcolor='white' width='100%'>";
	txt += "<tr><td align='center'>";
	txt += "<div align='center'>";
	//txt += "<img src='images/gof1w.gif' width='181' height='41' border='0' alt=''><p>";
	txt += "<img src='images/Game_of_Floys3.gif' width='184' height='54' border='0' alt=''>";
	txt += "<h3>Dhtml/Vml Alife Playground</h3>";
	txt += "<b>by Ariel Dolan</b><p>";
	txt += "<table cellspacing='2' cellpadding='2' border='0' width='90%'>";
	txt += "<tr>";
    txt += "<td align='left'>";
	txt += "Email:"; 
	txt += "</td>";
    txt += "<td align='right'>";
	txt += "<a href='mailto:aridolan@netvision.net.il'>aridolan@netvision.net.il</a>";
	txt += "</td>";
	txt += "</tr>";
	txt += "<tr>";
    txt += "<td align='left'>";
	txt += "Web Site #1:";
	txt += "</td>";
    txt += "<td align='right'>";
	txt += "<a href='http://www.arieldolan.com'>http://www.arieldolan.com</a>";
	txt += "</td>";
	txt += "</tr>";
	txt += "<tr>";
    txt += "<td align='left'>";
	txt += "Web Site #2:";
	txt += "</td>";
    txt += "<td align='right'>";
	txt += "<a href='http://www.aridolan.com'>http://www.aridolan.com</a>";
	txt += "</td>";
	txt += "</tr>";
	txt += "</table>";

	txt += "</div></td></tr></table><p>";
	
	return txt;
	
}

function showAbout() {
var txttop,txtbot;
	
	txttop = "<img src='images/dot.jpg' width='1' height='5' border='0' alt=''>";
	txttop += getAbout();
	
	txttop += getMinifloys();
	
	txtbot = "<table bgcolor='white' width='100%'>";
	txtbot += "<tr><td align='center'>";	
	txtbot += "<img src='images/dot.jpg' width='1' height='35' border='0' alt=''>";
	txtbot += "<input type='button' name='close_showlocation' value='Close' onclick='javascript:closeMsg()' class='button0'><p>";
	txtbot += "</td></tr></table>";

	showMsgGen(txttop,txtbot,350,500);

}

function getGlobalParams(n) {
var i,txt;

	currentForm = "frmGetGlobalParams";
	if (n == 0)
		group = "Locals";
	else
	if (n == 1)
		group = "Strangers";
	else
		group = "";
		
	txt = "";
	//txt +=  "<img src='images/dot.jpg' width='1' height='15' border='0' alt=''>";
	txt +=  "<div align='center' class='header3'>";
	txt += "Global Parameters <br> (" + group + ")";   //Data for;
	txt += "</div>";
	txt += "<img src='images/dot.jpg' width='1' height='1' border='0' alt=''>";

	txt +=  "<form name='globalparams' class='smalltext'>";

	txt += "Number of Floys: " + params.nf[n] + "<br>";
	txt += "Max. Speed: " + params.maxspeed[n] + "<br>";
	txt += "Acceleration: " + params.acc[n] + "<br>";
	txt += "Attraction to center: " + params.acctomid[n] + "<br>";
	txt += "Personal distance: " + params.revdist[n] + "<br>";
	txt += "<p>";
	
	txt += "Color: " + params.color[n] + "<br>";
	txt += "Size: " + params.size[n] + "<br>";
	txt += "Shape: " + params.shape[n] + "<br>";
	txt += "<p>";
	txt += "Approach speed: " + params.revapproach[n] + "<br>";
	txt += "Backoff speed: " + params.revbackoff[n] + "<br>";
	txt += "Chasing speed: " + params.revchase[n] + "<br>";
	txt += "Avoiding speed: " + params.revavoid[n] + "<br>";
	txt += "Attack speed: " + params.revattack[n] + "<br>";
	txt += "Flee speed: " + params.revflee[n] + "<br>";		

	txt += "<p>";
	txt += "</form>";

	txt += "<center>";
	txt += "<input type='button' name='close' value='";
	txt += "Close"; //strings[7][1];  
	txt += "' onclick='putSmallMap()' class='buttonCSS'>";

	txt += "</center>";
	
	document.all.item("smallmap").innerHTML = txt;

}

function getDefaultReport() {
var txt, t;

	nform = 11;

	t = document.all.map.innerHTML;
	if (t.indexOf("<vml:image") > 0) {
		oldImage = document.all.map.innerHTML;
	}	
	
	if (floys[0] == null) {
		alert("No Floys exist\nPlease initialize Floys population");
		return;
	}

	txt = "";
	txt += "<img src='images/dot.jpg' width='1' height='1' border='0' alt=''>";
	txt +=  "<div align='center' class='black12'>";
	txt += strings[nform][0];   //"Floys Status Report"; 
	txt += "</div>";
	txt += gapVert(10);
	
	txt += "<div class='scroll'>";
	txt += "<table cellspacing='2' cellpadding='2' border='1' width='" + parseInt(v_mainwidth*0.90) + "'>";
	txt += "<thead>";
	txt += "<th class='text_9_bold'>" + "Num" + "</th>";
	txt += "<th class='text_9_bold'>" + "Group" + "</th>";
	txt += "<th class='text_9_bold'>" + "Name" + "</th>";
	txt += "<th class='text_9_bold'>" + "x" + "</th>";
	txt += "<th class='text_9_bold'>" + "y" + "</th>";
	txt += "<th class='text_9_bold'>" + "vx" + "</th>";
	txt += "<th class='text_9_bold'>" + "vy" + "</th>";
	txt += "<th class='text_9_bold'>" + "ref1" + "</th>";
	txt += "<th class='text_9_bold'>" + "ref2" + "</th>";	
	txt += "<th class='text_9_bold'>" + "Energy" + "</th>";
	txt += "</thead>";
	
	txt += "<tbody>";
	for (i=0;i<nf;i++) {
		txt += "<tr>"
		txt += "<td class='text_9_normal'>" + floys[i].num + "</td>";
		if (floys[i].type == 1)
			txt += "<td class='text_9_normal'>" + "Strangers" + "</td>";	
		else
			txt += "<td class='text_9_normal'>" + "Locals" + "</td>";
		txt += "<td class='text_9_normal'>" + floys[i].name + "</td>";
		txt += "<td class='text_9_normal'>" + floys[i].x + "</td>";
		txt += "<td class='text_9_normal'>" + floys[i].y + "</td>";
		txt += "<td class='text_9_normal'>" + Math.round(floys[i].vx) + "</td>";
		txt += "<td class='text_9_normal'>" + Math.round(floys[i].vy) + "</td>";
		txt += "<td class='text_9_normal'>" + floys[i].neighbors[0] + "</td>";
		txt += "<td class='text_9_normal'>" + floys[i].neighbors[1] + "</td>";
		txt += "<td class='text_9_normal'>" + floys[i].energy + "</td>";
		txt += "</tr>";
	}
	
	txt += "</tbody>";
	txt += "<tfoot>";
	txt += "</tfoot>";
	txt += "</table>";
	txt += "</div>";
	
	txt += gapVert(40);
	
	txt += "<input type='button' name='but1' value='";
	txt += strings[nform][2];   //"Close"  
	txt += "' onclick='javascript:restoreImage()' class='buttonCSS'  align='center'>";	

	toggleFloys("hidden");
	document.all.map.innerHTML = txt;
	
}


function restoreImage() {

	document.all.map.innerHTML = oldImage;
	toggleFloys("visible");

}


function scrollTest() {

	txt = "";
	

	txt += gapHorz(3);
	txt += "<input type='button' name='butback' value='";
	txt += "<<<";
	txt += "' onclick='' class='minibutton'  align='center'>";	

	
	txt += gapHorz(3);
	txt += "<input type='button' name='butstop' value='";
	txt += "stop";
	txt += "' onclick='' class='minibutton'  align='center'>";	
	
	txt += gapHorz(3);
	txt += "<input type='button' name='butfor' value='";
	txt += ">>>";
	txt += "' onclick='' class='minibutton'  align='center'>";			
	
	document.all.map.innerHTML = txt;	
}


function getFloysList() {
var txt,i;

	nform = 16;
	currentForm = "getFloyList";
	
	if (nf == 0) {
		alert(strings[13][1]);  //"There are no Floys here\nPlease initialize population"
		return "";
	}

	txt = "";
	
	txt +=  "<img src='../images/dot.jpg' width='1' height='15' border='0' alt=''>";
	txt +=  "<div align='center' class='header3'>";
	txt += strings[nform][0];   //"Objects List";
	txt += "</div>";
	txt += "<img src='../images/dot.jpg' width='1' height='1' border='0' alt=''>";
	
	txt += "<div align='center'>";
	txt +=  "<form name='scrollform'>";
	txt += "<select name='scroller' size='8'  onchange='javascript:findFloy(this.options(this.selectedIndex).text)'>";

	for (i=0;i<nf;i++) {
		txt += "<option>" + floys[i].name + "</option>";
	}
	txt +=  "</select></form>";
	
	txt += "<p><input type='button' name='close' value='";
	txt += strings[nform][1];   //"Close";
	txt += "' onclick='putSmallMap()' class='buttonCSS'>";
	txt += "</div>";

	currentString = txt;
	document.all.item("smallmap").innerHTML = txt;

}


function getFloyControl(name) {
var txt;

	nform = 16;
	txt = "";
	
	txt += "<div align='center'>";
	txt += "<span class='header3'>" + name + "</span>";
	txt += "<form action=''>";
	
	txt += "<input type='button' name='b1' value='";
	txt += strings[nform][2];   //"Object Data";
	txt += "' onclick='showProperties()' class='buttonCSS'><br>";	
	txt += "<input type='button' name='b3' value='";	
	txt += strings[nform][3];   //"Start following";
	txt += "' onclick='" + "startFollow()" + "' class='buttonCSS'><br>";	
	txt += "<input type='button' name='b4' value='";	
	txt += strings[nform][4];   //"Stop following";
	txt += "' onclick='" + "stopFollow()" + "' class='buttonCSS'><br>";	
	txt += "<input type='button' name='b5' value='";	
	txt += strings[nform][5];   //"Blink";
	txt += "' onclick='" + "blinkFloy()" + "' class='buttonCSS'><br>";	

	txt += "<input type='button' name='close' value='";
	txt += strings[nform][6];   //"Close";
	txt += "' onclick='putLastForm()' class='buttonCSS' align='center'><br>";		

	txt += "</from></div>";

	document.all.item("smallmap").innerHTML = txt;

}	


function putLastForm() {

	document.all.item("smallmap").innerHTML = currentString;
	
}





