
// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Copyright 2009 Jamie Burns
// This is NOT Open Source code.
// All rights reserved.

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

try {

	if (!$defined(console)) {

		var console = new Object();

		console.debug = function () { /* dummy/empty stub */ };

		console.log = function () { /* dummy/empty stub */ };

	}

} catch (error) { /* do nothing */ }

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy = {

	_DEBUG : false

};

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Gregorian Calendar Selector

// Accepts and returns a date formatted according to RFC 2822

// created: 22/07/2007

// updated: 04/09/2007

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var SNAZZY_DATE_SELECTOR_DEBUG = false;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Date_Selector = new Class (

	{

		_createTable : function () {

			if (SNAZZY_DATE_SELECTOR_DEBUG == true) {

				console.debug('Snazzy_Date_Selector::_createTable');

			}

			var table = new Element(

				"table",

				{ "class" : "snazzy-date-selector" }

			);

			var tableHead = new Element("thead").injectInside(table);

			// create month / year selections

			var selectionTableData = new Element(

				"td",

				{ "colspan" : "7" }

			).injectInside(

				new Element("tr").injectInside(tableHead)

			);

			// add months selector

			var monthSelector = new Element(

				"select",

				{ "class" : "month-selector" }

			).addEvent(

				"change",

				function (event) {

					event = new Event(event);

					event.preventDefault();

					this.selectMonth( event.target.options[ event.target.selectedIndex ].value );

				}.bind(this)

			).injectInside(selectionTableData);

			for (var i = 1; i <= 12; ++i) {

				new Element(

					"option",

					{ "value" : i }

				).injectInside(monthSelector).appendText( this.monthLabels[ ( i - 1 ) ] );

			}

			monthSelector.selectedIndex = this.selectedDate.month - 1;

			// add years selector

			var yearSelector = new Element(

				"select",

				{ "class" : "year-selector" }

			).addEvent(

				"change",

				function (event) {

					event = new Event(event);

					event.preventDefault();

					this.selectYear( event.target.options[ event.target.selectedIndex ].value );

				}.bind(this)

			).injectInside(selectionTableData);

			var lowerYear = ( ( new Date() ).getFullYear() - 10); // these need to become parameters and members (passing year range) !!!

			var upperYear = ( ( new Date() ).getFullYear() + 10); // these need to become parameters and members (passing year range) !!!

			for (var i = lowerYear; i < upperYear; ++i) {

				new Element(

					"option",

					{ "value" : i }

				).injectInside(yearSelector).appendText(i);

			}

			if (this.selectedDate.year >= lowerYear && this.selectedDate.year < upperYear) {

				yearSelector.selectedIndex = ( this.selectedDate.year - lowerYear );

			}

			// add day labels

			var tableRow = new Element("tr").injectInside(tableHead);

			for (var i = 1; i <= 7; ++i) {

				new Element(

					"span",

					{ "title" : this.dayTitles[ ( i - 1 ) ] }

				).injectInside(

					new Element(

						"th",

						{ "class" : ( "day-label day-label-" + i ) }

					).injectInside(tableRow)

				).appendText( this.dayLabels[ ( i - 1 ) ] )

			}

			this._table = table;

			this._table.injectBefore(this.input);

			this._tableHead = tableHead;

		},

		_selectDate : function (date) {

			this.selectedDate.day = date.getDate();

			this.selectedDate.month = date.getMonth() + 1;

			this.selectedDate.year = date.getFullYear();

			this.selectedDateObject = date; // used by external scripts

			var dateString = this.dateFormat;

			dateString = dateString.replace( "%d" , String( "00" + ( this.selectedDate.day ) ).slice( -2 ) );

			dateString = dateString.replace( "%m" , String( "00" + ( this.selectedDate.month ) ).slice( -2 ) );

			dateString = dateString.replace( "%y" , String( "00" + ( this.selectedDate.year ) ).slice( -2 ) );

			dateString = dateString.replace( "%Y" , String( "0000" + ( this.selectedDate.year ) ).slice( -4 ) );

			this.input.value = dateString;

			if (this.onChange) {

				this.onChange();

			}

			if (SNAZZY_DATE_SELECTOR_DEBUG == true) {

				console.log( "%s -> %s" , this.dateFormat , dateString );

			}

		},

		_updateDays : function () {

			if (!this._table) {

				this._createTable();

			} else this._tableBody.remove();

			this._tableBody = new Element("tbody").injectInside(this._table);

			// update the calendar view ...

			var days = this.monthDays[ ( this.selectedDate.month - 1 ) ];

			if (this.selectedDate.month == 2) {

				if ( this.selectedDate.year % 400 == 0 || ( this.selectedDate.year % 100 != 0 && this.selectedDate.year % 4 == 0 ) ) {

					++days; // leap year

				}

			}

			var firstDate = new Date( this.selectedDate.year , ( this.selectedDate.month - 1 ) , 1 );

			var firstDayPosition = firstDate.getDay() - 1;

			if (firstDayPosition < 0) {

				firstDayPosition += 7;

			}

			var lastDayPosition = firstDayPosition + days;

			var weeks = Math.ceil(lastDayPosition / 7) + 1;

			for (var week = 1; week < weeks; ++week) {

				var tableRow = new Element("tr").injectInside(this._tableBody);

				for (var day = 1; day <= 7; ++day) {

					var position = ( ( ( week - 1 ) * 7 ) + day );

					var tableData = new Element(

						"td",

						{ "class" : ( ( position > firstDayPosition && position <= lastDayPosition ) ? "day day-" + ( position - firstDayPosition ) : "" ) }

					).injectInside(tableRow);

					if ( position > firstDayPosition && position <= lastDayPosition ) {

						var anchor = new Element(

							"a",

							{ "href" : "javascript-required" }

						).appendText( ( position - firstDayPosition ) ).injectInside(tableData);

						anchor.addEvent(

							"click",

							function (event) {

								event = new Event(event);

								event.preventDefault();

								event.target.blur();

								this.selectDay( event.target.getText() );

							}.bind(this)

						);

					}

				}

			}

			this._table.getElements('td.day-' + ( this.selectedDate.day ) ).addClass('selected');

		},

		dateFormat : '%Y-%m-%d',

		dayLabels : [ 'M', 'T', 'W', 'T', 'F', 'S', 'S' ],

		dayTitles : [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ],

		initialize : function (date, dateFormat, input, options) {

			if (dateFormat) {

				this.dateFormat = dateFormat;

			}

			if (date) {

				var day = parseInt( date.substr( this.dateFormat.indexOf("%d") , 2 ) , 10 );

				var month = parseInt( date.substr( this.dateFormat.indexOf("%m") , 2 ) , 10 );

				if (this.dateFormat.indexOf("%y") != -1) {

					var year = parseInt( date.substr( this.dateFormat.indexOf("%y") , 2 ) , 10 );

					if (year >= 69) { // assume 19xx for 69 through 99

						year += 1900;

					} else year += 2000;

				} else {

					var year = parseInt( date.substr( this.dateFormat.indexOf("%Y") , 4 ) , 10 );

				}

				date = new Date();

				var lowerYear = ( ( new Date() ).getFullYear() - 10); // these need to become parameters and members (passing year range) !!!

				var upperYear = ( ( new Date() ).getFullYear() + 10); // these need to become parameters and members (passing year range) !!!

				if (year >= lowerYear && year < upperYear ) {

					date.setFullYear( year , ( month - 1 ) , day );

				}

			} else {

				date = new Date(); // use today's date

				if ( options && options.addDaysIfEmpty ) {

					date = new Date( date.getTime() + ( options.addDaysIfEmpty * 24 * 60 * 60 * 1000 ) );

				}

				if ( options && options.addWeeksIfEmpty ) {

					date = new Date( date.getTime() + ( options.addWeeksIfEmpty * 7 * 24 * 60 * 60 * 1000 ) );

				}

			}

			date.setHours(0, 0, 0, 0); // blank the time part

			this.input = input;

			this.input.setStyle( "display" , "none" );

			this._selectDate(date);

			this._updateDays();

		},

		input : null,

		monthLabels : [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],

		monthDays : [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],

		selectedDate : {

			day : null,

			month : null,

			year: null

		},

		selectDay : function (day) {

			this._table.getElements('td.selected').removeClass('selected');

			this._table.getElements('td.day-' + day).addClass('selected');

			this._selectDate( new Date( this.selectedDate.year, (this.selectedDate.month - 1), day ) );

		},

		selectMonth : function (month) {

			// adjust the day to be within the selected month

			var days = this.monthDays[ month - 1 ];

			if (month == 2) {

				if ( this.selectedDate.year % 400 == 0 || ( this.selectedDate.year % 100 != 0 && this.selectedDate.year % 4 == 0 ) ) {

					++days; // leap year

				}

			}

			if ( this.selectedDate.day > days ) {

				this.selectDay( days );

			}

			this._selectDate( new Date( this.selectedDate.year, (month - 1), this.selectedDate.day ) );

			this._updateDays();

		},

		selectYear : function (year) {

			// adjust the day to be within the selected month (this only happens when moving between common years and leap years)

			if (this.selectedDate.month == 2) {

				var days = this.monthDays[ this.selectedDate.month - 1 ];

				if ( year % 400 == 0 || ( year % 100 != 0 && year % 4 == 0 ) ) {

					++days; // leap year

				}

				if ( this.selectedDate.day > days ) {

					this.selectDay( days );

				}

			}

			this._selectDate( new Date( year, (this.selectedDate.month - 1), this.selectedDate.day ) );

			this._updateDays();

		},

		sunday : 7

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Date_Selector_Window = new Class ();

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Smooth Menu v1.00

// Copyright 2007 Jamie Burns

// Created: 30/03/2007

// Updated: 15/09/2007

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var snugBorders = true;

var zIndex = 1000;

var Smooth_Menu = new Class (

	{

		cancelHide : false,

		childrenShowing : false,

		hide : function () {

			if (--this.pendingHides > 0) {

				return this;

			}

			// console.log('Hide [%s] (cancelHide=%d, this.visible=%d)', this.id, this.cancelHide, this.visible);

			if (this.cancelHide == false && this.visible == true) {

				for (var i = this.menuChildren.length - 1; i >= 0; --i) {

					this.menuChildren[i].hide(); // can add a delay() here to make nicer phased fade in

				}

				this.setStyle('z-index', 1000);

				this.visible = false;

			}

			return this;

		},

		initialise : function (level, menuParent) {

			// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

			this.level = level;

			this.menuChildren = this.getChildren();

			this.menuParent = menuParent;

			// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

			if (this.level > 0) {

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				// here we move the list out of view temporarily to avoid flicker as we update (we put it back at the later in this method)

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				this.setStyle('left', '-1000px');

				this.setStyle('top', '-1000px');

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				// here we modify the borders of anchors, to remove the "double border"

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				if (snugBorders == true) {

					for (var i = 0; i < this.menuChildren.length; ++i) {

						var anchor = this.menuChildren[i].getElement('a');

						if (anchor) {

							if (i < this.menuChildren.length - 1) {

								var nextAnchor = this.menuChildren[i + 1].getElement('a');

								if (nextAnchor) {

									if (anchor.getStyle('border-bottom-width').toInt() > 0 && nextAnchor.getStyle('border-top-width').toInt() > 0) {

										anchor.setStyle('border-bottom-width', '0');

									}

								}

							}

						}

					}

				}

				var maxElementWidth = 100; // 100 is minimum width for a drop down menu

				var top = 0;

				for (var i = 0; i < this.menuChildren.length; ++i) {

					// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

					// here we modify the list item to be the correct size/position (IE6 makes a mess without this kind of thing)

					// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

					var height = this.menuChildren[i].getStyle('height').toInt();

					var width = this.menuChildren[i].getStyle('width').toInt();

					if (maxElementWidth < width) {

						maxElementWidth = width;

					}

					this.menuChildren[i].setStyle('height', height + 'px');

					this.menuChildren[i].setStyle('overflow', 'visible');

					this.menuChildren[i].setStyle('position', 'absolute');

					this.menuChildren[i].setStyle('top', top + 'px');

					this.menuChildren[i].setStyle('visibility', 'visible');

					this.menuChildren[i].setStyle('width', maxElementWidth + 'px');

					top += height;

				}

				for (var i = 0; i < this.menuChildren.length; ++i) {

					// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

					// here we modify the list item anchor to be the correct size/position

					// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

					var anchor = this.menuChildren[i].getElement('a');

					if (anchor) {

						var outerFrameWidth =

							anchor.getStyle('border-left-width').toInt() +

							anchor.getStyle('border-right-width').toInt() +

							anchor.getStyle('padding-left').toInt() +

							anchor.getStyle('padding-right').toInt();

						anchor.setStyle('display', 'block');

						anchor.setStyle('opacity', 0);

						anchor.setStyle('position', 'absolute');

						anchor.setStyle('width', (maxElementWidth - outerFrameWidth) + 'px');

					}

					// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				}

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				// here we modify the list to be the correct size/position

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				this.setStyle('height', top + 'px'); // needed for opera!

				if (this.level >= 2) {

					// shift this menu to the right hand side of parent

					if (snugBorders == true && this.menuChildren.length > 0 && this.menuChildren[0].getElement('a')) {

						this.setStyle('margin-left', (this.menuParent.getStyle('width').toInt() - this.menuChildren[0].getElement('a').getStyle('border-left-width').toInt()) + 'px'); // shift drop down menu to the right hand side

					} else this.setStyle('margin-left', this.menuParent.getStyle('width').toInt() + 'px');

				} else this.setStyle('margin-left', '-1px');

				this.setStyle('overflow', 'visible');

				this.setStyle('position', 'absolute');

				this.setStyle('visibility', 'visible');

				this.setStyle('width', maxElementWidth + 'px');

				this.setStyle('z-index', this.level + 1000);

			}

			// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

			// extend and initialise children

			// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

			for (var i = 0; i < this.menuChildren.length; ++i) {

				this.menuChildren[i] = $extend( this.menuChildren[i], new Smooth_Menu_Item );

				this.menuChildren[i].initialise(this);

				if (unorderedList = this.menuChildren[i].getElement('ul')) {

					unorderedList = $extend( unorderedList, new Smooth_Menu );

					unorderedList.initialise(level + 1, this.menuChildren[i]);

				}

			}

			// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

			if (this.level > 0) {

				// this prevents safari from detecting mouse over events for hidden lists

				this.setStyle('display', 'none');

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				// here we bring the list back into view (we moved the list out of view temporarily earlier in this method)

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

				this.setStyle('left', 'auto');

				this.setStyle('top', 'auto');

				// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

			}

			// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

		},

		level : null,

		menuChildren : null,

		menuParent : null,

		onmouseout : function (event) { if (this.visible == false) { var event = new Event(event); event.stop(); } },

		onmouseover : function (event) { if (this.visible == false) { var event = new Event(event); event.stop(); } },

		pendingHides : 0,

		show : function() {

			// console.log('Show [%d] (this.visible=%d, zIndex=%d)', this.id, this.visible, zIndex + 1);

			if (this.visible == false) {

				for (var i = 0; i < this.menuChildren.length; ++i) {

					// console.log('Showing List Item [%s]', this.menuChildren[i].id);

					this.menuChildren[i].show(); // can add a delay() here to make nicer phased fade in

				}

				this.visible = true;

			}

			this.setStyle('z-index', ++zIndex);

			return this;

		},

		visible : false

	}

);

// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

var Smooth_Menu_Item = new Class (

	{

		anchor : null,

		hide : function () {

			if (this.anchor) {

				var opacity = this.anchor.getStyle('opacity');

				this.anchor.showHideFx.stop().start(opacity, 0);

			}

			return this;

		},

		initialise : function (menuParent) {

			/* INSTEAD OF JUST LOOKING FOR AN ANCHOR, WE SHOULD LOOK FOR ANY CHILD CONTAINER TAG TO USE AS THE TRIGGER */

			this.anchor = this.getElement('a');

			if (this.anchor) {

				this.anchor.showHideFx = new Fx.Style(this.anchor, 'opacity',

					{

						duration: 250,

						fps: 100,

						onStart : function (element) {

							var opacity = element.getStyle('opacity');

							if (opacity == 0) {

								// if the item has just been faded in to view, we need to reveal the parent Menu Item to the DOM
								// we do this to make sure child anchors or text blocks become visible
								// technically, the parent Menu Item is always invisible to the eye because of CSS rules

								element.getParent().getParent().setStyle('display', 'block');

							}

							// console.log('Started transition [%s]', element.id);

						},

						onComplete : function (element) {

							// console.log('Completed transition [%s]', element.id);

							var opacity = element.getStyle('opacity');

							if (opacity == 0) {

								// if the item has just been faded out of view, we need to hide the parent Menu Item from the DOM
								// we do this to stop mouse events firing from "invisible" parts of the page
								// technically, the parent Menu Item is always invisible to the eye because of CSS rules

								element.getParent().getParent().setStyle('display', 'none');

							}

						}

					}

				);

			}

			this.menuChild = this.getElement('ul');

			this.menuParent = menuParent;

		},

		menuChild : null,

		menuParent : null,

		onmouseout : function (event) {

			if (this.menuChild != null && this.menuChild.hide != undefined) {

				// console.log('MouseOut [%d]', this.id);

				this.menuChild.cancelHide = false;

				this.menuChild.pendingHides++;

				this.menuChild.hide.delay(500, this.menuChild);

				this.menuParent.childrenShowing = false;

			}

		},

		onmouseover : function (event) {

			if (this.menuChild != null && this.menuChild.show != undefined) {

				// console.log('MouseOver [%d]', this.id);

				this.menuChild.cancelHide = true;

				this.menuChild.show();

				this.menuParent.childrenShowing = true;

			}

		},

		show : function() {

			if (this.anchor) {

				var opacity = this.anchor.getStyle('opacity');

				this.anchor.showHideFx.stop().start(opacity, 1);

			}

			return this;

		},

		showHideFx : null

	}

);

// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

window.addEvent('domready',

	function() {

		var menuContainers = $$('div.smooth-menu');

		menuContainers.each(

			function (menuContainer) {

				var menu = menuContainer.getElement('ul');

				if (menu) {

					menu = $extend( menu, new Smooth_Menu );

					menu.initialise(0, null);

				}

			}

		);

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Snazzy Stripes version 1.00

// Copyright 2007 Jamie Burns

// Created: 8/06/2007

// Updated: 15/09/2007

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Striped_Lists = new Class (

	{

		initialize : function (lists) {

			if ($type(lists) != 'array') {

				lists = [ lists ];

			}

			lists.each(

				function (listElement) {

					$ES("li", listElement).each(

						function (li, i) {

							li.addClass( (i % 2 == 0) ? "even" : "odd" );

						}

					);

				}

			);

		}

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Striped_List = Snazzy_Striped_Lists.extend(); // this class is used for readability in code using these classes

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Striped_Tables = new Class (

	{

		initialize : function (tables) {

			if ($type(tables) != 'array') {

				tables = [ tables ];

			}

			tables.each(

				function (table, i) {

					$ES('tbody tr', table).each(

						function (tr, j) {

							$ES('td', tr).addClass( (j % 2 == 0) ? "even" : "odd" );

						}

					);

				}

			);

		}

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Striped_Table = Snazzy_Striped_Tables.extend(); // this class is used for readability in code using these classes

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Snazzy Tabs

// Copyright 2007 Jamie Burns

// Created: 17/07/2007

// Updated: 15/09/2007

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var SNAZZY_TABS_DEBUG = false;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Tabs = new Class (

	{

		activeTab : null,

		initialize : function (containingElement) {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tabs::initialize");

			}

			if (containingElement.snazzyTabs == true) {

				return containingElement.snazzyTabs;

			}

			// create Snazzy_Tab's

			this.tabs = [];

			$ES("ul.tab-anchors li a", containingElement).each(

				function (anchor) {

					this.tabs[ this.tabs.length ] = new Snazzy_Tab(anchor, this);

				},

				this

			);

			containingElement.snazzyTabs = this;

			// select an appropriate tab

			if (this.tabs.length > 0) {

				var panel = $E("#" + Cookie.get("tabPanelID"), containingElement);

				var tab = null;

				if (panel) {

					for (var c = this.tabs.length, i = 0; i < c; ++i) {

						if (this.tabs[ i ].panel == panel) {

							tab = this.tabs[ i ];

							break;

						}

					}

				}

				if (tab == null) {

					tab = this.tabs[0];

				}

				this.select(tab);

			}

		},

		select : function (tab) {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tabs::select");

			}

			tab._activate();

			this.activeTab = tab;

			for (var c = this.tabs.length, i = 0; i < c; ++i) {

				if (this.tabs[ i ] != this.activeTab) {

					this.tabs[ i ]._deactivate();

				}

			}

		},

		tabs : []

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var Snazzy_Tab = new Class (

	{

		_activate : function () {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tab::_activate");

			}

			this.anchor.getParent().addClass("active");

			this.panel.addClass("active");

		},

		_deactivate : function () {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tab::_deactivate");

			}

			this.anchor.getParent().removeClass("active");

			this.panel.removeClass("active");

		},

		anchor : null,

		container : null,

		initialize : function (anchor, container) {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tab::initialize");

			}

			this.anchor = anchor;

			this.anchor.addEvent("click", this.onclick.bind(this));

			this.container = container;

			this.panel = $E( "#" + this.anchor.getProperty("href").split("#")[1] );

		},

		onclick : function (event) {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tab::onclick");

			}

			this.anchor.blur();

			this.select();

			if (this.panel.getStyle("vertical-align") == "super") { // we use this as a check for css support (only if the appropriate stylesheet is selected, then we disable named anchor links)

				event = new Event(event);

				event.preventDefault();

			}

		},

		panel : null,

		select : function () {

			if (SNAZZY_TABS_DEBUG == true) {

				console.debug("Snazzy_Tab::select");

			}

			Cookie.set("tabPanelID", this.panel.id, { path : "/" });

			this.container.select(this);

			this.fireEvent("onSelect");

		}

	}

);

Snazzy_Tab.implement( new Events );

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Smooth Tips

// Copyright 2007 Jamie Burns

// Created: 11/03/2007

// Updated: 15/09/2007

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

window.addEvent(

	'domready',

	function() {

		var spans = [];

		$ES('span.tip').each(

			function(span) {

				if (span.getAttribute('title')) {

					spans.push(span);

				}

			}

		);

		new Tips(spans, { maxOpacity: 0.7, maxTitleChars: 32 } );

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Smooth Classes

// Copyright 2007 Jamie Burns

// Created: 11/03/2007

// Updated: 26/10/2007

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Library = {

	baseHREF : document.getElement('base').href,

	getGuaranteedInteger : function (i) {

		i = parseInt(i);

		return (isNaN(i) == true) ? 0 : i;

	}

};

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget = new Class(

	{

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_DEBUG : false,

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		options : { },

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		initialize : function (options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.options = options;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return this;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement = Snazzy.Widget.extend(

	{

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		initialize : function (element, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent(options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Enhancement::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (element == null || element.enhanced == true) {

				return;

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if ($type(element) == 'array') {

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

// how does this know which super class gets used when making enhancements???
// should it rather call a method which can be overriden in super classes?

				var enhancedWidgets = new Array(element.length);

				for (var c = element.length, i = 0; i < c; ++i) {

					enhancedWidgets[ i ] = new Snazzy.Widget.Enhancement( element[ i ] , options );

				}

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

				return enhancedWidgets;

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

			} else if ($type(element) == 'element') {

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

				this.element = element;

				this.element.enhanced = true;

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

				return this;

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement.ImageManager = Snazzy.Widget.Enhancement.extend (

	{

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_dialog : null,

		_lightBox : null,

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_render : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log("Snazzy.Widget.Enhancement.ImageManager::_render");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.controlName = this.element.getElement("p.control select").name;

			this.controlValue = this.element.getElement("p.control select").value;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.element.getElement("p.control").replaceWith(

				new Element( "div" , { "class" : "sub-fields" } )

			);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._renderDescription();

			this._renderImageSelector();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_renderDescription : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log("Snazzy.Widget.Enhancement.ImageManager::_renderDescription");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			/*

			EXAMPLE:

			<div class="sub-field">

				<div class="plain-text_line">

					<div class="description">

						<p class="label">Description: <span>Awesome Image</span></p>

					</div>

				</div>

			</div>

			*/

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var span = new Element("span").injectInside(

				new Element(

					"p" ,

					{ "class" : "label" }

				).injectInside(

					new Element(

						"div" ,

						{ "class" : "description" }

					).injectInside(

						new Element(

							"div" ,

							{ "class" : "plain-text_line" }

						).injectInside(

							new Element(

								"div" ,

								{ "class" : "sub-field" }

							).injectInside(

								this.element.getElement("div.sub-fields")

							)

						)

					)

				).setText("Description: ")

			);

			if (this.options["default-file-description"] == "") {

				span.addClass("subtle").setText("(a value has not been set)");

			} else span.setText(this.options["default-file-description"]);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_renderImageSelector : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log("Snazzy.Widget.Enhancement.ImageManager::_renderImageSelector");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			/*

			EXAMPLE:

			<div class="sub-field">

				<p class="preview">

					<a class="snazzy-image" href="{ @echo property='product.data.image-(i)-file-location' }"><img alt="{ @echo property='product.data.image-(i)-file-description' }" class="tiny uploaded" src="gecko_app/libraries/resize-image.php?file-location={ @echo property='product.data.image-(i)-file-location' }&max-height=120" /></a>

				</p>

				<p class="control">

					<button>Select Image</button>

				</p>

			</div>

			*/

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var subFieldElement = new Element(

				"div" ,

				{ "class" : "sub-field" }

			).injectInside(

				this.element.getElement("div.sub-fields")

			);

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

			new Element(

				"img",

				{ "src" : ( ( this.options["default-file-location"] ) ? "gecko_app/libraries/resize-image.php?file-location=" + encodeURIComponent( this.options["default-file-location"] ) + "&max-height=120" : "" ) }

			).injectInside(

				new Element(

					"a",

					{ "href" : this.options["default-file-location"] }

				).addEvent( "click" , this.showLightBox.bind(this) ).injectInside(

					new Element(

						"p",

						{ "class" : "preview" + ( ( this.options["default-file-location"] ) ? "" : " script-hidden" ) }

					).injectInside(subFieldElement)

				)

			);

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

			var controlElement = new Element( "p" , { "class" : "control" } ).injectInside(

				subFieldElement

			);

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

			new Element(

				"input" ,

				{

					"name" : this.controlName,

					"type" : "hidden",

					"value" : this.controlValue

				}

			).injectInside(controlElement);

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

			new Element(

				"input" ,

				{

					"class" : "select",

					"type" : "button",

					"value" : ( ( this.options["default-file-location"] ) ? "Change Image" : "Select Image" )

				}

			).addEvent( "click" , this.showDialog.bind(this) ).injectInside(controlElement);

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

			new Element(

				"input" ,

				{

					"class" : "upload" + ( ( this.options["default-file-location"] ) ? " script-hidden" : "" ),

					"type" : "button",

					"value" : "Upload Image"

				}

			).addEvent( "click" , this.showUploadDialog.bind(this) ).injectInside(controlElement);

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

			new Element(

				"input" ,

				{

					"class" : "remove" + ( ( this.options["default-file-location"] ) ? "" : " script-hidden" ),

					"type" : "button",

					"value" : "Remove Image"

				}

			).addEvent( "click" , this.removeImage.bind(this) ).injectInside(controlElement);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		hideDialog : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._dialog) {

				this._dialog.hide();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		hideLightBox : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._lightBox) {

				this._lightBox.hide();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		initialize : function (element, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var widgets = this.parent(element, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Enhancement.ImageManager::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.element) {

				this._render();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return widgets;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		previewImage : function (resource) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Enhancement.ImageManager::previewImage');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (resource.fileMimeType.indexOf("image/") != 0) {

				return; // return early if the resource is not an image

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var lightBox = new Snazzy.Widget.Window.LightBox();

			lightBox.caller = this;

			lightBox.show(resource.fileLocation);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		removeImage : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.element.getElement("p.preview a").href = "";

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

			var imageElement = this.element.getElement("p.preview a img");

			imageElement.alt = "";

			imageElement.src = "";

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

			this.element.getElement("p.control input.remove").addClass("script-hidden");

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

			this.element.getElement("p.control input.select").value = "Select Image";

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

			this.element.getElement("p.control input[type=hidden]").value = "";

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

			this.element.getElement("p.label span").addClass("subtle").setText("(a value has not been set)");

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

			this.element.getElement("p.preview").addClass("script-hidden");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		showDialog : function (event) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			event = new Event(event);

			event.preventDefault(); // prevent the original click action

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

			this.element.blur();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._dialog == null) {

				this._dialog = new Snazzy.Widget.Window.Dialog();

				this._dialog.caller = this;

				this._dialog.onPing = this.updateImage.bind(this);

			}

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

			var selectedResourceId = this.element.getElement("p.control input[type=hidden]").value;

			if (selectedResourceId > 0) {

				this._dialog.show("administration/resources/id/" + parseInt(selectedResourceId) + ";commit(inline)?resource-type=images");

			} else this._dialog.show("administration/resources(inline)?resource-type=images");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		showLightBox : function (event) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			event = new Event(event);

			event.preventDefault(); // prevent the original click action

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

			this.element.blur();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var imageSrc = this.element.getElement("p.preview a").href;

			if (imageSrc) {

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

				if (this._lightBox == null) {

					this._lightBox = new Snazzy.Widget.Window.LightBox();

					this._lightBox.caller = this;

				}

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

				imageSrc = imageSrc.substr(Snazzy.Library.baseHREF.length);

				this._lightBox.show(imageSrc);

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		showUploadDialog : function (event) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			event = new Event(event);

			event.preventDefault(); // prevent the original click action

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

			this.element.blur();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._dialog == null) {

				this._dialog = new Snazzy.Widget.Window.Dialog();

				this._dialog.caller = this;

				this._dialog.onPing = this.updateImage.bind(this);

			}

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

			this._dialog.show("administration/resources;commit(inline)?resource-type=images&select=yes");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		updateImage : function (resource) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (resource.fileMimeType.indexOf("image/") != 0) {

				return; // return early if the resource is not an image

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.element.getElement("p.preview a").href = resource.fileLocation;

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

			var imageElement = this.element.getElement("p.preview a img");

			imageElement.alt = resource.fileDescription;

			imageElement.src = "gecko_app/libraries/resize-image.php?file-location=" + encodeURIComponent(resource.fileLocation) + "&max-height=120";

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

			this.element.getElement("p.control input.remove").removeClass("script-hidden");

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

			this.element.getElement("p.control input.select").value = "Change Image";

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

			this.element.getElement("p.control input[type=hidden]").value = resource.resourceId;

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

			if (resource.fileDescription == "") {

				this.element.getElement("p.label span").addClass("subtle").setText("(a value has not been set)");

			} else this.element.getElement("p.label span").removeClass("subtle").setText(resource.fileDescription);

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

			this.element.getElement("p.preview").removeClass("script-hidden");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement.DisabledAnchor = Snazzy.Widget.Enhancement.extend (

	{

		_anchor : null,

		initialize : function (element, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var widgets = this.parent(element, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Enhancement.DisabledAnchor::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.element) {

				if (this.element.getTag() == "a") {

					this._anchor = this.element;

					this.element.addEvent(

						"click",

						this.onclick.bind(this)

					)

				} else {

					this._anchor = new Element(

						"a",

						{

							"events" : {

								"click" : this.onclick.bind(this)

							},

							"href" : "administration"

						}

					).setHTML( this.element.innerHTML )

					this.element.empty();

					this.element.adopt( this._anchor );

				}

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return widgets;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

		onclick : function (event) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (event) {

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

				event = new Event(event);

				event.preventDefault();

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

				this._anchor.blur();

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement.ChoiceTable = Snazzy.Widget.Enhancement.extend(

	{

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

		initialize : function (element, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var widgets = this.parent(element, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Enhancement.ChoiceTable::initialize");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.element) {

				this.element.getElements("input").addEvent(

					"click",

					this.onclick.bind(this)

				);

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return widgets;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

		onclick : function (event) {

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Enhancement.ChoiceTable::onclick");

			}

			if (event.target) {

				event.target.blur();

				this.select(event.target);

			}

		},

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

		select : function (input) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Enhancement.ChoiceTable::select");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement.ExclusiveChoiceTable = Snazzy.Widget.Enhancement.ChoiceTable.extend(

	{

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

		select : function (inputRadio) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Enhancement.ExclusiveChoiceTable::select");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			inputRadio.getParent().getParent().getParent().getElements('td').removeClass('marked');

			if (inputRadio.checked) {

				inputRadio.getParent().addClass('marked');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement.MultipleChoiceTable = Snazzy.Widget.Enhancement.ChoiceTable.extend(

	{

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

		select : function (inputCheckbox) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Enhancement.MultipleChoiceTable::select");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (inputCheckbox.checked) {

				inputCheckbox.getParent().addClass("marked");

			} else inputCheckbox.getParent().removeClass("marked");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Enhancement.Toggler = Snazzy.Widget.Enhancement.extend(

	{

		_anchor : null,

		_target : null,

		initialize : function (element, target, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var widgets = this.parent(element, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Enhancement.Toggler::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.element) {

				this._target = target;

				this._target.addClass('script-hidden');

				if (this.element.getTag() == "a") {

					this._anchor = this.element;

					this.element.addEvent(

						"click",

						this.onclick.bind(this)

					)

				} else {

					this._anchor = new Element(

						"a",

						{

							"events" : {

								"click" : this.onclick.bind(this)

							},

							"href" : "administration"

						}

					).setHTML( this.element.innerHTML )

					this.element.empty();

					this.element.adopt( this._anchor );

				}

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return widgets;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

		onclick : function (event) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (event) {

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

				event = new Event(event);

				event.preventDefault();

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

				this._anchor.blur();

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.toggle();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

		toggle : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._target.toggleClass('script-hidden');

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

var SNAZZY_WINDOW_DEBUG = false;

var SNAZZY_WINDOW_DEFAULT_VIEW_HEIGHT = 180;

var SNAZZY_WINDOW_DEFAULT_VIEW_WIDTH = 360;

var SNAZZY_WINDOW_EFFECT_UNDERLAY_IN = 320;

var SNAZZY_WINDOW_EFFECT_UNDERLAY_OUT = 320;

var SNAZZY_WINDOW_EFFECT_VIEW_IN = 480;

var SNAZZY_WINDOW_EFFECT_VIEW_OUT = 320;

var SNAZZY_WINDOW_IMAGE_DELAY_IMAGE_VIEW_IN = 180;

var SNAZZY_WINDOW_IMAGE_DELAY_UNDERLAY_OUT = 180;

var SNAZZY_WINDOW_IMAGE_DELAY_VIEW_OUT = 180;

var SNAZZY_WINDOW_IMAGE_EFFECT_IMAGE_VIEW_IN = 240;

var SNAZZY_WINDOW_IMAGE_EFFECT_IMAGE_VIEW_OUT = 240;

var SNAZZY_WINDOW_IMAGE_EFFECT_VIEW_RESIZE_MAXIMUM = 960;

var SNAZZY_WINDOW_IMAGE_EFFECT_VIEW_RESIZE_MINIMUM = 320;

var SNAZZY_WINDOW_VIEW_LEADING = 100;

Snazzy.Widget.Window = Snazzy.Widget.extend (

	{

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_createContainer : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_createContainer');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._container = new Element(

				"div",

				{ "class" : "snazzy-window-container" }

			);

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

			this._container.injectInside( document.body ); // insert at the end of document body

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

			this._container.owner = this;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_createUnderlay : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_createUnderlay');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._underlay = new Element(

				"div",

				{

					"class" : "underlay",

					"styles" : {

						"opacity" : 0,

						"overflow" : "hidden",

						"position" : (window.ie6 == true) ? "absolute" : "fixed",

						"z-index" : "3001"

					}

				}

			);

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

			this._underlay.injectInside( this._container );

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (window.ie6 == true) { // ie6 needs an iframe under the underlay element to stop <select> boxes popping through

				this._underlayIframe = new Element(

					"iframe",

					{

						"class" : "underlay-iframe",

						"styles" : {

							"opacity" : 0,

							"overflow" : "hidden",

							"position" : "absolute",

							"visibility" : "visible", // prevent mootools from setting visibility to hidden when the element's opacity is set to 0

							"z-index" : "3000"

						}

					}

				);

				this._underlayIframe.injectInside( this._container );

			}

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

			this._updateUnderlayPosition();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_createWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_createWindow');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._window = new Element(

				"div",

				{

					"class" : "window",

					"styles" : {

						"opacity" : 0,

						"overflow" : "hidden",

						"position" : (window.ie6 == true) ? "absolute" : "fixed",

						"z-index" : "3002"

					}

				}

			);

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

			if (window.gecko == true) {

				// see the comments in Snazzy.Widget.Window::_calculateWindowPosition()

				// for an explanation as to why gecko needs tranparent borders

				this._window.setStyles(

					{

						"-moz-background-clip" : "padding", // this enables fully transparent borders for gecko browsers (moz 1.2+)

						"border-color" : "transparent",

						"border-style" : "solid"

					}

				);

			}

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

			this._window.injectInside( this._container );

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._windowControls = new Element(

				"div",

				{ "class" : "controls" }

			);

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

			this._windowControls.injectInside( this._window );

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._windowView = new Element(

				"div",

				{ "class" : "view" }

			);

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

			this._windowView.injectTop( this._window );

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._updateWindowPosition();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_calculateUnderlayPosition : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_calculateUnderlayPosition');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var styles = {

				"height" : window.getHeight(),

				"left" : 0,

				"top" : 0,

				"width" : window.getWidth()

			};

			if (window.ie6 == true) {

				// compensate for lack of fixed position support in ie6

				styles.left += window.getScrollLeft();

				styles.top += window.getScrollTop();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return styles;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_calculateWindowPosition : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_calculateWindowPosition');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var height = window.getHeight();

			var width = window.getWidth();

			if (window.gecko == true) {

				// work around firefox's rendering/rounding bug with opaque elements.

				// basically, firefox incorrectly renders content underneath an opaque

				// element at certain window sizes (those that trigger a rounding bug).

				// the content underneath is incorrectly rendered 1 pixel to the right, or

				// to the bottom, or both - from the left or top edge of the opaque element.

				// the work around involves adding a transparent border around the viewport

				// so that the left and top edges of the opaque element are aligned with

				// the edge of the window, that way the bug cannot be seen on-screen

				var borderHeight = ( ( height - this.windowHeight ) / 2 );

				var borderWidth = ( ( width - this.windowWidth ) / 2 );

				var styles = {

					"border-bottom-width" : ( borderHeight * 2 ) - ( ( height - this.windowHeight ) > ( SNAZZY_WINDOW_VIEW_LEADING * 2 ) ) ? SNAZZY_WINDOW_VIEW_LEADING : ( height / 2 ) - ( this.windowHeight / 2 ),

					"border-left-width" : borderWidth,

					"border-right-width" : borderWidth,

					"border-top-width" : ( ( height - this.windowHeight ) > ( SNAZZY_WINDOW_VIEW_LEADING * 2 ) ) ? SNAZZY_WINDOW_VIEW_LEADING : ( height / 2 ) - ( this.windowHeight / 2 ),

					"height" : height - ( borderHeight * 2 ),

					"left" : 0,

					"top" : 0,

					"width" : width - ( borderWidth * 2 )

				};

			} else {

				var styles = {

					"height" : this.windowHeight,

					"left" : ( width / 2 ) - ( this.windowWidth / 2 ),

					"top" : ( ( height - this.windowHeight ) > ( SNAZZY_WINDOW_VIEW_LEADING * 2 ) ) ? SNAZZY_WINDOW_VIEW_LEADING : ( height / 2 ) - ( this.windowHeight / 2 ),

					"width" : this.windowWidth

				};

				if (window.ie6 == true) {

					// compensate for lack of fixed position support in ie6

					styles.left += window.getScrollLeft();

					styles.top += window.getScrollTop();

				}

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return styles;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_destroyContainer : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_destroyContainer');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._container) {

				this._container.remove();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_destroyUnderlay : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_destroyUnderlay');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._underlay) {

				this._underlay.remove();

			}

			if (this._underlayIframe) {

				this._underlayIframe.remove();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_destroyWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_destroyWindow');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._window) {

				this._window.remove();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hide : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_hide');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._hideContainer();

			this._hideUnderlay();

			this._hideWindow();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideContainer : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_hideContainer');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._destroyContainer.delay( ( ( SNAZZY_WINDOW_EFFECT_UNDERLAY_OUT > SNAZZY_WINDOW_EFFECT_VIEW_OUT ) ? SNAZZY_WINDOW_EFFECT_UNDERLAY_OUT : SNAZZY_WINDOW_EFFECT_VIEW_OUT ) );

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideUnderlay : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_hideUnderlay');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			new Fx.Style(

				this._underlay,

				"opacity",

				{

					duration : SNAZZY_WINDOW_EFFECT_UNDERLAY_OUT,

					onComplete : function () {

						this._destroyUnderlay();

					}.bind(this)

				}

			).start(0);

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

			this._underlay.removeEvent("click", this.hide.bind(this)); // remove the event that hides the window when clicked

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_hideWindow');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			new Fx.Style(

				this._window,

				"opacity",

				{

					duration : SNAZZY_WINDOW_EFFECT_VIEW_OUT,

					onComplete : function () {

						this._destroyWindow();

					}.bind(this)

				}

			).start(0);

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

			if (window.gecko == true) {

				// see the comments in Snazzy.Widget.Window::_calculateWindowPosition()

				// for an explanation as to why gecko needs tranparent borders (for which

				// this event is needed)

				this._window.removeEvent("click", this.hide.bind(this)); // remove the event that hides the window when clicked

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_showing : false,

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_show : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_show');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._showContainer();

			this._showUnderlay();

			this._showWindow();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_showContainer : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_showContainer');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._createContainer();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_showUnderlay : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_showUnderlay');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._createUnderlay();

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

			new Fx.Style(

				this._underlay,

				"opacity",

				{ duration : SNAZZY_WINDOW_EFFECT_UNDERLAY_IN }

			).start(0.75);

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

			this._underlay.addEvent("click", this.hide.bind(this)); // add the event that hides the window when clicked

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_showWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_showWindow');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._createWindow();

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

			new Fx.Style(

				this._window,

				"opacity",

				{ duration : SNAZZY_WINDOW_EFFECT_VIEW_IN }

			).start(1);

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

			if (window.gecko == true) {

				// see the comments in Snazzy.Widget.Window::_calculateWindowPosition()

				// for an explanation as to why gecko needs tranparent borders (for which

				// this event is needed)

				this._window.addEvent("click", this.hide.bind(this)); // add the event that hides the window when clicked

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_updatePositions : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_updatePositions');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._updateContainerPosition();

			this._updateUnderlayPosition();

			this._updateWindowPosition();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_updateContainerPosition : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_updateContainerPosition');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_updateUnderlayPosition : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_updateUnderlayPosition');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var styles = this._calculateUnderlayPosition();

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

			if (this._underlay) {

				this._underlay.setStyles(styles);

			}

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

			if (this._underlayIframe) {

				this._underlayIframe.setStyles(styles);

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_updateWindowPosition : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::_updateWindowPosition');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._window) {

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

				var styles = this._calculateWindowPosition();

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

				this._window.setStyles(styles);

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		hide : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::hide');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._showing == true) {

				if (this.onHide) {

					this.onHide();

				}

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

				this._hide();

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

				this._showing = false;

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

				window.removeEvent("resize", this._updatePositions.bind(this));

				if (window.ie6 == true) {

					window.removeEvent("scroll", this._updatePositions.bind(this));

				}

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		isShowing : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return this._showing;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		show : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window::show');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._showing == false) {

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

				if (this.onShow) {

					this.onShow();

				}

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

				this._showing = true;

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

				this._show();

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

				window.addEvent("resize", this._updatePositions.bind(this));

				if (window.ie6 == true) {

					window.addEvent("scroll", this._updatePositions.bind(this));

				}

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		windowHeight : SNAZZY_WINDOW_DEFAULT_VIEW_HEIGHT,

		windowWidth : SNAZZY_WINDOW_DEFAULT_VIEW_WIDTH

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Window.Dialog = Snazzy.Widget.Window.extend(

	{

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_createWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.Dialog::_createWindow");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


			if (window.ie == true) {

				// IE does not like scripting the object tag, so we must use an iframe (which is not really XHTML compliant)

				this._dialog = new Element(

					"iframe",

					{

						"frameborder" : '0',

						"height" : ( this.windowHeight - this._windowControls.getStyle("height").toInt() ),

						"type" : "text/html",

						"width" : "100%"

					}

				);

			} else {

				this._dialog = new Element(

					"object",

					{

						"height" : ( this.windowHeight - this._windowControls.getStyle("height").toInt() ),

						"type" : "text/html",

						"width" : "100%"

					}

				);

			}

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

			this._dialog.injectInside(this._windowView);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._window.addClass("dialog");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._windowControlClose = new Element(

				"div",

				{

					"class" : "close-window",

					"events" : { "click" : this.hide.bind(this) }

				}

			);

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

			this._windowControlClose.injectInside(this._windowControls);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideUnderlay : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent.delay(SNAZZY_WINDOW_IMAGE_DELAY_UNDERLAY_OUT, this);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.Dialog::_hideUnderlay");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent.delay(SNAZZY_WINDOW_IMAGE_DELAY_VIEW_OUT, this);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.Dialog::_hideWindow");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			new Fx.Style(

				this._windowView,

				"opacity",

				{ duration : SNAZZY_WINDOW_IMAGE_EFFECT_IMAGE_VIEW_OUT }

			).start(0);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_url : '',

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		initialize : function (url, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent(null, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window.Dialog::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._url = url;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.windowHeight > window.getHeight() - 40) {

				this.windowHeight = ( window.getHeight() - 40 );

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		ping : function (data) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.Dialog::ping");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.onPing) {

				this.onPing(data);

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		show : function (url) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.Dialog::show " + url);

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._dialog.tagName === 'IFRAME') { // IE needs to use <iframes> rather than <object>

				this._dialog.src = (url) ? url : this._url;

			} else this._dialog.data = (url) ? url : this._url;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		resourceType : 'all',

		windowHeight : 600,

		windowWidth : 768

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	}

);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Snazzy.Widget.Window.LightBox = Snazzy.Widget.Window.extend(

	{

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_createWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.LightBox::_createWindow");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._image = new Element(

				"img",

				{

					"events" : {

						"click" : this.hide.bind(this),

						"load" : this._revealImage.bind(this)

					}

				}

			);

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

			this._image.injectInside(this._windowView);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._window.addClass("lightbox");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._windowControlClose = new Element(

				"div",

				{

					"class" : "close-window",

					"events" : { "click" : this.hide.bind(this) }

				}

			);

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

			this._windowControlClose.injectInside(this._windowControls);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this._windowView.setStyle("opacity", "0");

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideUnderlay : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent.delay(SNAZZY_WINDOW_IMAGE_DELAY_UNDERLAY_OUT, this);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.LightBox::_hideUnderlay");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_hideWindow : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent.delay(SNAZZY_WINDOW_IMAGE_DELAY_VIEW_OUT, this);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.LightBox::_hideWindow");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			new Fx.Style(

				this._windowView,

				"opacity",

				{ duration : SNAZZY_WINDOW_IMAGE_EFFECT_IMAGE_VIEW_OUT }

			).start(0);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		_revealImage : function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug("Snazzy.Widget.Window.LightBox::_revealImage");

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var windowViewIn = new Fx.Style(

				this._windowView,

				"opacity",

				{ duration : SNAZZY_WINDOW_IMAGE_EFFECT_IMAGE_VIEW_IN }

			);

			var heightDifference = Math.abs( ( this._image.height + this._windowControls.getCoordinates().height ) - this.windowHeight );

			var widthDifference = Math.abs( this._image.width - this.windowWidth );

			if (heightDifference > 0 || widthDifference > 0) {

				// resize the window

				this.windowHeight = this._image.height + this._windowControls.getCoordinates().height; // add room for a close button

				this.windowWidth = ( this._image.width > 320 ) ? this._image.width : 320; // enforce a minimum of 320 pixels wide

				var duration = ( ( ( heightDifference > widthDifference ) ? heightDifference : widthDifference ) * 100 );

				var styles = this._calculateWindowPosition();

				new Fx.Styles(

					this._window,

					{

						duration : ( ( duration < SNAZZY_WINDOW_IMAGE_EFFECT_VIEW_RESIZE_MAXIMUM ) ? ( ( duration > SNAZZY_WINDOW_IMAGE_EFFECT_VIEW_RESIZE_MINIMUM ) ? duration : SNAZZY_WINDOW_IMAGE_EFFECT_VIEW_RESIZE_MINIMUM ) : SNAZZY_WINDOW_IMAGE_EFFECT_VIEW_RESIZE_MAXIMUM ),

						onComplete : function () {

							if (window.opera == true) {

								this._updateWindowPosition(); // opera jitters without updating the window position here

							}

							windowViewIn.start(1); // fade the image into the view

						}.bind(this)

					}

				).start(styles);

			} else windowViewIn.start.delay(SNAZZY_WINDOW_IMAGE_DELAY_IMAGE_VIEW_IN, windowViewIn, 1);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		initialize : function (imageSrc, options) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent(null, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Window.LightBox::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (imageSrc) {

				this._imageSrc = imageSrc;

				this.show();

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		},

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

		show : function (imageSrc) {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			this.parent();

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.debug('Snazzy.Widget.Window.LightBox::show');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (imageSrc == null) {

				imageSrc = this._imageSrc;

			}

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

			// encodeURIComponent must happen on the tag level, not here, or it sometimes can be double escaped

			this._image.src = "gecko_app/libraries/resize-image.php?file-location=" + /*encodeURIComponent*/(imageSrc) + "&max-height=" + ( window.getHeight() - this._windowControls.getStyle("height").toInt() - 40 ) + "&max-width=" + ( window.getWidth() - 40 );

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	}

);

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

Snazzy.Widget.Enhancement.LiveFilter = Snazzy.Widget.Enhancement.extend (

	{

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		_switchControl : {

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

			element : null,

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

			onclick : function (event) {

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

				if (event) {

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

					event = new Event(event);

					event.preventDefault();

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

				}

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

			}

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

		},

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		initialize : function (element, options) {

return; // NOT USED YET

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			var widgets = this.parent(element, options);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this._DEBUG == true) {

				console.log('Snazzy.Widget.Enhancement.LiveFilter::initialize');

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			if (this.element) {

				/*

				EXAMPLE:

				<div class="live-filter">

					<ul>

						<li><a href="javascript:return false;" style="color: #444444;">Live Filter</a></li>

					</ul>

				</div>

				*/

				this._switchControl.element = new Element(

					"div",

					{ "class" : "live-filter" }

				);

				new Element(

					"a",

					{

						"events" : {

							"click" : this._switchControl.onclick.bind(this)

						},

						"href" : "administration"

					}

				).appendText('Live Filter').injectInside(

					new Element("li").injectInside(

						new Element("ul").injectInside(this._switchControl.element)

					)

				);

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

				console.log(this._switchControl.element);

				this._switchControl.element.injectTop( this.element );

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

			}

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

			return widgets;

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		}

	}

);

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

Snazzy.Widget.Enhancement.LiveFilter.ChoiceTable = Snazzy.Widget.Enhancement.LiveFilter.extend (

	{

	}

);

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================

// here we detect a few things about the
// client environment

var html = $$("html");

if (window.gecko) {

	html.addClass("gecko-browser");

} else if (window.ie) {

	html.addClass("ie-browser");

	if (window.ie6) {

		html.addClass("ie6-browser");

	} else if (window.ie7) {

		html.addClass("ie7-browser");

	}

} else if (window.opera) {

	html.addClass("opera-browser");

} else if (window.webkit) {

	html.addClass("webkit-browser");

	if (window.webkit419) {

		html.addClass("webkit419-browser");

	} else if (window.webkit420) {

		html.addClass("webkit420-browser");

	}

}

html.addClass("images-enabled"); // assume images are enabled until we can be sure they are not

html.addClass("script-enabled");

window.addEvent(

	"load",

	function () {

		var detect_browser_image_support = $("detect-browser-image-support");

		if (detect_browser_image_support) {

			if (detect_browser_image_support.height < 1 || detect_browser_image_support.width < 1) {

				html.removeClass("images-enabled-browser");

			}

		}

	}

);

Cookie.set("script-enabled", "1", { path : "/" } );

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// look for any widgets not already created
// and create them when the DOM is ready

window.addEvent(

	"domready",

	function () {

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

		var elements = $$(".snazzy-lightbox");

		elements.each(

			function (element) {

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

				if (element.enhanced == true) {

					return;

				}

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

				element.addEvent(

					"click",

					function (event) {

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

						if (this.href == "" || this.tagName != "A") {

							return;

						}

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

						event = new Event(event);

						event.preventDefault();

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

						imageSrc = this.href;

						imageSrc = imageSrc.substr(Snazzy.Library.baseHREF.length);

						new Snazzy.Widget.Window.LightBox(imageSrc);

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

					}.bind(element)

				);

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

			}

		);

		// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

	}

);

// =============================================================================================================================================================================================
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// =============================================================================================================================================================================================
