	function populateAll(){//this function fills the all cottages box
		var html = new String();
		html = "<table width=\"230\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		for(var i=0;i<properties.length;i++){
			html += "<tr><td width=\"25\"><input type=\"checkbox\" name=\""+properties[i].id+"\" id=\""+properties[i].id+"\" /></td><td>"+properties[i].name+"</td><td width=\"30\"><a href=\""+properties[i].loc+"\" class=\"list\" target=\"_blank\">view</td></tr>";
			if(i == properties.length-1){
				break;
			}
			html += "<tr><td colspan=\"3\"><hr size=\"1\" width=\"95%\" color=\"#000000\" /></td></tr>";
		}
		html += "</table>";
		document.getElementById('allProperties').innerHTML = html;
	}
	
	function populateMy(){//this array fills the cottages I'm interested in box
		var html = new String();
		html = "<table width=\"230\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		for(var i=0;i<myProperties.length;i++){
			html += "<tr><td width=\"25\"><input type=\"checkbox\" name=\""+myProperties[i].id+"\" id=\""+myProperties[i].id+"\" /></td><td>"+myProperties[i].name+"</td><td width=\"30\"><a href=\""+myProperties[i].loc+"\" class=\"list\" target=\"_blank\">view</td></tr>";
			if(i == myProperties.length-1){
				break;
			}
			html += "<tr><td colspan=\"3\"><hr size=\"1\" width=\"95%\" color=\"#000000\" /></td></tr>";
		}
		html += "</table>";
		document.getElementById('myProperties').innerHTML = html;
	}
	
	function add(){
		for(var i=0;i<properties.length;i++){
			if(document.getElementById(properties[i].id).checked){
				myProperties[myProperties.length] = properties[i];
				properties.splice(i,1);
				i--;
			}
		}
		populateAll();
		populateMy();
	}
	
	function remove(){
		for(var i=0;i<myProperties.length;i++){
			if(document.getElementById(myProperties[i].id).checked){
				properties[properties.length] = myProperties[i];
				myProperties.splice(i,1);
				i--;
			}
		}
		populateAll();
		populateMy();
	}
	
	function FillValues(){
		var str = "0";
		
		for(var i=0;i<myProperties.length;i++){
			str = str + "," + myProperties[i].id;
		}

		document.getElementById('IdProperties').value = str
	}

