/**
 * $Id: jquery.plugins.js,v 1.2 2009/08/17 15:35:13 hassana Exp $ 
 */
;(function( $ ){
	var URI = location.href.replace(/#.*/,''); // local url without hash

	var $localScroll = $.localScroll = function( settings ){
		$('body').localScroll( settings );
	};

	// Many of these defaults, belong to jQuery.ScrollTo, check it's demo for an example of each option.
	// @see http://flesler.demos.com/jquery/scrollTo/
	// The defaults are public and can be overriden.
	$localScroll.defaults = {
		duration:1000, // How long to animate.
		axis:'y', // Which of top and left should be modified.
		event:'click', // On which event to react.
		stop:true, // Avoid queuing animations 
		target: window, // What to scroll (selector or element). The whole window by default.
		reset: true // Used by $.localScroll.hash. If true, elements' scroll is resetted before actual scrolling
		/*
		lock:false, // ignore events if already animating
		lazy:false, // if true, links can be added later, and will still work.
		filter:null, // filter some anchors out of the matched elements.
		hash: false // if true, the hash of the selected link, will appear on the address bar.
		*/
	};

	// If the URL contains a hash, it will scroll to the pointed element
	$localScroll.hash = function( settings ){
		if( location.hash ){
			settings = $.extend( {}, $localScroll.defaults, settings );
			settings.hash = false; // can't be true
			
			if( settings.reset ){
				var d = settings.duration;
				delete settings.duration;
				$(settings.target).scrollTo( 0, settings );
				settings.duration = d;
			}
			scroll( 0, location, settings );
		}
	};

	$.fn.localScroll = function( settings ){
		settings = $.extend( {}, $localScroll.defaults, settings );

		return settings.lazy ?
			// use event delegation, more links can be added later.		
			this.bind( settings.event, function( e ){
				// Could use closest(), but that would leave out jQuery -1.3.x
				var a = $([e.target, e.target.parentNode]).filter(filter)[0];
				// if a valid link was clicked
				if( a )
					scroll( e, a, settings ); // do scroll.
			}) :
			// bind concretely, to each matching link
			this.find('a,area')
				.filter( filter ).bind( settings.event, function(e){
					scroll( e, this, settings );
				}).end()
			.end();

		function filter(){// is this a link that points to an anchor and passes a possible filter ? href is checked to avoid a bug in FF.
			return !!this.href && !!this.hash && this.href.replace(this.hash,'') == URI && (!settings.filter || $(this).is( settings.filter ));
		};
	};

	function scroll( e, link, settings ){
		var id = link.hash.slice(1),
			elem = document.getElementById(id) || document.getElementsByName(id)[0];

		if ( !elem )
			return;

		if( e )
			e.preventDefault();

		var $target = $( settings.target );

		if( settings.lock && $target.is(':animated') ||
			settings.onBefore && settings.onBefore.call(settings, e, elem, $target) === false ) 
			return;

		if( settings.stop )
			$target.stop(true); // remove all its animations

		if( settings.hash ){
			var attr = elem.id == id ? 'id' : 'name',
				$a = $('<a> </a>').attr(attr, id).css({
					position:'absolute',
					top: $(window).scrollTop(),
					left: $(window).scrollLeft()
				});

			elem[attr] = '';
			$('body').prepend($a);
			location = link.hash;
			$a.remove();
			elem[attr] = id;
		}
			
		$target
			.scrollTo( elem, settings ) // do scroll
			.trigger('notify.serialScroll',[elem]); // notify serialScroll about this change
	};

})( jQuery );


/**
 * $Id: jquery.plugins.js,v 1.2 2009/08/17 15:35:13 hassana Exp $ 
 */
;(function( $ ){

	var $scrollTo = $.scrollTo = function( target, duration, settings ){
		$(window).scrollTo( target, duration, settings );
	};

	$scrollTo.defaults = {
			axis:'xy',
			duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1
	};

	// Returns the element that needs to be animated to scroll the window.
	// Kept for backwards compatibility (specially for localScroll & serialScroll)
	$scrollTo.window = function( scope ){
		return $(window).scrollable();
	};

	// Hack, hack, hack... stay away!
	// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
	$.fn.scrollable = function(){
		return this.map(function(){
			var elem = this,
			isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;

			if( !isWin )
				return elem;

			var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;

			return $.browser.safari || doc.compatMode == 'BackCompat' ?
					doc.body : 
						doc.documentElement;
		});
	};

	$.fn.scrollTo = function( target, duration, settings ){
		if( typeof duration == 'object' ){
			settings = duration;
			duration = 0;
		}
		if( typeof settings == 'function' )
			settings = { onAfter:settings };

		if( target == 'max' )
			target = 9e9;

		settings = $.extend( {}, $scrollTo.defaults, settings );
		// Speed is still recognized for backwards compatibility
		duration = duration || settings.speed || settings.duration;
		// Make sure the settings are given right
		settings.queue = settings.queue && settings.axis.length > 1;

		if( settings.queue )
			// Let's keep the overall duration
			duration /= 2;
		settings.offset = both( settings.offset );
		settings.over = both( settings.over );

		return this.scrollable().each(function(){
			var elem = this,
			$elem = $(elem),
			targ = target, toff, attr = {},
			win = $elem.is('html,body');

			switch( typeof targ ){
			// A number will pass the regex
			case 'number':
			case 'string':
				if( /^([+-]=)?\d+(\.\d+)?(px)?$/.test(targ) ){
					targ = both( targ );
					// We are done
					break;
				}
				// Relative selector, no break!
				targ = $(targ,this);
			case 'object':
				// DOMElement / jQuery
				if( targ.is || targ.style )
					// Get the real position of the target 
					toff = (targ = $(targ)).offset();
			}
			$.each( settings.axis.split(''), function( i, axis ){
				var Pos	= axis == 'x' ? 'Left' : 'Top',
						pos = Pos.toLowerCase(),
						key = 'scroll' + Pos,
						old = elem[key],
						Dim = axis == 'x' ? 'Width' : 'Height';

				if( toff ){// jQuery / DOMElement
					attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );

					// If it's a dom element, reduce the margin
					if( settings.margin ){
						attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
						attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
					}

					attr[key] += settings.offset[pos] || 0;

					if( settings.over[pos] )
						// Scroll to a fraction of its width/height
						attr[key] += targ[Dim.toLowerCase()]() * settings.over[pos];
				}else
					attr[key] = targ[pos];

				// Number or 'number'
				if( /^\d+$/.test(attr[key]) )
					// Check the limits
					attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max(Dim) );

				// Queueing axes
				if( !i && settings.queue ){
					// Don't waste time animating, if there's no need.
					if( old != attr[key] )
						// Intermediate animation
						animate( settings.onAfterFirst );
					// Don't animate this axis again in the next iteration.
					delete attr[key];
				}
			});

			animate( settings.onAfter );			

			function animate( callback ){
				$elem.animate( attr, duration, settings.easing, callback && function(){
					callback.call(this, target, settings);
				});
			};

			// Max scrolling position, works on quirks mode
			// It only fails (not too badly) on IE, quirks mode.
			function max( Dim ){
				var scroll = 'scroll'+Dim;

				if( !win )
					return elem[scroll];

				var size = 'client' + Dim,
				html = elem.ownerDocument.documentElement,
				body = elem.ownerDocument.body;

				return Math.max( html[scroll], body[scroll] ) 
				- Math.min( html[size]  , body[size]   );

			};

		}).end();
	};

	function both( val ){
		return typeof val == 'object' ? val : { top:val, left:val };
	};

})( jQuery );


/**
 * $Id: jquery.plugins.js,v 1.2 2009/08/17 15:35:13 hassana Exp $ 
 */
(function($) { 	

	function fireEvent(opts, name, self) {
		var fn = opts[name];
		
		if ($.isFunction(fn)) {
			
			try {  
				return fn.call(self);
				
			} catch (error) {
				if (opts.alert) {
					alert("Error calling expose." + name + ": " + error);
				} else {
					throw error;		
				}
				return false;
			} 			
		}
		return true;			
	}
	
	// mask instance (singleton)
	var mask = null;	
	

	// exposed elements
	var exposed, conf = null;

	
	// global methods
	$.expose = {		
		
		getVersion: function() {
			return [1, 0, 0];	
		},
		
		getMask: function() {
			return mask;	
		},
		
		getExposed: function() {
			return exposed;	
		},
		
		getConf: function() {
			return conf;	
		},		
		
		isLoaded: function() {
			return mask && mask.is(":visible");	
		},
		
		load: function(els, opts) { 
			
			// already loaded ?
			if (this.isLoaded()) { return this;	}

			if (els) {
				exposed = els;
				conf = opts;					
			} else {
				els = exposed;
				opts = conf;
			} 

			if (!els || !els.length) { return this; }
				
			// setup mask if not already done
			if (!mask) {
	
				mask = $('<div id="' + opts.maskId + '"></div>').css({				
					position:'absolute', 
					top:0, 
					left:0,
					width:'100%',
					height:$(document).height(),
					display:'none',
					opacity: 0,					 		
					zIndex:opts.zIndex	
				});
						
				
				$("body").append(mask);
				
				
				// esc button closes all instances
				$(document).bind("keypress.unexpose", function(evt) {
					if (evt.keyCode == 27) {
						$.expose.close();	
					}		
				});			
				
				// clicking on the mask closes all
				if (opts.closeOnClick) {
					mask.bind("click.unexpose", function()  {
						$.expose.close();		
					});					
				} 
			}

			
			// onBeforeLoad
			if (fireEvent(opts, "onBeforeLoad", this) === false) {
				return this;	
			}				
			
			// make sure element is positioned absolutely or relatively
			$.each(els, function() {
				var el = $(this);
				if (!/relative|absolute/i.test(el.css("position"))) {
					el.css("position", "relative");		
				}					
			});
		 
			// make elements sit on top of the mask
			els.css({zIndex:opts.zIndex + 1});				
			 

			// background color of the mask
			if (opts.color) {
				mask.css("backgroundColor", opts.color);	
			} 
			
			// reveal mask
			if (!this.isLoaded()) {					
				mask.css({opacity: 0, display: 'block'}).fadeTo(opts.loadSpeed, opts.opacity, function()  {
					fireEvent(opts, "onLoad", $.expose);  						
				});					
			}

			return this;
		}, 
		
		
		close: function() {
			
			var self = this;
			
			if (!this.isLoaded()) { return self; }   
			
			if (fireEvent(conf, "onBeforeClose", self) === false) {
				return self;   
			} 
			
			mask.fadeOut(conf.closeSpeed, function() {          
				exposed.css({zIndex:conf.zIndex -1});
				fireEvent(conf, "onClose", self);               
			});            				
		}
		
	};
	
	// jQuery plugin initialization
	$.prototype.expose = function(conf) {

		// no elements to expose
		if (!this.length)  {
			return this;	
		}
		
		var opts = {
			/*
			CALLBACKS: 
			 - onBeforeLoad 
			 - onLoad
			 - onBeforeClose 
			 - onClose 
			*/		
			alert: true,

			// mask settings
			maskId: 'exposeMask',
			loadSpeed: 'slow',
			closeSpeed: 'fast',
			closeOnClick: true,
			
			// css settings
			zIndex: 9998,
			opacity: 0.8,
			color: '#333'
		};
		
		if (typeof conf == 'string') {
			conf = {color: conf};
		}
		
		$.extend(opts, conf);
		
		// call expose function		
		$.expose.load(this, opts);
		
		// return jQuery object
		return this;
		
	}; 


})(jQuery);


/**
 * $Id: jquery.plugins.js,v 1.2 2009/08/17 15:35:13 hassana Exp $ 
 */
;(function( $ ){

	var $serialScroll = $.serialScroll = function( settings ){
		$.scrollTo.window().serialScroll( settings );
	};

	//Many of these defaults, belong to jQuery.ScrollTo, check it's demo for an example of each option.
	//@see http://flesler.webs/jQuery.ScrollTo/
	$serialScroll.defaults = {//the defaults are public and can be overriden.
		duration:1000, //how long to animate.
		axis:'x', //which of top and left should be scrolled
		event:'click', //on which event to react.
		start:0, //first element (zero-based index)
		step:1, //how many elements to scroll on each action
		lock:true,//ignore events if already animating
		cycle:true, //cycle endlessly ( constant velocity )
		constant:true //use contant speed ?
		/*
		navigation:null,//if specified, it's a selector a collection of items to navigate the container
		target:null, //if specified, it's a selector to the element to be scrolled.
		interval:0, //it's the number of milliseconds to automatically go to the next
		lazy:false,//go find the elements each time (allows AJAX or JS content, or reordering)
		stop:false, //stop any previous animations to avoid queueing
		force:false,//force the scroll to the first element on start ?
		jump: false,//if true, when the event is triggered on an element, the pane scrolls to it
		items:null, //selector to the items (relative to the matched elements)
		prev:null, //selector to the 'prev' button
		next:null, //selector to the 'next' button
		onBefore: function(){}, //function called before scrolling, if it returns false, the event is ignored
		exclude:0 //exclude the last x elements, so we cannot scroll past the end
		*/
	};

	$.fn.serialScroll = function( settings ){
		settings = $.extend( {}, $serialScroll.defaults, settings );
		var event = settings.event, //this one is just to get shorter code when compressed
			step = settings.step, // idem
			lazy = settings.lazy;//idem

		return this.each(function(){
			var 
				context = settings.target ? this : document, //if a target is specified, then everything's relative to 'this'.
				$pane = $(settings.target || this, context),//the element to be scrolled (will carry all the events)
				pane = $pane[0], //will be reused, save it into a variable
				items = settings.items, //will hold a lazy list of elements
				active = settings.start, //active index
				auto = settings.interval, //boolean, do auto or not
				nav = settings.navigation, //save it now to make the code shorter
				timer; //holds the interval id

			if( !lazy )//if not lazy, go get the items now
				items = getItems();

			if( settings.force )
				jump( {}, active );//generate an initial call

			// Button binding, optionall
			$(settings.prev||[], context).bind( event, -step, move );
			$(settings.next||[], context).bind( event, step, move );

			// Custom events bound to the container
			if( !pane.ssbound )//don't bind more than once
				$pane
					.bind('prev.serialScroll', -step, move ) //you can trigger with just 'prev'
					.bind('next.serialScroll', step, move ) //for example: $(container).trigger('next');
					.bind('goto.serialScroll', jump ); //for example: $(container).trigger('goto', [4] );
			if( auto )
				$pane
					.bind('start.serialScroll', function(e){
						if( !auto ){
							clear();
							auto = true;
							next();
						}
					 })
					.bind('stop.serialScroll', function(){//stop a current animation
						clear();
						auto = false;
					});
			$pane.bind('notify.serialScroll', function(e, elem){//let serialScroll know that the index changed externally
				var i = index(elem);
				if( i > -1 )
					active = i;
			});
			pane.ssbound = true;//avoid many bindings

			if( settings.jump )//can't use jump if using lazy items and a non-bubbling event
				(lazy ? $pane : getItems()).bind( event, function( e ){
					jump( e, index(e.target) );
				});

			if( nav )
				nav = $(nav, context).bind(event, function( e ){
					e.data = Math.round(getItems().length / nav.length) * nav.index(this);
					jump( e, this );
				});

			function move( e ){
				e.data += active;
				jump( e, this );
			};
			function jump( e, button ){
				if( !isNaN(button) ){//initial or special call from the outside $(container).trigger('goto',[index]);
					e.data = button;
					button = pane;
				}

				var
					pos = e.data, n,
					real = e.type, //is a real event triggering ?
					$items = settings.exclude ? getItems().slice(0,-settings.exclude) : getItems(),//handle a possible exclude
					limit = $items.length,
					elem = $items[pos],
					duration = settings.duration;

				if( real )//real event object
					e.preventDefault();

				if( auto ){
					clear();//clear any possible automatic scrolling.
					timer = setTimeout( next, settings.interval ); 
				}

				if( !elem ){ //exceeded the limits
					n = pos < 0 ? 0 : limit - 1;
					if( active != n )//we exceeded for the first time
						pos = n;
					else if( !settings.cycle )//this is a bad case
						return;
					else
						pos = limit - n - 1;//invert, go to the other side
					elem = $items[pos];
				}

				if( !elem || real && active == pos || //could happen, save some CPU cycles in vain
					settings.lock && $pane.is(':animated') || //no animations while busy
					real && settings.onBefore && //callback returns false ?
					settings.onBefore.call(button, e, elem, $pane, getItems(), pos) === false ) return;

				if( settings.stop )
					$pane.queue('fx',[]).stop();//remove all its animations

				if( settings.constant )
					duration = Math.abs(duration/step * (active - pos ));//keep constant velocity

				$pane
					.scrollTo( elem, duration, settings )//do scroll
					.trigger('notify.serialScroll',[pos]);//in case serialScroll was called on this elem more than once.
			};
			function next(){//I'll use the namespace to avoid conflicts
				$pane.trigger('next.serialScroll');
			};
			function clear(){
				clearTimeout(timer);
			};
			function getItems(){
				return $( items, pane );
			};
			function index( elem ){
				if( !isNaN(elem) ) return elem;//number
				var $items = getItems(), i;
				while(( i = $items.index(elem)) == -1 && elem != pane )//see if it matches or one of its ancestors
					elem = elem.parentNode;
				return i;
			};
		});
	};

})( jQuery );

/**
 * $Id: jquery.plugins.js,v 1.2 2009/08/17 15:35:13 hassana Exp $ 
 */
jQuery.fn.supersleight = function(settings) {
	settings = jQuery.extend({
		imgs: true,
		backgrounds: true,
		shim: 'x.gif',
		apply_positioning: true
	}, settings);
	
	return this.each(function(){
		if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 7 && parseInt(jQuery.browser.version) > 4) {
			jQuery(this).find('*').each(function(i,obj) {
				var self = jQuery(obj);
				// background pngs
				if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {
					var bg = self.css('background-image');
					var src = bg.substring(5,bg.length-2);
					var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');
					var styles = {
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",
						'background-image': 'url('+settings.shim+')'
					};
					self.css(styles);
				};
				// image elements
				if (settings.imgs && self.is('img[src$=png]')){
					var styles = {
						'width': self.width() + 'px',
						'height': self.height() + 'px',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
					};
					self.css(styles).attr('src', settings.shim);
				};
				// apply position to 'active' elements
				if (settings.applyPositioning && self.is('a, input') && self.css('position') === ''){
					self.css('position', 'relative');
				};
			});
		};
	});
};


/**
 * $Id: jquery.plugins.js,v 1.2 2009/08/17 15:35:13 hassana Exp $ 
 */
(function($) { 
		
	var instances = [];
		
	function fireEvent(opts, name, self, arg) {
		var fn = opts[name];
		
		if ($.isFunction(fn)) {
			try {  
				return fn.call(self, arg);
				
			} catch (error) {
				if (opts.alert) {
					alert("Error calling overlay." + name + ": " + error);
				} else {
					throw error;		
				}
				return false;
			} 					
		}
		return true;			
	}
	
	
	function Overlay(el, opts) {
		
		var self = this; 
		var trigger = null;
		var w = $(window);  
		
		
		// get trigger and overlayed element
		var jq = opts.target || el.attr("rel");
		var o = jq ? $(jq) : null;

		if (!o) { o = el; }	
		else { trigger = el; }
		
		// get growing image
		var bg = o.attr("overlay");
		
		if (!bg) {
			bg = o.css("backgroundImage");
			bg = bg.substring(bg.indexOf("(") + 1, bg.indexOf(")"));
			o.css("backgroundImage", "none");
			o.attr("overlay", bg);			
		}
		
		// growing image is required (on this version) 
		if (!bg) {
			throw "background-image CSS property not set for overlay element: " + jq;
		}
		
		// replace hyphens so that Opera/IE works
		bg = bg.replace(/\"/g, "");
		
		
		// automatic preloading of images
		if (opts.preload) {
			$(window).load(function() { 
				setTimeout(function() {
					var img = new Image();
					img.src = bg;					
				}, 2000);
			});
		}
		
		
		// set initial growing image properties
		var oWidth = o.outerWidth({margin:true});
		var oHeight = o.outerHeight({margin:true});
		
		var img = $('<img src="' + bg + '"/>');
		img.css({border:0,position:'absolute'}).width(oWidth).hide(); 
		
	

		$('body').append(img);   
		

		// trigger action
		if (trigger) {
			trigger.bind("click.overlay", function(e) {
				self.load(e.pageY - w.scrollTop(), e.pageX - w.scrollLeft());
				return e.preventDefault();
			});
		}   		
				
		// close button
		if (!opts.close || !o.find(opts.close).length) {
			o.prepend('<div class="close"></div>');
			opts.close = "div.close";
		} 
		
		var closeButton = o.find(opts.close);		

				
		// API methods  
		$.extend(self, {

			load: function(top, left) {
				
				// one instance visible at once
				if (self.isOpened()) {
					return self;	
				}
				
				if (opts.oneInstance) {
					$.each(instances, function() {
						this.close();
					});
				}
				
				// onBeforeLoad
				if (fireEvent(opts, "onBeforeLoad", self) === false) {
					return self;	
				}				
				
				// start position			
				top = top   || opts.start.top; 					
				left = left || opts.start.left;
				
				
				// finish position 
				var toTop = opts.finish.top;
				var toLeft = opts.finish.left;

				
				if (toTop == 'center') { toTop = Math.max((w.height() - oHeight) / 2 - 30, 0); }
				if (toLeft == 'center') { toLeft = Math.max((w.width() - oWidth) / 2, 0); }
				
				// adjust positioning relative to scrolling position
				if (!opts.start.absolute)  {
					top += w.scrollTop();
					left += w.scrollLeft();
				}
				
				if (!opts.finish.absolute)  {
					toTop += w.scrollTop();
					toLeft += w.scrollLeft();
				}

				
				// initialize background image  
				img.css({top:top, left:left, width: opts.start.width, zIndex: opts.zIndex}).show();
				
				// begin growing
				img.animate({top:toTop, left:toLeft, width: oWidth}, opts.speed, function() { 
		
					// set content on top of the image
					o.css({position:'absolute', top:toTop, left:toLeft}); 
					var z = img.css("zIndex");
					closeButton.add(o).css("zIndex", ++z);
					
					o.fadeIn(opts.fadeInSpeed, function() {  
						fireEvent(opts, "onLoad", self); 	 
					});
					
				});		
				
				
				return self;
				
			}, 
			
			getBackgroundImage: function() {
				return img;	
			},
			
			getContent: function() {
				return o;	
			}, 
			
			getTrigger: function() {
				return trigger;	
			},

			isOpened: function()  {
				return o.is(":visible")	;
			},
			
			// manipulate start, finish and speeds
			getConf: function() {
				return opts;	
			},
			
			close: function() {
				
				if (!self.isOpened()) { return self; }
				
				if (fireEvent(opts, "onClose", self) === false) { return self; }
				
				if (img.is(":visible")) {
					img.hide();
					o.hide();
				}
				
				return self;
			},  
			
			getVersion: function() {
				return [1, 0, 0];	
			},
			
			// @deprecated
			expose: function() {
				img.expose();	
			}
			
		});
		
		
		closeButton.bind("click.overlay", function() { 
			self.close();  
		});  
				
		
		// keyboard::escape
		w.bind("keypress.overlay", function(evt) {
			if (evt.keyCode == 27) {
				self.close();	
			}
		});		

		
		// when window is clicked outside overlay, we close
		if (opts.closeOnClick) {					
			w.bind("click.overlay", function(evt) {
				if (!o.is(":visible, :animated")) { return; }
				var target = $(evt.target);
				if (target.attr("overlay")) { return; }
				if (target.parents("[overlay]").length) { return; }					
				self.close(); 
			});						
		}		
		
	}
	
	// jQuery plugin initialization
	jQuery.prototype.overlay = function(conf) {   
		
		// already constructed --> return API
		var api = this.eq(typeof conf == 'number' ? conf : 0).data("overlay");
		if (api) { return api; }	
		
		var w = $(window);  		
		
		var opts = { 
		
			/*
			CALLBACKS: 
			 - onBeforeLoad 
			 - onLoad
			 - onBeforeClose 
			 - onClose 
			*/			
			
			start: {
				// by default: button position || center
				top: Math.round(w.height() / 2), 
				left: Math.round(w.width() / 2),				
				width: 0,
				absolute: false
			},
			
			finish: {
				top: 'center', 
				left: 'center',
				absolute: false
			},   
			
			speed: 'normal',
			fadeInSpeed: 'fast',
			close: null,	
			oneInstance: true,
			closeOnClick: true, 
			preload: true, 
			zIndex: 9999,
			
			// target element to be overlayed. by default taken from [rel]
			target: null, 
			alert: true
		};
		
		if ($.isFunction(conf)) {
			conf = {onBeforeLoad: conf};	
		}
		
		$.extend(true, opts, conf);  
		
		
		this.each(function() {			
			var instance = new Overlay($(this), opts);
			instances.push(instance);
			$(this).data("overlay", instance);	
		});

		
		return this; 
	}; 
	
})(jQuery);




