// Web software by DavidRegier.com: Unauthorized use of this code is prohibited


PRICES = new Array();
PRICES.Capri = new Array();
PRICES.ClassicDgMf = new Array();
PRICES.Classic35 = new Array();
PRICES.Premiere = new Array();
PRICES.PWHP = new Array();

PRICES.Capri[ "A" ] = "$2,050";
PRICES.Capri[ "B" ] = "$2,450";
PRICES.Capri[ "C" ] = "$2,850";
PRICES.Capri[ "D" ] = "$3,450";
PRICES.Capri[ "E" ] = "$3,850";
PRICES.Capri[ "F" ] = "$4,250";
PRICES.Capri[ "G" ] = "$4,650";

PRICES.ClassicDgMf[ "1" ] = "$675";
PRICES.ClassicDgMf[ "2" ] = "$875";
PRICES.ClassicDgMf[ "3" ] = "$1,125";
PRICES.ClassicDgMf[ "4" ] = "$1,475";

PRICES.Classic35[ "5" ] = "$500";
PRICES.Classic35[ "6" ] = "$650";
PRICES.Classic35[ "7" ] = "$800";
PRICES.Classic35[ "8" ] = "$1100";

PRICES.Premiere[ "ALaCarte" ] = "$2,000 Minimum";
PRICES.Premiere[ "Hourly" ] = "$250/hour";
PRICES.Premiere[ "Prints" ] = "$550/hour";

PRICES.PWHP[ "photoCD" ] = "$75";
PRICES.PWHP[ "photoCDContactPages" ] = "$5 per page";
PRICES.PWHP[ "host1-125" ] = "$150";
PRICES.PWHP[ "host126-175" ] = "$200";
PRICES.PWHP[ "host176-225" ] = "$250";
PRICES.PWHP[ "host226-300" ] = "$300";
PRICES.PWHP[ "host301-400" ] = "$375";
PRICES.PWHP[ "host401-500" ] = "$450";
PRICES.PWHP[ "hostAdditionalPhotos" ] = "60¢ per image";


///////////////////////////// CONTACT DATA-BASE /////////////////////////////

function contactInfo() {

	this.MAILING_ADD = "PO Box 1913";
	this.CITY_ST_ZIP = "Kihei, Maui, HI 96753";
	this.TEL_TOLL_FREE = "(800) 878-1583 Toll Free";
	this.TEL_TOLL_FREE1 = "800.878.1583";
	this.TEL_DIRECT = "(808) 875-8461 On Maui";
	this.FAX = "??? Fax";
	this.E_MAIL = "jillian@mauiphoto.com";
	this.BULLET = "&nbsp;&nbsp;&#149;&nbsp;&nbsp;";
}

CI = new contactInfo();

REPORT_ERRORS_TO = "david" +
"@" + "DavidRegier." +
"com";

///////////////////////////// JILLIAN SOFTWARE /////////////////////////////

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;

var IE = false;
var NC = 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] );
	IE = true;
}
else if( theAppVersion.indexOf( "Safari" ) >= 0 )
	SF = true;
else if( bName == "Netscape" ) {
	// 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;
	}
	NC = true;
}
var winOS = ( os.substring( 0, 3 ) == "Win" );
var winIE = ( winOS && IE );
var macOS = ( os.substring( 0, 3 ) == "Mac" );
var macIE = ( macOS && IE );
var ieTrans = ( IE && winOS );
var ncTrans = ( NC );

//macIE = true;

var theHost = document.location.hostname.toLowerCase();
var local = ( theHost.length == 0 || theHost == "127.0.0.1" || theHost == "localhost" );
var live = !local;


cookieDomain = null;
if( live && theHost ) {
	var Host = theHost.split( "." ), hLen = Host.length;
	if( hLen >= 2 )
		cookieDomain = "." + Host[ hLen - 2 ] + "." + Host[ hLen - 1 ];
}
//---------------------------------------------------------------------------------------
function borderIm( Img, color ) { if( Img.complete ) Img.style.borderColor = color; }
//--------------------------------------------------------------------------------------

function replaceLiteral( target, replacement ) {
	return this.split( target ).join( replacement );
}
String.prototype.replaceLiteral = replaceLiteral;

//--------------------------------------------------------------------------------------

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;

//----------------------------------- String Prototype -----------------------------------
// If key is found in strToSearch then returns its value, otherwise returns null
function getVal( key, eqDelim, fieldDelim ) {

	if( !eqDelim ) eqDelim = "=";
	if( !fieldDelim ) fieldDelim = "&";

	var value = null;
	var strToSearch = this.toString();

	var KeyVals = strToSearch.split( fieldDelim );

	for( member in KeyVals ) {
		var ThisPair = KeyVals[ member ].split( eqDelim );
		if( key == ThisPair[ 0 ] ) { value = ThisPair[ 1 ]; break; }
	}
	if( typeof value == "undefined" ) value = "";
	return value;
}
String.prototype.getVal = getVal;
//----------------------------------------------------------------------------------------
function getCleanText( input ) {
	var output = input.replaceLiteral( '^', '"' );
	return output;
}

//----------------------------------------------------------------------------------------
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
//---------------------------------------------------------------------------------------

function actImage( imgName ) { document[imgName].src = eval( imgName + "On.src" ); }
function deActImage( imgName ) { document[imgName].src = eval( imgName + "Off.src" ); }

//---------------------------------------------------------------------------------------
	var dText = new Array(
"&nbsp;", // 0
"Goes back to our Home Page...", // 1
"See photos with testimonials & learn more about us", // 2
"Submit an inquiry & we'll get right back to you", // 3
"We're a full service photography company specializing in weddings...", // 4
"You'll love our Slide-Show - sit back, relax, pick a song & enjoy...", // 5
"Our Slide-Show photos on a traditional \"click-to-enlarge\" page", // 6
"View More Photos: Real-Life weddings & Photo Journalistic images", // 7
"Shortcut right back to the last page you were on...", // 8
"Get Wedding Packages & Pricing Information...",
"Send us an e-mail and we'll get right back to you", // 10
"Check out our Contemporary Digital Coffee Table Books", // 11
"", // 12
"", // 13
"Rendering data as HTML...", // 14
"Place Holder"
	);

//--------------------------------------------------------------------------------------
function actLink( link ) {
	link.style.color = 'rgb(255,0,0)'; link.style.textDecoration = 'underline';
}
function deactLink( link ) {
	link.style.color = 'rgb(188,22,24)'; link.style.textDecoration = 'none';
}
//----------------------------------------------------------------------------------------
function getCallout() {

	var calloutType = '';
	var fontSize = 10;

	calloutType = '<DIV ID="callout" CLASS="theCallout">' + dText[ 0 ] + '</DIV>';

	return calloutType;
}
//--------------------------------------------------------------------------------------
var timeout = 0;

function activateMsg( index ) {
 	clearTimeout(timeout);
	document.getElementById( 'callout' ).innerHTML = dText[ index ];
}

//--------------------------------------------------------------------------------------

function deActivateMsg() {
	timeout = setTimeout('document.getElementById( "callout" ).innerHTML = dText[ 0 ]', 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';
	}
}

//--------------------------------------------------------------------------------------

var mmmWin = null;

function openWin( theSite, tool, loc, status, menu, winSize ) {

	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 ) {
		wid = ( IE ) ? document.body.clientWidth : screen.availWidth - 10;
		hgt = ( IE ) ? document.body.clientHeight : screen.availHeight - 50;
	}

	mmmWin = window.open("","mmm_window","toolbar="+tool+",location="+loc+",directories=0,status="+status+",menubar="+menu+",scrollbars=1,resizable=1,width="+wid+",height="+hgt+",top="+screen.availTop+",left="+screen.availLeft+"");

	mmmWin.location.href = theSite;
	focusWin();

}

function closeWin() {
	if( mmmWin != null && mmmWin.closed == false ) {
		mmmWin.close();
		mmmWin = null;
	}
}
function focusWin() {
	if( mmmWin != null && typeof mmmWin.registered == 'boolean' ) mmmWin.focus();
	else setTimeout( "focusWin()", 500 );
}

function linkToPopUp() {
	if( eval( "typeof mmmWin.registered" ) == "boolean" ) mmmWin.myOpener = self;
	else setTimeout( "linkToPopUp()", 250 );
}
//--------------------------------------------------------------------------------------

var popUpMsg = true;
var popUpMsgTimer = 0;

function setPopUpMsg( on ) {
	if( on ) {
		if( popUpMsg ) { self.status = "Slide-show not working? Then disable your pop-up/ad blocker software..."; popUpMsg = false; }
		else { self.status = " "; popUpMsg = true; 	}
	}
	else { clearTimeout( popUpMsgTimer ); popUpMsgTimer = 0; self.status = " "; }
}
//--------------------------------------------------------------------------------------

function launchSS( dataFile ) {
	openWin( "ss.html?db=" + dataFile, "0", "0", "1", "0", 1.0 );
	linkToPopUp();
	if( !popUpMsgTimer ) popUpMsgTimer = setInterval( "setPopUpMsg( 1 )", 1500 );
}
//---------------------------------------------------------------------------------------

function getHawaiiTime() {

	var gmtOffset = 10; // for Hawaii
	var now = new Date();
	var difhrs = now.getTimezoneOffset()/60;
	var lochrs = now.getHours();
	GMThours = (difhrs < 0) ? lochrs - difhrs : lochrs + difhrs;
	now.setHours( GMThours - gmtOffset );

	var hiTime = getFormatedTime( now.getHours(), now.getMinutes(), now.getSeconds() );

	return hiTime;
}
//--------------------------------------------------------------------------------------

function getFormatedTime( hours, minutes, seconds ) {

	var am_pm = "AM";

	if( hours >= 12 ) am_pm = "PM";
	if( hours >= 13 ) hours -= 12;
	if( hours == 0 ) hours = "12";

	if( minutes < 10 ) minutes = "0" + minutes;

	if( seconds != '' ) {
		if( seconds < 10 ) seconds = "0" + seconds;
		seconds = ':' + seconds;
	}

	var strTime = hours + ':' + minutes + seconds + ' ' + am_pm;

	return strTime;

}
//---------------------------------------------------------------------------------------

function statusBar() {

	var c = new contactInfo();
	var hiTime = getHawaiiTime();
	self.status = c.TEL_TOLL_FREE + "   " + c.TEL_DIRECT + "   " + hiTime + " Hawaii Time";
}

//---------------------------------------------------------------------------------------
function section( sectionNum, command ) {

	sectionNum = getObject( sectionNum );
	if ( command == "on" ) sectionNum.className = "on";
	else sectionNum.className = "off";
}
//--------------------------------------------------------------------------------------
function randompick() {
  return randompick.arguments[ Math.floor( Math.random()*randompick.arguments.length ) ];
}
//--------------------------------------------------------------------------------------

function getTransition( transNum, duration ) {

	var trans = "";
	if( ieTrans ) {
		var d = duration;

		if( exactVer >= 5.5 ) {

			var thisTrans = ( transNum == 0 ) ? Math.floor( Math.random() * 17 ) + 1 : transNum;

			switch ( thisTrans ) {
				case 1: trans="Fade(duration="+d+",overlap=1)"; break;
				case 2: trans="Blinds(duration="+d+",bands="+randompick(2,4,6,8)+",direction="+randompick('up','down','right','left')+")"; break;
				case 3: trans="CheckerBoard(duration="+d+",squaresX="+randompick(2,4,8,12)+",squaresY="+randompick(2,4,8,12)+",direction="+randompick('up','down','right','left')+")"; break;
				case 4: trans="Barn(duration="+d+",motion="+randompick('in','out')+",orientation=",randompick('horizontal','vertical')+")"; break;
				case 5: 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 6: trans="Inset(duration="+d+")"; break;
				case 7: trans="Iris(duration="+d+",irisStyle="+randompick('DIAMOND','CIRCLE','CROSS','PLUS','SQUARE','STAR')+",motion="+randompick('in','out')+")"; break;
				case 8: trans="RadialWipe(duration="+d+",wipeStyle="+randompick('CLOCK','WEDGE','RADIAL')+")"; break;
				case 9: trans="RandomBars(duration="+d+",orientation="+randompick('horizontal','vertical')+")"; break;
				case 10: trans="RandomBars(duration="+d+")"; break;
				case 11: trans="Slide(duration="+d+",pushStyle="+randompick('HIDE','PUSH','SWAP')+",bands="+randompick(1,2,3,4,5,6,7)+")"; break;
				case 12: trans="Spiral(duration="+d+",gridSizeX="+randompick(8,16,32,64)+",gridSizeY="+randompick(8,16,32,64)+")"; break;
				case 13: trans="Stretch(duration="+d+",stretchStyle="+randompick('HIDE','PUSH','SPIN')+")"; break;
				case 14: trans="Strips(duration="+d+",motion="+randompick('leftdown','leftup','rightdown','rightup')+")"; break;
				case 15: trans="Wheel(duration="+d+",spokes="+randompick(2,4,10,16,20)+")"; break;
				case 16: trans="Zigzag(duration="+d+",gridSizeX="+randompick(8,16,32,64)+",gridSizeY="+randompick(8,16,32,64)+")"; break;
				case 17: trans="RandomDissolve(duration="+d+")"; break;
        //case 18: 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 1: trans="blendTrans(duration="+d+")"; break;
				default: trans="revealTrans(duration="+d+",transition=" + Math.floor(Math.random()*23) + ")";
			}
		}
	}
	return trans;
}


function showImg( imgInfo ) {
	openWin( "image_viewer.html?" + escape( imgInfo ), 0, 0, 1, 0, 1, 1 );
	linkToPopUp();
}
//--------------------------------------------------------------------------------------

function getObject( strObjName ) { return document.getElementById( strObjName ); }

//---------------------------------------------------------------------------------------

function recordData( key, value ) {

	var cookName = "mmmpCookie";

	// In unlikely event user input special delimiter characters remove them
	if( eval( "typeof key" ) == "string" ) {
		key = key.replaceLiteral( "&", "and" );
		key = key.replaceLiteral( "=", "is" );
	}
	if( eval( "typeof value" ) == "string" ) {
		value = value.replaceLiteral( "&", "and" );
		value = value.replaceLiteral( "=", "is" );
	}

	var newCookie = "";
	var oldCookie = GetCookie( cookName );

	var target = key + "=";
	var newKeyValPair = target + value;

	if( oldCookie != null ) {

		var startPos = oldCookie.indexOf( target );
		var endPos = oldCookie.indexOf( "&", startPos );

		// If there is only one key/value pair in cookie
		if( endPos == -1 ) endPos = oldCookie.length;

		// key already exists; so update it with this new value
		if( startPos != -1 ) {

			var slice1 = oldCookie.substring( 0, startPos );
			var slice2 = oldCookie.substring( endPos, oldCookie.length );
			newCookie = slice1 + newKeyValPair + slice2;

		}
		else // Key does not exist in existing cookie so append this new key/value pair
			newCookie += oldCookie + "&" + newKeyValPair;

		SetCookie( cookName, newCookie, expdate, "/", cookieDomain );
	}
	else // No existing cookie so make one
		SetCookie( cookName, newKeyValPair, expdate, "/", cookieDomain );

}
//--------------------------------------------------------------------------------------
pricePrivileges = false;
if( window.myPar ) {
	var qStr = unescape( parent.getQueryStr( "self" ) );
	if( qStr == "page=prices.html" ) {
		recordData( "pricePrivileges", "true" );
		pricePrivileges = true;
	}
}
var mmmpCookie = GetCookie( "mmmpCookie" );
if( mmmpCookie ) {
	var pricePrivilegesStr = mmmpCookie.getVal( "pricePrivileges" );
	if( pricePrivilegesStr == "true" ) pricePrivileges = true;
	SetCookie( "mmmpCookie", mmmpCookie, expdate, "/" );
}
//--------------------------------------------------------------------------------------

function loadPage( PullDown ) {
	if( myPar ) {
		var pdVal = PullDown[ PullDown.selectedIndex ].value;
		if( pdVal.substring( 0, 3 ) == "db=" ) {
			openWin( "ss.html?" + pdVal, "0", "0", "1", "0", 1.0 );
			linkToPopUp();
		}
		else document.location.href = pdVal;
		if( PullDown && pdVal.substring( 0, 3 ) == "db=" ) PullDown.selectedIndex = 0;
	}
}
//--------------------------------------------------------------------------------------
function getShortCuts() {

	var html = "" +
		"<FORM NAME='jump' STYLE='margin:0px 0px 0px 0px;'>" +
		"<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) loadPage( this );' CLASS='pullDown'>" +
			"<OPTION>Jump To..." +
			"<OPTION VALUE='homepage.html'>Home" +
			"<OPTION VALUE='sample.html'>Gallery" +
			"<OPTION VALUE='db=ss-data-main.js''>Slide-Show" +
			"<OPTION VALUE='thumbnails.html?db=ss-data-main.js'>Thumbnails" +
			"<OPTION VALUE='weddings.html'>Weddings" +
			"<OPTION VALUE='albums.html'>Books" +
			"<OPTION VALUE='prices.html'>Packages" +
			"<OPTION VALUE='reply.html'>Contact Us" +
		"</SELECT>" +
	"</FORM>";

	return html;

}
function resetShortCuts() { document.jump.page.selectedIndex = 0; }
//--------------------------------------------------------------------------------------
var ImgReal = null;
function checkDim( imgNameToCk, imgWidToCk, imgHgtToCk ) {

	if( ImgReal == null ) {
		ImgReal = new Image();
		ImgReal.src = eval( "document.images." + imgNameToCk + ".src;" );
	}
	if( ImgReal.complete ) {
		var realWid = ImgReal.width;
		var realHgt = ImgReal.height;
		if( realWid > 1 && realHgt > 1 ) {
			if( imgWidToCk != realWid || imgHgtToCk != realHgt )
				alert( ImgReal.src + " has incorrect dimensions set:\n\n1) " + imgWidToCk + "x" + imgHgtToCk + " are the errant values\n2) " + realWid + "x" + realHgt + " are the true values" );
		}
		ImgReal = null;
	}
	else {
		this.imgNameToCk = imgNameToCk;
		this.imgWidToCk = imgWidToCk;
		this.imgHgtToCk = imgHgtToCk;
		setTimeout( "checkDim( imgNameToCk, imgWidToCk, imgHgtToCk );", 500 );
	}
}
//////////////////////////////// START IMAGE VIEWER: IV ////////////////////////////////

/*
ACCESSOR CLS: off, on, ivLgImgMargin, ivLgImgTitle
ACCESSOR FUN: checkDim, getTransition, randompick, replaceLiteral
ACCESSOR VAR: macIE, IE, ieTrans, ncTrans
*/

//--------------------------------- OBJECT CONSTRUCTOR ---------------------------------

function ImageViewer() {

	this.transNum = 1;
	this.transDur = 0.8;

	this.Link = null;
	this.setSectVis = setSectVis;
	this.hideOtherPhotos = hideOtherPhotos;
	this.show = show;
	this.hideLgImg = hideLgImg;
	this.startFilter = startFilter;
	this.setImgTitle = setImgTitle;
	this.Photo = null;
	this.opacity = 0;
	this.opacityTimer = 0;
	this.scrollFromTop = 0;
	this.scrollFromLeft = 0;
	this.lgPhotoShowing = false;

	//-------------------------------------- METHOD --------------------------------------
	// Reads the body style even if value was not set thru script: Doesn't work on Safari

	/*function getBodyStyle( domStyle, cssStyle) {
		var Elem = document.getElementsByTagName( "body" )[ 0 ];
		if( Elem.currentStyle ) return Elem.currentStyle[ domStyle ];
		else { // Doesn't work on Safari
			var compStyle = document.defaultView.getComputedStyle( Elem, "" );
			return compStyle.getPropertyValue( cssStyle );
		}
	}*/
	//-------------------------------------- METHOD --------------------------------------
	// 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 --------------------------------------
	// 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 --------------------------------------
	// [ '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" );

			switch( ImgInfoArr[ 5 ] ) {
				case "w": ImgInfoArr[ 5 ] = "255,255,255"; break;
				case "b": ImgInfoArr[ 5 ] = "0,0,0"; break;
			}

			var imgFilter = "";

			if( ieTrans ) imgFilter = "visibility:hidden; filter:" + getTransition( this.transNum,this.transDur );
			else if( ncTrans ) imgFilter = "-moz-opacity:0";

			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 + ";'" : " ";
						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; " + imgFilter + ";' onAbort='this.src=this.src;' onLoad='checkDim( \"" + sectName + "IV\", " + ImgInfoArr[ 2 ] + ", " + ImgInfoArr[ 3 ] + " ); if( ieTrans || ncTrans ) IV.startFilter( this ); IV.setImgTitle( \"" + ImgInfoArr[ 4 ] + "\" );'></A>" +
						"</TD>" +
					"</TR>" +
					"<TR>" +
						"<TD ALIGN='center'>" +
							"<DIV ID='imgTitleIV' CLASS='ivLgImgTitle'>Loading image, please wait...</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' ID='botFocalPt'>Back</A>" +
						"</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";
			var FocuserBot = document.getElementById( "botFocalPt" ); FocuserBot.focus();
			var FocuserTop = document.getElementById( "topFocalPt" ); FocuserTop.focus();
			return false;
		}
		else { // Old Browsers
			document.location.href = ImgInfoArr[ 0 ] + ImgInfoArr[ 1 ];
			return false;
		}
	}

	//-------------------------------------- METHOD --------------------------------------
	// 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 --------------------------------------
	function startFilter( Photo ) {
		if( ieTrans ) {
			eval( "" +
				"try {" +
					"Photo.filters(0).apply();" +
					"Photo.style.visibility = 'visible';" +
					"Photo.filters(0).play();" +
				"}" +
				"catch( e ) { Photo.style.visibility = 'visible'; }" +
			"" );
		}
		else {

			Photo.onload = function() { /*cancel photo onload function*/ }
			Photo.style.MozOpacity = this.opacity;
			this.opacity += .05;

			if( IV.opacity < 1 ) {
				this.Photo = Photo;
				IV.opacityTimer = setTimeout( "IV.startFilter( IV.Photo )", 40 );
			}
			else {
				Photo.style.MozOpacity = 0.9999; // 1.0 causes flicker
				clearTimeout( IV.opacityTimer );
				IV.opacity = 0;

			}
		}
	}
	//-------------------------------------- METHOD --------------------------------------

	function setImgTitle( imgTitle ) {
		var ImgTitle = document.getElementById( "imgTitleIV" );
		imgTitle = imgTitle.replaceLiteral( '^^', "'" );
		imgTitle = imgTitle.replaceLiteral( '^', '"' );
		ImgTitle.innerHTML = imgTitle + "<DIV STYLE='line-height:4px;'> &nbsp;</DIV>";

	}
}
var IV = new ImageViewer();
////////////////////////////////// END IMAGE VIEWER: IV //////////////////////////////////

//--------------------------------------------------------------------------------------

function reportErr( sub, msg, msgType ) {

	function eMail() {
		document.location.href = "mailto:" + REPORT_ERRORS_TO + "?subject=" + escape( sub ) + "&body=" + escape( msg + ' \n\nDIAGNOSTICS: This info may be used to help us troubleshoot technical problems' +diagnostics );
	}

	var Now = new Date();

	var diagnostics = " \nURL: " + document.location.href;

	try{ var topURL = top.document.location.href; }
	catch( e ){ var topURL = "Exception thrown while reading top URL"; }

	diagnostics += " \nTop URL: " + topURL;

	diagnostics += " \nTime: " + Now.toLocaleString() + " (client's time)";

	diagnostics += " \nGMT Offset: " + Now.getTimezoneOffset() / 60 + " hours";

	diagnostics += " \nMonitor: " + screen.width + "x" + screen.height + "x" + screen.colorDepth;

	diagnostics += " \nJava Enabled: " + navigator.javaEnabled();

	for( i in navigator ) diagnostics += " \n" + i + ": " + navigator[ i ];

	switch( msgType ) {

		case 0:
			eMail();
			break;

		case 1:
			if( confirm ( sub + "\n\n" + msg + "\n\nHelp us improve our site, click OK to report this problem to our Web Site Administrator..." ) )
				eMail();
			break;

		case 2:
			if( confirm ( "Help us improve our site: Report a technical web-site problem to the Web Master.\n\nNOTE: Your e-mail will be delivered to the Web Master. If you are trying to contact the web-site owner or staff, click Cancel and use the e-mail link and/or contact form found on our web site." ) )
				eMail();
			break

	}
}
//--------------------------------------------------------------------------------------

function getErrLink() {

	return "<A HREF='javascript:reportErr( \"Making Maui Memories; Web Site Problem\", \"PLEASE DESCRIBE THE PROBLEM YOU EXPERIENCED: \", 2 )' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' onContextMenu='if( confirm ( \"Delete mmmpCookie?\" ) ) { DeleteCookie( \"mmmpCookie\", \"/\" ); document.location.reload( true ); } return false;' TITLE='Report a technical problem to the WebMaster' style='font-size:8pt;'>Report a Problem</a>";

}
//--------------------------------------------------------------------------------------
function mailTo() {

	var CI = new contactInfo();
	var subject = prompt( "For our reference, \"Groom/Bride\" Last Names and Wedding Date is:\nAnswer like this example: Smith/Jones 2-2-01", "" );

	if( subject ) {
		subject = subject.split(" ").join("_") + "_Wedding";
		document.location.href = "mailto:" + CI.E_MAIL + "?subject=" + subject;
	}
	else document.location.href = "mailto:" + CI.E_MAIL + "";
}

//--------------------------------- OBJECT CONSTRUCTOR ---------------------------------
// ACCESOR FUNCTIONS: getObject
// ACCESSOR CLASSES: offP, onP
function PrinterFriendly() {

	this.dText = [
		"Printer-Friendly", // 0
		"Reformat Page Back To Default Web-Layout", // 1
		"Compacts page and maximizes it for your printer..", // 2
		"Reformat page back to default \"web\" layout..." // 3
	];

	this.getElemArr = getElemArr;
	this.setView = setView;
	this.printPage = printPage;

	//-------------------------------------- METHOD --------------------------------------
	// Scans page and returns array of elements (as objects) that start with elemNameStr
	function getElemArr( elemNameStr ) {

		var elemArr = new Array();

		var allElements = document.getElementsByTagName( "*" );

		var k = 0;

		for ( var i = 0; i < allElements.length; i++ ) {
			if( allElements[ i ].id.indexOf( elemNameStr ) == 0 ) {
				elemArr[ k ] = allElements[ i ];
				k++;
			}
		}

		return elemArr;
	}
	//-------------------------------------- METHOD --------------------------------------
	function setView( ThisPrnFrnLink, bkgImg, printPullDowns ) {

		var hide = ( ThisPrnFrnLink.innerHTML == this.dText[ 0 ] ) ? true : false;

		var prnFrnLinksArr = getElemArr( "printer_friendly" );

		for( member in prnFrnLinksArr ) {
			if( hide ) {
				prnFrnLinksArr[ member ].innerHTML = this.dText[ 1 ];
				prnFrnLinksArr[ member ].title = this.dText[ 3 ];
			}
			else {
				prnFrnLinksArr[ member ].innerHTML = this.dText[ 0 ];
				prnFrnLinksArr[ member ].title = this.dText[ 2 ];
			}
		}

		var divArr = getElemArr( "PRN_" );

		// Show or Hide all elements starting with "PRN_"
		for( member in divArr ) {
			if( hide ) divArr[ member ].className = "offP";
			else divArr[ member ].className = "onP";
		}

		if( hide ) {
			if( bkgImg ) document.body.style.backgroundImage = "url( none )";
		}
		else {
			if( bkgImg ) document.body.style.backgroundImage = "url( " + bkgImg + " )";
		}
		if( ThisPrnFrnLink.focus ) {
			ThisPrnFrnLink.focus();
			ThisPrnFrnLink.blur();
		}
	}
	//-------------------------------------- METHOD --------------------------------------
	function printPage( TheLink ) {
		if( window.print && TheLink.innerHTML == this.dText[ 1 ] ) {
			document.title += "; " + CI.TEL_TOLL_FREE + " & " + CI.TEL_DIRECT;
			self.print();
		}
	}
}

//---------------------------------------------------------------------------------------
//--------------------------------- DATA-BASE CODE --------------------------------------
//---------------------------------------------------------------------------------------

function getDataFile() {
	var dataFile = 'null';
	if( myPar ) {
		var queryString = parent.getQueryStr( "visible_frame" );
		if( queryString != null ) dataFile = queryString.split( '=' )[ 1 ];
	}
	return dataFile;
}

//////////////////////////////// START DYNAMIC MENU ////////////////////////////////

/*
ACCESSOR VARIABLES: IE, NC, winIE, macIE, SF
ACCESSOR FUNCTIONS: None
*/

//--------------------------------- OBJECT CONSTRUCTOR ---------------------------------

function DynamicMenu( objName ) {

	var ssMsg = "View portfolio via our automated pop-up slide-show";
	var tnMsg = "View portfolio on a traditional click-to-enlarge page";

	// Begin User Settings
	this.Links = new Array();

	this.Links[ "portfolio" ] =
	[
		[ "Slide-Show", "javascript:launchSS( \\&#39;ss-data-main.js\\&#39; );", ssMsg ],
		[ "Thumbnails", "thumbnails.html?db=ss-data-main.js", tnMsg ],
		[  "",        8,     [5,8],   [0, -3], [0, 0], [0, 4], [0,0] ]
		// Title, fontSize, relative, above,   right,  below,  left: [xPos, yPos]
	];

	this.settings = new Array();
	this.settings[ "fontFace" ] = "arial,helvetica";
	this.settings[ "fgColorOff" ] = "153,153,153";
	this.settings[ "fgColorOn" ] = "255,255,255";
	this.settings[ "fgColorDisable" ] = "90,90,90";
	this.settings[ "bgColorOff" ] = "51,51,51";
	this.settings[ "bgColorOn" ] = "102,102,102";
	this.settings[ "borderColor" ] = "151,151,151";
	this.settings[ "fgTitleColor" ] = "255,255,255";
	this.settings[ "bgTitleColor" ] = "70,70,70";
	this.settings[ "formElements" ] = null;
	this.settings[ "delayToKill" ] = 1000;
	this.settings[ "showToolTip" ] = 1;

	// Do not edit past this line -------------------------

	this.Menu = null;
	this.OldLink = null;
	this.timer = 0;

	this.start = start;
	this.show = show;
	this.killOthers = killOthers;
	this.hide = hide;
	this.resetTimer = resetTimer;
	this.getPos = getPos;
	this.setElemVis = setElemVis;
	this.keepInWin = keepInWin;

	//-------------------------------------- METHOD --------------------------------------

	function start( Link, theEvent, arrName, menuPosition ) {
		killOthers( Link );
		show( Link, theEvent, arrName, menuPosition );
	}

	//-------------------------------------- METHOD --------------------------------------

	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 --------------------------------------
	// 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 --------------------------------------

	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 --------------------------------------

	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 thePage = document.location.href;
						var pageShowing = ( thePage.substring( thePage.length - DM.Links[ arrName ][ i ][ 1 ].length, thePage.length ) == DM.Links[ arrName ][ i ][ 1 ] && !document.location.hash );

						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";

						var onClickCode = ( pageShowing ) ? "self.status = \"You are already on the \\&#34;" + DM.Links[ arrName ][ i ][ 0 ]  + "\\&#34; page\"; return true;" : "document.location.href=\"" + DM.Links[ arrName ][ i ][ 1 ] + "\"";

						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.style.color=\"rgb( " + fgColOn + ")\"; style.cursor = \"" + cursorType + "\"; style.backgroundColor=\"rgb( " + bgCol + ")\"; return true;' onMouseOut='" + mouseOutCode + "this.firstChild.style.color=\"rgb( " + fgColOff + ")\"; style.backgroundColor=\"rgb( " + DM.settings[ 'bgColorOff' ] + ")\"; return true;' onClick='" + onClickCode + "'>" +

								"<DIV STYLE='font-size:" + fontSize + "pt; font-family:" + DM.settings.fontFace + "; color:rgb( " + ( ( pageShowing ) ? fgColOn : DM.settings[ 'fgColorOff' ] ) + "); margin:0px 3px 0px 3px;'>" + DM.Links[ arrName ][ i ][ 0 ]  + "</DIV>" +

							"</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 = 1000;
			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 --------------------------------------

	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 --------------------------------------

	function hide( delay ) {
		if( !arguments.length ) delay = DM.settings.delayToKill;
		if( DM.timer == 0 && DM.Menu ) {
			DM.timer = setTimeout( "" +
				"DM.Menu.innerHTML = '';" +
				"DM.Menu = null;" +
				"DM.timer = 0;" +
				"DM.setElemVis( '', 'visible' );",
				delay
			);
		}
	}

	//-------------------------------------- METHOD --------------------------------------

	function resetTimer() {
		clearTimeout( DM.timer );
		DM.timer = 0;
	}
}

DM = ( document.getElementById ) ? new DynamicMenu() : null;

////////////////////////////////// END DYNAMIC MENU //////////////////////////////////