
		
		
		function swapImage(newImg) 
		{	
			document.Image1.src = newImg;
			document.Image1.width = 500;
			document.Image1.height = 375;
		}

	//For diplaying images with aspect ratio
	function swapImage2(newImg) 
		{	
			imgThumb = new Image()
			imgThumb.src= newImg;
			
					
			document.Image1.src = newImg;
			document.Image1.width = imgThumb.width;
			document.Image1.height = imgThumb.height;
		
		}



		
		function openWindow(ad_id){
			var settings;
			settings='scrollbars=yes,width=750,height=320,left=50,top=50';
			window.open('email_to_friend.aspx?ad_id='+ad_id+'','',settings);
		}
		
		
		function addbookmark(){
			var bookmarkurl=document.location.href;
			var bookmarktitle=document.title;
			if (document.all)
			window.external.AddFavorite(bookmarkurl,bookmarktitle)
		}
		
		
	var refer=document.referrer;
	var url =document.URL;
	document.write("<script language=\"php\" src=\"stats/hit.php?url="+url+"&refer="+refer+"\" ></"+"script>");
	
	

function showpay() {
	flagIncomplete=false;
	if ((document.calc.loan.value == null || document.calc.loan.value.length == 0)) { 
		alert("Please enter loan amount!");
		flagIncomplete=true;
	} 
	
	if (document.calc.months.value == '') {
		alert('Please choose term!');
		flagIncomplete=true;		
	
	}
	if (document.calc.rate.value == '') {
		alert('Please choose rate!');
		flagIncomplete=true;	
	
	}
	
	
	if (flagIncomplete == false) {
		var princ = document.calc.loan.value;
		var term  = document.calc.months.value;
		var intr  = document.calc.rate.value / 1200;
		if (document.calc.down) {
			var down  = document.calc.down.value;
		} else {
			var down = 0;
		}		
		var total = (princ - down) * intr / (1 - (Math.pow(1/(1 + intr), term)));
		document.calc.pay.value = Math.round(total) + '.00';
	}
}

		