function img_next() {
	PicCurrentNum++;
	if (PicCurrentNum >= (howMany - 1)) {
		PicCurrentNum = howMany - 1;
	}
	PicCurrent.src = Pix[PicCurrentNum];
	mainCurrent.src = mainPix[PicCurrentNum];
	CurrentCap=cap[PicCurrentNum];
	document.all["TheCap"].innerText=CurrentCap;
	document["ThePic"].src = PicCurrent.src;
}
												
function changepic(PicCurrentNum) {
	
	if (PicCurrentNum <= 0) {
		PicCurrentNum = 0;
	}
	PicCurrent.src = Pix[PicCurrentNum];
mainCurrent.src = mainPix[PicCurrentNum];
	CurrentCap=cap[PicCurrentNum];
	if (document.all) {
		document.all["TheCap"].innerHTML='<b>' + CurrentCap + '</b>';
		document["ThePic"].src = mainCurrent.src;
		document.all.TheURL.href = 'boatpic.cfm?pic=' + PicCurrent.src;
	}
	if (document.getElementById) {
		document.getElementById("TheCap").innerHTML='<b>' + CurrentCap + '</b>';
		document.getElementById("ThePic").src = mainCurrent.src;
		document.getElementById("TheURL").href = 'boatpic.cfm?pic=' + PicCurrent.src;
	}
}

function PopUp(width,height,theurl) { 
	OpenWindow=window.open(theurl, "newwin", "height="+height+", width="+width+",toolbar=no,scrollbars="+1+",menubar=no,resizable=yes");
self.name="main";
}
function PopUpNoScroll(width,height,theurl) { 
	OpenWindow=window.open(theurl, "newwin", "height="+height+", width="+width+",toolbar=no,scrollbars="+0+",menubar=no,resizable=yes");
self.name="main";
}

function contactUs(contact) {
	window.open("http://www.boatsvillenetwork.com/contact/index.cfm?who=" + contact, "pop", "height=460, width=550,toolbar=no,scrollbars="+1+",menubar=no,resizable=yes");
}

function checkout() 
	{window.open("https://www.boatsville.com/checkout/index.cfm", "pop", "height=460, width=550,toolbar=no,scrollbars="+1+",menubar=no,resizable=yes");
}

function imgswap(imgName, imgSrc) {
	if (document.images) {
		if (imgSrc != "none") {document.images[imgName].src = imgSrc;}
	}
}

function commaFormat(nStr) {
	nStr += '';var x = nStr.split('.');var x1 = x[0];var x2 = x.length > 1 ? '.' + x[1] : '';var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {x1 = x1.replace(rgx, '$1' + ',' + '$2');}
	return x1 + x2;
}

function payment(pv) {
var ir = 0;var fv = 0;var np = 0;var tir = 0;var tfv = 0;var tpv = 0;var scale = 0;var pmt=0;var q = 0;pv=pv*0.85;

if (pv < 8000) {return ("");}
else if (pv < 15000) {ir=0.0999;np=72;}
else if (pv < 25000) {ir=0.0899;np=120;}
else if (pv < 50000) {ir=0.0725;np=180;}
else if (pv < 100000) {ir=0.0699;np=180;}
else {ir=0.0675;np=240;}

tir = Math.abs(ir) / 12;
tfv = Math.abs(fv);
tpv = Math.abs(pv);
q = (1 + tir)^ Math.abs(np);
pmt = (tir * (tfv + q * tpv)) / (-1 + q);
if (scale != 0) {pmt = int(pmt * scale + 0.5) / scale;}
ir=ir*100;
document.write('<img src="http://www.boatsville.com/img/inv.gif" width=20 height=5><br><b>Est. Monthly Payment<sup>*</sup>:</b> ' + commaFormat(pmt.toFixed(2)) + '<div class="footer">(15% down, ' + np + ' pmts at ' + ir.toFixed(2) + '% APR)</div>');
//  return("#pmt#,#ir#,#np#");
}
function advertserveRightTextAds() {
	document.write('<'+'scr' + 'ipt src="http://boatsvillenetwork.advertserve.com/advertpro/servlet/view/text/unique/javascript/strip?zid=4&amp;pid=0&amp;total=2&amp;layout=vertical&amp;margin=0&amp;padding=6&amp;random=' + Math.floor(89999999 * Math.random() + 10000000) + '&amp;millis=' + new Date().getTime() + '" language="JavaScript" type="text/javascript"></scr' + 'ipt>');
}

function doPassVar(){
	document.getElementById("swfmyFlash").SetVariable("maintitle", sendText1);
	document.getElementById("swfmyFlash").SetVariable("topblurb", sendText2);
	document.getElementById("swfmyFlash").SetVariable("headertext", sendText3);
	document.getElementById("swfmyFlash").SetVariable("infotext", sendText4);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(doPassVar);

