function docWrite(str) {
  document.write(str);
}

function setRandomImg(i) {
var maxPossibleNum = 2
var randomNum = Math.round(Math.random()*(maxPossibleNum-1))+1;
	document.images[i].src = 'images/home' + randomNum + 'wBG.jpg';
}

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function js5Process () {
  var w=750;
  var h=550;
  var dx=20;
  var dy=20;
  var win=window.open("http://www.FASTSITE.COM/cgi-bin/vic.pl?mode=1&ref="+escape(document.URL)+"&csz="+escape(document.js5.csz.value)+"&user=larterandsons-larter&perpage=10&mpage=0","Results","width="+w+",height="+h+",screenX="+dx+",screenY="+dy+",left="+dx+",top="+dy+",scrollbars,resizable=no");
  //var win=window.open("http://www.FASTSITE.COM/cgi-bin/vic.pl?mode=1&ref="+escape(document.URL)+"&csz="+escape(document.js5.csz.value)+"&user=larterandsons-larter&perpage=10&mpage=0","Results","width="+w+",height="+h+",screenX="+dx+",screenY="+dy+",left="+dx+",top="+dy+",resizable,scrollbars,toolbar,status,menubar");
  if (win.focus)
    win.focus ();
  return false;
}

var curAngle = '45'
function SetAngle(newA) {
	curAngle = newA;
}

function FullView(viewLink) {
	viewLink = viewLink + '&a=' + curAngle;
	PopWin(viewLink,450,450)
}

var popUpWin=0;
function PopWin(strLoc,winWidth,winHeight) {
  if (popUpWin) { if (!popUpWin.closed) popUpWin.close(); }
	var lPos = ((screen.width / 2) - (winWidth / 2));
	var tPos = ((screen.height / 2) - (winHeight / 2) - 20);
	var strOpenOptions = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+winWidth+',height='+winHeight+',left='+lPos+', top='+tPos+',screenX='+lPos+',screenY='+tPos;
	popUpWin = window.open(strLoc, 'popUpWin', strOpenOptions);
}

function StripString(strOrig,charStart,charEnd) {
	var strUnstripped = new String(strOrig);
	var posStart = strUnstripped.indexOf(charStart)+1;
	var posEnd = strUnstripped.indexOf(charEnd);
	if(charStart=='!'){posStart=0};
	var strStripped = strUnstripped.substring(posStart, posEnd);
	return strStripped;
}

function ShowConfirm(txtVal) {
	//	\r places a line break
	if (confirm(txtVal)) {
		top.window.close();
	}
}

var currSampleNum = 1
var totalSampleNum = 5

function changeImage(i,n) {
	if (n == 'sample') {
		currSampleNum = currSampleNum + 1;
		if (currSampleNum > totalSampleNum) {
			currSampleNum = 1;
		}
		n = 'images/homeSample' + currSampleNum + '.jpg';
	}
	document.images[i].src = n;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);