// JavaScript Document

function cleartext(thefield) {
	if (thefield.defaultValue == thefield.value) {
		thefield.value = "";
	}
}

function settext(thefield) {
	if (thefield.value == "") {
		thefield.value = thefield.defaultValue;
	}
}

// detail opens the detail contact window.  
function detail(url,width,height) {
			//url=escape(url);
			window.open(url,"detail","menubar=0,location=0,resizable=0,status=0,width=" + width + ",height=" + height);
			return false;
}

function numbersonly(myfield, e, dec) {
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

function bvnswap(image,capt) {
	document.getElementById("imgmaincaption").innerHTML = capt;
	document.getElementById('imgmain').src = image;
}

function bvn_go(url,width,height) {
		if (url.length > 0) {
		bvnwin = window.open (url,
  "bvnwin",'location=1,status=0,scrollbars=1,width=' + width + ',height=' + height);
		bvnwin.focus();}
  return false;
}

function bvn_tips(id) {
		bvnwin = window.open ('http://www.boatsville.com/bvn/tips.cfm?id=' + id,
  "bvnwin",'location=1,status=0,scrollbars=1,width=780,height=600');
		bvnwin.focus();
  return false;
}
