function reloadNS(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadNS; }}
else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function adjust() {
	if ((NS4) || (NS6)) {
  		if (lastX==-1 || delayspeed==0)
		{
			lastX=window.pageXOffset + floatX;
			lastY=window.pageYOffset + floatY;
		}
	 	else
  		{
			dx=Math.abs(0+floatX-lastX);
			dy=Math.abs(window.pageYOffset+floatY-lastY);
			d=Math.sqrt(dx*dx+dy*dy);
			c=Math.round(dy/10);
			if ((c < 3) && (last != 0)) {document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-static.gif';}
			if (window.pageYOffset+floatY>lastY)
				{
				lastY=lastY+delayspeed+c;
				if (last==0) {document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-animated.gif'; last=1;}
				}
			else if (window.pageYOffset+floatY<lastY)
				{
				lastY=lastY-delayspeed-c;
				if (last==0) {document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-animated.gif'; last=-1;}
				}
			else if (last!=0)
				{
				document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-static.gif';
				last=0;
				}
		}
		if (NS4){
			document.layers['floatlayer'].pageX = lastX;
			document.layers['floatlayer'].pageY = lastY;
		}
		if (NS6){
			document.getElementById('floatlayer').style.left=0;
			document.getElementById('floatlayer').style.top=lastY;
		}
	}
	else if (IE4){
		if (lastX==-1 || delayspeed==0)
		{
			lastX=document.body.scrollLeft + floatX;
			lastY=document.body.scrollTop + floatY;
			
		}
		else
		{
			dy=Math.abs(document.body.scrollTop+floatY-lastY);
			dx=Math.abs(document.body.scrollLeft+floatX-lastX);
			d=Math.sqrt(dy*dy+dx*dx);
			c=Math.round(dy/10);
			if ((c < 3) && (last != 0)) {document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-static.gif';}
			if (document.body.scrollTop+floatY>lastY)
				{
				lastY=lastY+delayspeed+c;
				if (last==0) {document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-animated.gif'; last=1;}
				}
			else if (document.body.scrollTop+floatY<lastY)
				{
				lastY=lastY-delayspeed-c;
				if (last==0) {document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-animated.gif'; last=-1;}
				}
			else if (last!=0)
				{
				document.images.menu.src='/wp-content/themes/rockypointkayak/0/menu-static.gif';
				last=0;
				}

		}
		document.all['floatlayer'].style.posLeft = lastX;
		document.all['floatlayer'].style.posTop = lastY;

	} 
	setTimeout('adjust()',50);
}

function define()
{
if ((NS4) || (NS6)) 
{ 
if (align=="left") {floatX=ifloatX};
if (align=="right") {floatX=window.innerWidth-ifloatX-layerwidth-20};
if (align=="center") {floatX=Math.round((window.innerWidth-20)/2)-Math.round(layerwidth/2)};
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=window.innerHeight-ifloatY-layerheight};
if (valign=="center") {floatY=Math.round((window.innerHeight+60)/2)-Math.round(layerheight/2)};
}
if (IE4)
{
if (align=="left") {floatX=ifloatX};
if (align=="right") {floatX=document.body.offsetWidth-ifloatX-layerwidth-20}
if (align=="center") {floatX=Math.round((document.body.offsetWidth-20)/2)-Math.round(layerwidth/2)}
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=document.body.offsetHeight-ifloatY-layerheight}
if (valign=="center") {floatY=Math.round((document.body.offsetHeight+60)/2)-Math.round(layerheight/2)}
}
}

function fdp(n,d)
{
	var xx = n.indexOf('.')
	var l = n.length
	var zstr = '0000000000000000000000'
	var theInt = ''
	var theFrac = ''
	var theNo = ''
	rfac = ''
	rfacx = 0
	nx = 0
	var xt = parseInt(d) + 1
	var rstr = '' + zstr.substring(1,xt)
	var rfac = '.' + rstr + '5'
	var rfacx = parseFloat(rfac)
	if (xx == -1 ) 	{    // No fraction
		theFrac = zstr
		theInt = "" + n
	}
	else if (xx == 0) {
		theInt = '0'
		nx = 0 + parseFloat(n) + parseFloat(rfacx)
		n = nx + zstr
		theFrac = '' + n.substring(1, n.length)
	}
	else {
		theInt = n.substring(0,xx)
		nx = parseFloat(n) + rfacx
		n = '' + nx + zstr
		theFrac = '' + n.substring(xx+1,xx + 1 + parseInt(d))
		var astr = 'd = ' + d
	}
	theFrac = theFrac.substring(0,parseInt(d))
	var ii = 0
	theNo = theInt + '.' + theFrac
	return theNo
}

function round(number,X) 
{
 X = (!X ? 2 : X);
 return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

function FormatNumber(num,decimalNum)
 
{ 
  if (isNaN(parseInt(num))) return "NaN";

	var tmpNum = num;
	var iSign = num < 0 ? -1 : 1;		// Get sign of number
	
	// Adjust number so only the specified number of numbers after
	// the decimal point are shown.
	tmpNum *= Math.pow(10,decimalNum);
	tmpNum = Math.round(Math.abs(tmpNum))
	tmpNum /= Math.pow(10,decimalNum);
	tmpNum *= iSign;					// Readjust for sign
	
	
	// Create a string object to do our formatting on
	var tmpNumStr = new String(tmpNum);


	return tmpNumStr;		// Return our formatted string!
}

<!--
reloadNS(true);
// -->
 
 <!--
floatX=0;
floatY=10;
layerwidth=100;
layerheight=300;
align="left";
valign="top";
delayspeed=1;

last=0;
NS6=false;
IE4=(document.all);
if (!IE4) {NS6=(document.getElementById);}
NS4=(document.layers);

//-->
