/* Window onload ................................................................................................ */
window.onload = function()
	{
		oLoad._run();
	}



function doHeader(){}
doHeader._init = function()
	{

		var fo = new SWFObject('/img/header/header.swf', 'mymovie', '735', '170', '6');
	  fo.addParam('scale', 'noscale');
	  //fo.addParam('wmode', 'transparent');
	  //fo.write('flashheader');
	  fo.write('imgheader');
	  
	  //$hide('imgheader');

	}
oLoad.aFunc.push(doHeader);



function getMap(){}
getMap._init = function()
	{

		if($("counties"))
			{

				var fo = new SWFObject('/img/content/what_is_bikeability/nearyou_new.swf', 'mymovie', '405', '500', '6');
			  fo.write('counties');

			}

	}



/* Search ................................................................................................ */
function doSearch()
	{

		f = document.searchform.search.value;

		if(f.length<3 || f=="Search...")
			{
				alert("Please enter more than 2	 characters.");
				return false;
			}

	}



/* CTSB Registration ................................................................................................ */
function copyToList(from, to)
	{

		fExists = false;

		for(i=0;i<to.options.length;i++)
			{

				if(to.options[i].value == from.value)
					{
						fExists = true;
					}

			}

		if(fExists == false)
			{

				to.options[to.options.length] = new Option(from.options[from.selectedIndex].text, from.options[from.selectedIndex].value);

			}

	}


function removeFromList(list)
	{

		if(list.selectedIndex > -1)
			{

				list.remove(list.selectedIndex);

			}

	}


function selectAllOptions(sel)
	{

		for(i=0;i<sel.options.length;i++)
			{

				sel.options[i].selected = "selected";

			}

	}
	
	
	
/* Schemes */
function updatetotal(input, id, price)
{
	var v = input.value * price;
	var tempTotal = ($('total').innerHTML*1) - ($(id).innerHTML*1);
	
	$(id).innerHTML = v.toFixed(2);
	$('total').innerHTML = ((tempTotal*1) + (v.toFixed(2)*1)).toFixed(2);
}