;(function($) {
$.keyCode = {BACKSPACE: 8,CAPS_LOCK: 20,COMMA: 188,CONTROL: 17,DELETE: 46,DOWN: 40,END: 35,ENTER: 13,ESCAPE: 27,HOME: 36,INSERT: 45,LEFT: 37,NUMPAD_ADD: 107,	NUMPAD_DECIMAL: 110,NUMPAD_DIVIDE: 111,NUMPAD_ENTER: 108,NUMPAD_MULTIPLY: 106,NUMPAD_SUBTRACT: 109,PAGE_DOWN: 34,PAGE_UP: 33,PERIOD: 190,RIGHT: 39,SHIFT: 16,SPACE: 32,	TAB: 9,UP: 38};
var _remove = $.fn.remove;var isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
$.ui = {version: "@VERSION",plugin: {add: function(module, option, set) {var proto = $.ui[module].prototype;for(var i in set) {proto.plugins[i] = proto.plugins[i] || [];proto.plugins[i].push([option, set[i]]);	}},	call: function(instance, name, args) {var set = instance.plugins[name];	if(!set) { return; }for (var i = 0; i < set.length; i++) {if (instance.options[set[i][0]]) {set[i][1].apply(instance.element, args);}}}	},cssCache: {},css: function(name) {if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }var tmp = $('<div class="ui-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
		$.ui.cssCache[name] = !!((!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));	try { $('body').get(0).removeChild(tmp.get(0));	} catch(e){}	return $.ui.cssCache[name];	},	hasScroll: function(e, a) {	if ($(e).css('overflow') == 'hidden') { return false; }	var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',	has = false;if (e[scroll] > 0) { return true; }	e[scroll] = 1;	has = (e[scroll] > 0);	e[scroll] = 0;	return has;	}};
$.fn.extend({remove: function() {	$("*", this).add(this).each(function() {$(this).triggerHandler("remove");});return _remove.apply(this, arguments );	},	enableSelection: function() {return this .attr('unselectable', 'off').css('MozUserSelect', '').unbind('selectstart.ui');},disableSelection: function() {return this			.attr('unselectable', 'on').css('MozUserSelect', 'none').bind('selectstart.ui', function() { return false; });},ariaRole: function(role) {	return (role !== undefined
? this.attr("role", isFF2 ? "wairole:" + role : role): (this.attr("role") || "").replace(/^wairole:/, ""));	},	ariaState: function(state, value) {	return (value !== undefined	? this.each(function(i, el) {(isFF2	? el.setAttributeNS("http://www.w3.org/2005/07/aaa","aaa:" + state, value): $(el).attr("aria-" + state, value));})			: this.attr(isFF2 ? "aaa:" + state : "aria-" + state));}});
$.extend($.expr[':'], {data: function(a, i, m) {return $.data(a, m[3]);},tabbable: function(a, i, m) {var nodeName = a.nodeName.toLowerCase();	var isVisible = function(element) {	function checkStyles(element) {	var style = element.style;return (style.display != 'none' && style.visibility != 'hidden');	}var visible = checkStyles(element);(visible && $.each($.dir(element, 'parentNode'), function() {	return (visible = checkStyles(this));}));return visible;};	return (a.tabIndex >= 0 &&
( ('a' == nodeName && a.href) ||	(/input|select|textarea|button/.test(nodeName) &&	'hidden' != a.type && !a.disabled)) &&	isVisible(a));	}});
function getter(namespace, plugin, method, args) {	function getMethods(type) {	var methods = $[namespace][plugin][type] || [];	return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);	}var methods = getMethods('getter');if (args.length == 1 && typeof args[0] == 'string') {	methods = methods.concat(getMethods('getterSetter'));}return ($.inArray(method, methods) != -1);}
$.widget = function(name, prototype) {	var namespace = name.split(".")[0];	name = name.split(".")[1];$.fn[name] = function(options) {var isMethodCall = (typeof options == 'string'),args = Array.prototype.slice.call(arguments, 1);	if (isMethodCall && options.substring(0, 1) == '_') {	return this;	}	if (isMethodCall && getter(namespace, name, options, args)) {	var instance = $.data(this[0], name);return (instance ? instance[options].apply(instance, args)	: undefined);}
return this.each(function() {var instance = $.data(this, name);	(!instance && !isMethodCall &&	$.data(this, name, new $[namespace][name](this, options)));			(instance && isMethodCall && $.isFunction(instance[options]) &&	instance[options].apply(instance, args));});};
$[namespace] = $[namespace] || {};	$[namespace][name] = function(element, options) {	var self = this;this.widgetName = name;	this.widgetEventPrefix = $[namespace][name].eventPrefix || name;	this.widgetBaseClass = namespace + '-' + name;	this.options = $.extend({},	$.widget.defaults,$[namespace][name].defaults,	$.metadata && $.metadata.get(element)[name],options);this.element = $(element)	.bind('setData.' + name, function(e, key, value) {	return self._setData(key, value);})	.bind('getData.' + name, function(e, key) {	return self._getData(key);	})	.bind('remove', function() {return self.destroy();	});	this._init();	};
	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);	$[namespace][name].getterSetter = 'option';};
$.widget.prototype = {_init: function() {},	destroy: function() {this.element.removeData(this.widgetName);},option: function(key, value) {var options = key,self = this;
if (typeof key == "string") {	if (value === undefined) {	return this._getData(key);}	options = {};options[key] = value;}	$.each(options, function(key, value) {			self._setData(key, value);});},_getData: function(key) {return this.options[key];},	_setData: function(key, value) {this.options[key] = value;if (key == 'disabled') {			this.element[value ? 'addClass' : 'removeClass'](this.widgetBaseClass + '-disabled');}},enable: function() {this._setData('disabled', false);},	disable: function() {		this._setData('disabled', true);},	_trigger: function(type, e, data) {	var eventName = (type == this.widgetEventPrefix	? type : this.widgetEventPrefix + type);		e = e|| $.event.fix({ type: eventName, target: this.element[0] });	return this.element.triggerHandler(eventName, [e, data], this.options[type]);}};$.widget.defaults = {disabled: false};
$.ui.mouse = {_mouseInit: function() {	var self = this;this.element	.bind('mousedown.'+this.widgetName, function(e) {	return self._mouseDown(e);	})
.bind('click.'+this.widgetName, function(e) {if(self._preventClickEvent) {self._preventClickEvent = false;	return false;	}});
if ($.browser.msie) {this._mouseUnselectable = this.element.attr('unselectable');this.element.attr('unselectable', 'on');}this.started = false;	},	_mouseDestroy: function() {this.element.unbind('.'+this.widgetName);($.browser.msie && this.element.attr('unselectable', this._mouseUnselectable));},	_mouseDown: function(e) {		(this._mouseStarted && this._mouseUp(e));this._mouseDownEvent = e;	var self = this,btnIsLeft = (e.which == 1),	elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).parents().add(e.target).filter(this.options.cancel).length : false);	if (!btnIsLeft || elIsCancel || !this._mouseCapture(e)) {	return true;}	this.mouseDelayMet = !this.options.delay;	if (!this.mouseDelayMet) {	this._mouseDelayTimer = setTimeout(function() {	self.mouseDelayMet = true;	}, this.options.delay);
}if (this._mouseDistanceMet(e) && this._mouseDelayMet(e)) {	this._mouseStarted = (this._mouseStart(e) !== false);if (!this._mouseStarted) {	e.preventDefault();			return true;}}
this._mouseMoveDelegate = function(e) {	return self._mouseMove(e);};this._mouseUpDelegate = function(e) {return self._mouseUp(e);};
$(document)	.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);return false;	},
_mouseMove: function(e) {	if ($.browser.msie && !e.button) {	return this._mouseUp(e);}if (this._mouseStarted) {this._mouseDrag(e);return false;}
if (this._mouseDistanceMet(e) && this._mouseDelayMet(e)) {this._mouseStarted =	(this._mouseStart(this._mouseDownEvent, e) !== false);	(this._mouseStarted ? this._mouseDrag(e) : this._mouseUp(e));	}return !this._mouseStarted;},	
_mouseUp: function(e) {	$(document)	.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)	.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
if (this._mouseStarted) {this._mouseStarted = false;this._preventClickEvent = true;	this._mouseStop(e);	}return false;},	
_mouseDistanceMet: function(e) {return (Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX),Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance
);},	
_mouseDelayMet: function(e) {return this.mouseDelayMet;	},_mouseStart: function(e) {},_mouseDrag: function(e) {},_mouseStop: function(e) {},_mouseCapture: function(e) { return true; }};
$.ui.mouse.defaults = {	cancel: null,distance: 1,delay: 0};})(jQuery);
(function($) {$.widget("ui.tabs", {	_init: function() {	this._tabify(true);	},	_setData: function(key, value) {	if ((/^selected/).test(key))this.select(value);
else {	this.options[key] = value;	this._tabify();	}},	length: function() {return this.$tabs.length;},	_tabId: function(a) {return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '')	|| this.options.idPrefix + $.data(a);},	ui: function(tab, panel) {	return {options: this.options,	tab: tab,panel: panel,			index: this.$tabs.index(tab)};},_sanitizeSelector: function(hash) {	return hash.replace(/:/g, '\\:'); 	},	_cookie: function() {var cookie = this.cookie || (this.cookie = 'ui-tabs-' + $.data(this.element[0]));	return $.cookie.apply(null, [cookie].concat($.makeArray(arguments)));},	_tabify: function(init) {this.$lis = $('li:has(a[href])', this.element);	this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });	this.$panels = $([]);var self = this, o = this.options;
	this.$tabs.each(function(i, a) {if (a.hash && a.hash.replace('#', '')) 	self.$panels = self.$panels.add(self._sanitizeSelector(a.hash));else if ($(a).attr('href') != '#') { $.data(a, 'href.tabs', a.href); $.data(a, 'load.tabs', a.href); var id = self._tabId(a);a.href = '#' + id;var $panel = $('#' + id);if (!$panel.length) {
$panel = $(o.panelTemplate).attr('id', id).addClass(o.panelClass)	.insertAfter(self.$panels[i - 1] || self.element);	$panel.data('destroy.tabs', true);	}
self.$panels = self.$panels.add($panel);}	else o.disabled.push(i + 1);});	if (init) {	this.element.addClass(o.navClass);	this.$panels.addClass(o.panelClass);			if (o.selected === undefined) {	if (location.hash) {this.$tabs.each(function(i, a) {if (a.hash == location.hash) {	o.selected = i;	return false; }});}	else if (o.cookie) {var index = parseInt(self._cookie(), 10);	if (index && self.$tabs[index]) o.selected = index;	}else if (self.$lis.filter('.' + o.selectedClass).length)
o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] );	}o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; 			o.disabled = $.unique(o.disabled.concat($.map(this.$lis.filter('.' + o.disabledClass),function(n, i) { return self.$lis.index(n); } ))).sort();			if ($.inArray(o.selected, o.disabled) != -1)	o.disabled.splice($.inArray(o.selected, o.disabled), 1);this.$panels.addClass(o.hideClass);	this.$lis.removeClass(o.selectedClass);			if (o.selected !== null) {	this.$panels.eq(o.selected).removeClass(o.hideClass);var classes = [o.selectedClass];if (o.deselectable) classes.push(o.deselectableClass);				this.$lis.eq(o.selected).addClass(classes.join(' '));var onShow = function() {	self._trigger('show', null,	self.ui(self.$tabs[o.selected], self.$panels[o.selected]));			};
if ($.data(this.$tabs[o.selected], 'load.tabs'))this.load(o.selected, onShow);	else onShow();	}$(window).bind('unload', function() {self.$tabs.unbind('.tabs');				self.$lis = self.$tabs = self.$panels = null;});}else o.selected = this.$lis.index( this.$lis.filter('.' + o.selectedClass)[0] );	if (o.cookie) this._cookie(o.selected, o.cookie);for (var i = 0, li; li = this.$lis[i]; i++)	$(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass(o.selectedClass) ? 'addClass' : 'removeClass'](o.disabledClass);if (o.cache === false) this.$tabs.removeData('cache.tabs');	var hideFx, showFx;	if (o.fx) {	if (o.fx.constructor == Array) {hideFx = o.fx[0];				showFx = o.fx[1];}	else hideFx = showFx = o.fx;}function resetStyle($el, fx) {	$el.css({ display: '' });if ($.browser.msie && fx.opacity) $el[0].style.removeAttribute('filter');}	var showTab = showFx ?	function(clicked, $show) {$show.animate(showFx, showFx.duration || 'normal', function() {$show.removeClass(o.hideClass);					resetStyle($show, showFx);	self._trigger('show', null, self.ui(clicked, $show[0]));});	} :	function(clicked, $show) {	$show.removeClass(o.hideClass);				self._trigger('show', null, self.ui(clicked, $show[0]));};	var hideTab = hideFx ? function(clicked, $hide, $show) {$hide.animate(hideFx, hideFx.duration || 'normal', function() {$hide.addClass(o.hideClass);resetStyle($hide, hideFx);	if ($show) showTab(clicked, $show, $hide);	});	} :	function(clicked, $hide, $show) {				$hide.addClass(o.hideClass);if ($show) showTab(clicked, $show);};	function switchTab(clicked, $li, $hide, $show) {var classes = [o.selectedClass];	if (o.deselectable) classes.push(o.deselectableClass);$li.addClass(classes.join(' ')).siblings().removeClass(classes.join(' '));	hideTab(clicked, $hide, $show);	}
this.$tabs.unbind('.tabs').bind(o.event + '.tabs', function() {	var $li = $(this).parents('li:eq(0)'),	$hide = self.$panels.filter(':visible'),$show = $(self._sanitizeSelector(this.hash));	if (($li.hasClass(o.selectedClass) && !o.deselectable)	|| $li.hasClass(o.disabledClass) || $(this).hasClass(o.loadingClass)				|| self._trigger('select', null, self.ui(this, $show[0])) === false	) {	this.blur();return false;}	o.selected = self.$tabs.index(this);if (o.deselectable) {				if ($li.hasClass(o.selectedClass)) {self.options.selected = null;$li.removeClass([o.selectedClass, o.deselectableClass].join(' '));	self.$panels.stop();					hideTab(this, $hide);this.blur();return false;} else if (!$hide.length) {self.$panels.stop();var a = this;	self.load(self.$tabs.index(this), function() {						$li.addClass([o.selectedClass, o.deselectableClass].join(' '));	showTab(a, $show);});this.blur();return false;	}}if (o.cookie) self._cookie(o.selected, o.cookie);			self.$panels.stop();if ($show.length) {	var a = this;self.load(self.$tabs.index(this), $hide.length ? function() {switchTab(a, $li, $hide, $show);} : function() {
$li.addClass(o.selectedClass);showTab(a, $show);});} else throw 'jQuery UI Tabs: Mismatching fragment identifier.';	if ($.browser.msie) this.blur();return false;});
if (o.event != 'click') this.$tabs.bind('click.tabs', function(){return false;});},
add: function(url, label, index) {	if (index == undefined)	index = this.$tabs.length;var o = this.options;	var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label));$li.data('destroy.tabs', true);	var id = url.indexOf('#') == 0 ? url.replace('#', '') : this._tabId( $('a:first-child', $li)[0] );		var $panel = $('#' + id);	if (!$panel.length) {$panel = $(o.panelTemplate).attr('id', id)	.addClass(o.hideClass)	.data('destroy.tabs', true);}	$panel.addClass(o.panelClass);if (index >= this.$lis.length) {$li.appendTo(this.element);	$panel.appendTo(this.element[0].parentNode);} else {$li.insertBefore(this.$lis[index]);			$panel.insertBefore(this.$panels[index]);}o.disabled = $.map(o.disabled,function(n, i) { return n >= index ? ++n : n });this._tabify();	if (this.$tabs.length == 1) {			$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href = $.data(this.$tabs[0], 'load.tabs');if (href)this.load(index, href);}this._trigger('add', null, this.ui(this.$tabs[index], this.$panels[index]));},	remove: function(index) {var o = this.options, $li = this.$lis.eq(index).remove(),	$panel = this.$panels.eq(index).remove();if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1)this.select(index + (index + 1 < this.$tabs.length ? 1 : -1));o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),	function(n, i) { return n >= index ? --n : n });this._tabify();	this._trigger('remove', null, this.ui($li.find('a')[0], $panel[0]));},	enable: function(index) {var o = this.options;if ($.inArray(index, o.disabled) == -1)	return;	var $li = this.$lis.eq(index).removeClass(o.disabledClass);
if ($.browser.safari) { $li.css('display', 'inline-block');	setTimeout(function() {	$li.css('display', 'block');}, 0);}	o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });	this._trigger('enable', null, this.ui(this.$tabs[index], this.$panels[index]));	},disable: function(index) {var self = this, o = this.options;
if (index != o.selected) { 		this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();	this._trigger('disable', null, this.ui(this.$tabs[index], this.$panels[index]));}},select: function(index) {if (typeof index == 'string')index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] );
this.$tabs.eq(index).trigger(this.options.event + '.tabs');},load: function(index, callback) {	var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0],
bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs');callback = callback || function() {};	if (!url || !bypassCache && $.data(a, 'cache.tabs')) {callback();return;}var inner = function(parent) {var $parent = $(parent), $inner = $parent.find('*:last');return $inner.length && $inner.is(':not(img)') && $inner || $parent;};var cleanup = function() {self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass) .each(function() {if (o.spinner)							inner(this).parent().html(inner(this).data('label.tabs'));}); self.xhr = null;};if (o.spinner) {var label = inner(a).html();inner(a).wrapInner('<em></em>')				.find('em').data('label.tabs', label).html(o.spinner);}var ajaxOptions = $.extend({}, o.ajaxOptions, {url: url,	success: function(r, s) {$(self._sanitizeSelector(a.hash)).html(r);	cleanup();if (o.cache)$.data(a, 'cache.tabs', true); self._trigger('load', null, self.ui(self.$tabs[index], self.$panels[index]));	try {o.ajaxOptions.success(r, s);}	catch (e) {}callback();	}});if (this.xhr) {	this.xhr.abort();cleanup();	}$a.addClass(o.loadingClass);self.xhr = $.ajax(ajaxOptions);},
url: function(index, url) {	this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url);},
	destroy: function() {
		var o = this.options;
		this.element.unbind('.tabs')
			.removeClass(o.navClass).removeData('tabs');
		this.$tabs.each(function() {
			var href = $.data(this, 'href.tabs');
			if (href)
				this.href = href;
			var $this = $(this).unbind('.tabs');
			$.each(['href', 'load', 'cache'], function(i, prefix) {
				$this.removeData(prefix + '.tabs');
			});
		});
		this.$lis.add(this.$panels).each(function() {
			if ($.data(this, 'destroy.tabs'))
				$(this).remove();
			else
				$(this).removeClass([o.selectedClass, o.deselectableClass,
					o.disabledClass, o.panelClass, o.hideClass].join(' '));
		});
		if (o.cookie)
			this._cookie(null, o.cookie);
	}
});

$.extend($.ui.tabs, {version: '@VERSION',getter: 'length',defaults: {deselectable: false,event: 'click',disabled: [],cookie: null, 	spinner: 'Loading&#8230;',		cache: false,	idPrefix: 'ui-tabs-',	ajaxOptions: null,fx: null,	tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate: '<div></div>',
navClass: 'ui-tabs-nav',selectedClass: 'ui-tabs-selected',deselectableClass: 'ui-tabs-deselectable',disabledClass: 'ui-tabs-disabled',panelClass: 'ui-tabs-panel',		hideClass: 'ui-tabs-hide',loadingClass: 'ui-tabs-loading'}});
$.extend($.ui.tabs.prototype, {	rotation: null,	rotate: function(ms, continuing) {continuing = continuing || false;	var self = this, t = this.options.selected;		function start() {	self.rotation = setInterval(function() {t = ++t < self.$tabs.length ? t : 0;self.select(t);	}, ms);}function stop(e) {if (!e || e.clientX) { 				clearInterval(self.rotation);}}	if (ms) {start();if (!continuing)this.$tabs.bind(this.options.event + '.tabs', stop);else this.$tabs.bind(this.options.event + '.tabs', function() {stop();	t = self.options.selected;	start();});}else {	stop();	this.$tabs.unbind(this.options.event + '.tabs', stop);	}}});})(jQuery);

stuHover = function() {
	var cssRule;
	var newSelector;
	for (var i = 0; i < document.styleSheets.length; i++)
		for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
			{
			cssRule = document.styleSheets[i].rules[x];
			if (cssRule.selectorText.indexOf("LI:hover") != -1)
			{
				 newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
				document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
			}
		}
	var getElm = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<getElm.length; i++) {
		getElm[i].onmouseover=function() {
			this.className+=" iehover";
		}
		getElm[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", stuHover);

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2N.3g=6(4){4=23.2H({2B:\'#34\',2g:0.8,1d:F,1M:\'18/5-33-Y.16\',1v:\'18/5-1u-2Q.16\',1E:\'18/5-1u-2L.16\',1W:\'18/5-1u-2I.16\',19:\'18/5-2F.16\',1f:10,2A:3d,2s:\'1j\',2o:\'32\',2j:\'c\',2f:\'p\',2d:\'n\',h:[],9:0},4);f I=N;6 20(){1X(N,I);u F}6 1X(1e,I){$(\'1U, 1S, 1R\').l({\'1Q\':\'2E\'});1O();4.h.B=0;4.9=0;7(I.B==1){4.h.1J(v 1m(1e.17(\'J\'),1e.17(\'2v\')))}j{36(f i=0;i<I.B;i++){4.h.1J(v 1m(I[i].17(\'J\'),I[i].17(\'2v\')))}}2n(4.h[4.9][0]!=1e.17(\'J\')){4.9++}D()}6 1O(){$(\'m\').31(\'<e g="q-13"></e><e g="q-5"><e g="5-s-b-w"><e g="5-s-b"><1w g="5-b"><e 2V="" g="5-k"><a J="#" g="5-k-V"></a><a J="#" g="5-k-X"></a></e><e g="5-Y"><a J="#" g="5-Y-29"><1w W="\'+4.1M+\'"></a></e></e></e><e g="5-s-b-T-w"><e g="5-s-b-T"><e g="5-b-A"><1i g="5-b-A-1t"></1i><1i g="5-b-A-1g"></1i></e><e g="5-1s"><a J="#" g="5-1s-22"><1w W="\'+4.1W+\'"></a></e></e></e></e>\');f z=1D();$(\'#q-13\').l({2K:4.2B,2J:4.2g,S:z[0],P:z[1]}).1V();f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]}).E();$(\'#q-13,#q-5\').C(6(){1a()});$(\'#5-Y-29,#5-1s-22\').C(6(){1a();u F});$(G).2G(6(){f z=1D();$(\'#q-13\').l({S:z[0],P:z[1]});f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]})})}6 D(){$(\'#5-Y\').E();7(4.1d){$(\'#5-b,#5-s-b-T-w,#5-b-A-1g\').1b()}j{$(\'#5-b,#5-k,#5-k-V,#5-k-X,#5-s-b-T-w,#5-b-A-1g\').1b()}f Q=v 1j();Q.1P=6(){$(\'#5-b\').2D(\'W\',4.h[4.9][0]);1N(Q.S,Q.P);Q.1P=6(){}};Q.W=4.h[4.9][0]};6 1N(1o,1r){f 1L=$(\'#5-s-b-w\').S();f 1K=$(\'#5-s-b-w\').P();f 1n=(1o+(4.1f*2));f 1y=(1r+(4.1f*2));f 1I=1L-1n;f 2z=1K-1y;$(\'#5-s-b-w\').3f({S:1n,P:1y},4.2A,6(){2y()});7((1I==0)&&(2z==0)){7($.3e.3c){1H(3b)}j{1H(3a)}}$(\'#5-s-b-T-w\').l({S:1o});$(\'#5-k-V,#5-k-X\').l({P:1r+(4.1f*2)})};6 2y(){$(\'#5-Y\').1b();$(\'#5-b\').1V(6(){2u();2t()});2r()};6 2u(){$(\'#5-s-b-T-w\').38(\'35\');$(\'#5-b-A-1t\').1b();7(4.h[4.9][1]){$(\'#5-b-A-1t\').2p(4.h[4.9][1]).E()}7(4.h.B>1){$(\'#5-b-A-1g\').2p(4.2s+\' \'+(4.9+1)+\' \'+4.2o+\' \'+4.h.B).E()}}6 2t(){$(\'#5-k\').E();$(\'#5-k-V,#5-k-X\').l({\'K\':\'1C M(\'+4.19+\') L-O\'});7(4.9!=0){7(4.1d){$(\'#5-k-V\').l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9-1;D();u F})}j{$(\'#5-k-V\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9-1;D();u F})}}7(4.9!=(4.h.B-1)){7(4.1d){$(\'#5-k-X\').l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9+1;D();u F})}j{$(\'#5-k-X\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9+1;D();u F})}}2k()}6 2k(){$(d).30(6(12){2i(12)})}6 1G(){$(d).11()}6 2i(12){7(12==2h){U=2Z.2e;1x=27}j{U=12.2e;1x=12.2Y}14=2X.2W(U).2U();7((14==4.2j)||(14==\'x\')||(U==1x)){1a()}7((14==4.2f)||(U==37)){7(4.9!=0){4.9=4.9-1;D();1G()}}7((14==4.2d)||(U==39)){7(4.9!=(4.h.B-1)){4.9=4.9+1;D();1G()}}}6 2r(){7((4.h.B-1)>4.9){2c=v 1j();2c.W=4.h[4.9+1][0]}7(4.9>0){2b=v 1j();2b.W=4.h[4.9-1][0]}}6 1a(){$(\'#q-5\').2a();$(\'#q-13\').2T(6(){$(\'#q-13\').2a()});$(\'1U, 1S, 1R\').l({\'1Q\':\'2S\'})}6 1D(){f o,r;7(G.1h&&G.28){o=G.26+G.2R;r=G.1h+G.28}j 7(d.m.25>d.m.24){o=d.m.2P;r=d.m.25}j{o=d.m.2O;r=d.m.24}f y,H;7(Z.1h){7(d.t.1l){y=d.t.1l}j{y=Z.26}H=Z.1h}j 7(d.t&&d.t.1A){y=d.t.1l;H=d.t.1A}j 7(d.m){y=d.m.1l;H=d.m.1A}7(r<H){1z=H}j{1z=r}7(o<y){1B=o}j{1B=y}21=v 1m(1B,1z,y,H);u 21};6 1p(){f o,r;7(Z.1Z){r=Z.1Z;o=Z.2M}j 7(d.t&&d.t.1F){r=d.t.1F;o=d.t.1Y}j 7(d.m){r=d.m.1F;o=d.m.1Y}2q=v 1m(o,r);u 2q};6 1H(2C){f 2x=v 2w();1q=2h;3h{f 1q=v 2w()}2n(1q-2x<2C)};u N.11(\'C\').C(20)}})(23);',62,204,'||||settings|lightbox|function|if||activeImage||image||document|div|var|id|imageArray||else|nav|css|body||xScroll||jquery|yScroll|container|documentElement|return|new|box||windowWidth|arrPageSizes|details|length|click|_set_image_to_view|show|false|window|windowHeight|jQueryMatchedObj|href|background|no|url|this|repeat|height|objImagePreloader|arrPageScroll|width|data|keycode|btnPrev|src|btnNext|loading|self||unbind|objEvent|overlay|key||gif|getAttribute|images|imageBlank|_finish|hide|left|fixedNavigation|objClicked|containerBorderSize|currentNumber|innerHeight|span|Image|bind|clientWidth|Array|intWidth|intImageWidth|___getPageScroll|curDate|intImageHeight|secNav|caption|btn|imageBtnPrev|img|escapeKey|intHeight|pageHeight|clientHeight|pageWidth|transparent|___getPageSize|imageBtnNext|scrollTop|_disable_keyboard_navigation|___pause|intDiffW|push|intCurrentHeight|intCurrentWidth|imageLoading|_resize_container_image_box|_set_interface|onload|visibility|select|object|top|embed|fadeIn|imageBtnClose|_start|scrollLeft|pageYOffset|_initialize|arrayPageSize|btnClose|jQuery|offsetHeight|scrollHeight|innerWidth||scrollMaxY|link|remove|objPrev|objNext|keyToNext|keyCode|keyToPrev|overlayOpacity|null|_keyboard_action|keyToClose|_enable_keyboard_navigation|right|hover|while|txtOf|html|arrayPageScroll|_preload_neighbor_images|txtImage|_set_navigation|_show_image_data|title|Date|date|_show_image|intDiffH|containerResizeSpeed|overlayBgColor|ms|attr|hidden|blank|resize|extend|close|opacity|backgroundColor|next|pageXOffset|fn|offsetWidth|scrollWidth|prev|scrollMaxX|visible|fadeOut|toLowerCase|style|fromCharCode|String|DOM_VK_ESCAPE|event|keydown|append|of|ico|000|fast|for||slideDown||100|250|msie|400|browser|animate|lightBox|do'.split('|'),0,{}))

/*
$(function() {$('#container-1 > ul').tabs();$('#container-1').tabs({select: function(event, ui) {window.location.hash = ui.tab.hash;}});if(document.location.hash!='') {
 tabSelect = document.location.hash.substr(1,document.location.hash.length);$("#container-1").tabs('select',tabSelect-1);}  $('a[@class*=lightBOXMakeup]').lightBox({imageLoading: 'http://sunnyislesmiamirealestate.com/images/lightbox_ico_loading.gif',imageBtnClose: 'http://sunnyislesmiamirealestate.com/images/lightbox_btn_close.gif',imageBtnPrev: 'http://sunnyislesmiamirealestate.com/images/lightbox_btn_prev.gif',imageBtnNext: 'http://sunnyislesmiamirealestate.com/images/lightbox_btn_next.gif'}); });
*/

$(function() {$('#container-1 > ul').tabs();$('#container-1').tabs({select: function(event, ui) {window.location.hash = ui.tab.hash;}});if(document.location.hash!='') {
 tabSelect = document.location.hash.substr(1,document.location.hash.length);$("#container-1").tabs('select',tabSelect-1);}  $('a[@class*=lightBOXMakeup]').lightBox({imageLoading: 'http://sunnyislesmiamirealestate.com/images/lightbox_ico_loading.gif',imageBtnClose: 'http://sunnyislesmiamirealestate.com/images/lightbox_btn_close.gif',imageBtnPrev: 'http://sunnyislesmiamirealestate.com/images/lightbox_btn_prev.gif',imageBtnNext: 'http://sunnyislesmiamirealestate.com/images/lightbox_btn_next.gif'}); });
	var slideshow2_noFading = false;	
	var slideshow2_timeBetweenSlides = 6000;	
	var slideshow2_fadingSpeed = 20;		
	
	var slideshow2_galleryHeigh;	
	var slideshow2_galleryContainer;	
	var slideshow2_galleryWidth;	
	var slideshow2_slideIndex = -1;
	var slideshow2_slideIndexNext = false;	
	var slideshow2_imageDivs = new Array();	
	var slideshow2_currentOpacity = 100;	
	var slideshow2_imagesInGallery = false;		
	function getGalleryImageSize(imageIndex)
	{
		if(imageIndex==slideshow2_imagesInGallery){			
			showGallery();
		}else{
			var imgObj = document.getElementById('galleryImage' + imageIndex);
			var imgWidth = imgObj.width;
			var imgHeight = imgObj.height;
			if(imgWidth>50){						
				var tmpDiv = document.createElement('DIV');
				tmpDiv.id = 'galleryDiv' + imageIndex;
				tmpDiv.style.visibility = 'hidden';
				tmpDiv.className='imageInGallery';
				slideshow2_galleryContainer.appendChild(tmpDiv);
				tmpDiv.appendChild(imgObj);
				imgObj.style.left = Math.round((slideshow2_galleryWidth - imgWidth)/2)  + "px";
				imgObj.style.top = Math.round((slideshow2_galleryHeight - imgHeight)/2)  + "px";
				tmpDiv.style.visibility = 'hidden';
				slideshow2_imageDivs.push(tmpDiv);
				imageIndex++;
				getGalleryImageSize(imageIndex);
			}else{
				setTimeout('getGalleryImageSize(' + imageIndex + ')',10);
			}
		}		
	}
	
	function showGallery()
	{
		if(slideshow2_slideIndex==-1)slideshow2_slideIndex=0; else slideshow2_slideIndex++;	
		if(slideshow2_slideIndex==slideshow2_imageDivs.length)slideshow2_slideIndex=0;
		slideshow2_slideIndexNext = slideshow2_slideIndex+1;	
		if(slideshow2_slideIndexNext==slideshow2_imageDivs.length)slideshow2_slideIndexNext = 0;
		
		slideshow2_currentOpacity=100;	

		
		slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'visible';
		if(navigator.userAgent.indexOf('Opera')<0){
			slideshow2_imageDivs[slideshow2_slideIndexNext].style.visibility = 'visible';
		}
		
		
		if(document.all){	
			slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity=100)';
			slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity=1)';
		}else{
			slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = 0.99;	
			slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = 0.01;
		}		
		

		setTimeout('revealImage()',slideshow2_timeBetweenSlides);		
	}
	
	function revealImage()
	{
		if(slideshow2_noFading){
			slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';
			showGallery();
			return;
		}
		slideshow2_currentOpacity--;
		if(document.all){
			slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity='+slideshow2_currentOpacity+')';
			slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity='+(100-slideshow2_currentOpacity)+')';
		}else{
			slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = Math.max(0.01,slideshow2_currentOpacity/100);	// Can't use 1 and 0 because of screen flickering in FF
			slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = Math.min(0.99,(1 - (slideshow2_currentOpacity/100)));
		}
		if(slideshow2_currentOpacity>0){
			setTimeout('revealImage()',slideshow2_fadingSpeed);
		}else{
			slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';			
			showGallery();
		}
	}
	
	function initImageGallery()
	{
		slideshow2_galleryContainer = document.getElementById('imageSlideshowHolder');
		slideshow2_galleryWidth = slideshow2_galleryContainer.clientWidth;
		slideshow2_galleryHeight = slideshow2_galleryContainer.clientHeight;
		galleryImgArray = slideshow2_galleryContainer.getElementsByTagName('IMG');
		for(var no=0;no<galleryImgArray.length;no++){
			galleryImgArray[no].id = 'galleryImage' + no;
		}
		slideshow2_imagesInGallery = galleryImgArray.length;
		getGalleryImageSize(0);		
		
	}
	
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */

/*

	GalleryView - jQuery Content Gallery Plugin
	Author: 		Jack Anderson
	Version:		1.1 (April 5, 2009)
	Documentation: 	http://www.spaceforaname.com/jquery/galleryview/
	
	Please use this development script if you intend to make changes to the
	plugin code.  For production sites, please use jquery.galleryview-1.0.1-pack.js.
	
*/
(function($){
	$.fn.galleryView = function(options) {
		var opts = $.extend($.fn.galleryView.defaults,options);
		var id;
		var iterator = 0;
		var gallery_width;
		var gallery_height;
		var frame_margin = 10;
		var strip_width;
		var wrapper_width;
		var item_count = 0;
		var slide_method;
		var img_path;
		var paused = false;
		var frame_caption_size = 20;
		var frame_margin_top = 5;
		var pointer_width = 2;
		
		//Define jQuery objects for reuse
		var j_gallery;
		var j_filmstrip;
		var j_frames;
		var j_panels;
		var j_pointer;
		
/************************************************/
/*	Plugin Methods								*/
/************************************************/	
		function showItem(i) {
			//Disable next/prev buttons until transition is complete
			$('img.nav-next').unbind('click');
			$('img.nav-prev').unbind('click');
			j_frames.unbind('click');
			if(has_panels) {
				if(opts.fade_panels) {
					//Fade out all panels and fade in target panel
					j_panels.fadeOut(opts.transition_speed).eq(i%item_count).fadeIn(opts.transition_speed,function(){
						if(!has_filmstrip) {
							$('img.nav-prev').click(showPrevItem);
							$('img.nav-next').click(showNextItem);		
						}
					});
				} 
			}
			
			if(has_filmstrip) {
				//Slide either pointer or filmstrip, depending on transition method
				if(slide_method=='strip') {
					//Stop filmstrip if it's currently in motion
					j_filmstrip.stop();
					
					//Determine distance between pointer (eventual destination) and target frame
					var distance = getPos(j_frames[i]).left - (getPos(j_pointer[0]).left+2);
					var leftstr = (distance>=0?'-=':'+=')+Math.abs(distance)+'px';
					
					//Animate filmstrip and slide target frame under pointer
					//If target frame is a duplicate, jump back to 'original' frame
					j_filmstrip.animate({
						'left':leftstr
					},opts.transition_speed,opts.easing,function(){
						//Always ensure that there are a sufficient number of hidden frames on either
						//side of the filmstrip to avoid empty frames
						if(i>item_count) {
							i = i%item_count;
							iterator = i;
							j_filmstrip.css('left','-'+((opts.frame_width+frame_margin)*i)+'px');
						} else if (i<=(item_count-strip_size)) {
							i = (i%item_count)+item_count;
							iterator = i;
							j_filmstrip.css('left','-'+((opts.frame_width+frame_margin)*i)+'px');
						}
						
						if(!opts.fade_panels) {
							j_panels.hide().eq(i%item_count).show();
						}
						$('img.nav-prev').click(showPrevItem);
						$('img.nav-next').click(showNextItem);
						enableFrameClicking();
					});
				} else if(slide_method=='pointer') {
					//Stop pointer if it's currently in motion
					j_pointer.stop();
					//Get position of target frame
					var pos = getPos(j_frames[i]);
					//Slide the pointer over the target frame
					j_pointer.animate({
						'left':(pos.left-2+'px')
					},opts.transition_speed,opts.easing,function(){	
						if(!opts.fade_panels) {
							j_panels.hide().eq(i%item_count).show();
						}	
						$('img.nav-prev').click(showPrevItem);
						$('img.nav-next').click(showNextItem);
						enableFrameClicking();
					});
				}
			
				if($('a',j_frames[i])[0]) {
					j_pointer.unbind('click').click(function(){
						var a = $('a',j_frames[i]).eq(0);
						if(a.attr('target')=='_blank') {window.open(a.attr('href'));}
						else {location.href = a.attr('href');}
					});
				}
			}
		};
		function showNextItem() {
			$(document).stopTime("transition");
			if(++iterator==j_frames.length) {iterator=0;}
			showItem(iterator);
			$(document).everyTime(opts.transition_interval,"transition",function(){
				showNextItem();
			});
		};
		function showPrevItem() {
			$(document).stopTime("transition");
			if(--iterator<0) {iterator = item_count-1;}
			//alert(iterator);
			showItem(iterator);
			$(document).everyTime(opts.transition_interval,"transition",function(){
				showNextItem();
			});
		};
		function getPos(el) {
			var left = 0, top = 0;
			var el_id = el.id;
			if(el.offsetParent) {
				do {
					left += el.offsetLeft;
					top += el.offsetTop;
				} while(el = el.offsetParent);
			}
			//If we want the position of the gallery itself, return it
			if(el_id == id) {return {'left':left,'top':top};}
			//Otherwise, get position of element relative to gallery
			else {
				var gPos = getPos(j_gallery[0]);
				var gLeft = gPos.left;
				var gTop = gPos.top;
				
				return {'left':left-gLeft,'top':top-gTop};
			}
		};
		function enableFrameClicking() {
			j_frames.each(function(i){
				//If there isn't a link in this frame, set up frame to slide on click
				//Frames with links will handle themselves
				if($('a',this).length==0) {
					$(this).click(function(){
						$(document).stopTime("transition");
						showItem(i);
						iterator = i;
						$(document).everyTime(opts.transition_interval,"transition",function(){
							showNextItem();
						});
					});
				}
			});
		};
		
		function buildPanels() {
			//If there are panel captions, add overlay divs
			if($('.panel-overlay').length>0) {j_panels.append('<div class="overlay"></div>');}
			
			if(!has_filmstrip) {
				//Add navigation buttons
				$('<img />').addClass('nav-next').attr('src',img_path+opts.nav_theme+'/next.png').appendTo(j_gallery).css({
					'position':'absolute',
					'zIndex':'1100',
					'cursor':'pointer',
					'top':((opts.panel_height-22)/2)+'px',
					'right':'10px',
					'display':'none'
				}).click(showNextItem);
				$('<img />').addClass('nav-prev').attr('src',img_path+opts.nav_theme+'/prev.png').appendTo(j_gallery).css({
					'position':'absolute',
					'zIndex':'1100',
					'cursor':'pointer',
					'top':((opts.panel_height-22)/2)+'px',
					'left':'10px',
					'display':'none'
				}).click(showPrevItem);
				
				$('<img />').addClass('nav-overlay').attr('src',img_path+opts.nav_theme+'/panel-nav-next.png').appendTo(j_gallery).css({
					'position':'absolute',
					'zIndex':'1099',
					'top':((opts.panel_height-22)/2)-10+'px',
					'right':'0',
					'display':'none'
				});
				
				$('<img />').addClass('nav-overlay').attr('src',img_path+opts.nav_theme+'/panel-nav-prev.png').appendTo(j_gallery).css({
					'position':'absolute',
					'zIndex':'1099',
					'top':((opts.panel_height-22)/2)-10+'px',
					'left':'0',
					'display':'none'
				});
			}
			j_panels.css({
				'width':(opts.panel_width-parseInt(j_panels.css('paddingLeft').split('px')[0],10)-parseInt(j_panels.css('paddingRight').split('px')[0],10))+'px',
				'height':(opts.panel_height-parseInt(j_panels.css('paddingTop').split('px')[0],10)-parseInt(j_panels.css('paddingBottom').split('px')[0],10))+'px',
				'position':'absolute',
				'top':(opts.filmstrip_position=='top'?(opts.frame_height+frame_margin_top+(opts.show_captions?frame_caption_size:frame_margin_top))+'px':'0px'),
				'left':'0px',
				'overflow':'hidden',
				'background':'white',
				'display':'none'
			});
			$('.panel-overlay',j_panels).css({
				'position':'absolute',
				'zIndex':'999',
				'width':(opts.panel_width-20)+'px',
				'height':opts.overlay_height+'px',
				'top':(opts.overlay_position=='top'?'0':opts.panel_height-opts.overlay_height+'px'),
				'left':'0',
				'padding':'0 10px',
				'color':opts.overlay_text_color,
				'fontSize':opts.overlay_font_size
			});
			$('.panel-overlay a',j_panels).css({
				'color':opts.overlay_text_color,
				'textDecoration':'underline',
				'fontWeight':'bold'
			});
			$('.overlay',j_panels).css({
				'position':'absolute',
				'zIndex':'998',
				'width':opts.panel_width+'px',
				'height':opts.overlay_height+'px',
				'top':(opts.overlay_position=='top'?'0':opts.panel_height-opts.overlay_height+'px'),
				'left':'0',
				'background':opts.overlay_color,
				'opacity':opts.overlay_opacity
			});
			$('.panel iframe',j_panels).css({
				'width':opts.panel_width+'px',
				'height':(opts.panel_height-opts.overlay_height)+'px',
				'border':'0'
			});
		};
		
		function buildFilmstrip() {
			//Add wrapper to filmstrip to hide extra frames
			j_filmstrip.wrap('<div class="strip_wrapper"></div>');
			if(slide_method=='strip') {
				j_frames.clone().appendTo(j_filmstrip);
				j_frames.clone().appendTo(j_filmstrip);
				j_frames = $('li',j_filmstrip);
			}
			//If captions are enabled, add caption divs and fill with the image titles
			if(opts.show_captions) {
				j_frames.append('<div class="caption"></div>').each(function(i){
					$(this).find('.caption').html($(this).find('img').attr('title'));			   
				});
			}
			
			j_filmstrip.css({
				'listStyle':'none',
				'margin':'0',
				'padding':'0',
				'width':strip_width+'px',
				'position':'absolute',
				'zIndex':'900',
				'top':'0',
				'left':'0',
				'height':(opts.frame_height+10)+'px',
				'background':opts.background_color
			});
			j_frames.css({
				'float':'left',
				'position':'relative',
				'height':opts.frame_height+'px',
				'zIndex':'901',
				'marginTop':frame_margin_top+'px',
				'marginBottom':'0px',
				'marginRight':frame_margin+'px',
				'padding':'0',
				'cursor':'pointer'
			});
			$('img',j_frames).css({
				'border':'none'
			});
			$('.strip_wrapper',j_gallery).css({
				'position':'absolute',
				'top':(opts.filmstrip_position=='top'?'0px':opts.panel_height+'px'),
				'left':((gallery_width-wrapper_width)/2)+'px',
				'width':wrapper_width+'px',
				'height':(opts.frame_height+frame_margin_top+(opts.show_captions?frame_caption_size:frame_margin_top))+'px',
				'overflow':'hidden'
			});
			$('.caption',j_gallery).css({
				'position':'absolute',
				'top':opts.frame_height+'px',
				'left':'0',
				'margin':'0',
				'width':opts.frame_width+'px',
				'padding':'0',
				'color':opts.caption_text_color,
				'textAlign':'center',
				'fontSize':'10px',
				'height':frame_caption_size+'px',
				
				'lineHeight':frame_caption_size+'px'
			});
			var pointer = $('<div></div>');
			pointer.attr('id','pointer').appendTo(j_gallery).css({
				 'position':'absolute',
				 'zIndex':'1000',
				 'cursor':'pointer',
				 'top':getPos(j_frames[0]).top-(pointer_width/2)+'px',
				 'left':getPos(j_frames[0]).left-(pointer_width/2)+'px',
				 'height':opts.frame_height-pointer_width+'px',
				 'width':opts.frame_width-pointer_width+'px',
				 'border':(has_panels?pointer_width+'px solid '+(opts.nav_theme=='dark'?'black':'white'):'none')
			});
			j_pointer = $('#pointer',j_gallery);
			//if(has_panels) {
				//var pointerArrow = $('<img />');
				//pointerArrow.attr('src',img_path+opts.nav_theme+'/pointer'+(opts.filmstrip_position=='top'?'-down':'')+'.png').appendTo($('#pointer')).css({
					//'position':'absolute',
					//'zIndex':'1001',
					//'top':(opts.filmstrip_position=='bottom'?'-'+(10+pointer_width)+'px':opts.frame_height+'px'),
					//'left':((opts.frame_width/2)-10)+'px'
				//});
			//}
			
			//If the filmstrip is animating, move the strip to the middle third
			if(slide_method=='strip') {
				j_filmstrip.css('left','-'+((opts.frame_width+frame_margin)*item_count)+'px');
				iterator = item_count;
			}
			//If there's a link under the pointer, enable clicking on the pointer
			if($('a',j_frames[iterator])[0]) {
				j_pointer.click(function(){
					var a = $('a',j_frames[iterator]).eq(0);
					if(a.attr('target')=='_blank') {window.open(a.attr('href'));}
					else {location.href = a.attr('href');}
				});
			}
			
			//Add navigation buttons
			
			
		};
		
		//Check mouse to see if it is within the borders of the panel
		//More reliable than 'mouseover' event when elements overlay the panel
		function mouseIsOverPanels(x,y) {		
			var pos = getPos(j_gallery[0]);
			var top = pos.top;
			var left = pos.left;
			return x > left && x < left+opts.panel_width && y > top && y < top+opts.panel_height;				
		};
		
/************************************************/
/*	Main Plugin Code							*/
/************************************************/
		return this.each(function() {
			j_gallery = $(this);
			//Determine path between current page and filmstrip images
			//Scan script tags and look for path to GalleryView plugin
			$('script').each(function(i){
				var s = $(this);
				if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
					img_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';	
				}
			});
			
			//Hide gallery to prevent Flash of Unstyled Content (FoUC) in IE
			j_gallery.css('visibility','hidden');
			
			//Assign elements to variables for reuse
			j_filmstrip = $('.filmstrip',j_gallery);
			j_frames = $('li',j_filmstrip);
			j_panels = $('.panel',j_gallery);
			
			id = j_gallery.attr('id');
			
			has_panels = j_panels.length > 0;
			has_filmstrip = j_frames.length > 0;
			
			if(!has_panels) opts.panel_height = 0;
			
			//Number of frames in filmstrip
			item_count = has_panels?j_panels.length:j_frames.length;
			
			//Number of frames that can display within the screen's width
			//64 = width of block for navigation button * 2
			//5 = minimum frame margin
			strip_size = has_panels?Math.floor((opts.panel_width-64)/(opts.frame_width+frame_margin)):Math.min(item_count,opts.filmstrip_size); 
			
			
			/************************************************/
			/*	Determine transition method for filmstrip	*/
			/************************************************/
					//If more items than strip size, slide filmstrip
					//Otherwise, slide pointer
					if(strip_size >= item_count) {
						slide_method = 'pointer';
						strip_size = item_count;
					}
					else {slide_method = 'strip';}
			
			/************************************************/
			/*	Determine dimensions of various elements	*/
			/************************************************/
					
					//Width of gallery block
					gallery_width = has_panels?opts.panel_width:(strip_size*(opts.frame_width+frame_margin))-frame_margin+64;
					
					//Height of gallery block = screen + filmstrip + captions (optional)
					gallery_height = (has_panels?opts.panel_height:0)+(has_filmstrip?opts.frame_height+frame_margin_top+(opts.show_captions?frame_caption_size:frame_margin_top):0);
					
					//Width of filmstrip
					if(slide_method == 'pointer') {strip_width = (opts.frame_width*item_count)+(frame_margin*(item_count));}
					else {strip_width = (opts.frame_width*item_count*3)+(frame_margin*(item_count*3));}
					
					//Width of filmstrip wrapper (to hide overflow)
					wrapper_width = ((strip_size*opts.frame_width)+((strip_size-1)*frame_margin));
			
			/************************************************/
			/*	Apply CSS Styles							*/
			/************************************************/
					j_gallery.css({
						'position':'relative',
						'margin':'5px 0 0 27px',
						'background':opts.background_color,
						'border':opts.border,
						'width':gallery_width+'px',
						'height':gallery_height+'px'
					});
			
			/************************************************/
			/*	Build filmstrip and/or panels				*/
			/************************************************/
					if(has_filmstrip) {
						buildFilmstrip();
					}
					if(has_panels) {
						buildPanels();
					}

			
			/************************************************/
			/*	Add events to various elements				*/
			/************************************************/
					if(has_filmstrip) enableFrameClicking();
					
						
						
						$().mousemove(function(e){							
							if(mouseIsOverPanels(e.pageX,e.pageY)) {
								if(opts.pause_on_hover) {
									$(document).oneTime(500,"animation_pause",function(){
										$(document).stopTime("transition");
										paused=true;
									});
								}
								if(has_panels && !has_filmstrip) {
									$('.nav-overlay').fadeIn('fast');
									$('.nav-next').fadeIn('fast');
									$('.nav-prev').fadeIn('fast');
								}
							} else {
								if(opts.pause_on_hover) {
									$(document).stopTime("animation_pause");
									if(paused) {
										$(document).everyTime(opts.transition_interval,"transition",function(){
											showNextItem();
										});
										paused = false;
									}
								}
								if(has_panels && !has_filmstrip) {
									$('.nav-overlay').fadeOut('fast');
									$('.nav-next').fadeOut('fast');
									$('.nav-prev').fadeOut('fast');
								}
							}
						});
			
			
			/************************************************/
			/*	Initiate Automated Animation				*/
			/************************************************/
					//Show the first panel
					j_panels.eq(0).show();

					//If we have more than one item, begin automated transitions
					if(item_count > 1) {
						$(document).everyTime(opts.transition_interval,"transition",function(){
							showNextItem();
						});
					}
					
					//Make gallery visible now that work is complete
					j_gallery.css('visibility','visible');
		});
	};
	
	$.fn.galleryView.defaults = {
		panel_width: 626,
		panel_height: 335,
		frame_width: 80,
		frame_height: 80,
		filmstrip_size: 3,
		overlay_height: 70,
		overlay_font_size: '1em',
		transition_speed: 400,
		transition_interval: 6000,
		overlay_opacity: 0.6,
		overlay_color: 'black',
		background_color: 'black',
		overlay_text_color: 'white',
		caption_text_color: 'white',
		border: '1px solid black',
		nav_theme: 'light',
		easing: 'swing',
		filmstrip_position: 'bottom',
		overlay_position: 'bottom',
		show_captions: false,
		fade_panels: true,
		pause_on_hover: false
	};
})(jQuery);

/**
 * jQuery.timers - Timer abstractions for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/02/08
 *
 * @author Blair Mitchelmore
 * @version 1.1.2
 *
 **/

jQuery.fn.extend({
	everyTime: function(interval, label, fn, times, belay) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times, belay);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.event.special

jQuery.extend({
	timer: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result[2]) {
				var num = parseFloat(result[1]);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times, belay) {
			var counter = 0;
			
			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}
			
			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
				return;

			if (times && times.constructor != Number) {
				belay = !!times;
				times = 0;
			}
			
			times = times || 0;
			belay = belay || false;
			
			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
			
			if (!timers[label])
				timers[label] = {};
			
			fn.timerID = fn.timerID || this.guid++;
			
			var handler = function() {
				if (belay && this.inProgress) 
					return;
				this.inProgress = true;
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
				this.inProgress = false;
			};
			
			handler.timerID = fn.timerID;
			
			if (!timers[label][fn.timerID])
				timers[label][fn.timerID] = window.setInterval(handler,interval);
			
			this.global.push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = jQuery.data(element, this.dataKey), ret;
			
			if ( timers ) {
				
				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.timerID ) {
							window.clearInterval(timers[label][fn.timerID]);
							delete timers[label][fn.timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}
					
					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}
				
				for ( ret in timers ) break;
				if ( !ret ) 
					jQuery.removeData(element, this.dataKey);
			}
		}
	}
});

jQuery(window).bind("unload", function() {
	jQuery.each(jQuery.timer.global, function(index, item) {
		jQuery.timer.remove(item);
	});
});


$(document).ready(function(){
		if(document.getElementById('photos'))
		{
			$('#photos').galleryView({
				panel_width: 626,
				panel_height: 335,
				frame_width: 80,
				frame_height: 80
			});
		}
		else if(document.getElementById('photosVilla'))
		{
				
				$('#photosVilla').galleryView({
				panel_width: GallWidth,
				panel_height: GallHeight,
				frame_width: 80,
				frame_height: 80
			});
				
				$('#photosVilla').css('margin','0px');
		}
			
	});

