
var CI = new Array();
CI[ "DavidEmail" ] = "david" + "@" + "creativetouchphoto." + "com";
CI[ "BuzickEmail" ] = "kennaj" + "@" + "aol." + "com";
REPORT_ERRORS_TO = CI[ "DavidEmail" ];


var theUserAgent = navigator.userAgent;
var theAppVersion = navigator.appVersion;
var bName = navigator.appName;
var exactVer = parseFloat( theAppVersion );
var bVer = parseInt( exactVer );
var bMinor = navigator.appMinorVersion;
var os = navigator.platform;

cb = true; var dHTML_IE4 = false; var dHTML_DOM = false;
var IE = false; var IE4 = false; var IE5 = false;
var NC = false; var NC4 = false; var NC6 = false; var NC7 = false;
var SF = false;

if (bName == "Microsoft Internet Explorer") {
	var splitAppVersion = theAppVersion.split('MSIE');
	bVer = parseInt( splitAppVersion[1] );
	exactVer = parseFloat( splitAppVersion[1] );
	if(bVer >= 5) { IE5 = true; dHTML_DOM = true; }
	else { IE4 = true; dHTML_IE4 = true; }
	IE = true;
}
else if( theAppVersion.indexOf( "Safari" ) >= 0 )
	SF = true;
else if ( bName == "Netscape" ) {
	NC = true;
	// SAVE navigator.userAgent:
	//Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1
	//Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
	//Mozilla/4.73 [en] (Windows NT 5.0; U)
	if( theUserAgent.lastIndexOf( "Netscape" ) >= 0 ) { // NC6 or NC7
		var nInfo = theUserAgent.split( "Netscape" )[ 1 ];
		var slash = ( nInfo.indexOf( "/" ) >= 0 ) ? true : false;
		exactVer = ( slash ) ? parseFloat( nInfo.split( "/" )[ 1 ] ) : parseFloat( nInfo );
		bVer = parseInt( exactVer );
	}
	if( bVer >= 7 ) NC7 = true;
	else if( bVer == 6 ) NC6 = true;
	else if( document.layers ) NC4 = true;
}

var dHTML_DOM = ( document.getElementById ) ? true : false;
var dHTML = ( dHTML_IE4 || dHTML_DOM ) ? true : false;

var macOS = ( theAppVersion.indexOf('Macintosh') > -1 ) ? true : false;
var winOS = ( os.substring( 0, 3 ) == "Win" );
var winIE = ( winOS && IE );
var macIE = ( macOS && IE  );

var theHost = document.location.hostname.toLowerCase();

var local = ( theHost.length == 0 || theHost == "127.0.0.1" ) ? true : false;
var live = !local;

var ieTrans = ( IE5 && winOS ) ? true : false;
var ncTrans = ( NC && winOS );

var qStr = unescape( document.location.search ).substring( 1 );

var framed = false;
try { if( top != self ) framed = true; } catch( e ) { framed = true; }
//--------------------------------------------------------------------------------------
function reDirect() {
	if( !document.location.search ) {
		var redirectPage = ( live ) ? "http://www.mauialohacondos.com/" : "index.html";
		document.location.replace( redirectPage );
	}
}
//---------------------------------- PROTOTYPES ----------------------------------
function errorHandler( msg, url, line ) {
	if ( local ) {
		alert( "ERROR: " + msg + "\n\nURL: " + url + "\n\nLINE: " + line );
		return false;
	}
	return true;
}
window.onerror = errorHandler;

//----------------------------------- STRING PROTOTYPE -----------------------------------
function replaceLiteral( target, replacement ) { // String Method
	return this.split( target ).join( replacement );
}
String.prototype.replaceLiteral = replaceLiteral;

//----------------------------------- STRING PROTOTYPE -----------------------------------

function getValue( strToSearch, eqDelim, fieldDelim ) {

	if( !eqDelim ) eqDelim = "=";
	if( !fieldDelim ) fieldDelim = "&";

	var value = null;
	var key = this.toString();
	var lookUpPattern = key + eqDelim;

	// If lookUpPattern is found
	if( strToSearch.indexOf( lookUpPattern ) != -1 ) {

		// if string has more than 1 key/value pair
		if( strToSearch.indexOf( fieldDelim ) != -1 ) {
			var searchArr = strToSearch.split( fieldDelim );
			for( var i = 0; i < searchArr.length; i++ ) {
				if( searchArr[ i ].indexOf( lookUpPattern ) == 0 ) {
					value = searchArr[ i ].split( eqDelim )[1];
					break;
				}
			}
		}
		else // There is only one key/value pair in strToSearch
			value = strToSearch.split( eqDelim )[1];
	}
	if( !value ) value = null; //N6 problem
	return value;
}
String.prototype.getValue = getValue;


//----------------------------------- STRING PROTOTYPE -----------------------------------
var tmpStr = "";

function removeHtmlTags() { // String Method

	var theString = this.toString(); // Object ==> String
	tmpStr = theString;

	var startPos = theString.indexOf( "<" );
	var endPos = theString.indexOf( ">" );

	// If we got an HTML tag...
	if( startPos != -1 && endPos != -1 && ( endPos > startPos ) ) {
		var htmlTag = "<" + theString.substring( startPos + 1, endPos ) + ">";
		tmpStr = theString.replaceLiteral( htmlTag, "" );
		tmpStr.removeHtmlTags();
	}
	return tmpStr;
}
String.prototype.removeHtmlTags = removeHtmlTags;

////////////////////////// START GLOBAL IMAGE DISSOLVE FUNCTIONS /////////////////////////

function randompick() {
  return randompick.arguments[ Math.floor( Math.random()*randompick.arguments.length ) ];
}
// ACCESSOR VARS: ieTrans, exactVer
// ACCESSOR FUNC: randompick()

//----------------------------------------------
function getTransition( transNum, duration ) {

	var trans = "";
	if( winIE ) {
		var d = duration;

		if( exactVer >= 5.5 ) {

			var thisTrans = ( transNum == 1 ) ? Math.floor( Math.random() * 17 ) + 2 : transNum;

			switch ( thisTrans ) {
				case 2: trans="Fade(duration="+d+",overlap=1)"; break;
				case 3: trans="Blinds(duration="+d+",bands="+randompick(2,4,6,8)+",direction="+randompick('up','down','right','left')+")"; break;
				case 4: trans="CheckerBoard(duration="+d+",squaresX="+randompick(2,4,8,12)+",squaresY="+randompick(2,4,8,12)+",direction="+randompick('up','down','right','left')+")"; break;
				case 5: trans="Barn(duration="+d+",motion="+randompick('in','out')+",orientation=",randompick('horizontal','vertical')+")"; break;
				case 6: trans="GradientWipe(duration="+d+",gradientSize="+randompick(0,0.1,0.3,0.5,0.7,0.9,1)+",wipeStyle="+randompick(0,1)+",motion="+randompick('forward','reverse')+")"; break;
				case 7: trans="Inset(duration="+d+")"; break;
				case 8: trans="Iris(duration="+d+",irisStyle="+randompick('DIAMOND','CIRCLE','CROSS','PLUS','SQUARE','STAR')+",motion="+randompick('in','out')+")"; break;
				case 9: trans="RadialWipe(duration="+d+",wipeStyle="+randompick('CLOCK','WEDGE','RADIAL')+")"; break;
				case 10: trans="RandomBars(duration="+d+",orientation="+randompick('horizontal','vertical')+")"; break;
				case 11: trans="RandomBars(duration="+d+")"; break;
				case 12: trans="Slide(duration="+d+",pushStyle="+randompick('HIDE','PUSH','SWAP')+",bands="+randompick(1,2,3,4,5,6,7)+")"; break;
				case 13: trans="Spiral(duration="+d+",gridSizeX="+randompick(8,16,32,64)+",gridSizeY="+randompick(8,16,32,64)+")"; break;
				case 14: trans="Stretch(duration="+d+",stretchStyle="+randompick('HIDE','PUSH','SPIN')+")"; break;
				case 15: trans="Strips(duration="+d+",motion="+randompick('leftdown','leftup','rightdown','rightup')+")"; break;
				case 16: trans="Wheel(duration="+d+",spokes="+randompick(2,4,10,16,20)+")"; break;
				case 17: trans="Zigzag(duration="+d+",gridSizeX="+randompick(8,16,32,64)+",gridSizeY="+randompick(8,16,32,64)+")"; break;
				case 18: trans="RandomDissolve(duration="+d+")"; break;
        //case 19: trans="Pixelate(duration="+d+",maxSquare="+randompick(5,10,20,30,40,50)+")"; break;
				default: alert( "SWITCH/CASE ERROR: Case caught by default handler in \"getTransition\"" );
			}
			trans = "progid:DXImageTransform.Microsoft." + trans;
		}
		else { // Old IE 5 Browsers

			switch ( transNum ) {
				case 2: trans="blendTrans(duration="+d+")"; break;
				default: trans="revealTrans(duration="+d+",transition=" + Math.floor(Math.random()*23) + ")";
			}
		}
	}
	return trans;
}
//----------------------------------------------
function getRGB( abbrev ) {
	var rgb = abbrev;
	switch( abbrev ) {
		case "b": rgb = "0,0,0"; break;
		case "w": rgb = "255,255,255"; break;
	}
	return rgb;
}

//----------------------------------------------
function startFade( FadeInPhoto, transNum, transDur ) {
	if( winIE ) fadeInDirectX( FadeInPhoto, transNum, transDur );
	else if ( NC || SF ) {
		if( NC ) FadeInPhoto.style.MozOpacity = "-moz-opacity:0";
		else if( SF ) FadeInPhoto.style.opacity = "opacity:0";
		FadeInPhoto.style.visibility = "visible";
		FadeInPhoto.onload = function() { /*cancel photo onload function*/ }
		fadeIn( FadeInPhoto );
	}
	else FadeInPhoto.style.visibility = "visible";
}

//----------------------------------------------
function fadeInDirectX( FadeInPhoto, transNum, transDur ) {

	try {
		FadeInPhoto.style.filter = getTransition( transNum, transDur );
		FadeInPhoto.filters(0).apply();
		FadeInPhoto.style.visibility = "visible";
		FadeInPhoto.filters(0).play();
	}
	catch( Err ) {
		if( local ) {
			var eMsg = "Exception Caught in fadeInDirectX function:\n\n";
			for( var i in Err ) eMsg += i + ": " + Err[ i ] + "\n";
			alert( eMsg );
		}
		FadeInPhoto.style.visibility = "visible";
	}
}

FadePhoto = null;
fadeOpacity = 0;
fadeOpacityTimer = 0;

//----------------------------------------------
// SF & NC: Uses recursion
function fadeIn( FadePhoto ) {

	if( NC ) FadePhoto.style.MozOpacity = this.fadeOpacity;
	else FadePhoto.style.opacity = this.fadeOpacity;

	this.fadeOpacity += .05;
	if( fadeOpacity < 1 ) {
		this.FadePhoto = FadePhoto;
		fadeOpacityTimer = setTimeout( "fadeIn( FadePhoto )", 40 );
	}
	else {
		if( NC ) FadePhoto.style.MozOpacity = 0.9999; // 1.0 causes flicker
		else FadePhoto.style.opacity = 0.9999;
		clearTimeout( fadeOpacityTimer );
		fadeOpacity = 0;
	}
}

//----------------------------------------------
function dissolveDirectX( OldPhoto, newPhotoSrc, borderWid, borderCol, transNum, transDur ) {

	try {
		OldPhoto.style.filter = getTransition( transNum, transDur );
		OldPhoto.filters(0).apply();
		OldPhoto.src = newPhotoSrc;
		if( borderWid ) OldPhoto.style.borderColor = "rgb( " + getRGB( borderCol ) + " )";
		OldPhoto.filters(0).play();
	}
	catch( Err ) {
		if( local ) {
			var eMsg = "Exception Caught in dissolveDirectX function:\n\n";
			for( var i in Err ) eMsg += i + ": " + Err[ i ] + "\n";
			alert( eMsg );
		}
		OldPhoto.src = newPhotoSrc;
		if( borderWid ) OldPhoto.style.borderColor = "rgb( " + getRGB( borderCol ) + " )";
	}
}

/////////////////////////// END GLOBAL IMAGE DISSOLVE FUNCTIONS //////////////////////////

//--------------------------------------------------------------------------------------

var ImgReal = null;
function checkDim( img, imgWidToCk, imgHgtToCk ) {

	if( ImgReal == null ) {
		ImgReal = new Image();
		ImgReal.src = ( typeof img == "string" ) ? eval( "document.images." + img + ".src;" ) : eval( "document.images[" + img + "].src;" );
	}
	if( ImgReal.complete ) {
		var realWid = ImgReal.width;
		var realHgt = ImgReal.height;
		if( realWid > 1 && realHgt > 1 ) {
			if( imgWidToCk != realWid || imgHgtToCk != realHgt ) {
				var msg = ImgReal.src + " has incorrect dimensions set: \n\n• " + imgWidToCk + "x" + imgHgtToCk + " are the errant values \n• " + realWid + "x" + realHgt + " are the true values."
				if( confirm ( msg + "\n\nClick OK to report this problem to our Web Site Administrator:" ) )
					document.location.href = "mailto:" + REPORT_ERRORS_TO + "?subject=" + escape( 'Image Dimension Error' ) + "&body=" + escape( 'Error occured at: ' + document.location.href + ' \n' + msg.replaceLiteral( '•', '' ) );
			}
		}
		ImgReal = null;
	}
	else {
		this.img = img;
		this.imgWidToCk = imgWidToCk;
		this.imgHgtToCk = imgHgtToCk;
		setTimeout( "checkDim( img, imgWidToCk, imgHgtToCk );", 500 );
	}
}
//--------------------------------------------------------------------------------------

function getObject( strObjName ) {
	if( dHTML )
		return ( dHTML_DOM ) ? document.getElementById( strObjName ) : eval( strObjName );
	else
		return null;
}
getObj = getObject;
//--------------------------------------------------------------------------------------

var mapsOff = new Image(); mapsOff.src = "images/mapsOff.gif";
var mapsOn = new Image(); mapsOn.src = "images/mapsOn.gif";

var calOff = new Image(); calOff.src = "images/calOff.gif";
var calOn = new Image(); calOn.src = "images/calOn.gif";

var aboutOff = new Image(); aboutOff.src = "images/aboutOff.gif";
var aboutOn = new Image(); aboutOn.src = "images/aboutOn.gif";

var aboutHomeOff = new Image(); aboutHomeOff.src = "images/aboutHomeOff.gif";
var aboutHomeOn = new Image(); aboutHomeOn.src = "images/aboutHomeOn.gif";

var ratesOff = new Image(); ratesOff.src = "images/ratesOff.gif";
var ratesOn = new Image(); ratesOn.src = "images/ratesOn.gif";

var ssOff = new Image(); ssOff.src = "images/ssOff.gif";
var ssOn = new Image(); ssOn.src = "images/ssOn.gif";

var tnOff = new Image(); tnOff.src = "images/tnOff.gif";
var tnOn = new Image(); tnOn.src = "images/tnOn.gif";

var homeOff = new Image(); homeOff.src = "images/homeOff.gif";
var homeOn = new Image(); homeOn.src = "images/homeOn.gif";
//--------------------------------------------------------------------------------------

var dTextGen = new Array(
	"Go to our Luxury Golf Course Home - Branson, Missouri", // 0
	"Goes to our Kaanapali Royal Web Site - our other condo...", // 1
	"Send us e-mail, click \"Rates & Reservations\" for initial inquiries", // 2
	"Click map to view it full size...", // 3
	"View Expedia.com\'s Kahana street map", // 4
	"Kaanapali Royal - an affordable oceanfront condo...", // 5
	"Royal Kahana - a luxurious oceanfront penthouse suite...", // 6
	"View Expedia.com\'s Honakowai street map", // 7
	"Click to enlarge", // 8
	"View photos on a traditional click-to-enlarge page", // 9
	"View photos with our automated pop-up slide show" // 10
);
var dTextRK = new Array( //BRANSON
	"Goes back to our Golf Course Home Page: Get our, Phone Number, etc.", // 0
	"Our quick loading slide-show is a great way to see pictures of our Luxury Golf Course Home in Branson Missouri..", // 1
	"See photos & learn about our Executive Luxury Golf Course Home in Branson, Missouri", // 2
	"", // 3
	"", // 4
	"Contact Us: Get our rental rates and fill out our easy rental inquiry form", // 5
	"A 4-bedroom Luxury Golf Course Vacation Home in Branson, Missouri", // 6
	"", // 7
	"View the Slide-Show photos of our Golf Course Home on a traditional \"click-to-enlarge\" style page" // 8
);
var dTextKR = new Array(
	"Goes back to our Kaanapali Royal Home Page: Get our, Phone Number, etc.", // 0
	"Our quick loading slide-show is a great way to see pictures of our lovely Kaanapali Royal Condo", // 1
	"See photos & learn about our spacious garden unit. Kaanapali Royal offers a spa, pool, tennis courts, BBQ's &amp; more...", // 2
	"Don't know where Kaanapali Royal is? We've got a map of Maui and a detailed Street Map courtesy of Expedia.com", // 3
	"Check your vacation dates against our Kaanapali Royal Booking Calendar to make sure it is available", // 4
	"Contact Us: Get the Kaanapali Royal rental rates and fill out our easy rental inquiry form", // 5
	"Kaanapali Royal is a privately owned 1,800 SF 2-bedroom condo situated on the 16th fairway of the North Kaanapali Golf Course", // 6
	"", // 7
	"View the Slide-Show photos of our Kaanapali Royal condo on a traditional \"click-to-enlarge\" style page" // 8
);
//----------------------------------------------------------------------------------------
var dText = new Array();

function getCallout( theCondo ) {

	dText = ( theCondo == "rk" ) ? dTextRK: dTextKR;

	var calloutType = "<BR>";

	if( dHTML )
		calloutType = "<TABLE WIDTH=175 HEIGHT=161 BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR=#FFFCF7><TR><TD ALIGN=center VALIGN=top><BR><SPAN ID='callout' CLASS=dText>" + dText[ 6 ] + "</SPAN></TD></TR></TABLE>";
	else if( NC4 ) {
		calloutType = "<ILAYER NAME=masterLayer visibility=show BGCOLOR=#FFFCF7>";
		for( i = 0; i <= 8; i++ ) // Build 7 layers and place in masterLayer container...
			calloutType += "<LAYER NAME=myLayer" + i + " visibility=hide BGCOLOR=#FFFCF7 WIDTH=175 HEIGHT=159><TABLE WIDTH=175 HEIGHT=159 BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#FFFCF7><TR><TD ALIGN=center VALIGN=top><SPAN CLASS=dText>" + dText[ i ] + "</SPAN></TD></TR></TABLE></LAYER>"
		calloutType += "</ILAYER>";
	}
	return calloutType;
}
//--------------------------------------------------------------------------------------
var timeout;

function activateMsg( index ) {

	clearTimeout(timeout);

	var Callout = getObject( "callout" );

	if( dHTML )
		Callout.innerHTML = dText[ index ];
	else if( NC4 ) {
		hideLayers();
		document.masterLayer.layers[ 'myLayer' + index ].visibility = 'show';
	}
}

function deActivateMsg() {
	Callout = getObject( "callout" );
	if( dHTML ) timeout = setTimeout('Callout.innerHTML = dText[ 6 ]', 500);
	else if( NC4 ) {
		timeout = setTimeout( 'hideLayers(), initLayers()', 500 );
	}
}
function hideLayers() {
	for( i = 0; i < document.masterLayer.layers.length; i++ ) {
		if( document.masterLayer.layers[ i ].name.indexOf( 'myLayer' ) == 0 )
		 document.masterLayer.layers[ i ].visibility = 'hide';
	}
}
function initLayers() {
	if( NC4 ) document.masterLayer.layers[ 6 ].visibility = 'show';
}
//--------------------------------------------------------------------------------------
function actLink(imgName) {	document [imgName].src = eval(imgName + "On.src"); }
function deActLink(imgName) {	document [imgName].src = eval(imgName + "Off.src"); }
//----------------------------------------------------------------------------------------
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
//----------------------------------------------------------------------------------------
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}
//----------------------------------------------------------------------------------------
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
//----------------------------------------------------------------------------------------
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
//----------------------------------------------------------------------------------------
//Global function read everytime page loads
var expdate = new Date ();
var expdate1 = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 365 * 1000)); // 1 year from now
expdate1.setTime (expdate1.getTime() + (24 * 60 * 60 * 30 * 1000)); // 30 days from now

// Record referring page as cookie
if( !GetCookie( "buzickReferrer" ) ) {
	var refPageQstr = ( qStr.indexOf( "ref=" ) == 0 ) ? qStr.split( "ref=" )[ 1 ] : "";

	if( refPageQstr )
		SetCookie( "buzickReferrer", refPageQstr, null, "/" );
	else {
		var refPage = document.referrer;
		var externalReferrer = ( refPage.indexOf( "http://www.mauialohacondos.com" ) == 0 || refPage.indexOf( "http://mauialohacondos.com" ) == 0 ) ? false : true;
		if( externalReferrer ) SetCookie( "buzickReferrer", document.referrer, null, "/" );
	}
}

function showReferrer() {
	self.status = ( framed ) ? "Framed" : GetCookie( "buzickReferrer" );
}
//---------------------------------------------------------------------------------------

function getThanks() {

	var text = "";

	if( qStr && qStr.indexOf( "fName=" == 0 ) ) {
		var firstName = qStr.split( "fName=" )[ 1 ];
		text = '' +
		"<TABLE BORDER=0><TR><TD>" +
		"<SPAN CLASS='largeBrwnText'>" +
			"Mahalo " + firstName + "...<BR>" +
		"</SPAN>" +
		"</TD></TR><TR><TD ALIGN=right>" +
		"<SPAN CLASS='brwnText'>" +
			"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks for your inquiry - we'll get right back to you!<BR><BR>" +
			"Marcy \"Tutu\" Buzick - Owner&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
		"</SPAN>" +
		"</TD></TR></TABLE><BR>";
	}
	return text;
}
//----------------------------------------------------------------------------------------
function cacheImages() {
	image0 = new Image(); image0.src = "images/royalKahana.gif";
	image1 = new Image(); image1.src = "images/kr.gif";
}

function cacheRK() { image0 = new Image(); image0.src = "images/royalKahana.gif"; }

function cacheKR() { image0 = new Image(); image0.src = "images/kr.gif"; }

//----------------------------------------------------------------------------------------
var buzickWin = null;

function openWin( theSite, tool, loc, status, menu, winSize, resizable ) {

	closeWin();

	var wid = 800 * 1.1 * winSize;
	var hgt = 450 * winSize;

	// Works on AOL, IE, N6 & NC4
	// IE Makes pop up same size as INNER DIMENSIONS of parent window.
	// AOL makes pop up same exact size as parent since toobars etc. don't attribute to inner dim of AOL window

	if( winSize == 1 ) { // Make a full size pop-up...
		if( IE ) {
			var aolCookie = GetCookie( "AOL" );
			var AOL = ( aolCookie == null || aolCookie == "true" ) ? true : false;
			wid = ( AOL ) ? document.body.clientWidth : screen.availWidth - 10;
			hgt = ( AOL ) ? document.body.clientHeight : screen.availHeight - 50;
		}
		else { // NC4 & 6
			var hSkew = ( NC6 ) ? 50 : 100;
			wid = screen.availWidth - 10;
			hgt = screen.availHeight - hSkew;
		}
	}

	buzickWin = window.open("","buzick_window","toolbar="+tool+",location="+loc+",directories=0,status="+status+",menubar="+menu+",scrollbars=1,resizable="+resizable+",width="+wid+",height="+hgt+",top="+screen.availTop+",left="+screen.availLeft+"");

	buzickWin.location.href = theSite;
	focusWin();

}

function closeWin() {
	if( buzickWin && !buzickWin.closed ) {
		buzickWin.close();
		buzickWin = null;
	}
}
function focusWin() {
	if( buzickWin && typeof buzickWin.registered == "boolean" ) buzickWin.focus();
	else setTimeout( "focusWin()", 500 );
}
//---------------------------------------------------------------------------------------
function linkToPopUp() {
	if( eval( "typeof buzickWin.registered" ) == "boolean" ) buzickWin.myOpener = self;
	else setTimeout( "linkToPopUp()", 250 );
}
//--------------------------------------------------------------------------------------

function showImg( imgInfo ) {
	openWin( "image_viewer.html?" + escape( imgInfo ), 0, 0, 1, 0, 1, 1 );
	linkToPopUp();
}

//////////////////////////////// START IMAGE VIEWER: IV ////////////////////////////////

/*
ACCESSOR CLS: off, on, ivLgImgMargin, ivLgImgTitle
ACCESSOR FUN: checkDim, replaceLiteral, getRGB, startFade
ACCESSOR VAR: macIE, IE, winIE, NC
*/

//--------------------------------- OBJECT CONSTRUCTOR ---------------------------------

function ImageViewer( transNum, transDur ) {

	this.transNum = ( transNum ) ? transNum :   2;
	this.transDur = ( transDur ) ? transDur : 0.8;

	this.Link = null;
	this.setSectVis = setSectVis;
	this.hideOtherPhotos = hideOtherPhotos;
	this.show = show;
	this.hideLgImg = hideLgImg;
	this.setImgTitle = setImgTitle;
	this.scrollFromTop = 0;
	this.scrollFromLeft = 0;
	this.lgPhotoShowing = false;

	//------------------------------------- METHOD IV -------------------------------------
	// Loops thru any section(s) that are to be hidden when large image is displayed AND
	// Loops thru any section(s) that are to be re-shown when large image is is hidden

	function setSectVis( sectName, className ) {
		var i = 0;
		while( document.getElementById( sectName + i ) ) {
			Section = document.getElementById( sectName + i );
			Section.className = className;
			i++;
		}
	}
	//------------------------------------- METHOD IV -------------------------------------
	// Loops thru other open photos (if any) and hides them.
	// Keeps more than 1 large photos from showing simultaneously

	function hideOtherPhotos( tnPage ) {
		if( document.getElementById && !tnPage ) {
			var OtherDivs = document.getElementsByTagName( "DIV" );
			for( var i = 0; i < OtherDivs.length; i++ ) {
				if( OtherDivs[i].id.indexOf( "bigIV" ) == 0 )
					this.hideLgImg( OtherDivs[i].id.substring( 5, OtherDivs[i].id.length ) );
			}
		}
	}
	//------------------------------------- METHOD IV -------------------------------------
	// [ 'images/', 'princeWFReid.jpg', 347, 351, 'Maui Prince', 'b', 1, LinkObj , 'sectName' ]
	//      0               1           2    3           4       5   6     7           8

	// Displays full size image on the current page
	function show( ImgInfoArr ) {

		if( document.getElementById ) {

			// Record where page is scrolled to so it can be reset back later
			var ieCSS = ( IE && document.compatMode) ? document.compatMode ==  "CSS1Compat" : false;
			if( IE ) var IeBody = ieCSS ? document.documentElement : document.body;
			this.scrollFromTop = ( IE ) ? IeBody.scrollTop : window.pageYOffset;
			this.scrollFromLeft = ( IE ) ? IeBody.scrollLeft : window.pageXOffset;

			var tnPage = ( ImgInfoArr[ 8 ] == "thumbnails" ) ? true : false;

			if( tnPage ) this.Link = ImgInfoArr[ 7 ];

			this.hideOtherPhotos( tnPage );
			var sectName = ImgInfoArr[ 8 ];
			this.setSectVis( sectName, "off" );

			ImgInfoArr[ 5 ] = getRGB( ImgInfoArr[ 5 ] );

			var html = ( tnPage ) ? "<DIV ID='bigIV" + sectName + "' STYLE='position:absolute; top:50%; left:50%; margin-left:-" + ( ImgInfoArr[ 2 ] / 2 ) + "px; margin-top:-" + ( ImgInfoArr[ 3 ] / 2 + 20 ) + "px;'>" : "<DIV ID='bigIV" + sectName + "' CLASS='ivLgImgMargin'>";

			if( tnPage ) {

				// Evaluate & set global stmts from arrGlobalInfo
				for( i = 0; i < arrGlobalInfo.length - 1; i++ ) eval( arrGlobalInfo[ i ] );

				this.lgPhotoShowing = true;
				var BodyStyle = document.body.style;
				BodyStyle.backgroundImage = "url( none )";
				BodyStyle.backgroundColor = bkgColOnTN;
				BodyStyle.marginTop = "0px";
				BodyStyle.marginRight = "0px";
				BodyStyle.marginBottom = "0px";
				BodyStyle.marginLeft = "0px";

				if( macIE )
					html = "<DIV ID='bigIV" + sectName + "'>" + "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='0' WIDTH='100%' HEIGHT='" + ( document.body.clientHeight - 60 ) + "'><TR><TD ALIGN='center' VALIGN='middle'>";
				if( !WRITE_TN_IMAGE_TITLE ) ImgInfoArr[ 4 ] = "&nbsp; <BR>";
			}

				html +=
				"<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='0'>" +
					"<TR>" +
						"<TD>" +
							"<A HREF='javascript:void(0);' ID='topFocalPt'></A><BR>" +
						"</TD>" +
					"</TR>" +
					"<TR>";

						var bkgStyle = ( tnPage ) ? " STYLE='background-color:" + bkgColOnTN + ";'" : " ";
						var imgTitle = ImgInfoArr[ 4 ];
						var imgtitle = imgTitle.toLowerCase();
						var nLinesInTitle = imgtitle.split( "<br>" ).length;
						var lineBrks = "";
						for( var i = 0; i < nLinesInTitle; i++ ) lineBrks += "<BR>";

						html +=
						"<TD ALIGN='center'" + bkgStyle + ">" +
							"<A HREF='javascript:IV.hideLgImg( \"" + sectName + "\" );' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Click to go back'" + bkgStyle + "><IMG NAME='" + sectName + "IV' SRC='" + ImgInfoArr[ 0 ] + ImgInfoArr[ 1 ] + "' BORDER='0' WIDTH='" + ImgInfoArr[ 2 ] + "' HEIGHT='" + ImgInfoArr[ 3 ] + "' HSPACE=0 VSPACE=0 STYLE='border:" + ImgInfoArr[ 6 ] + "px solid rgb( " + ImgInfoArr[ 5 ] + " ); float:left; visibility:hidden;' onAbort='this.src=this.src;' onLoad='checkDim( \"" + sectName + "IV\", " + ImgInfoArr[ 2 ] + ", " + ImgInfoArr[ 3 ] + " ); window.startFade( this, IV.transNum, IV.transDur ); IV.setImgTitle( \"" + imgTitle + "\" );'></A>" +
						"</TD>" +
					"</TR>" +
					"<TR>" +
						"<TD ALIGN='center'>" +
							"<DIV ID='imgTitleIV' CLASS='ivLgImgTitle'>Loading image, please wait..." + lineBrks + "</DIV><DIV STYLE='line-height:4px;'> &nbsp;</DIV>" +
						"</TD>" +
					"</TR>" +
					"<TR>" +
						"<TD ALIGN='center'>" +
							"<A HREF='javascript:IV.hideLgImg( \"" + sectName + "\" );' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Click photo to go back to thumbnail'>Back</A>" +
						"</TD>" +
					"</TR>" +
					"<TR>" +
						"<TD>" +
							"<A HREF='javascript:void(0);' ID='botFocalPt'></A><BR>" +
						"</TD>" +
					"</TR>" +
				"</TABLE><BR>";

			if( macIE && tnPage ) html += "</TD></TR></TABLE><BR>";
			html += "</DIV>";
			var ImgConsole = document.getElementById( sectName );
			ImgConsole.innerHTML = html;
			ImgConsole.className = "on";
			if( !macIE ) {
				var FocuserTop = document.getElementById( "topFocalPt" ); FocuserTop.focus();
				var FocuserBot = document.getElementById( "botFocalPt" ); FocuserBot.focus();
			}
			return false;
		}
		else { // Old Browsers
			document.location.href = ImgInfoArr[ 0 ] + ImgInfoArr[ 1 ];
			return false;
		}
	}

	//------------------------------------- METHOD IV -------------------------------------
	// Set page back to default state by hiding large image
	function hideLgImg( sectName ) {

		var tnPage = ( sectName == "thumbnails" ) ? true : false;
		var ImgConsole = document.getElementById( "bigIV" + sectName );
		ImgConsole.innerHTML = "";
		ImgConsole.className = "off";
		if( tnPage ) {
			this.lgPhotoShowing = false;
			var BodyStyle = document.body.style;
			BodyStyle.backgroundImage = TN_PAGE_STYLE.bkgImg;
			BodyStyle.backgroundColor = TN_PAGE_STYLE.bkgCol;
			BodyStyle.marginTop = TN_PAGE_STYLE.marTop;
			BodyStyle.marginRight = TN_PAGE_STYLE.marRgt;
			BodyStyle.marginBottom = TN_PAGE_STYLE.marBot;
			BodyStyle.marginLeft = TN_PAGE_STYLE.marLft;
		}

		IV.setSectVis( sectName, "on" );
		if( tnPage && typeof this.Link == "object" ) {
			this.Link.focus();
			this.Link.blur();
		}
		// Scroll window back to where it was before
		window.scroll( this.scrollFromLeft, this.scrollFromTop );
	}
	//------------------------------------- METHOD IV -------------------------------------

	function setImgTitle( imgTitle ) {
		var ImgTitle = document.getElementById( "imgTitleIV" );
		imgTitle = imgTitle.replaceLiteral( '^^', "'" );
		imgTitle = imgTitle.replaceLiteral( '^', '"' );
		ImgTitle.innerHTML = imgTitle + "<DIV STYLE='line-height:4px;'> &nbsp;</DIV>";

	}
}
////////////////////////////////// END IMAGE VIEWER: IV //////////////////////////////////

var IV = new ImageViewer();

//////////////////////////////// START DYNAMIC MENU ////////////////////////////////

/*
ACCESSOR VARIABLES: IE, NC, winIE, macIE, SF
ACCESSOR FUNCTIONS: None
*/

//-------------------------------- OBJECT CONSTRUCTOR DM --------------------------------

function DynamicMenu( Set ) {

	// Begin User Settings
	this.Links = new Array();

	this.Links[ "rk" ] =
	[
		[ "Homepage", "br_home.html", "Go to Luxury Golf Course Homepage" ],
		[ "Slide Show", "javascript:loadPage( \"db=ss-data-br.js\", null );", "View photos with our automated slide-show" ],
		[ "Thumbnails", "thumbnails.html?db=ss-data-br.js", "View photos on a traditional \\&#34;click-to-enlarge\\&#34; page" ],
		[ "About our Home", "br_about.html", "Learn more about our Executive Home..." ],
		[ "Rates & Inquiries", "br_inquire.html", "Get our rental rates and submit an inquiry" ],
		[ "GOLF COURSE HOME", 9,       [0,0],  [0, -3], [0, 0] ]
		// Title,      fontSize, relative,   above    below: [xPos, yPos]
	];

	this.Links[ "kr" ] =
	[
		[ "Homepage", "kr_home.html", "Go to Kaanapali Royal Homepage" ],
		[ "Slide Show", "javascript:loadPage( \"db=ss-data-kr.js\", null );", "View photos with our automated slide-show" ],
		[ "Thumbnails", "thumbnails.html?db=ss-data-kr.js", "View photos on a traditional \\&#34;click-to-enlarge\\&#34; page" ],
		[ "About our Condo", "kr_about.html", "Learn more about our spacious condo..." ],
		[ "Street Map", "kr_maps.html", "Get Directions: View a street map of our condo" ],
		[ "Rates & Inquiries", "kr_inquire.html", "Get our rental rates and submit an inquiry" ],
		[ "KAANAPALI ROYAL", 9, [0,0], [0, -3], [0, 0] ]
		// Title, fontSize, relative, above & below: [xPos, yPos]
	];


	this.settings = new Array();
	this.settings[ "textAlign" ]      = ( Set && Set[ 00 ] ) ? Set[ 00 ] : "left";
	this.settings[ "fontFace" ]       = ( Set && Set[ 01 ] ) ? Set[ 01 ] : "arial,helvetica";
	this.settings[ "fgColorOff" ]     = ( Set && Set[ 02 ] ) ? Set[ 02 ] : "153,0,0";
	this.settings[ "fgColorOn" ]      = ( Set && Set[ 03 ] ) ? Set[ 03 ] : "215,31,9";
	this.settings[ "fgColorDisable" ] = ( Set && Set[ 04 ] ) ? Set[ 04 ] : "217,172,100";
	this.settings[ "bgColorOff" ]     = ( Set && Set[ 05 ] ) ? Set[ 05 ] : "255,220,163";
	this.settings[ "bgColorOn" ]      = ( Set && Set[ 06 ] ) ? Set[ 06 ] : "255,205,125";
	this.settings[ "borderColor" ]    = ( Set && Set[ 07 ] ) ? Set[ 07 ] : "153,102,51";
	this.settings[ "fgTitleColor" ]   = ( Set && Set[ 08 ] ) ? Set[ 08 ] : "153,0,0";
	this.settings[ "bgTitleColor" ]   = ( Set && Set[ 09 ] ) ? Set[ 09 ] : "255,205,125";
	this.settings[ "formElements" ]   = ( Set && Set[ 10 ] ) ? Set[ 10 ] : null;
	this.settings[ "showToolTip" ]    = ( Set && Set[ 11 ] ) ? Set[ 11 ] : 0;

	// Do not edit past this line -------------------------

	this.Menu = null;
	this.OldLink = null;
	this.timer = 0;
	this.start = start;
	this.hide = hide;
	this.killOthers = killOthers;
	this.getPos = getPos;
	this.keepInWin = keepInWin;
	this.show = show;
	this.setElemVis = setElemVis;
	this.resetTimer = resetTimer;

	//------------------------------------- METHOD DM -------------------------------------

	function start( Link, theEvent, arrName, menuPosition ) {
		killOthers( Link );
		show( Link, theEvent, arrName, menuPosition );
	}

	//------------------------------------- METHOD DM -------------------------------------

	function hide( delay ) {
		if( !arguments.length ) delay = 1000;
		if( DM.timer == 0 && DM.Menu ) {
			DM.timer = setTimeout( "" +
				"DM.Menu.innerHTML = '';" +
				"DM.Menu = null;" +
				"DM.timer = 0;" +
				"DM.setElemVis( '', 'visible' );",
				delay
			);
		}
	}
	//------------------------------------- METHOD DM -------------------------------------

	function killOthers( NewLink ) {
		resetTimer();
		if( DM.Menu && DM.OldLink && DM.OldLink != NewLink ) {
			DM.Menu.innerHTML = '';
			DM.Menu = null;
			DM.timer = 0;
			DM.OldLink = null;
			DM.setElemVis( "", "visible" );
		}
	}

	//------------------------------------- METHOD DM -------------------------------------
	// It appears that Safari fails to add BODY: margin-top to y however it correctly determines y when link is set as position:absolute.
	function getPos( TheElement ) {
		var x = 0; var y = 0;
		//var deBugStr = ""
		while( TheElement != document.body ) {
			y += TheElement.offsetTop;
			x += TheElement.offsetLeft;
			y -= TheElement.scrollTop;
			x -= TheElement.scrollLeft;
			//deBugStr += "TAG: " + TheElement.tagName + ";  x:" + x + ";  y:" + y + "\n";
			TheElement = TheElement.offsetParent;
		}
		//prompt( "", deBugStr );
		return[ x, y ];
	}
	//------------------------------------- METHOD DM -------------------------------------

	function keepInWin( topEdge, leftEdge, IeBody ) {

		var bodyHgt = ( IE ) ? IeBody.clientHeight : window.innerHeight;
		var bodyWid = ( IE ) ? IeBody.clientWidth : window.innerWidth;

		// Prevent menu from going off bottom & top of page
		var menuHgt = DM.Menu.offsetHeight;
		var yOffset = ( IE ) ? IeBody.scrollTop : window.pageYOffset;
		var vScreenPos = topEdge - yOffset;
		var vSkew = bodyHgt - vScreenPos;
		if( vSkew < menuHgt + 10 ) topEdge -= menuHgt - vSkew + 10; // bottom edge
		else if( vScreenPos < 10 ) topEdge = 10 + yOffset; // top edge

		// Prevent menu from going off right & left edges
		var menuWid = DM.Menu.offsetWidth;
		var xOffset = ( IE ) ? IeBody.scrollLeft : window.pageXOffset;
		var hScreenPos = leftEdge - xOffset;
		var hSkew = bodyWid - hScreenPos;
		if( hSkew < menuWid + 10 ) leftEdge -= menuWid - hSkew + 10; // right edge
		else if( hScreenPos < 10 ) leftEdge = 10 + xOffset; // left edge

		return[ topEdge, leftEdge ];

	}
	//------------------------------------- METHOD DM -------------------------------------

	function show( Link, theEvent, arrName, menuPosition ) {

		if( !DM.Menu ) {

			DM.setElemVis( arrName, "hidden" )

			var e = ( window.event ) ? event : theEvent;

			var borderCol = DM.settings.borderColor;
			var borderStyle = ( borderCol ) ? " STYLE='border:1px solid rgb( " + borderCol + " );'" : "";

			var nLinks = DM.Links[ arrName ].length - 1;

			var menuTitle = DM.Links[ arrName ][ nLinks ][ 0 ];

			var fontSize = DM.Links[ arrName ][ nLinks ][ 1 ];

			var table = "" +

			"<TABLE ALIGN='left' BORDER='0' CELLSPACING='0' CELLPADDING='0' " + borderStyle + " onMouseover='DM.resetTimer();' onMouseout='DM.hide( 0 );'>";
				for( var i = 0; i < nLinks; i++ ) {

					if( menuTitle && i == 0 ) {
						table +=
						"<TR>" +
							"<TD NOWRAP ALIGN='center' STYLE='color:rgb( " + DM.settings.fgTitleColor + " ); background-color:rgb( " + DM.settings.bgTitleColor + " ); font-size:" + fontSize + "pt; font-family:" + DM.settings.fontFace + "; font-weight:bold;'>" +
								"<DIV STYLE='margin:0px 3px 0px 3px;'>" + menuTitle + "</DIV>" +
							"</TD>" +
						"</TR>";
					}

					table +=
					"<TR ALIGN='left' VALIGN='middle'>";

						var separator = ( DM.Links[ arrName ][ i ][ 0 ] == "-" );

						var target = ( DM.Links[ arrName ][ i ][ 3 ] ) ? DM.Links[ arrName ][ i ][ 3 ] : "_self";
						var domTarget = ( target.indexOf( "_" ) == 0 ) ? target.substring( 1, target.length ) : "parent." + target;

						var thePage = eval( domTarget + ".document.location.href" );
						var newPage = eval( "!" + domTarget + ".document.location.hash" );

						var pageShowing = ( thePage.substring( thePage.length - DM.Links[ arrName ][ i ][ 1 ].length, thePage.length ) == DM.Links[ arrName ][ i ][ 1 ] && newPage );

						var selfStatusCode = "";

						if( DM.Links[ arrName ][ i ][ 2 ] && !pageShowing ) {
							if( DM.settings.showToolTip )
								selfStatusCode = "this.title = \"" + DM.Links[ arrName ][ i ][ 2 ] + "\"; self.status = \"" + DM.Links[ arrName ][ i ][ 2 ] + "\"; ";
							else
								selfStatusCode = "self.status = \"" + DM.Links[ arrName ][ i ][ 2 ] + "\"; ";
						}

						var mouseOutCode = ( DM.Links[ arrName ][ i ][ 2 ] ) ? "self.status = \"\"; " : "";

						var fgColOn = ( pageShowing ) ? DM.settings.fgColorDisable : DM.settings.fgColorOn;

						var fgColOff = ( pageShowing ) ? DM.settings.fgColorDisable : DM.settings.fgColorOff;

						var bgCol = ( pageShowing )  ? DM.settings.bgColorOff : DM.settings.bgColorOn;

						var cursorType = ( pageShowing ) ? "default" : "hand";
						if( NC ) cursorType = "default";

						if( separator ) {
							table +=
								"<TD ALIGN='center' STYLE='background-color:rgb( " + DM.settings.bgColorOff + " );'>";
									if( SF ) table +=
										"<HR SIZE=1 NOSHADE STYLE='line-height:1px; margin:2px 0px 2px 0px; color:rgb( " + borderCol + " );'>"
									else table +=
										"<TABLE WIDTH='100%' ALIGN='center' BORDER='0' CELLSPACING='0' CELLPADDING='0' STYLE='margin:2px 0px 2px 0px;'>" +
											"<TR>" +
												"<TD ALIGN='center' WIDTH='100%' STYLE='background-color:rgb( " + borderCol + " );'>" +
													"<DIV STYLE='line-height:1px;'>&nbsp;</DIV>" +
												"</TD>" +
											"</TR>" +
										"</TABLE>";
								table +=
								"</TD>";
						}

						else table +=

							"<TD NOWRAP STYLE='background-color:rgb( " + DM.settings.bgColorOff + " );' onMouseOver='" + selfStatusCode + "this.firstChild.firstChild.style.color=\"rgb( " + fgColOn + ")\"; style.backgroundColor=\"rgb( " + bgCol + ")\"; return true;' onMouseOut='" + mouseOutCode + "this.firstChild.firstChild.style.color=\"rgb( " + fgColOff + ")\"; style.backgroundColor=\"rgb( " + DM.settings.bgColorOff + ")\"; return true;'>" +

								"<a href='" + ( ( pageShowing ) ? "javascript:self.status=\"You are already on the \\&#34;" + DM.Links[ arrName ][ i ][ 0 ]  + "\\&#34; page\";void(0);" : DM.Links[ arrName ][ i ][ 1 ]  ) + "' TARGET='" + target + "' style='text-decoration:none;' onClick='DM.hide( 0 ); return true;' onMouseOver='style.cursor = \"" + cursorType + "\"; return true;'><div style='width:100%; font-size:" + fontSize + "pt; font-family:" + DM.settings.fontFace + "; color:rgb( " + ( ( pageShowing ) ? fgColOn : DM.settings.fgColorOff ) + "); text-align:" + DM.settings.textAlign + ";'>&nbsp;" + DM.Links[ arrName ][ i ][ 0 ]  + "&nbsp;</div></a>" +

							"</TD>";

					table +=
					"</TR>";
				}

			table +=
			"</TABLE><BR>"; // Trailing "<BR>" nesessary for macIE - don't delete!

			DM.Menu = document.createElement( "DIV" );
			document.body.appendChild( DM.Menu );

			DM.OldLink = Link;
			DM.Menu.style.zIndex = 2000;
			DM.Menu.style.visibility = "hidden";
			DM.Menu.style.position = "absolute";
			DM.Menu.style.top = ( screen.height * -1 ) + "px";
			DM.Menu.style.left = ( screen.width * -1 ) + "px";
			DM.Menu.innerHTML = table;

			if( macIE || SF ) menuPosition = "relative";
			if( menuPosition != "relative" ) var PosArr = getPos( Link );

			var ieCSS = ( IE && document.compatMode) ? document.compatMode ==  "CSS1Compat" : false;
			var IeBody = null;
			if( IE ) IeBody = ( ieCSS ) ? document.documentElement : document.body;
			var MenuPos = [ -1 ,-1 ];

			switch( menuPosition ) {

				case "relative":
					var topEdge = ( IE ) ? e.clientY + IeBody.scrollTop : e.pageY;
					topEdge += DM.Links[ arrName ][ nLinks ][ 2 ][ 1 ];
					var leftEdge = ( IE ) ? e.clientX + IeBody.scrollLeft : e.pageX;
					leftEdge += DM.Links[ arrName ][ nLinks ][ 2 ][ 0 ];
					MenuPos = DM.keepInWin( topEdge, leftEdge, IeBody );
					break;

				case "above":
					var topEdge = PosArr[ 1 ] - DM.Menu.offsetHeight + DM.Links[ arrName ][ nLinks ][ 3 ][ 1 ];
					var leftEdge = PosArr[ 0 ] + DM.Links[ arrName ][ nLinks ][ 3 ][ 0 ];
					MenuPos = DM.keepInWin( topEdge, leftEdge, IeBody );
					break;

				case "right":
					var topEdge = PosArr[ 1 ] + DM.Links[ arrName ][ nLinks ][ 4 ][ 1 ];
					var leftEdge = PosArr[ 0 ] + Link.offsetWidth + DM.Links[ arrName ][ nLinks ][ 4 ][ 0 ];
					MenuPos = DM.keepInWin( topEdge, leftEdge, IeBody );
					break;

				case "below":
					var topEdge = PosArr[ 1 ] + Link.offsetHeight + DM.Links[ arrName ][ nLinks ][ 5 ][ 1 ];
					var leftEdge = PosArr[ 0 ] + DM.Links[ arrName ][ nLinks ][ 5 ][ 0 ];
					MenuPos = DM.keepInWin( topEdge, leftEdge, IeBody );
					break;

				case "left":
					var topEdge = PosArr[ 1 ] + DM.Links[ arrName ][ nLinks ][ 6 ][ 1 ];
					var leftEdge = PosArr[ 0 ] - DM.Menu.offsetWidth + DM.Links[ arrName ][ nLinks ][ 6 ][ 0 ];
					MenuPos = DM.keepInWin( topEdge, leftEdge, IeBody );
					break;

				default:
					alert( "SWITCH/CASE ERROR: menuPosition \"" + menuPosition + "\" is invalid. It must be set to \"relative\", \"above\", \"right\", \"below\" or \"left\"." );

			}
			DM.Menu.style.top = MenuPos[ 0 ] + "px";
			DM.Menu.style.left = MenuPos[ 1 ] + "px";
			DM.Menu.style.visibility = "visible";

		}
	}

	//------------------------------------- METHOD DM -------------------------------------

	function setElemVis( arrName, vis ) {
		if( winIE && DM.settings.formElements ) {
			for( member in DM.settings.formElements ) {
				if( vis == "visible" || arrName == DM.settings.formElements[ member ][ 0 ] ) {
					if( document.getElementById( DM.settings.formElements[ member ][ 1 ] ) )
						document.getElementById( DM.settings.formElements[ member ][ 1 ] ).style.visibility = vis;
				}
			}
		}
	}

	//------------------------------------- METHOD DM -------------------------------------

	function resetTimer() {
		clearTimeout( DM.timer );
		DM.timer = 0;
	}
}

////////////////////////////////// END DYNAMIC MENU //////////////////////////////////


function loadPage( page, PullDown ) {
	if( page.substring( 0, 3 ) == "db=" ) {
		openWin( "ss.html?" + page, "0", "0", "1", "0", 1.0, 1 );
		linkToPopUp();
	}
	else document.location.href = page;
	if( PullDown && page == "db=ss-data-main.js" ) PullDown.selectedIndex = 0;
}

//--------------------------------------------------------------------------------------

function getValueFromKey( key, strToSearch, eqDelim, fieldDelim ) {

	var value = null;
	var lookUpPattern = key + eqDelim;

	// If lookUpPattern is found
	if( strToSearch.indexOf( lookUpPattern ) != -1 ) {

		// if string has more than 1 key/value pair
		if( strToSearch.indexOf( fieldDelim ) != -1 ) {
			var searchArr = strToSearch.split( fieldDelim );
			for( var i = 0; i < searchArr.length; i++ ) {
				if( searchArr[ i ].indexOf( lookUpPattern ) == 0 ) {
					value = searchArr[ i ].split( eqDelim )[1];
					break;
				}
			}
		}
		else // There is only one key/value pair in strToSearch
			value = strToSearch.split( eqDelim )[1];
	}
	if( typeof value == "undefined" ) value = null; //N6 problem
	return value;
}

//---------------------------------------------------------------------------------------
function borderIm( Img, on ) {
	if( Img.complete ) Img.style.borderColor = ( on ) ? "rgb(0,0,255)" : "rgb(0,0,0)";
}

//--------------------------------------------------------------------------------------

function getErrLink() {

	var eURL = ( NC7 ) ? "http://www.creativetouchphoto.com/other/error.html?recipient»" + CI.DavidEmail + "¦subject»Buzick Web Site Problem¦referrer»" + document.location.href + "¦top»" + parent.document.location.href + "¦compName»MauiAlohaCondos.com" : "http://www.creativetouchphoto.com/other/error.html?" + escape( "recipient»" + CI.DavidEmail + "¦subject»Buzick Web Site Problem¦referrer»" + document.location.href + "¦top»" + parent.document.location.href + "¦compName»MauiAlohaCondos.com" );

	return "<A HREF='javascript:openWin(\"" + eURL + "\", \"0\", \"0\", \"1\", \"0\", 0.70, 0 );' onMouseOver=' if( window.DM ) DM.killOthers( this ); self.status=\"Report a technical problem to the Web Master\"; return true;' onMouseOut=' self.status=\"\"; return true;' TITLE='Report a technical problem to the Web Master'><SPAN CLASS='smLinkUnd'>Report a Problem</SPAN></A>";
}

//--------------------------------------------------------------------------------------
function writeShortCuts( thisPage, condo ) {

	var html = "" +

	"<FORM NAME='jump' CLASS='jumpForm'>" +
		"<SELECT NAME='page' onMouseover='self.status=\"Goes to other pages in this site...\"' onMouseout='self.status=\"\"' TITLE='Goes to other pages in this site...' onChange='if( this.selectedIndex > 0 && this[this.selectedIndex].value != \"stop\" ) { loadPage( this[this.selectedIndex].value, this ); } else this.selectedIndex = 0;' CLASS='pullDown'>" +

			"<OPTION>Jump To...";
			if( condo == "br" ) { // Branson Links
				html += "<OPTION VALUE='db=ss-data-br.js'>Slide-Show";
				if( thisPage != "thumbnails.html" ) html += "<OPTION VALUE='thumbnails.html?db=ss-data-br.js'>Thumbnails";
				if( thisPage != "br_about.html" ) html += "<OPTION VALUE='br_about.html'>About our Home";
				//if( thisPage != "br_maps.html" ) html += "<OPTION VALUE='br_maps.html'>Street Map";
				if( thisPage != "br_inquire.html" ) html += "<OPTION VALUE='br_inquire.html'>Contact Us";
				html += "<OPTION VALUE='br_home.html'>Home";
				html += "<OPTION VALUE='stop'>————————";
				html += "<OPTION VALUE='kr_home.html'>Kaanapali Royal";
			}
			else { // Kaanapali Royal Links
				html += "<OPTION VALUE='db=ss-data-kr.js'>Slide-Show";
				if( thisPage != "thumbnails.html" ) html += "<OPTION VALUE='thumbnails.html?db=ss-data-kr.js'>Thumbnails";
				if( thisPage != "kr_about.html" ) html += "<OPTION VALUE='kr_about.html'>About our Condo";
				if( thisPage != "kr_maps.html" ) html += "<OPTION VALUE='kr_maps.html'>Street Map";
				if( thisPage != "kr_inquire.html" ) html += "<OPTION VALUE='kr_inquire.html'>Contact Us";
				html += "<OPTION VALUE='kr_home.html'>Home";
				html += "<OPTION VALUE='stop'>————————";
				html += "<OPTION VALUE='br_home.html'>Golf Course Home";
			}

		html += "</SELECT>" +

	"</FORM>";

	document.write( html );
	document.jump.page.selectedIndex = 0;
}
//--------------------------------------------------------------------------------------

function writeLinkToKR() {
	document.write( "<DIV ALIGN=center STYLE='margin-top:4px;'><A HREF='kr_home.html' onMouseover='if( cb ) { if( window.DM ) DM.start( this, event, \"kr\", \"above\" ); }' onMouseout='if( cb ) { if( window.DM ) DM.hide(); }' CLASS='fSize10'>Go to Kaanapali Royal<BR>Maui, Hawaii</A></DIV>" );
}

function writeLinkToBR() {
	document.write( "<DIV ALIGN=center STYLE='margin-top:4px;'><A HREF='br_home.html' onMouseover='if( cb ) { if( window.DM ) DM.start( this, event, \"rk\", \"above\" ); }' onMouseout='if( cb ) { if( window.DM ) DM.hide(); }' CLASS='fSize10'>Go to Golf Course Home<BR>Branson, Missouri</A></DIV>" );
}