/* 
	Exodus Windows Functions
	
	Copyright (c) 2001 - 2002  All Rights Reserved Worldwide
	Exodus Enterprise Systems - West Chester, PA

	These functions may be used freely as long as the above copyright is attached.
*/
var _helpWindow = _popUpWindow = null;

// Set the client window to fit the entire screen
function maxClientWindow(width, height)	{
	var windowWidth = (isNav4) ? window.innerWidth - 16 : document.body.offsetWidth - 20
	var newWidth = (width < windowWidth) ? width : windowWidth;
	var newHeight = (height < windowHeight) ? height : windowHeight;
	window.moveTo(0,0);
	window.resizeTo(newWidth, newHeight);
}

// Create a window in the center of the screen using the defined URL.  No controls
function openURL(theURL,wndWidth,wndHeight) {
	var x = (screen.availWidth) ? (screen.availWidth / 2) - (wndWidth / 2) : 0
	var y = (screen.availWidth) ? (screen.availHeight / 2) - (wndHeight / 2): 0;
	window.open(theURL,'MoreInfo','width='+wndWidth+' ,height='+wndHeight+' ,toolbar=no,scrollbars=yes,resizable=no,left=' + x + ',screenX=' + x + ',top=' + y + ',screenY=' + y);
}

// Center the window in the middle of the screen
function centerIt()	{
	if(isIE4)	{
		clientY = document.body.clientHeight;
		clientX = document.body.clientWidth;
		}
		else {
			clientY = window.outerHeight
			clientX = window.outerWidth
		}
	moveTo((screen.availWidth / 2) - (clientX / 2), (screen.availHeight / 2) - (clientY /2));
}

/* Zooming link script by Paul Anderson, copyright 2001 CNET Builder.com.
   May be freely used with attribution. Not for resale. All rights reserved. 
   Make a link zoom open by adding the event handler
   
   onclick="zoomBox(event,this);return false"
   
   To zoom into a new, positioned window add width, height, left, and top
   
   onclick="zoomBox(event,this,500,400,100,50);return false"
   */

var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;

function zoomBox(evt,zlink,maxw,maxh,tox,toy) {
if (arguments.length > 2) zNew=1;
scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
toX=tox?tox:0;
toY=(toy?toy:0)+scrollH;
fromX=evt.pageX?evt.pageX:evt.clientX;
fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
adjX=toX+evt.screenX-fromX;
adjY=toY+evt.screenY-fromY;
if (document.createElement && document.body.appendChild && !zBox) {
	zBox=document.createElement("div");
	zBox.style.position="absolute";
	document.body.appendChild(zBox);
} else if (document.all && !zBox) {
	document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
	zBox=document.all.zBoxDiv;
} else if (document.layers && !zBox) {
	zBox=new Layer(maxW);
	zBox.style=zBox;
	}
zLink=zlink;
doZoom();
}

function doZoom() {
zStep+=1;
zPct=(10-zStep)/10
if (document.layers) {
	zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
	zBox.document.open();
	zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
	zBox.document.close();
	} else {
	zBox.style.border="2px solid #999999";
	zBox.style.left=toX+zPct*(fromX-toX);
	zBox.style.top=toY+zPct*(fromY-toY);
	zBox.style.width=maxW*(1-zPct);
	zBox.style.height=maxH*(1-zPct);
	}
zBox.style.visibility="visible";
if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
else {
	zBox.style.visibility='hidden';
	zStep=0;
	if (zLink && !zNew) location.href=zLink.href;
	else if (zLink && zNew) {
		var w=window.open(zLink.href,'','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY+',scrollbars,resizable');
		zNew=null;
		}
	}
}

// Popup the User Inquiry window to get demographic information.
function getMoreInfo(theItem)	{
	var theWnd = openURL('/site/userinquiry.shtml?s=' + theItem,650,750);
}

// Register for access
function registerFor(theItem)	{
	var theWnd = openURL('/site/register.shtml?item=' + theItem);
}

// popupContraints= "'resizable=yes,toolbar=yes,location=yes,scrollbars=yes,status=yes,menubar=no,directories=no,width=" + width + ",height=" + height + ",top=0,left=0'";

/********************************************
AUTHOR:WWW.CGISCRIPT.NET.LLC
URL:http://www.cgiscript.net
Use the code for FREE but leave this message intact
Download your FREE CGI/Perl Scripts today!
( http://www.cgiscript.net/scripts.htm )
****************************************************/
var acePopupWindow=null;
function acePopup(mypage,myname,w,h,pos,infocus){
	if(pos=='random'){
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
		}
		if(pos=='center'){
			LeftPosition=(screen.width)?(screen.width-w)/2:100;
			TopPosition=(screen.height)?(screen.height-h)/2:100;
			}
		else if((pos!='center' && pos!='random') || pos==null){
			LeftPosition=100;
			TopPosition=100;
			}
			settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,dependent=yes';
			acePopupWindow=window.open(''+mypage,myname,settings);
		if(infocus=='front'){
			acePopupWindow.focus();
	}
}

var PAHiRes = '/villa_videos/PAHiRes/';
var PALoRes = '/villa_videos/PALoRes/';
function popPix(mySrc)	{
	// var pixTitle = myTitle;
	var pixSrc = PAHiRes + mySrc + '/index.html';
	var _paWnd = window.open(pixSrc, "pixPopup", "width=615,height=470,menubar=no,scrollbars=no,resizable=no,copyhistory=no");
	_paWnd.moveTo(100,100);
	_paWnd.focus();
}
