
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);
}
