contactEmail="a";
emailHost="quakerjane.com";

debugging="";
zindex=100;
divON="";
bV = parseInt(navigator.appVersion);
agt=navigator.userAgent.toLowerCase();
is_ie3up = ((agt.indexOf('msie') !=-1) && (bV >= 3));
is_mozilla5 = ((agt.indexOf('mozilla')!=-1) && (bV >= 5));
is_nav4 = ((agt.indexOf('mozilla')!=-1) && (bV <= 4));
is_Safari = (agt.indexOf('safari') !=-1);
			
function getX(obj)
	{ return( obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+getX(obj.offsetParent) ); }
function getY(obj)
	{ return( obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+getY(obj.offsetParent) ); }


function flyingCarpet(flyingDiv,landingX,landingY,Xd,Yd,intervalOfinterval,Bf) {
	flyingObject = document.getElementById(flyingDiv);
	if (!landingX) landingX=200;
	if (!landingY) landingY=100;
	if (!Xd) Xd=3;
	if (!Yd) Yd=2;
	if (!intervalOfinterval) intervalOfinterval=50;
	if (!Bf) Bf=0;//default to no bounce
	theX=landingX;
	theY=landingY;
	Xdivisor=Xd;
	Ydivisor=Yd;
	speed=intervalOfinterval;
	bounceFactor=Bf;
	iterationCount=0;
	
	//debugging=debugging+"<BR>bounceFactor= "+Bf;
	//debugging=debugging+"<BR>landingY= "+landingY;
	//document.getElementById("debuggingDiv").innerHTML=debugging;
	theInterval=window.setInterval('fly()',speed);
}

function fly() {
	currentX=getX(flyingObject);
	currentY=getY(flyingObject);
	if (currentY == theY && currentX == theX) {
		//debugging=debugging+"<BR>  "+flyingObject.id+" iterations ="+iterationCount+" interval="+speed;
		//debuggingDiv.innerHTML=debugging;
		docked=true;
		window.clearInterval(theInterval);
	} else {
		if (currentX > theX) { Xmodifier="-"; } else { Xmodifier="+"; }
		if (currentY > theY) { Ymodifier="-"; } else { Ymodifier="+"; }
		
		if (bounceFactor) {
			Xstep=Math.round(Math.abs(eval(currentX + Xmodifier + theX)) / Xdivisor);
			Ystep=Math.round(Math.abs(eval(currentY + Ymodifier + theY)) / Ydivisor);
		} else {
			Xstep=Math.round(Math.abs(eval(currentX - theX)) / Xdivisor);
			Ystep=Math.round(Math.abs(eval(currentY - theY)) / Ydivisor);
		}
		if (Xstep == 0) { Xstep=1; Ydivisor=4;}
		if (Ystep == 0) { Ystep=1; Xdivisor=4;}
		if (currentX != theX) flyingObject.style.left=eval(currentX + Xmodifier + Xstep);
		if (currentY != theY) flyingObject.style.top=eval(currentY + Ymodifier + Ystep);
		iterationCount++;
		//debugging=debugging+"<BR>current y= "+currentY +' Ymod='+ Ymodifier + ' Ydivisor=' +Ydivisor+ ' theY=' + theY + " and x= " + Xstep;
		//debuggingDiv.innerHTML=debugging;
	}
}

function positionDiv(divToPosition,landingX,landingY) {
	myDiv = document.getElementById(divToPosition);
	if (!isNaN(parseInt(landingX))) {
		myDiv.style.left=eval(landingX);
	}
	if (!isNaN(parseInt(landingY))) {
		myDiv.style.top=eval(landingY);
	}
	divInPosition=1;
}



var waitId=0;
function delayLoad(a,b) {
	if (a) {thePage=a} else {alert("No page was passed to the function");}
	if (b) {theButton=b} else {theButton='next'};
	if (window.top.nav.loaded) {
		window.top.nav.presto(theButton);
		window.top.nav.changeLoad2(thePage);
		window.clearTimeout(waitId);waitId=0;
	} else {
		waitId=window.setTimeout("delayLoad(thePage,theButton);",250);
	}
}
    
function initializeDivs(divCount) {
	if (is_ie3up || is_mozilla5 || is_Safari) {
		for (i=1;i<=divCount;i++) {
			// determine name of div by browser
			if (is_mozilla5) {thisDiv = document.getElementById("dbox"+i)}
			else {thisDiv=eval("dbox"+i);}
			thisDiv.style.left=getX(eval("document.mainImg"));
			thisDiv.style.top=getY(eval("document.mainImg"));
		}
		
	} else { // is nav 4
		for (var i=1 ; i<=divCount ; i++) {
			thisDiv=eval(document.eval("dbox"+i));
			thisDiv.left=eval(document.mainImg.x);
			thisDiv.top=eval(document.mainImg.y);
		}
	}
}


function positionDivs() {
	for (x=1;x<=arguments.length/2;x++) {
		var divGroup = arguments[x-1];
		for (var i=1;i<=arguments[x];i++) {
			if (is_ie3up || is_mozilla5 || is_Safari) {
				
				// determine name of div by browser				
				if (is_mozilla5) {
					thisDiv = document.getElementById(divGroup+i);
					baseDiv = document.getElementById(divGroup+"_base");
				} else {
					thisDiv=eval(divGroup+i);
					baseDiv=eval(divGroup+"_base");
				}
				
		//alert(baseDiv);
				thisDiv.style.left=getX(baseDiv);
				thisDiv.style.top=getY(baseDiv);
			} else { // is old nav
				thisDiv=eval(document.eval(divGroup+i));
				thisDiv.left=eval("document."+divGroup+"_base.x");
				thisDiv.top=eval("document."+divGroup+"_base.y");
			}
		}
	}
}


function hideDiv(whichone){
if (window.open_divName)
	if (is_ie3up || is_mozilla5 || is_Safari) {
		open_divName.style.visibility="hidden";
		divON=0;
	} else {
		open_divName.visibility="hide";
		divON=0;
	}
}

function popit(e,divName) {
//alert(eval(divName+".style.top"));
	if (divON!=divName || divON==0) {

		if (is_ie3up || is_mozilla5 || is_Safari) {
			// determine name of div by browser
			if (is_mozilla5) {div = document.getElementById(divName)}
			else {div=eval(divName);}

			if (window.open_divName && open_divName.id!=div.id) {
				open_divName.style.visibility="hidden";
			}

			open_divName=div;
			if (open_divName.style.visibility=="hidden") {open_divName.style.visibility="visible";} else {hideDiv();}
		}
		else {
			// is nav
			div=eval(document.eval(divName));

			if (window.open_divName && open_divName.id!=div.id) {
				open_divName.visibility="hide";
			}
			
			open_divName=div;
			if (open_divName.visibility == "hide") { div.visibility="show";} else { open_divName.visibility="hide";}
		}
		divON=divName;
		
	} //else { hideDiv(); divON=""; }

}

//if (document.all) document.body.onclick=hideDiv;

//reload page if browser besides Netscape resizes window
//function reDo() { window.location.href=document.URL; }
//if (is_ie3up || is_mozilla5 || is_Safari) window.onresize = reDo;




function isFunction(a) {
    return typeof a == 'function';
}

function isNull(a) {
    return typeof a == 'object' && !a;
}

function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}

function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}

function isString(a) {
    return typeof a == 'string';
}

function isUndefined(a) {
	b=window[a]; 
    return typeof b == 'undefined';
} 


