
(
	function($)
	{
		function bindActor()
		{
			var args = Array.prototype.slice.call(arguments);
			var obj = null;
			var fn;
			var complete;
			
			if (typeof args[0] === "object") {
				obj = args.shift();
				fn = args.shift();
				if(fn == "animate") {
					complete = true;
				}
			}
			
		    if (typeof fn === "string") {	
				fn = obj[fn]
			} else {
				fn = args.shift();
			}
			return function (cb)
			{
		    	var r;
				if(complete) {
					var r = $.promise(
						function(dfd)
						{
							args[1].complete = dfd.resolve;
							fn.apply(obj, args);
						}
					);
				} else {
					r = fn.apply(obj, args);
				}
 				
				if(r && r.isResolved) {
					
					$.when(r).done(
						function()
						{
							
							cb(r);
						}
					);
				} else {
					
					cb(r);
				}
				return r;
			};
		}

		$.extend(
			{
				mobile: {}, // hack to loads parts of jQuery mobile
				promise: function(f, c)
				{
					return $.Deferred(f).promise();
					
					
					/*var dfd = $.Deferred(c === false ? null : f).promise();
					// using c to try and get things to fire only when its their turn in a chain
					if(c === false) {
						dfd.chain = function()
						{
							f(dfd);
							return dfd;
						}
					}
					return dfd;*/
				},
				chain: function (things, res)
				{
					res = res || [];
					return $.promise(
						function(dfd)
						{
							(
								function LOOP (i, len)
								{
							    	if (i >= len) {
										return dfd.resolve();
										//return cb();
									}
									/*if($.isFunction(things[i])) {
										things[i] = [$, "promise", things[i], false];
									}*/
							    	if ($.isArray(things[i])) {
							      		things[i] = bindActor.apply(
											null,
											$.map(
												things[i],
												function(i)
												{
													return (i===$.chain.first) ? res[0] : (i===$.chain.last) ? res[res.length - 1] : i;
												}
											)
										);
									} else if(things[i].chain !== null) {
										things[i] = bindActor.apply(null, [things[i].chain]);
									}
							    	if (!things[i]) {
										return LOOP(i + 1, len);
									}
		
							    	things[i](
										function (data)
										{
							      			res.push(data);
							      			LOOP(i + 1, len);
							    		}
									);
								}
							)(0, things.length);
						}
					);
	
				},
				scripts: function(scripts)
				{
					var dfds = new Array();
					var req = $.getScript;
					$.each(
						scripts,
						function(i)
						{
							if($.isArray(this)) {
								var chained = new Array();
								$.each(
									this,
									function(i)
									{
										chained.push([req, this]);
									}
								);
								dfds.push($.chain(chained));
							} else {
								dfds.push(req(this));
							}	
						}
					);
					return $.when.apply($, dfds);
				}
			}
			
		);
		$.chain.first = {};
		$.chain.last = {};
		
	}
)(jQuery);/*
* jQuery Mobile Framework : resolution and CSS media query related helpers and behavior
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($, undefined ) {

var $window = $(window),
	$html = $( "html" ),

	//media-query-like width breakpoints, which are translated to classes on the html element
	resolutionBreakpoints = [320,480,768,1024];


/* $.mobile.media method: pass a CSS media type or query and get a bool return
	note: this feature relies on actual media query support for media queries, though types will work most anywhere
	examples:
		$.mobile.media('screen') //>> tests for screen media type
		$.mobile.media('screen and (min-width: 480px)') //>> tests for screen media type with window width > 480px
		$.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') //>> tests for webkit 2x pixel ratio (iPhone 4)
*/
$.mobile.media = (function() {
	// TODO: use window.matchMedia once at least one UA implements it
	var cache = {},
		testDiv = $( "<div id='jquery-mediatest'>" ),
		fakeBody = $( "<body>" ).append( testDiv );

	return function( query ) {
		if ( !( query in cache ) ) {
			var styleBlock = document.createElement('style'),
        		cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }";
	        //must set type for IE!	
	        styleBlock.type = "text/css";
	        if (styleBlock.styleSheet){ 
	          styleBlock.styleSheet.cssText = cssrule;
	        } 
	        else {
	          styleBlock.appendChild(document.createTextNode(cssrule));
	        } 
				
			$html.prepend( fakeBody ).prepend( styleBlock );
			cache[ query ] = testDiv.css( "position" ) === "absolute";
			fakeBody.add( styleBlock ).remove();
		}
		return cache[ query ];
	};
})();

/*
	private function for adding/removing breakpoint classes to HTML element for faux media-query support
	It does not require media query support, instead using JS to detect screen width > cross-browser support
	This function is called on orientationchange, resize, and mobileinit, and is bound via the 'htmlclass' event namespace
*/
function detectResolutionBreakpoints(){
	var currWidth = $window.width(),
		minPrefix = "min-width-",
		maxPrefix = "max-width-",
		minBreakpoints = [],
		maxBreakpoints = [],
		unit = "px",
		breakpointClasses;

	$html.removeClass( minPrefix + resolutionBreakpoints.join(unit + " " + minPrefix) + unit + " " +
		maxPrefix + resolutionBreakpoints.join( unit + " " + maxPrefix) + unit );

	$.each(resolutionBreakpoints,function( i, breakPoint ){
		if( currWidth >= breakPoint ){
			minBreakpoints.push( minPrefix + breakPoint + unit );
		}
		if( currWidth <= breakPoint ){
			maxBreakpoints.push( maxPrefix + breakPoint + unit );
		}
	});

	if( minBreakpoints.length ){ breakpointClasses = minBreakpoints.join(" "); }
	if( maxBreakpoints.length ){ breakpointClasses += " " +  maxBreakpoints.join(" "); }

	$html.addClass( breakpointClasses );
};

/* $.mobile.addResolutionBreakpoints method:
	pass either a number or an array of numbers and they'll be added to the min/max breakpoint classes
	Examples:
		$.mobile.addResolutionBreakpoints( 500 );
		$.mobile.addResolutionBreakpoints( [500, 1200] );
*/
$.mobile.addResolutionBreakpoints = function( newbps ){
	if( $.type( newbps ) === "array" ){
		resolutionBreakpoints = resolutionBreakpoints.concat( newbps );
	}
	else {
		resolutionBreakpoints.push( newbps );
	}
	resolutionBreakpoints.sort(function(a,b){ return a-b; });
	detectResolutionBreakpoints();
};

/* 	on mobileinit, add classes to HTML element
	and set handlers to update those on orientationchange and resize*/

$(document).bind("mobileinit.htmlclass", function(){
	/* bind to orientationchange and resize
	to add classes to HTML element for min/max breakpoints and orientation */
	$window.bind("orientationchange.htmlclass resize.htmlclass", function(event){
		//add orientation class to HTML element on flip/resize.
		
		if(event.orientation){
			$html.removeClass( "portrait landscape" ).addClass( event.orientation );

		}
		//add classes to HTML element for min/max breakpoints
		detectResolutionBreakpoints();
	});
	/* Manually trigger an orientationchange event when the dom ready event fires.
   This will ensure that any viewport meta tag that may have been injected
   has taken effect already, allowing us to properly calculate the width of the
   document.
*/
$(function(){
	//trigger event manually
	$window.trigger( "orientationchange.htmlclass" );
});
});



})(jQuery);/*
* jQuery Mobile Framework : support tests
* Copyright (c) jQuery Project
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
* Note: Code is in draft form and is subject to change 
*/
(function($, undefined ) {



var fakeBody = $( "<body>" ).prependTo( "html" ),
	fbCSS = fakeBody[0].style,
	vendors = ['webkit','moz','o'],
	webos = window.palmGetResource || window.PalmServiceBridge, //only used to rule out scrollTop 
	bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB

//thx Modernizr
function propExists( prop ){
	var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
		props   = (prop + ' ' + vendors.join(uc_prop + ' ') + uc_prop).split(' ');
	for(var v in props){
		if( fbCSS[ v ] !== undefined ){
			return true;
		}
	}
};

//test for dynamic-updating base tag support (allows us to avoid href,src attr rewriting)
function baseTagTest(){
	var fauxBase = location.protocol + '//' + location.host + location.pathname + "ui-dir/",
		base = $("head base"),
		fauxEle = null,
		href = '';
	if (!base.length) {
		base = fauxEle = $("<base>", {"href": fauxBase}).appendTo("head");
	}
	else {
		href = base.attr("href");
	}
	var link = $( "<a href='testurl'></a>" ).prependTo( fakeBody ),
		rebase = link[0].href;
	base[0].href = href ? href : location.pathname;
	if (fauxEle) {
		fauxEle.remove();
	}
	return rebase.indexOf(fauxBase) === 0;
};

$.extend( $.support, {
	orientation: "orientation" in window,
	touch: "ontouchend" in document,
	cssTransitions: "WebKitTransitionEvent" in window,
	pushState: !!history.pushState,
	mediaquery: $.mobile.media('only all'),
	cssPseudoElement: !!propExists('content'),
	boxShadow: !!propExists('boxShadow') && !bb,
	scrollTop: ("pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[0]) && !webos,
	dynamicBaseTag: baseTagTest()
});

fakeBody.remove();

//for ruling out shadows via css
if( !$.support.boxShadow ){ $('html').addClass('ui-mobile-nosupport-boxshadow'); }

})( jQuery );/*
* jQuery Mobile Framework : events
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($, undefined ) {

// add new event shortcuts
$.each( "touchstart touchmove touchend orientationchange tap taphold swipe swipeleft swiperight scrollstart scrollstop".split( " " ), function( i, name ) {
	$.fn[ name ] = function( fn ) {
		return fn ? this.bind( name, fn ) : this.trigger( name );
	};
	$.attrFn[ name ] = true;
});

var supportTouch = $.support.touch,
	scrollEvent = "touchmove scroll",
	touchStartEvent = supportTouch ? "touchstart" : "mousedown",
	touchStopEvent = supportTouch ? "touchend" : "mouseup",
	touchMoveEvent = supportTouch ? "touchmove" : "mousemove";

// also handles scrollstop
$.event.special.scrollstart = {
	enabled: true,
	
	setup: function() {
		var thisObject = this,
			$this = $( thisObject ),
			scrolling,
			timer;
		
		function trigger( event, state ) {
			scrolling = state;
			var originalType = event.type;
			event.type = scrolling ? "scrollstart" : "scrollstop";
			$.event.handle.call( thisObject, event );
			event.type = originalType;
		}
		
		// iPhone triggers scroll after a small delay; use touchmove instead
		$this.bind( scrollEvent, function( event ) {
			if ( !$.event.special.scrollstart.enabled ) {
				return;
			}
			
			if ( !scrolling ) {
				trigger( event, true );
			}
			
			clearTimeout( timer );
			timer = setTimeout(function() {
				trigger( event, false );
			}, 50 );
		});
	}
};

// also handles taphold
$.event.special.tap = {
	setup: function() {
		var thisObject = this,
			$this = $( thisObject );
		
		$this
			.bind( "mousedown touchstart", function( event ) {
				if ( event.which && event.which !== 1 ||
					//check if event fired once already by a device that fires both mousedown and touchstart (while supporting both events)
					$this.data( "prevEvent") && $this.data( "prevEvent") !== event.type ) {
					return false;
				}
				
				//save event type so only this type is let through for a temp duration, 
				//allowing quick repetitive taps but not duplicative events 
				$this.data( "prevEvent", event.type );
				setTimeout(function(){
					$this.removeData( "prevEvent" );
				}, 800);
				
				var moved = false,
					touching = true,
					origTarget = event.target,
					origEvent = event.originalEvent,
					origPos = event.type == "touchstart" ? [origEvent.touches[0].pageX, origEvent.touches[0].pageY] : [ event.pageX, event.pageY ],
					originalType,
					timer;
					
				
				function moveHandler( event ) {
					if( event.type == "scroll" ){
						moved = true;
						return;
					}
					var newPageXY = event.type == "touchmove" ? event.originalEvent.touches[0] : event;
					if ((Math.abs(origPos[0] - newPageXY.pageX) > 10) ||
					    (Math.abs(origPos[1] - newPageXY.pageY) > 10)) {
					    moved = true;
					}
				}
				
				timer = setTimeout(function() {
					if ( touching && !moved ) {
						originalType = event.type;
						event.type = "taphold";
						$.event.handle.call( thisObject, event );
						event.type = originalType;
					}
				}, 750 );
				
				//scroll now cancels tap
				$(window).one("scroll", moveHandler);
				
				$this
					.bind( "mousemove touchmove", moveHandler )
					.one( "mouseup touchend", function( event ) {
						$this.unbind( "mousemove touchmove", moveHandler );
						$(window).unbind("scroll", moveHandler);
						clearTimeout( timer );
						touching = false;
						
						/* ONLY trigger a 'tap' event if the start target is
						 * the same as the stop target.
						 */
						if ( !moved && ( origTarget == event.target ) ) {
							originalType = event.type;
							event.type = "tap";
							$.event.handle.call( thisObject, event );
							event.type = originalType;
						}
					});
			});
	}
};

// also handles swipeleft, swiperight
$.event.special.swipe = {
	setup: function() {
		var thisObject = this,
			$this = $( thisObject );
		
		$this
			.bind( touchStartEvent, function( event ) {
				var data = event.originalEvent.touches ?
						event.originalEvent.touches[ 0 ] :
						event,
					start = {
						time: (new Date).getTime(),
						coords: [ data.pageX, data.pageY ],
						origin: $( event.target )
					},
					stop;
				
				function moveHandler( event ) {
					if ( !start ) {
						return;
					}
					
					var data = event.originalEvent.touches ?
							event.originalEvent.touches[ 0 ] :
							event;
					stop = {
							time: (new Date).getTime(),
							coords: [ data.pageX, data.pageY ]
					};
					
					// prevent scrolling
					if ( Math.abs( start.coords[0] - stop.coords[0] ) > 10 ) {
						event.preventDefault();
					}
				}
				
				$this
					.bind( touchMoveEvent, moveHandler )
					.one( touchStopEvent, function( event ) {
						$this.unbind( touchMoveEvent, moveHandler );
						if ( start && stop ) {
							if ( stop.time - start.time < 1000 && 
									Math.abs( start.coords[0] - stop.coords[0]) > 30 &&
									Math.abs( start.coords[1] - stop.coords[1]) < 75 ) {
								start.origin
								.trigger( "swipe" )
								.trigger( start.coords[0] > stop.coords[0] ? "swipeleft" : "swiperight" );
							}
						}
						start = stop = undefined;
					});
			});
	}
};

(function($){
	// "Cowboy" Ben Alman
	
	var win = $(window),
		special_event,
		get_orientation,
		last_orientation;
	
	$.event.special.orientationchange = special_event = {
		setup: function(){
			// If the event is supported natively, return false so that jQuery
			// will bind to the event using DOM methods.
			if ( $.support.orientation ) { return false; }
			
			// Get the current orientation to avoid initial double-triggering.
			last_orientation = get_orientation();
			
			// Because the orientationchange event doesn't exist, simulate the
			// event by testing window dimensions on resize.
			win.bind( "resize", handler );
		},
		teardown: function(){
			// If the event is not supported natively, return false so that
			// jQuery will unbind the event using DOM methods.
			if ( $.support.orientation ) { return false; }
			
			// Because the orientationchange event doesn't exist, unbind the
			// resize event handler.
			win.unbind( "resize", handler );
		},
		add: function( handleObj ) {
			// Save a reference to the bound event handler.
			var old_handler = handleObj.handler;
			
			handleObj.handler = function( event ) {
				// Modify event object, adding the .orientation property.
				event.orientation = get_orientation();
				
				// Call the originally-bound event handler and return its result.
				return old_handler.apply( this, arguments );
			};
		}
	};
	
	// If the event is not supported natively, this handler will be bound to
	// the window resize event to simulate the orientationchange event.
	function handler() {
		// Get the current orientation.
		var orientation = get_orientation();
		
		if ( orientation !== last_orientation ) {
			// The orientation has changed, so trigger the orientationchange event.
			last_orientation = orientation;
			win.trigger( "orientationchange" );
		}
	};
	
	// Get the current page orientation. This method is exposed publicly, should it
	// be needed, as jQuery.event.special.orientationchange.orientation()
	special_event.orientation = get_orientation = function() {
		var elem = document.documentElement;
		return elem && elem.clientWidth / elem.clientHeight < 1.1 ? "portrait" : "landscape";
	};
	
})(jQuery);

$.each({
	scrollstop: "scrollstart",
	taphold: "tap",
	swipeleft: "swipe",
	swiperight: "swipe"
}, function( event, sourceEvent ) {
	$.event.special[ event ] = {
		setup: function() {
			$( this ).bind( sourceEvent, $.noop );
		}
	};
});

})( jQuery );
/*
 * jQuery throttle / debounce - v1.1 - 3/7/2010
 * http://benalman.com/projects/jquery-throttle-debounce-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);(function($)
	{
		
		$.extend(
			$.event.special,
			{
				"mousewheel":
				{
					setup: function(data, namespaces)
					{
						var elem = this, $elem = $(elem);
						var o = this;
						$elem.bind(
							{
								mousewheeling: $.event.special.mousewheel.handle
							}
						);
					},
					teardown: function(namespaces)
					{
						var elem = this, $elem = $(elem);
						$elem.unbind(
							{
								mousewheeling: $.event.special.mousewheel.handle
							}
						);
						
					},
					handle: $.debounce(
						250,
						function(e, delta, deltaX, deltaY)
						{
							e.type = "mousewheel";
							return $.event.handle.apply(this, [e, delta, deltaX, deltaY]);
						}
					)
				}
			}
		);
	}
)(jQuery);



(function($) {

var types = ['DOMMouseScroll', 'mousewheel'];
/*
$.event.special.mousewheeling = {
    setup: function() {
        if ( this.addEventListener ) {
            for ( var i=types.length; i; ) {
                this.addEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = handler;
        }
    },
    
    teardown: function() {
        if ( this.removeEventListener ) {
            for ( var i=types.length; i; ) {
                this.removeEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = null;
        }
    }
};

$.fn.extend({
    mousewheeling: function(fn) {
        return fn ? this.bind("mousewheeling", fn) : this.trigger("mousewheeling");
    },
    
    unmousewheeling: function(fn) {
        return this.unbind("mousewheeling", fn);
    }
});
*/

function handler(event) {
    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
    event = $.event.fix(orgEvent);
    event.type = "mousewheeling";
    
    // Old school scrollwheel delta
    if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
    if ( event.detail     ) { delta = -event.detail/3; }
    
    // New school multidimensional scroll (touchpads) deltas
    deltaY = delta;
    
    // Gecko
    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
        deltaY = 0;
        deltaX = -1*delta;
    }
    
    // Webkit
    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
    
    // Add event and delta to the front of the arguments
    args.unshift(event, delta, deltaX, deltaY);
    
    return $.event.handle.apply(this, args);
}

})(jQuery);(function($)
	{
		/*if(!$.support.touch) {
			$.event.special.swiping = $.event.special.mousewheeling;
			$.event.special.swipe = $.event.special.mousewheel;
		
			return;
		}*/
		$.extend(
			$.event.special,
			{
				"swiping":
				{
					setup: function(data, namespaces)
					{
						var elem = this, $elem = $(elem);
						$elem.data('swiping.start', {});
						$elem.data('swiping.end', {});

    					$elem.bind('touchstart', $.event.special.swiping.touchStartHandler);
						$elem.bind('touchmove', $.event.special.swiping.touchMoveHandler);
						$elem.bind('gesturestart', $.event.special.swiping.gestureStartHandler);
						$elem.bind('gestureend', $.event.special.swiping.gestureEndHandler);
						
						
						
					},
					swipeHandler: function(e)
					{
						e.stopImmediatePropagation();
						
							
						var $this = $(this)
						var data = $this.data('swiping.start');
						var $data = $(data);
						var duration = Math.abs(data.deltaX * 50);
						var finalDelta = 0.2;
						if(data.deltaX < 0) {
							finalDelta = -finalDelta;
							
						}
						$data.stop(true);
						$.when(
							$.promise(
								function(dfd)
								{
									$data.animate(
										{
											deltaX: finalDelta
										},
										{
											easing: "easeOutCubic",
											duration: duration,
											step: function()
											{
												$this.trigger("swiping", [data.deltaX, data.deltaX]);
											},
											complete: dfd.resolve
										}
									);
								}
							)
						).done(
							function()
							{
								$this.trigger("swipe");//.trigger(finalDelta > 0 ? "swipeleft" : "swiperight");
							}
						);
					},
					teardown: function(namespaces)
					{
						var elem = this, $elem = $(elem);
						$elem.unbind('touchstart', $.event.special.swiping.touchStartHandler);
						$elem.unbind('touchmove', $.event.special.swiping.touchMoveHandler);
						$elem.unbind('gesturestart', $.event.special.swiping.gestureChangeHandler);
						$elem.unbind('gestureend', $.event.special.swiping.gestureEndHandler);
						$elem.data('swiping.start', {});
						$elem.data('swiping.end', {});
					},
					gestureStartHandler: function()
					{
						var elem = this, $elem = $(elem);
						$elem.unbind('touchstart', $.event.special.swiping.touchStartHandler);
						$elem.unbind('touchmove', $.event.special.swiping.touchMoveHandler);
						$elem.data('swiping.start', {});
						$elem.data('swiping.end', {});
					},
					
					gestureEndHandler: function()
					{
						var elem = this, $elem = $(elem);
						$elem.bind('touchstart', $.event.special.swiping.touchStartHandler);
						$elem.bind('touchmove', $.event.special.swiping.touchMoveHandler);
					},
					touchStartHandler: function(e)
					{
						var e = event;
						if(e.targetTouches.length > 1) {
							return;
						}
						var elem = this, $elem = $(elem);
						$elem.data(
							'swiping.start',
							{
								x: e.targetTouches[0].pageX,
								y: e.targetTouches[0].pageY
							}
						);
						$elem.one(
							{
								swipe: $.event.special.swiping.swipeHandler
							}
						);
					},
					touchMoveHandler: function()
					{
						
						var elem = this, $elem = $(elem);
						var e = event;// $.event.fix(event || window.event);
						
						if(e.targetTouches.length > 1) {
							return;
						}
						
						var args = [].slice.call( arguments, 1 );
						
						var start = $elem.data('swiping.start');
						var end = {
							x: e.targetTouches[0].pageX,
							y: e.targetTouches[0].pageY
						};
						var threshold = {
							x: 30,
							y: 30
						};
						var changeX, changeY;
						changeY = start.y - end.y;
						if(changeY < threshold.y && changeY > (threshold.y * -1)) {
							changeX = end.x - start.x;
							var ev = $.event.fix(event || window.event);
							ev.type = "swiping";
							var data = {
								startX: start.x,
								startY: start.y,
								endX: end.x,
								endY: end.y	
							};
							ev.deltaX = (end.x - start.x) * .1;
							ev.deltaY = (end.y - start.y) * .1;
							//args.unshift(ev, data);
							args.unshift(ev, data, ev.deltaX, ev.deltaX, ev.deltaY);
							$.event.handle.apply(this, args);
							end.deltaX = ev.deltaX;
							$elem.data('swiping.start', end);
							//e.preventDefault();
						} else {
							
						}
						
					}
				}
			}
		);
	}
)(jQuery);/*!
 * jQuery UI 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
/*
 * jQuery UI 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||(function(a){a.ui={version:"1.8",plugin:{add:function(c,d,f){var e=a.ui[c].prototype;for(var b in f){e.plugins[b]=e.plugins[b]||[];e.plugins[b].push([d,f[b]])}},call:function(b,d,c){var f=b.plugins[d];if(!f||!b.element[0].parentNode){return}for(var e=0;e<f.length;e++){if(b.options[f[e][0]]){f[e][1].apply(b.element,c)}}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(e,c){if(a(e).css("overflow")=="hidden"){return false}var b=(c&&c=="left")?"scrollLeft":"scrollTop",d=false;if(e[b]>0){return true}e[b]=1;d=(e[b]>0);e[b]=0;return d},isOverAxis:function(c,b,d){return(c>b)&&(c<(b+d))},isOver:function(g,c,f,e,b,d){return a.ui.isOverAxis(g,f,b)&&a.ui.isOverAxis(c,e,d)},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}};a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b==="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus();(c&&c.call(d))},b)}):this._focus.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})},scrollParent:function(){var b;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){b=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{b=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!b.length?a(document):b},zIndex:function(e){if(e!==undefined){return this.css("zIndex",e)}if(this.length){var c=a(this[0]),b,d;while(c.length&&c[0]!==document){b=c.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){d=parseInt(c.css("zIndex"));if(!isNaN(d)&&d!=0){return d}}c=c.parent()}}return 0}});a.extend(a.expr[":"],{data:function(d,c,b){return !!a.data(d,b[3])},focusable:function(c){var d=c.nodeName.toLowerCase(),b=a.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(d)?!c.disabled:"a"==d||"area"==d?c.href||!isNaN(b):!isNaN(b))&&!a(c)["area"==d?"parents":"closest"](":hidden").length},tabbable:function(c){var b=a.attr(c,"tabindex");return(isNaN(b)||b>=0)&&a(c).is(":focusable")}})})(jQuery);/*!
 * jQuery UI Widget 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
/*
 * jQuery UI Widget 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var a=b.fn.remove;b.fn.remove=function(c,d){return this.each(function(){if(!d){if(!c||b.filter(c,[this]).length){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")})}}return a.call(b(this),c,d)})};b.widget=function(d,f,c){var e=d.split(".")[0],h;d=d.split(".")[1];h=e+"-"+d;if(!c){c=f;f=b.Widget}b.expr[":"][h]=function(i){return !!b.data(i,d)};b[e]=b[e]||{};b[e][d]=function(i,j){if(arguments.length){this._createWidget(i,j)}};var g=new f();g.options=b.extend({},g.options);b[e][d].prototype=b.extend(true,g,{namespace:e,widgetName:d,widgetEventPrefix:b[e][d].prototype.widgetEventPrefix||d,widgetBaseClass:h},c);b.widget.bridge(d,b[e][d])};b.widget.bridge=function(d,c){b.fn[d]=function(g){var e=typeof g==="string",f=Array.prototype.slice.call(arguments,1),h=this;g=!e&&f.length?b.extend.apply(null,[true,g].concat(f)):g;if(e&&g.substring(0,1)==="_"){return h}if(e){this.each(function(){var i=b.data(this,d),j=i&&b.isFunction(i[g])?i[g].apply(i,f):i;if(j!==i&&j!==undefined){h=j;return false}})}else{this.each(function(){var i=b.data(this,d);if(i){if(g){i.option(g)}i._init()}else{b.data(this,d,new c(g,this))}})}return h}};b.Widget=function(c,d){if(arguments.length){this._createWidget(c,d)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(d,e){this.element=b(e).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(e)[this.widgetName],d);var c=this;this.element.bind("remove."+this.widgetName,function(){c.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(e,f){var d=e,c=this;if(arguments.length===0){return b.extend({},c.options)}if(typeof e==="string"){if(f===undefined){return this.options[e]}d={};d[e]=f}b.each(d,function(g,h){c._setOption(g,h)});return c},_setOption:function(c,d){this.options[c]=d;if(c==="disabled"){this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(d,e,f){var h=this.options[d];e=b.Event(e);e.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase();f=f||{};if(e.originalEvent){for(var c=b.event.props.length,g;c;){g=b.event.props[--c];e[g]=e.originalEvent[g]}}this.element.trigger(e,f);return !(b.isFunction(h)&&h.call(this.element[0],e,f)===false||e.isDefaultPrevented())}}})(jQuery);(function($)
	{
		var name = "hero";
		var qn = "code28." + name;
		var eventQn = "." + qn;

		$.cssHooks['parallaxLeft'] = {
			get: function(elem, computed, extra)
			{
				var $elem = $(elem);
				return $elem.css('marginLeft');
	        },
	        set: function(elem, value)
			{
				var $elem = $(elem);
				$elem.find(".screamer").screamer("parallaxLeft", value);
				return $(elem).css('marginLeft', value);
	        }
		};
		$.fx.step['parallaxLeft'] = function(fx)
		{
			return $.cssHooks['parallaxLeft'].set(fx.elem, fx.now + fx.unit);  
		};
			
		$.widget(
			qn,
			{	
				options: {
				
				},
				_init: function()
				{
					
					$.Widget.prototype._init.apply(this, arguments);
					var $widget = this.widget();
					clicked = false;
					
					var o = this;
					$widget.find(".nav li a").bind(
						{
							click: $.proxy(this, "_changeArticle")
						}
					);
					
					this.$section = $widget.find(".section");
					this.$articles = this.$section.find(".article");
					
					if(this._isSwipe()) {
						$widget.find(".section").bind(
							{
								swiping: $.proxy(this, "_swiping"),
								swipe: $.proxy(this, "_swipe"),
								mousewheeling: $.proxy(this, "_swiping"),
								mousewheel: $.proxy(this, "_swipe"),
								click: $.proxy(this, "_swipe")
							}
						);
						this.articleWidth = this.$articles.eq(0).width();
						this.fullWidth = this.articleWidth * this.$articles.length;
						halfWidth = this.articleWidth / 2;
					} else {
						var $selected = this.$section.find(".selected");
						$selected.css(
							{
								zIndex: this.$articles.length
							}
						);
					}
					this._scream();
					
					item_nr = 0;
					var items_count = $(".nav li").children().length;
					this._slideCycle(this,items_count);
				},
				
				_slideCycle: function(th,items_count)
				{
					if ( !clicked ) {
						setTimeout( function(){
							
							$(".nav li a").eq(item_nr).click();
							if ( item_nr == items_count-1) {
								item_nr = 0;
							} else {
								item_nr++;
							}
							th._slideCycle(th,items_count);
						}, interval );
					}
				},

				_isSwipe: function()
				{
					var $widget = this.widget();
					return $widget.find("> .section").hasClass("swipe")
				},
				_changeArticle: function(e)
				{
					var dfd;
					var $widget = this.widget();
					if(this._isSwipe()) {
						dfd = this._changeArticleHorizontal(e);
					} else {
						dfd = this._changeArticleFade(e);
					}
					var o = this;
					dfd.done(
						function(section)
						{
							o._scream();
						}
					);
				},
				_changeNav: function(e)
				{
					var $a = $(e.currentTarget);
					var i = $a.closest("li").index();
					slide_index = $a.closest("li").index();
					$a.closest("ul").find(".selected").removeClass("selected");
					$a.closest("li").addClass("selected");
					return i;
				},
				_changeArticleHorizontal: function(e)
				{
					e.preventDefault();
					var i = this._changeNav(e);
					
					
					this.$articles.filter(".selected").removeClass("selected");
					var $article = this.$articles.eq(i);
					article_left = $article.position().left;

					$article.addClass("selected");
					left = -$article.position().left - halfWidth;
					this.$section.stop();
				
					var o = this;
					
					// K speed tweak
					return $.promise(
						function(dfd)
						{
							o.$section.animate(
								{
									parallaxLeft: left + "px"
								},
								{
									easing: "easeInOutCubic",
									duration: 700, 
									complete: dfd.resolve
								}	
							);
						}
					);
					
				},
				_changeArticleFade: function(e)
				{
					var $widget = this.widget();
					e.preventDefault();
					
					
					var i = this._changeNav(e);
					
					var $article = this.$articles.eq(i);

					var len = this.$articles.length;
					this.$articles.filter(".selected").removeClass("selected");
					$article.addClass("selected").stop();
					var o = this;
					this.$articles.not(".selected").each(
						function()
						{
							$(this).css(
								{
									zIndex: $(this).css("zIndex") - 1
								}
							);
						}
					);
					return $.promise(
						function(dfd)
						{
							$article.css(
								{
									display: "none",
									zIndex: len
								}
							).fadeIn(
								function()
								{
									dfd.resolve();
								}
							);
						}	
					);
					
				},
				_scream: function()
				{
					
					var $widget = this.widget();
					var $article = this.$articles.filter(".selected");
					var $screamer = $article.find(".screamer");
					if($screamer.screamer("option", "parallax")) {
						return;
					}
					this.$articles.not($article).find(".screamer, .price").css(
						{
							visibility: "hidden"
						}
					);
				
					if($screamer.css("visibility") == "visible") {
						return;
					}
					
					$screamer.screamer("show");	
				},
				_clamp: function(x)
				{
					//return x;
					var left = -halfWidth;
					var right = halfWidth - this.fullWidth;
					return Math.max(Math.min(left, x), right);
				},
				_swiping: function(e, delta, deltaX, deltaY)
				{
					this.nudge = delta > 0 ? 560 : -560;
				
					var $target = $(e.currentTarget);
					$target.stop();
					var x = parseInt($target.css("parallaxLeft"));
					var delta = (deltaX * 10);
				
					$target.css(
						{
							parallaxLeft: this._clamp(x + delta) + "px"
						}
					);
				},
				_swipe: function(e, delta, deltaX, deltaY)
				{
					var $target = $(e.currentTarget);
					
					var x = parseInt($target.css("parallaxLeft")) + this.nudge;
					var i = Math.floor((-x / this.articleWidth));
				
					var $widget = this.widget();
					$target.stop();
					$widget.find(".nav li").eq(i).find("a").trigger("click");
				}
			}
		);
				

			
	}
)(jQuery);
		
		(function($)
	{
		var name = "screamer";
		var qn = "code28." + name;
		var eventQn = "." + qn;
		
		
		
		$.widget(
			qn,
			{	
				options: {
					speed: "random",
					parallax: false
				},
				_init: function()
				{
					$.Widget.prototype._init.apply(this, arguments);
					var $widget = this.widget();
					if(this.options.parallax) {
						$widget.add($widget.find(".price")).css(
							{
								visibility: "visible"
							}
						);
					}
				},
				parallaxLeft: function(v)
				{
					if(this.options.parallax) {
						var $widget = this.widget();
						v = parseInt(v);
						var left = $widget.parent().position().left;
						var res = left + v;
						var perc = (-res / ((1920 * 2) / 100)) + 25;
						//perc = 100 - perc;
						$widget.css(
							{
								left: perc + "%"
							}
						);
					}
					
				},
				_fast: function()
				{
					var $widget = this.widget();
					var $price = $widget.find(".price");
					$.chain(
						[
							[$.wait, 0],
							[
								$widget, "animate",
								{
									top: $widget.data("y")
								},
								{
									easing: "easeOutCubic",
									duration: 100
								}
							],
							[$.wait, 100],
							[
								$price, "css",
								{
									visibility: "visible"
								}
							],
							[
								$price, "animate",
								{
									width: $price.data("w"),
									height: $price.data("h")
								},
								{
									duration: 100
								}
							]
						]
					);
				},
				_slow: function()
				{
					var $widget = this.widget();
					var $price = $widget.find(".price");
					$.chain(
						[
							[$.wait, 100],
							[
								$widget, "animate",
								{
									top: $widget.data("y")
								},
								{
									duration: 700,
									easing: "easeInOutCubic"
								}
							],
							[$.wait, 500],
							[
								$price, "css",
								{
									visibility: "visible"
								}
							],
							[
								$price, "animate",
								{
									scale: 1
								},
								{
									duration: 100
								}
							]
						]
					);
				},
				_back: function()
				{
					var $widget = this.widget();
					var $price = $widget.find(".price");
					$widget.css(
						{
							opacity: 0
						}
					);
					$price.css(
						{
							opacity: 0
						}
					);
					$.chain(
						[
							[
								$widget, "animate",
								{
									top: $widget.data("y"),
									opacity: 1
								},
								{
									duration: 350,
									easing: "easeOutBack"
								}
							],
							[
								$price, "css",
								{
									visibility: "visible"
								}
							],
							[
								$price, "animate",
								{
									scale: 1,
									opacity: 1
								},
								{
									duration: 150
								}
							]
						]
					);
				},
				show: function()
				{
					var $widget = this.widget();
					var $price = $widget.find(".price");
					if($widget.data("y") == null) {
						$widget.data("y", $widget.css("top"));
					}
					$price.css(
						{
							scale: 1.1
						}
					);
					$widget.css(
						{
							top: "-200px",
							visibility: "visible"
						}
					);
					var method;
					if(this.options.speed == "random") {
						var methods = "fast slow back".split(" ");
						method = "_" + methods[this.randomBetween(0, methods.length - 1)];
					} else {
						method = "_" + this.options.speed;
					}
					this[method]();
				},
				randomBetween: function(a, b)
				{
					return (a + Math.floor(Math.random()*(b - a + 1)));
				}	
			}
		);
				

			
	}
)(jQuery);
		
		(function($)
	{
				var name = "menu";
				var qn = "code28." + name;
				var eventQn = "." + qn;
				
				$.widget(
					qn,
					{	
						options: {
					
						},
						_init: function()
						{
							$.Widget.prototype._init.apply(this, arguments);
							var $widget = this.widget();
							this._space();

							var eventName = "mouseenter";
							var $li = $widget.find(".dropdown").closest("li");
						
							if($("html").hasClass("touch")) {
								eventName = "click";
							} else {
								$li.bind(
									"click",
									function(e){e.preventDefault();}
								);
							}
							
							$li.bind(
								eventName,
								$.proxy(this, "_showDropdown")
							);
							
							
							eventName = "mouseleave";
							if($("html").hasClass("touch")) {
								eventName = "touchstartoutside";
							}
							$li.bind(
								eventName,
								$.proxy(this, "_hideDropdown")
							);
							$li.bind(
								"clickoutside",
								$.proxy(this, "_hideDropdown")
							);
						},
						_space: function()
						{
							var $widget = this.widget();
							var $menuItems = $widget.find("> ul > li:not(.first)").css(
								{
									marginLeft: 0,
									marginRight: 0
								}
							);
							var width = 0;
							$menuItems.find(">a").each(
								function()
								{
									var $this = $(this);
									width += parseInt($this.width());
								}
							);
							var space = Math.round((710 - width) / $menuItems.length);
							var halfSpace = Math.floor(space / 2);
							$menuItems.filter(":first").css(
								{
									marginLeft: halfSpace + "px"
								}
							);
							/*$menuItems.filter(":last").css(
								{
									marginRight: halfSpace + "px"
								}
							);*/
							$menuItems.filter(":not(:last)").css(
								{
									marginRight: space + "px"
								}
							);
							$widget.css(
								{
									visibility: "visible"
								}
							);
						},
						_size: function($dropdown)
						{
							if(!$dropdown.data("sized")) {
								var width = 0;
								$dropdown.find(".section").each(
									function()
									{
										var w = 0;
										var $section = $(this);
										$section.find(".column").each(
											function()
											{	
												w += $(this).width() + 40;
											}
										);
										w += 1;
										width = Math.max(width, w);
									}
								);
								$dropdown.width(width);
								var $li = $dropdown.closest("li");
								var left = $li.position().left + parseInt($li.css("margin-left"));
								var right = left + width;
								var extra = 958 - right;
								if(extra < 0) {
									$dropdown.css(
										{
											left: extra + "px"
										}
									);
								}
								
								
							}
						},
						_showDropdown: function(e)
						{
						
							e.preventDefault();
							var $widget = this.widget();
							//$(e.currentTarget).find(".dropdown:visible").closest("li").trigger("clickoutside");
							$widget.find(".selected.dropdown").css(
								{
									display: "none"
								}
							).removeClass("selected");
							var $dropdown = $(e.currentTarget).find(".dropdown");
							$dropdown.addClass("selected");
							//var $visible = $widget.find(".dropdown:visible");
							
							//if($dropdown.get(0) != $visible.get(0)) {
							//	$visible.closest("li").trigger("mouseleave");
							//}
							
							var wait;
							wait = $dropdown.data("wait");
							if(wait) {
								clearInterval(wait.interval);
							}
								
								
							wait = $.wait(300);
							$dropdown.data("wait", wait);
							var o = this;
							
							
							$.when(
								wait
							).done(
								function()
								{
									$dropdown.stop(true).fadeIn(200);
									o._size($dropdown);
								}
							);
							
							
							
							
						},
						_hideDropdown: function(e)
						{
							var $dropdown = $(e.currentTarget).find(".dropdown");
							var wait;
							wait = $dropdown.data("wait")
							if(wait) {
								clearInterval(wait.interval);
							}
							var ms = 300;
							// K added fadeout and fixed delay 
							if(e.type == "mouseleave") {
								ms = 300;
							}
							if(e.type == "clickoutside") {
								ms = 0;
							}
							var wait = $.wait(ms);
							$dropdown.data("wait", wait);
							$.when(
								wait
							).done(
								function()
								{
									$(e.currentTarget).find(".dropdown").stop(true).css(
										{
											opacity: 1,
											display: "none"
										}
									);
									
								}
							);
							
							
							
							
						}
					}
				);
				

			
	}
)(jQuery);
		
		/**
 * jQuery Roundabout - v1.1
 * http://fredhq.com/projects/roundabout/
 *
 * Moves list-items of enabled ordered and unordered lists long
 * a chosen path. Includes the default "lazySusan" path, that
 * moves items long a spinning turntable.
 *
 * Terms of Use // jQuery Roundabout
 * 
 * Open source under the BSD license
 *
 * Copyright (c) 2010, Fred LeBlanc
 * 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 its 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 HOLDER 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.
 */


// creates a default shape to be used for pathing
jQuery.extend({
	roundabout_shape: {
		def: 'lazySusan',
		lazySusan: function(r, a, t) {
			return {
				x: Math.sin(r + a), 
				y: (Math.sin(r + 3*Math.PI/2 + a) / 8) * t, 
				z: (Math.cos(r + a) + 1) / 2,
				scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5
			};
		}
	}
});

jQuery.fn.roundabout = function() {
	var options = (typeof arguments[0] != 'object') ? {} : arguments[0];

	// set options and fill in defaults
	// K modified duration to 500 from 600
	options = {
		bearing: (typeof options.bearing == 'undefined') ? 0.0 : jQuery.roundabout_toFloat(options.bearing % 360.0),
		tilt: (typeof options.tilt == 'undefined') ? 0.0 : jQuery.roundabout_toFloat(options.tilt),
		minZ: (typeof options.minZ == 'undefined') ? 100 : parseInt(options.minZ, 10),
		maxZ: (typeof options.maxZ == 'undefined') ? 400 : parseInt(options.maxZ, 10),
		minOpacity: (typeof options.minOpacity == 'undefined') ? 0.40 : jQuery.roundabout_toFloat(options.minOpacity),
		maxOpacity: (typeof options.maxOpacity == 'undefined') ? 1.00 : jQuery.roundabout_toFloat(options.maxOpacity),
		minScale: (typeof options.minScale == 'undefined') ? 0.40 : jQuery.roundabout_toFloat(options.minScale),
		maxScale: (typeof options.maxScale == 'undefined') ? 1.00 : jQuery.roundabout_toFloat(options.maxScale),
		duration: (typeof options.duration == 'undefined') ? 500 : parseInt(options.duration, 10),
		btnNext: options.btnNext || null,
		btnPrev: options.btnPrev || null,
		easing: options.easing || 'swing',
		clickToFocus: (options.clickToFocus !== false),
		focusBearing: (typeof options.focusBearing == 'undefined') ? 0.0 : jQuery.roundabout_toFloat(options.focusBearing % 360.0),
		shape: options.shape || 'lazySusan',
		debug: options.debug || false,
		childSelector: options.childSelector || 'li',
		startingChild: (typeof options.startingChild == 'undefined') ? null : parseInt(options.startingChild, 10),
		reflect: (typeof options.reflect == 'undefined' || options.reflect === false) ? false : true
	};

	// assign things 
	this.each(function(i) {
		var ref = jQuery(this);
		var period = jQuery.roundabout_toFloat(360.0 / ref.children(options.childSelector).length);
		var startingBearing = (options.startingChild === null) ? options.bearing : options.startingChild * period;
		
		// set starting styles
		ref
			.addClass('roundabout-holder')
			.css('padding', 0)
			.css('position', 'relative')
			.css('z-index', options.minZ);
		
		// set starting options
		ref.data('roundabout', {
			'bearing': startingBearing,
			'tilt': options.tilt,
			'minZ': options.minZ,
			'maxZ': options.maxZ,
			'minOpacity': options.minOpacity,
			'maxOpacity': options.maxOpacity,
			'minScale': options.minScale,
			'maxScale': options.maxScale,
			'duration': options.duration,
			'easing': options.easing,
			'clickToFocus': options.clickToFocus,
			'focusBearing': options.focusBearing,
			'animating': 0,
			'childInFocus': -1,
			'shape': options.shape,
			'period': period,
			'debug': options.debug,
			'childSelector': options.childSelector,
			'reflect': options.reflect
		});
				
		// bind click events
		if (options.clickToFocus === true) {
			ref.children(options.childSelector).each(function(i) {
				jQuery(this).click(function(e) {
					var degrees = (options.reflect === true) ? 360.0 - (period * i) : period * i;
					degrees = jQuery.roundabout_toFloat(degrees);
					if (!jQuery.roundabout_isInFocus(ref, degrees)) {
						e.preventDefault();
						if (ref.data('roundabout').animating === 0) {
							ref.roundabout_animateAngleToFocus(degrees);
						}
						return false;
					}
				});
			});
		}
		
		// bind next buttons
		if (options.btnNext) {
			jQuery(options.btnNext).bind('click.roundabout', function(e) {
				e.preventDefault();
				if (ref.data('roundabout').animating === 0) {
					ref.roundabout_animateToNextChild();
				}
				return false;
			});
		}
		
		// bind previous buttons
		if (options.btnPrev) {
			jQuery(options.btnPrev).bind('click.roundabout', function(e) {
				e.preventDefault();
				if (ref.data('roundabout').animating === 0) {
					ref.roundabout_animateToPreviousChild();
				}
				return false;
			});
		}
	});

	// start children
	this.roundabout_startChildren();

	// callback once ready
	if (typeof arguments[1] === 'function') {
		var callback = arguments[1], ref = this;
		setTimeout(function() { callback(ref); }, 0);
	}

	return this;
};

jQuery.fn.roundabout_startChildren = function() {
	this.each(function(i) {
		var ref = jQuery(this);
		var data = ref.data('roundabout');
		var children = ref.children(data.childSelector);
		
		children.each(function(i) {
			var degrees = (data.reflect === true) ? 360.0 - (data.period * i) : data.period * i;

			// apply classes and css first
			jQuery(this)
				.addClass('roundabout-moveable-item')
				.css('position', 'absolute');
			
			// then measure
			jQuery(this).data('roundabout', {
				'startWidth': jQuery(this).width(),
				'startHeight': jQuery(this).height(),
				'startFontSize': parseInt(jQuery(this).css('font-size'), 10),
				'degrees': degrees
			});
		});
		
		ref.roundabout_updateChildPositions();
	});
	return this;
};

jQuery.fn.roundabout_setTilt = function(newTilt) {
	this.each(function(i) {
		jQuery(this).data('roundabout').tilt = newTilt;
		jQuery(this).roundabout_updateChildPositions();
	});
	
	if (typeof arguments[1] === 'function') {
		var callback = arguments[1], ref = this;
		setTimeout(function() { callback(ref); }, 0);
	}
	
	return this;
};

jQuery.fn.roundabout_setBearing = function(newBearing) {
	this.each(function(i) {
		jQuery(this).data('roundabout').bearing = jQuery.roundabout_toFloat(newBearing % 360, 2);
		jQuery(this).roundabout_updateChildPositions();
	});

	if (typeof arguments[1] === 'function') {
		var callback = arguments[1], ref = this;
		setTimeout(function() { callback(ref); }, 0);
	}
	
	return this;
};

jQuery.fn.roundabout_adjustBearing = function(delta) {
	delta = jQuery.roundabout_toFloat(delta);
	if (delta !== 0) {
		this.each(function(i) {
			jQuery(this).data('roundabout').bearing = jQuery.roundabout_getBearing(jQuery(this)) + delta;
			jQuery(this).roundabout_updateChildPositions();
		});
	}
	
	if (typeof arguments[1] === 'function') {
		var callback = arguments[1], ref = this;
		setTimeout(function() { callback(ref); }, 0);
	}

	return this;
};

jQuery.fn.roundabout_adjustTilt = function(delta) {
	delta = jQuery.roundabout_toFloat(delta);
	if (delta !== 0) {
		this.each(function(i) {
			jQuery(this).data('roundabout').tilt = jQuery.roundabout_toFloat(jQuery(this).roundabout_get('tilt') + delta);
			jQuery(this).roundabout_updateChildPositions();
		});
	}
	
	if (typeof arguments[1] === 'function') {
		var callback = arguments[1], ref = this;
		setTimeout(function() { callback(ref); }, 0);
	}

	return this;
};
jQuery.fn.roundabout_stop = function(bool)
{
	var ref = jQuery(this);
	var data = ref.data('roundabout');
	//var bearing = (bearing < 0) ? bearing + 360 : bearing % 360;
	data.animating = 0;
	//ref.roundabout_setBearing(bearing);
	return this;
}
jQuery.fn.roundabout_animateToBearing = function(bearing) {
	bearing = jQuery.roundabout_toFloat(bearing);
	var currentTime = new Date();
	var duration    = (typeof arguments[1] == 'undefined') ? null : arguments[1];
	var easingType  = (typeof arguments[2] == 'undefined') ? null : arguments[2];
	var passedData  = (typeof arguments[3] !== 'object')   ? null : arguments[3];

	this.each(function(i) {
		var ref = jQuery(this), data = ref.data('roundabout'), timer, easingFn, newBearing;
		var thisDuration = (duration === null) ? data.duration : duration;
		var thisEasingType = (easingType !== null) ? easingType : data.easing || 'swing';

		if (passedData === null) {
			passedData = {
				timerStart: currentTime,
				start: jQuery.roundabout_getBearing(ref),
				totalTime: thisDuration
			};
		}
		timer = currentTime - passedData.timerStart;

		if (timer < thisDuration) {
			data.animating = 1;
			
			if (typeof jQuery.easing.def == 'string') {
				easingFn = jQuery.easing[thisEasingType] || jQuery.easing[jQuery.easing.def];
				newBearing = easingFn(null, timer, passedData.start, bearing - passedData.start, passedData.totalTime);
			} else {
				newBearing = jQuery.easing[thisEasingType]((timer / passedData.totalTime), timer, passedData.start, bearing - passedData.start, passedData.totalTime);
			}
			
			ref.roundabout_setBearing(newBearing, function() { if(data.animating == 1){ref.roundabout_animateToBearing(bearing, thisDuration, thisEasingType, passedData);} });
		} else {
			bearing = (bearing < 0) ? bearing + 360 : bearing % 360;
			data.animating = 0;
			ref.roundabout_setBearing(bearing);
		}
	});	
	return this;
};

jQuery.fn.roundabout_animateToDelta = function(delta) {
	var duration = arguments[1], easing = arguments[2];
	this.each(function(i) {
		delta = jQuery.roundabout_getBearing(jQuery(this)) + jQuery.roundabout_toFloat(delta);
		jQuery(this).roundabout_animateToBearing(delta, duration, easing);
	});
	return this;
};

jQuery.fn.roundabout_animateToChild = function(childPos) {	
	var duration = arguments[1], easing = arguments[2];	
	this.each(function(i) {
		var ref = jQuery(this), data = ref.data('roundabout');
		if (data.childInFocus !== childPos && data.animating === 0) {		
			var child = jQuery(ref.children(data.childSelector)[childPos]);
			ref.roundabout_animateAngleToFocus(child.data('roundabout').degrees, duration, easing);
		}
	});
	return this;
};

jQuery.fn.roundabout_animateToNearbyChild = function(passedArgs, which) {
	var duration = passedArgs[0], easing = passedArgs[1];
	this.each(function(i) {
		var data     = jQuery(this).data('roundabout');
		var bearing  = jQuery.roundabout_toFloat(360.0 - jQuery.roundabout_getBearing(jQuery(this)));
		var period   = data.period, j = 0, range;
		
		var reflect  = data.reflect;
		var length   = jQuery(this).children(data.childSelector).length;
		
		var diff	 = 360 - period * length;
		
		bearing = (reflect === true) ? bearing % 360.0 : bearing;
		
		if (data.animating === 0) {
			// if we're not reflecting and we're moving to next or
			//    we are reflecting and we're moving previous
			if ((reflect === false && which === 'next') || (reflect === true && which !== 'next')) {
				bearing = (bearing === 0) ? 360 : bearing;
							
				// counterclockwise
				while (true && j < length) {
					range = { lower: jQuery.roundabout_toFloat(period * j), upper: jQuery.roundabout_toFloat(period * (j + 1)) };
					range.upper = (j == length - 1) ? 360.0 : range.upper;  // adjust for javascript being bad at floats

					if (bearing <= range.upper && bearing > range.lower) {
						jQuery(this).roundabout_animateToDelta(bearing - range.lower, duration, easing);
						break;
					}
					j++;
				}
			} else {
				// clockwise
				/**/
				var segment = 360 / (length + 1);
				var halfSegment = segment / 2;
				/**/
				
				var counter = 0;
				//debugger;
				while (true) {
					
					counter++;
					
					range = { lower: jQuery.roundabout_toFloat(period * j), upper: jQuery.roundabout_toFloat(Math.floor( period ) * (j + 1)) };
					range.upper = (j == length - 1) ? 360.0 : range.upper;  // adjust for javascript being bad at floats
					
					//if ( Math.floor( bearing ) >= range.lower && Math.floor( bearing ) <= range.upper ) {
						
						/**/
						/*var num = (bearing - range.upper);
						
						if(!which) {
							
							num = (bearing - range.lower);
							if(num > halfSegment && which == null) {
								num = (bearing - range.upper) % segment;	
							}
						}*/
						
						var num = -period;
						/**/
						jQuery(this).roundabout_animateToDelta(num, duration, easing);
						break;
					//}
					
					j++;
				}
			}
		}
	});
	return this;
};

jQuery.fn.roundabout_animateToNextChild = function() {	
	return this.roundabout_animateToNearbyChild(arguments, 'next');
};

jQuery.fn.roundabout_animateToPreviousChild = function() {	
	return this.roundabout_animateToNearbyChild(arguments, 'previous');
};

// moves a given angle to the focus by the shortest means possible
jQuery.fn.roundabout_animateAngleToFocus = function(target) {
	var duration = arguments[1], easing = arguments[2];
	this.each(function(i) {
		var delta = jQuery.roundabout_getBearing(jQuery(this)) - target;
		delta = (Math.abs(360.0 - delta) < Math.abs(0.0 - delta)) ? 360.0 - delta : 0.0 - delta;
		delta = (delta > 180) ? -(360.0 - delta) : delta;
		
		if (delta !== 0) {
			jQuery(this).roundabout_animateToDelta(delta, duration, easing);	
		}
	});
	return this;
};

jQuery.fn.roundabout_updateChildPositions = function() {
	this.each(function(i) {
		var ref = jQuery(this), data = ref.data('roundabout');
		var inFocus = -1;
		var info = {
			bearing: jQuery.roundabout_getBearing(ref),
			tilt: data.tilt,
			stage: { width: Math.floor(ref.width() * 0.9), height: Math.floor(ref.height() * 0.9) },
			animating: data.animating,
			inFocus: data.childInFocus,
			focusBearingRad: jQuery.roundabout_degToRad(data.focusBearing),
			shape: jQuery.roundabout_shape[data.shape] || jQuery.roundabout_shape[jQuery.roundabout_shape.def]
		};
		info.midStage = { width: info.stage.width / 2, height: info.stage.height / 2 };
		info.nudge = { width: info.midStage.width + info.stage.width * 0.05, height: info.midStage.height + info.stage.height * 0.05 };
		info.zValues = { min: data.minZ, max: data.maxZ, diff: data.maxZ - data.minZ };
		info.opacity = { min: data.minOpacity, max: data.maxOpacity, diff: data.maxOpacity - data.minOpacity };
		info.scale = { min: data.minScale, max: data.maxScale, diff: data.maxScale - data.minScale };
		
		// update child positions
		ref.children(data.childSelector).each(function(i) {
			if (jQuery.roundabout_updateChildPosition(jQuery(this), ref, info, i) && info.animating === 0) {
				inFocus = i;
				jQuery(this).addClass('roundabout-in-focus');
			} else {
				jQuery(this).removeClass('roundabout-in-focus');
			}
		});

		// update status of who is in focus
		
		if (inFocus !== info.inFocus) {
			jQuery.roundabout_triggerEvent(ref, info.inFocus, 'blur');
			if (inFocus !== -1) {
				jQuery.roundabout_triggerEvent(ref, inFocus, 'focus');
			}

			data.childInFocus = inFocus;
		}
	});	
	return this;	
};

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

jQuery.roundabout_getBearing = function(el) {
	return jQuery.roundabout_toFloat(el.data('roundabout').bearing) % 360;
};

jQuery.roundabout_degToRad = function(degrees) {
	return (degrees % 360.0) * Math.PI / 180.0;
};

jQuery.roundabout_isInFocus = function(el, target) {
	return (Math.floor( jQuery.roundabout_getBearing(el) % 360 ) === Math.floor(target % 360));
};

jQuery.roundabout_triggerEvent = function(el, child, eventType) {
	return (child < 0) ? this : jQuery(el.children(el.data('roundabout').childSelector)[child]).trigger(eventType);
};

jQuery.roundabout_toFloat = function(number) {
	number = Math.round(parseFloat(number) * 1000) / 1000;
	return parseFloat(number.toFixed(2));
};

jQuery.roundabout_updateChildPosition = function(child, container, info, childPos) {
	var ref = jQuery(child), data = ref.data('roundabout'), out = [];
	var rad = jQuery.roundabout_degToRad((360.0 - ref.data('roundabout').degrees) + info.bearing);
	
	// adjust radians to be between 0 and Math.PI * 2
	while (rad < 0) {
		rad = rad + Math.PI * 2;
	}
	while (rad > Math.PI * 2) {
		rad = rad - Math.PI * 2;
	}
	
	var factors = info.shape(rad, info.focusBearingRad, info.tilt); // obj with x, y, z, and scale values

	// correct
	factors.scale = (factors.scale > 1) ? 1 : factors.scale;
	factors.adjustedScale = (info.scale.min + (info.scale.diff * factors.scale)).toFixed(4);
	factors.width = (factors.adjustedScale * data.startWidth).toFixed(4);
	factors.height = (factors.adjustedScale * data.startHeight).toFixed(4);
	
	// alter item
	ref
		.css('left', ((factors.x * info.midStage.width + info.nudge.width) - factors.width / 2.0).toFixed(1) + 'px')
		.css('top', ((factors.y * info.midStage.height + info.nudge.height) - factors.height / 2.0).toFixed(1) + 'px')
		.css('width', factors.width + 'px')
		.css('height', factors.height + 'px')
		.css('opacity', (info.opacity.min + (info.opacity.diff * factors.scale)).toFixed(2))
		.css('font-size', (factors.adjustedScale * data.startFontSize).toFixed(2) + 'px')
		.attr('current-scale', factors.adjustedScale)
		.css("visibility", factors.z > 0.4 ? "visible" : "hidden");
		
	if ( ref.hasClass( 'slide_back' ) ) {
		ref.css('z-index', '');
	} else {
		ref.css('z-index', factors.z == 1 ? '' : Math.round(info.zValues.min + (info.zValues.diff * factors.z)));
	}
	setTimeout( function(){
		
		ref.removeClass( 'slide_back' );
	}, 400 );
		
	ref.find( '.img_a' )
		.css('width', factors.width + 'px')
		.css('height', factors.height + 'px');

	if (container.data('roundabout').debug === true) {
		out.push('<div style="font-weight: normal; font-size: 10px; padding: 2px; width: ' + ref.css('width') + '; background-color: #ffc;">');
		out.push('<strong style="font-size: 12px; white-space: nowrap;">Child ' + childPos + '</strong><br />');
		out.push('<strong>left:</strong> ' + ref.css('left') + '<br /><strong>top:</strong> ' + ref.css('top') + '<br />');
		out.push('<strong>width:</strong> ' + ref.css('width') + '<br /><strong>opacity:</strong> ' + ref.css('opacity') + '<br />');
		out.push('<strong>z-index:</strong> ' + ref.css('z-index') + '<br /><strong>font-size:</strong> ' + ref.css('font-size') + '<br />');
		out.push('<strong>scale:</strong> ' + ref.attr('current-scale'));
		out.push('</div>');
		
		ref.html(out.join(''));
	}
	
	return jQuery.roundabout_isInFocus(container, ref.data('roundabout').degrees);
};(function($)
	{
		var name = "carousel";
		var qn = "code28." + name;
		var eventQn = "." + qn;
		var cssBearingProperty = "RoundaboutBearing";
		$.cssHooks[cssBearingProperty] = {
			get: function(elem, computed, extra)
			{
				return $.roundabout_getBearing($(elem));
			},
			set: function(elem, value)
			{
				$(elem).roundabout_adjustBearing(value);
			}
		};
		$.fx.step[cssBearingProperty] = function(fx)
		{
			return $.cssHooks[cssBearingProperty].set(fx.elem, fx.now + fx.unit);  
		};
		$.extend(
			$.roundabout_shape,
			{
				conveyor: function(r, a, t)
				{
				
					var obj = {
						x: Math.sin(r + a), 
						y: (Math.sin(r + 3 * Math.PI/2 + a) / 8) * t, 
						z: (Math.cos(r + a) + 1) / 2,
						scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5
					};
					if(obj.z < 0.5) {
						//obj.x = -Math.sin(r + a) * 2;
					}
					return obj;
				}
			}
		);
		$.widget(
			qn,
			{	
				options: {
			
				},
				_init: function()
				{
					$.Widget.prototype._init.apply(this, arguments);
					var $widget = this.widget();
					var $section = $widget.find(".section")
					var $carousel = this.$carousel = $section.find("ul")
					$carousel.css(
						{
							visibility: "visible",
							marginTop: $section.height() / 2 + "px"
						}
					);
					$carousel.roundabout(
						{
         					shape: 'lazysusan',
							btnNext: $widget.find(".nav a[rel=next]"),
							btnPrev: $widget.find(".nav a[rel=prev]")	
      					}
					);
					$carousel.find("li").bind(
						{
							focus: $.proxy(this, "_focus"),
							blur: $.proxy(this, "_blur")
						}
					).eq(0).trigger("focus");
					$widget.bind(
						{
							swiping: $.proxy(this, "_swiping"),
							swipe: $.proxy(this, "_swipe"),
							mousewheeling: $.proxy(this, "_swiping"),
							mousewheel: $.proxy(this, "_swipe")
						}
					);
					$widget.delegate(
						"li.roundabout-in-focus",
						"click",
						$.proxy(this, "_click")
					);	
				},
				_click: function(e)
				{
					$(".modal").modal("show");
				},
				_swiping: function(e, delta, deltaX, deltaY)
				{	
					this.$carousel.roundabout_stop(true).css(
						{
							RoundaboutBearing: deltaX * 3
						}
					);
				},
				_swipe: function(e, delta, deltaX, deltaY)
				{	
					// K  Change duration from 1000 to 500
					this.$carousel.stop(true).roundabout_animateToNearbyChild([500, "easeOutBack"]);
				},
				_focus: function(e)
				{
					
					if ( navigator.appName == "Microsoft Internet Explorer" ) {
					
						var $target = $(e.currentTarget);
						$target.find("div").stop(true).show();
					} else {
					
						var $target = $(e.currentTarget);
						$target.find("div").stop(true).css(
							{
								opacity: 1,
								display: "none"
							}
						).fadeIn(300);
						$target.find("div.price_cont").show();
					}
				},
				_blur: function(e)
				{
				
					if ( navigator.appName == "Microsoft Internet Explorer" ) {
						
						var $target = $(e.currentTarget);
						$target.css('z-index','').addClass( 'slide_back' );
						$target.find("div").stop(true).hide();
					} else {
					
						var $target = $(e.currentTarget);
						$target.css('z-index','').addClass( 'slide_back' );
						$target.find("div").stop(true).fadeOut( 200, function() {
							
							$target.find("div.price_cont").hide();
						});
					}
				

				}
				
			}
		);
	}
)(jQuery);
		
		(function($)
	{
		var name = "modal";
		var qn = "code28." + name;
		var eventQn = "." + qn;
		
		
		
		$.widget(
			qn,
			{	
				options: {
			
				},
				_init: function()
				{
					$.Widget.prototype._init.apply(this, arguments);
					var $widget = this.widget();
					$widget.prepend('<a href="#close" class="close">Close</a>');
					//this.show();
				},
				show: function()
				{
					var $widget = this.widget();
					$widget.lightbox_me(
						{
							overlayCSS: {
								backgroundColor: "#2e2335",
								opacity: .4
							},
							centered: true
						}
					);
				}
				
			}
		);
				

			
	}
)(jQuery);
		
		/*
 * jQuery UI Effects 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/
 */
jQuery.effects||(function(g){g.effects={};g.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(l,k){g.fx.step[k]=function(m){if(!m.colorInit){m.start=j(m.elem,k);m.end=i(m.end);m.colorInit=true}m.elem.style[k]="rgb("+Math.max(Math.min(parseInt((m.pos*(m.end[0]-m.start[0]))+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt((m.pos*(m.end[1]-m.start[1]))+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt((m.pos*(m.end[2]-m.start[2]))+m.start[2],10),255),0)+")"}});function i(l){var k;if(l&&l.constructor==Array&&l.length==3){return l}if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(l)){return[parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)]}if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(l)){return[parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55]}if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(l)){return[parseInt(k[1],16),parseInt(k[2],16),parseInt(k[3],16)]}if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(l)){return[parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16)]}if(k=/rgba\(0, 0, 0, 0\)/.exec(l)){return a.transparent}return a[g.trim(l).toLowerCase()]}function j(m,k){var l;do{l=g.curCSS(m,k);if(l!=""&&l!="transparent"||g.nodeName(m,"body")){break}k="backgroundColor"}while(m=m.parentNode);return i(l)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var e=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function f(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,o={},l,m;if(n&&n.length&&n[0]&&n[n[0]]){var k=n.length;while(k--){l=n[k];if(typeof n[l]=="string"){m=l.replace(/\-(\w)/g,function(p,q){return q.toUpperCase()});o[m]=n[l]}}}else{for(l in n){if(typeof n[l]==="string"){o[l]=n[l]}}}return o}function b(l){var k,m;for(k in l){m=l[k];if(m==null||g.isFunction(m)||k in c||(/scrollbar/).test(k)||(!(/color/i).test(k)&&isNaN(parseFloat(m)))){delete l[k]}}return l}function h(k,m){var n={_:0},l;for(l in m){if(k[l]!=m[l]){n[l]=m[l]}}return n}g.effects.animateClass=function(k,l,n,m){if(g.isFunction(n)){m=n;n=null}return this.each(function(){var r=g(this),o=r.attr("style")||" ",s=b(f.call(this)),q,p=r.attr("className");g.each(e,function(t,u){if(k[u]){r[u+"Class"](k[u])}});q=b(f.call(this));r.attr("className",p);r.animate(h(s,q),l,n,function(){g.each(e,function(t,u){if(k[u]){r[u+"Class"](k[u])}});if(typeof r.attr("style")=="object"){r.attr("style").cssText="";r.attr("style").cssText=o}else{r.attr("style",o)}if(m){m.apply(this,arguments)}})})};g.fn.extend({_addClass:g.fn.addClass,addClass:function(l,k,n,m){return k?g.effects.animateClass.apply(this,[{add:l},k,n,m]):this._addClass(l)},_removeClass:g.fn.removeClass,removeClass:function(l,k,n,m){return k?g.effects.animateClass.apply(this,[{remove:l},k,n,m]):this._removeClass(l)},_toggleClass:g.fn.toggleClass,toggleClass:function(m,l,k,o,n){if(typeof l=="boolean"||l===undefined){if(!k){return this._toggleClass(m,l)}else{return g.effects.animateClass.apply(this,[(l?{add:m}:{remove:m}),k,o,n])}}else{return g.effects.animateClass.apply(this,[{toggle:m},l,k,o])}},switchClass:function(k,m,l,o,n){return g.effects.animateClass.apply(this,[{add:m,remove:k},l,o,n])}});g.extend(g.effects,{version:"1.8",save:function(l,m){for(var k=0;k<m.length;k++){if(m[k]!==null){l.data("ec.storage."+m[k],l[0].style[m[k]])}}},restore:function(l,m){for(var k=0;k<m.length;k++){if(m[k]!==null){l.css(m[k],l.data("ec.storage."+m[k]))}}},setMode:function(k,l){if(l=="toggle"){l=k.is(":hidden")?"show":"hide"}return l},getBaseline:function(l,m){var n,k;switch(l[0]){case"top":n=0;break;case"middle":n=0.5;break;case"bottom":n=1;break;default:n=l[0]/m.height}switch(l[1]){case"left":k=0;break;case"center":k=0.5;break;case"right":k=1;break;default:k=l[1]/m.width}return{x:k,y:n}},createWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent()}var l={width:k.outerWidth(true),height:k.outerHeight(true),"float":k.css("float")},m=g("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});k.wrap(m);m=k.parent();if(k.css("position")=="static"){m.css({position:"relative"});k.css({position:"relative"})}else{g.extend(l,{position:k.css("position"),zIndex:k.css("z-index")});g.each(["top","left","bottom","right"],function(n,o){l[o]=k.css(o);if(isNaN(parseInt(l[o],10))){l[o]="auto"}});k.css({position:"relative",top:0,left:0})}return m.css(l).show()},removeWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent().replaceWith(k)}return k},setTransition:function(l,n,k,m){m=m||{};g.each(n,function(p,o){unit=l.cssUnit(o);if(unit[0]>0){m[o]=unit[0]*k+unit[1]}});return m}});function d(l,k,m,n){if(typeof l=="object"){n=k;m=null;k=l;l=k.effect}if(g.isFunction(k)){n=k;m=null;k={}}if(g.isFunction(m)){n=m;m=null}if(typeof k=="number"||g.fx.speeds[k]){n=m;m=k;k={}}k=k||{};m=m||k.duration;m=g.fx.off?0:typeof m=="number"?m:g.fx.speeds[m]||g.fx.speeds._default;n=n||k.complete;return[l,k,m,n]}g.fn.extend({effect:function(n,m,p,q){var l=d.apply(this,arguments),o={options:l[1],duration:l[2],callback:l[3]},k=g.effects[n];return k&&!g.fx.off?k.call(this,o):this},_show:g.fn.show,show:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]){return this._show.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:g.fn.hide,hide:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]){return this._hide.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:g.fn.toggle,toggle:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]||typeof l=="boolean"||g.isFunction(l)){return this.__toggle.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(k){var l=this.css(k),m=[];g.each(["em","px","%","pt"],function(n,o){if(l.indexOf(o)>0){m=[parseFloat(l),o]}});return m}});g.easing.jswing=g.easing.swing;g.extend(g.easing,{def:"easeOutQuad",swing:function(l,m,k,o,n){return g.easing[g.easing.def](l,m,k,o,n)},easeInQuad:function(l,m,k,o,n){return o*(m/=n)*m+k},easeOutQuad:function(l,m,k,o,n){return -o*(m/=n)*(m-2)+k},easeInOutQuad:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m+k}return -o/2*((--m)*(m-2)-1)+k},easeInCubic:function(l,m,k,o,n){return o*(m/=n)*m*m+k},easeOutCubic:function(l,m,k,o,n){return o*((m=m/n-1)*m*m+1)+k},easeInOutCubic:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m+k}return o/2*((m-=2)*m*m+2)+k},easeInQuart:function(l,m,k,o,n){return o*(m/=n)*m*m*m+k},easeOutQuart:function(l,m,k,o,n){return -o*((m=m/n-1)*m*m*m-1)+k},easeInOutQuart:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m*m+k}return -o/2*((m-=2)*m*m*m-2)+k},easeInQuint:function(l,m,k,o,n){return o*(m/=n)*m*m*m*m+k},easeOutQuint:function(l,m,k,o,n){return o*((m=m/n-1)*m*m*m*m+1)+k},easeInOutQuint:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m*m*m+k}return o/2*((m-=2)*m*m*m*m+2)+k},easeInSine:function(l,m,k,o,n){return -o*Math.cos(m/n*(Math.PI/2))+o+k},easeOutSine:function(l,m,k,o,n){return o*Math.sin(m/n*(Math.PI/2))+k},easeInOutSine:function(l,m,k,o,n){return -o/2*(Math.cos(Math.PI*m/n)-1)+k},easeInExpo:function(l,m,k,o,n){return(m==0)?k:o*Math.pow(2,10*(m/n-1))+k},easeOutExpo:function(l,m,k,o,n){return(m==n)?k+o:o*(-Math.pow(2,-10*m/n)+1)+k},easeInOutExpo:function(l,m,k,o,n){if(m==0){return k}if(m==n){return k+o}if((m/=n/2)<1){return o/2*Math.pow(2,10*(m-1))+k}return o/2*(-Math.pow(2,-10*--m)+2)+k},easeInCirc:function(l,m,k,o,n){return -o*(Math.sqrt(1-(m/=n)*m)-1)+k},easeOutCirc:function(l,m,k,o,n){return o*Math.sqrt(1-(m=m/n-1)*m)+k},easeInOutCirc:function(l,m,k,o,n){if((m/=n/2)<1){return -o/2*(Math.sqrt(1-m*m)-1)+k}return o/2*(Math.sqrt(1-(m-=2)*m)+1)+k},easeInElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r)==1){return k+u}if(!q){q=r*0.3}if(m<Math.abs(u)){m=u;var o=q/4}else{var o=q/(2*Math.PI)*Math.asin(u/m)}return -(m*Math.pow(2,10*(n-=1))*Math.sin((n*r-o)*(2*Math.PI)/q))+k},easeOutElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r)==1){return k+u}if(!q){q=r*0.3}if(m<Math.abs(u)){m=u;var o=q/4}else{var o=q/(2*Math.PI)*Math.asin(u/m)}return m*Math.pow(2,-10*n)*Math.sin((n*r-o)*(2*Math.PI)/q)+u+k},easeInOutElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r/2)==2){return k+u}if(!q){q=r*(0.3*1.5)}if(m<Math.abs(u)){m=u;var o=q/4}else{var o=q/(2*Math.PI)*Math.asin(u/m)}if(n<1){return -0.5*(m*Math.pow(2,10*(n-=1))*Math.sin((n*r-o)*(2*Math.PI)/q))+k}return m*Math.pow(2,-10*(n-=1))*Math.sin((n*r-o)*(2*Math.PI)/q)*0.5+u+k},easeInBack:function(l,m,k,p,o,n){if(n==undefined){n=1.70158}return p*(m/=o)*m*((n+1)*m-n)+k},easeOutBack:function(l,m,k,p,o,n){if(n==undefined){n=1.70158}return p*((m=m/o-1)*m*((n+1)*m+n)+1)+k},easeInOutBack:function(l,m,k,p,o,n){if(n==undefined){n=1.70158}if((m/=o/2)<1){return p/2*(m*m*(((n*=(1.525))+1)*m-n))+k}return p/2*((m-=2)*m*(((n*=(1.525))+1)*m+n)+2)+k},easeInBounce:function(l,m,k,o,n){return o-g.easing.easeOutBounce(l,n-m,0,o,n)+k},easeOutBounce:function(l,m,k,o,n){if((m/=n)<(1/2.75)){return o*(7.5625*m*m)+k}else{if(m<(2/2.75)){return o*(7.5625*(m-=(1.5/2.75))*m+0.75)+k}else{if(m<(2.5/2.75)){return o*(7.5625*(m-=(2.25/2.75))*m+0.9375)+k}else{return o*(7.5625*(m-=(2.625/2.75))*m+0.984375)+k}}}},easeInOutBounce:function(l,m,k,o,n){if(m<n/2){return g.easing.easeInBounce(l,m*2,0,o,n)*0.5+k}return g.easing.easeOutBounce(l,m*2-n,0,o,n)*0.5+o*0.5+k}})})(jQuery);(
	function($)
	{
		$.extend(
			{
				wait: function(time)
				{
					var interval;
					var promise = $.promise(
						function(dfd)
						{
				    		interval = setTimeout(dfd.resolve, time);
						}
					);
					promise.interval = interval;
					return promise;	
				}
			}	
		);
	}
)(jQuery);/*
 * jQuery outside events - v1.1 - 3/16/2010
 * http://benalman.com/projects/jquery-outside-events-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,c,b){$.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup touchstart".split(" "),function(d){a(d)});a("focusin","focus"+b);a("focusout","blur"+b);$.addOutsideEvent=a;function a(g,e){e=e||g+b;var d=$(),h=g+"."+e+"-special-event";$.event.special[e]={setup:function(){d=d.add(this);if(d.length===1){$(c).bind(h,f)}},teardown:function(){d=d.not(this);if(d.length===0){$(c).unbind(h)}},add:function(i){var j=i.handler;i.handler=function(l,k){l.target=k;j.apply(this,arguments)}}};function f(i){$(d).each(function(){var j=$(this);if(this!==i.target&&!j.has(i.target).length){j.triggerHandler(e,[i.target])}})}}})(jQuery,document,"outside");/*
 * scale: A jQuery cssHooks adding a cross browser 'scale' property to $.fn.css() and $.fn.animate()
 * 
 * limitations:
 * - requires jQuery 1.4.3+
 * - using composit values (e.g. 1.7,0.6) requires jQuery trunk
 * - cannot be used together with jquery.rotate.js
 *
 * Copyright (c) 2010 Louis-Rémi Babé twitter.com/louis_remi
 * Licensed under the MIT license.
 * 
 * This saved you an hour of work? 
 * Send me music http://www.amazon.fr/wishlist/HNTU0468LQON
 *
 */
(function($) {

var div = document.createElement('div'),
  divStyle = div.style,
  support = $.support;

support.transform = 
  divStyle.MozTransform === ''? 'MozTransform' :
  (divStyle.MsTransform === ''? 'MsTransform' :
  (divStyle.WebkitTransform === ''? 'WebkitTransform' : 
  (divStyle.OTransform === ''? 'OTransform' :
  (divStyle.transform === ''? 'transform' :
  false))));
support.matrixFilter = !support.transform && divStyle.filter === '';
div = null;

$.cssNumber.scale = true;
$.cssHooks.scale = {
  set: function( elem, value ) {
    var _support = support,
      supportTransform = _support.transform,
      scales,
      centerOrigin;
    
    $.data( elem, 'transform', {
      // convert value to an array
      scale: scales = value.toString().split(',')
    });
    
    if (supportTransform) {
      elem.style[supportTransform] = 'scale('+ value +')';
      
    } else if (_support.matrixFilter) {
      elem.style.filter = [
        "progid:DXImageTransform.Microsoft.Matrix(",
          "M11="+scales[0]+",",
          "M12=0,",
          "M21=0,",
          "M22="+scales [1]+",",
          "SizingMethod='auto expand'",
        ")"
      ].join('');
      
      // From pbakaus's Transformie http://github.com/pbakaus/transformie
      if(centerOrigin = $.scale.centerOrigin) {
        elem.style[centerOrigin == 'margin' ? 'marginLeft' : 'left'] = -(elem.offsetWidth/2) + (elem.clientWidth/2) + "px";
        elem.style[centerOrigin == 'margin' ? 'marginTop' : 'top'] = -(elem.offsetHeight/2) + (elem.clientHeight/2) + "px";
      }
    }
  },
  get: function( elem ) {
    var transform = $.data( elem, 'transform' );
    return transform && transform.scale? transform.scale : 0;
  }
};

$.fx.step.scale = function( fx ) {
  // fx.start is not correctly initialised by jQuery, fix it once for all
  if ( !$.isArray(fx.start) ) {
    fx.start = $.data( fx.elem, 'transform').scale;
  }

  var start = fx.start,
    end = fx.end.toString().split(',');

  // In case of composit value, we need to recalculate fx.now
  if (start.length == 2 || end.length == 2) {
    if (!start[1]) {
      start[1] = start[0];
    }
    if (!end[1]) {
      end[1] = end[0];
    }
    fx.now = 
      +(+start[0] + fx.pos * (+end[0] - start[0])) + ','+
      +(+start[1] + fx.pos * (+end[1] - start[1]));
  }
  $.cssHooks.scale.set( fx.elem, fx.now );  
};

$.scale = {
  centerOrigin: 'margin'
};
  
})(jQuery);/*
 * Copyright (C) 1999-2009 Jive Software. All rights reserved.
 *
 * This software is the proprietary information of Jive Software. Use is subject to license terms.
 */

/*
* $ lightbox_me
* By: Buck Wilson
* Version : 2.2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


(function($) {

    $.fn.lightbox_me = function(options) {

        return this.each(function() {

            var
                opts = $.extend({}, $.fn.lightbox_me.defaults, options),
                $overlay = $('div.' + opts.classPrefix + '_overlay'),
                $self = $(this),
                $iframe = $('iframe#lb_iframe'),
                ie6 = ($.browser.msie && $.browser.version < 7);
            
            if ($overlay.length > 0) {
                $overlay[0].removeModal(); // if the overlay exists, then a modal probably exists. Ditch it!
            } else {
                $overlay =  $('<div class="' + opts.classPrefix + '_overlay" style="display:none;"/>'); // otherwise just create an all new overlay. 
            }

            $iframe = ($iframe.length > 0) ? $iframe : $iframe = $('<iframe id="lb_iframe" style="z-index: ' + (opts.zIndex + 1) + '; display: none; border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0;"/>');

            /*----------------------------------------------------
               DOM Building
            ---------------------------------------------------- */
            if (ie6) {
                var src = /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank';
                $iframe.attr('src', src);
                $('body').append($iframe);
            } // iframe shim for ie6, to hide select elements
            $('body').append($self).append($overlay);

            /*----------------------------------------------------
               CSS stuffs
            ---------------------------------------------------- */

            // set css of the modal'd window

            setSelfPosition();
            $self.css({display: "none",left: '50%', marginLeft: ($self.outerWidth() / 2) * -1,  zIndex: (opts.zIndex + 3) });

            // set css of the overlay

            setOverlayHeight(); // pulled this into a function because it is called on window resize.
            $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2) })
                    .css(opts.overlayCSS);

            /*----------------------------------------------------
               Animate it in.
            ---------------------------------------------------- */

            if ($overlay.is(":hidden")) {
                $overlay.fadeIn(opts.overlaySpeed, function() {
                    $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); opts.onLoad()});
                });
            } else {
                $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); opts.onLoad()});
            }

            /*----------------------------------------------------
               Bind Events
            ---------------------------------------------------- */

            $(window).resize(setOverlayHeight)
                     .resize(setSelfPosition)
                     
                     .keydown(observeEscapePress);

			if(!ie6) {
				$(window).scroll(setSelfPosition);
			}
                     
            $self.find(opts.closeSelector).click(function() { removeModal(true); return false; });
            $overlay.click(function() { if(opts.closeClick){ removeModal(true); return false;} });

            
            $self.bind('close', function() { removeModal(true) });
            $self.bind('resize', setSelfPosition);
            $overlay[0].removeModal = removeModal;

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

            /*----------------------------------------------------
               Private Functions
            ---------------------------------------------------- */


            function removeModal(removeO) {
                // fades & removes modal, then unbinds events
                $self[opts.disappearEffect](opts.lightboxDisappearSpeed, function() {
                    
                    if (removeO) {
                      removeOverlay();  
                    } 
                    
                    opts.destroyOnClose ? $self.remove() : $self.hide()
                    
                    
                    $self.find(opts.closeSelector).unbind('click');
                    $self.unbind('close');
                    $self.unbind('resize');
                    $(window).unbind('scroll', setSelfPosition);
                    $(window).unbind('resize', setSelfPosition);
                    
                    
                });
            }
            
            
            function removeOverlay() {
                // fades & removes overlay, then unbinds events
                $overlay.fadeOut(opts.overlayDisappearSpeed, function() {
                    $(window).unbind('resize', setOverlayHeight);

                    $overlay.remove();
                    $overlay.unbind('click');
                    
                    
                    opts.onClose();

                })
            }
            


            /* Function to bind to the window to observe the escape key press */
            function observeEscapePress(e) {
                if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) removeModal(true);
            }

            /* Set the height of the overlay
                    : if the document height is taller than the window, then set the overlay height to the document height.
                    : otherwise, just set overlay height: 100%
            */
            function setOverlayHeight() {
                if ($(window).height() < $(document).height()) {
                    $overlay.css({height: $(document).height() + 'px'});
                } else {
                    $overlay.css({height: '100%'});
                    if (ie6) {$('html,body').css('height','100%'); } // ie6 hack for height: 100%; TODO: handle this in IE7
                }
            }

            /* Set the position of the modal'd window ($self)
                    : if $self is taller than the window, then make it absolutely positioned
                    : otherwise fixed
            */
            function setSelfPosition() {
                var s = $self[0].style;

                if (($self.height() + 80  >= $(window).height()) && ($self.css('position') != 'absolute' || ie6)) {
                    var topOffset = $(document).scrollTop() + 40;
                    $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0})
                    if (ie6) {
                        s.removeExpression('top');
                    }
                } else if ($self.height()+ 80  < $(window).height()) {
                    if (ie6) {
                        s.position = 'absolute';
                        if (opts.centered) {
                            s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
                            s.marginTop = 0;
                        } else {
                            var top = (opts.modalCSS && opts.modalCSS.top) ? parseInt(opts.modalCSS.top) : 0;
                            s.setExpression('top', '((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"')
                        }
                    } else {
                        if (opts.centered) {
                            $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1})
                        } else {
                            $self.css({ position: 'fixed'}).css(opts.modalCSS);
                        }
                    }
                }
            }
        });
    };


    $.fn.lightbox_me.defaults = {

        // animation when appears
        appearEffect: "fadeIn",
        overlaySpeed: 300,
        lightboxSpeed: "fast",
        
        // animation when dissapears
        disappearEffect: "fadeOut",
        overlayDisappearSpeed: 300,
        lightboxDisappearSpeed: "fast",

        // close
        closeSelector: ".close",
        closeClick: true,
        closeEsc: true,

        // behavior
        destroyOnClose: false,

        // callbacks
        onLoad: function() {},
        onClose: function() {},

        // style
        classPrefix: 'lb',
        zIndex: 999,
        centered: false,
        modalCSS: {top: '40px'},
        overlayCSS: {background: 'black', opacity: .6}
    }

})(jQuery);


$( document ).ready( function() {
	$(".carousel").carousel();
});

