
function removeDecimalPart (price) {

price = Math.round(price*100);
price /= 100;

price = new String(price); // make it a string, not number

// remove everyting after the decimal point
re = /\..+$/;
price = new String(price); // make it a string, not number
price = price.replace(re, '');

iLen=price.length;

temp=price.substring(iLen,price.length);

	for (var i=iLen-1;i>=0;i--){

		if ((iLen-i-1)%3==0&&i!=iLen-1){
        		temp=price.charAt(i)+","+temp;
		}else{
			temp=price.charAt(i)+temp;
		}
	}

return (""+temp);

}


function galleryOver(id_num) {
  var doc_id =  "photo" + id_num;
  document.getElementById(doc_id).className  = 'link_thumb_over';
}

function galleryOut(id_num) {
  var doc_id =  "photo" + id_num;
  document.getElementById(doc_id).className = 'link_thumb';
}

function setGalleryPhoto(id_num, newSource, newTitle){
  galleryOver(id_num);
  // set photo
	
  newImage = "url("+newSource+")";
  document.getElementById('table_row').style.backgroundImage = newImage;

  // set title
  var title_span = document.getElementById("gallery_photo_title");
  var oldText = title_span.childNodes.item(0);
  var newText = document.createTextNode(newTitle);
  var replaced = title_span.replaceChild(newText,oldText);
}

function _writeCitiesTowns_ (propRegion) {

propCityTown = "";
country = "USA"; // hard code country hame

options = "";

for (i = 0; i < towns.length; i++){ // how many countries?


	if (country == towns[i][0]){ // UK


		for (j = 0; j < towns[i][1].length; j++){ // how many states?


			if (towns[i][1][j][0] == propRegion){ // state name




				for (k = 0; k < towns[i][1][j][1].length; k++){

					townName = towns[i][1][j][1][k];

					if (townName == 'Other'){
						continue;
					}
					if (townName == propCityTown){
						options += ("<option value=\""+(townName)+"\" selected>"+(townName)+"</option>\n"); // elements of the options array
					}else{
						options += ("<option value=\""+(townName)+"\">"+(townName)+"</option>\n"); // elements of the options array
					}
				}
			}else{
			}
		}
	}
}

dd = 'propcitiestowns';
var divName = new getObj (dd);

if (options != ""){
	divName.obj.innerHTML = '<SELECT name=\"town\">'+options+'</SELECT>';
}else{
	divName.obj.innerHTML = '';
}

}

