var $j = jQuery.noConflict();
(function($) {
	$j.fn.slidingPanels = function(options) {
		var cfg = {
			panelSelector: "div.slide",
			slideDuration: 200,
			onLeaveDefaultDelay: 0,
			onLeaveStateDelay: 0
		};
		cfg = $j.extend(cfg, options);		
		return this.each(function(){
			var wrapper = $j(this).addClass("slidingPanelsActivated");
			var cPanels = $j(cfg.panelSelector,wrapper);
			var nPanels = cPanels.length;
			var nPanelDefaultX = ((1/nPanels)*100);
			var nPanelBaseX = nPanelDefaultX/2+4;
			var nPanelWidth = 100-(nPanelBaseX*(nPanels-1))+45;
			var unit = "%";
			var iMaximizedPanel; // set later
			cPanels.each(function(i){
				var properties = {
					index: i,
					position: "D",
					state: "Default",
					D2L: -i,
					D2R: nPanels-i,
					L2D: i,
					R2D: i-nPanels,
					L2R: nPanels,
					R2L: -nPanels
				}
				$j.data(this,"slidingPanels",properties);

				$j(this).attr("slidingPanelState","Default").css({
					left: nPanelDefaultX*i+unit,
					width: nPanelWidth+unit
				});
			}).click(function(){
				if ($j(this,".slidingPanelsActivated div").hasClass('active')) {
					if ($j(this).hasClass('one')||$j(this).hasClass('two')||$j(this).hasClass('three')) {
						var next = $j(this).next().attr('class').replace(/ /g,'.');
						$j('.'+next).trigger('click');	
					}
				} else {
					$j(".slidingPanelsActivated div").removeClass('active');
					$j(this).addClass('active');
					iMaximizedPanel = cPanels.index( this );
					cPanels.each(function(i){
						var position = $j.data(this,"slidingPanels").position;
						if ( i <= iMaximizedPanel ){
							if (position != "L"){ $j.data(this,"slidingPanels").direction = position + "2L" }
						} else {
							if (position != "R"){ $j.data(this,"slidingPanels").direction = position + "2R" }
						}
					});
					onLeavePanels();
				}
				return false;
			},function(){});
			
			var onLeavePanels = function(){
				if ( cfg.onLeaveState ){
					var state;
					cPanels.each(function(i){
						var direction = $j.data(this,"slidingPanels").direction;
						state = $j.data(this,"slidingPanels").state;
						if ( hasChangedState(this) ){ cfg.onLeaveState.apply(this,[state]); }
					});
					var delay = (state == "Default") ? cfg.onLeaveDefaultDelay : cfg.onLeaveStateDelay;
					if (delay > 0){
						setTimeout(animatePanels,delay);
						return;
					}
				}
				animatePanels();
			};
			var animatePanels = function(){
				var difference = 0;
				$j('<div></div>').css("left",0).animate({left:nPanelBaseX},{
					step:function(now){
						difference = now - difference;
						cPanels.each(function(i){
							var direction = $j.data(this,"slidingPanels").direction;
							if ( direction != undefined ){
								var currentX = Number(this.style.left.substring(0,this.style.left.length-1));
								var desiredX = currentX + (difference * $j.data(this,"slidingPanels")[direction]);
								$j(this).css("left",desiredX+unit);
							}
						});
						difference = now;
					},
					duration: cfg.slideDuration,
					complete: function(){
						cPanels.each(function(i){
							var direction = $j.data(this,"slidingPanels").direction;
							var position;
							var state = $j.data(this,"slidingPanels").state;
							if ( direction != undefined ){
								position = $j.data(this,"slidingPanels").position = direction.substring(2);
								var desiredX = Math.round(Number(this.style.left.substring(0,this.style.left.length-1))*100)/100;
								$j(this).css("left",desiredX+unit);
							}
							var wasMaximized = ( state == "Maximized" ) ? true : false;
							if( position == "D" ) { state = "Default"; } else { state = (i == iMaximizedPanel) ? "Maximized" : "Minimized"; }
							$j.data(this,"slidingPanels").state = state;
							if ( cfg.onEnterState && ( wasMaximized || hasChangedState(this) ) ){ cfg.onEnterState.apply(this,[state]); }
							$j.data(this,"slidingPanels").direction = undefined;
						});
					}
				});
			};
		});
	};
})(jQuery);

/*
 * 	simpleTabs 0.2 - jQuery plugin
 *	written by Nathan Searles, Pollinate Media
 *
 *	Copyright (c) 2009 Nathan Searles (http://pollinatemedia.com/)
 *
 */

(function($) {
	$j.fn.simpleTabs = function(options) {
	var defaults = {
		tabs: '.tabs li',
		tabContent: '.tab-content',
		fadeSpeed: 400	
	};
	this.each(function() {
		var obj = $j(this);
		var o = $j.extend(defaults, options);
		var activeTab = 0;
		var height = 0;
		$j(o.tabContent,obj).hide();
		$j(o.tabs+':eq(0)',obj).addClass('active').show();
		$j(o.tabContent+':first',obj).show();
		$j(o.tabs,obj).bind('click',function() {
			if ($j(this,obj).hasClass('active')) { return; }
			$j(o.tabs,obj).removeClass('active');
			$j(this,obj).addClass('active');
			$j(o.tabContent,obj).hide();
			activeTab = $j(this,obj).find('a').attr('href');
			$j(activeTab,obj).fadeIn(o.fadeSpeed);
			height = $j(activeTab,obj).outerHeight();
			$j(activeTab,obj).parent().css({'height':height});
			return false;
		});
	});
	}
})(jQuery);

/*
 * 	changeVideo 0.1 - jQuery plugin for Vimeo Videos switching
 *	written by Nathan Searles, Pollinate Media
 *
 *	Copyright (c) 2009 Nathan Searles (http://pollinatemedia.com/)
 *
 */
(function($){
	$j.fn.extend({ 
 		changeVideo: function() {
    		return this.each(function() {
				var obj = $j(this);
				var loadFirst = $j('.item a:eq(0)', obj).attr('href');
				var embedVideoPlayer = '<object width="472" height="319"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+ loadFirst +'&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=70b7e9&amp;fullscreen=1" /><embed src="'+ loadFirst +'&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=70b7e9&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="472" height="319"></embed></object>';
				$j('.videoplayer', obj).append(embedVideoPlayer);
				$j('.item a:eq(0)', obj).parent().find('.tn').addClass('active');
				$j('.item a', obj).click(function(){
					$j('.tn', obj).removeClass('active');
					var toLoad = $j(this).attr('href');
					var swapVideoPlayer = '<object width="472" height="319"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+ toLoad +'&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=70b7e9&amp;fullscreen=1" /><embed src="'+ toLoad +'&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=70b7e9&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="472" height="319"></embed></object>';
					$j('.videoplayer *').remove();
					$j('.videoplayer', obj).append(swapVideoPlayer);
					$j(this).parents('.item').find('.tn').addClass('active');
					return false;
				});
    		});
	    }
	});
})(jQuery);

/*

Uniform v1.0
Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC
http://pixelmatrixdesign.com

Modified for Energy Trust of Oregon by Nathan Searles (http://pollinatemedia.com)

Requires jQuery 1.3 or newer

Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this

License:
MIT License - http://www.opensource.org/licenses/mit-license.php

*/

(function($) {
  $j.uniform = {
    options: {
      selectClass:   'selector',
			radioClass: 'radio',
			checkboxClass: 'checker',
			checkedClass: 'checked',
      focusClass: 'focus'
    }
  };

	if($j.browser.msie && $j.browser.version < 7){
		$j.selectOpacity = false;
	}else{
		$j.selectOpacity = true;
	}

  $j.fn.uniform = function(options) {
    
		options = $j.extend($j.uniform.options, options);
	
		function doSelect(elem){
			
			var divTag = $j('<div />'),
	  			spanTag = $j('<span />');
		
			divTag.addClass(options.selectClass);
			
			spanTag.html(elem.children(":selected").text());
			
			elem.css('opacity', 0);
			elem.wrap(divTag);
			elem.before(spanTag);
			
			//redefine variables
			
			divTag = elem.parent("div");
			spanTag = elem.siblings("span");
			
			elem.change(function() {
       		spanTag.text(elem.children(":selected").text());
			var newHeight = spanTag.text(elem.children(":selected").text()).outerHeight();
			if (newHeight>12) {
				$j(this).parent().css({'height':newHeight+10,backgroundPosition:'0 18px'});
			} else {
				$j(this).parent().css({'height':22,backgroundPosition:'0 12px'});
			}
			
     	})
     	.focus(function() {
      		divTag.addClass(options.focusClass);
     	})
     	.blur(function() {
      		divTag.removeClass(options.focusClass);
     	});
		}
		
    return this.each(function() {
		if($j.selectOpacity){
			var elem = $j(this);
			doSelect(elem);
		}
    });
  };
})(jQuery);

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/*
 * 	loopedSlider 0.5.1 - jQuery plugin
 *  Modified by Nathan Searles, added description fade functionality
 *	written by Nathan Searles	
 *	http://nathansearles.com/loopedslider/
 *
 *	Copyright (c) 2009 Nathan Searles (http://nathansearles.com/)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 *
 */

(function($) {
	$j.fn.loopedSlider = function(options) {

	var defaults = {			
		container: '.container',
		slides: '.slides',
		pagination: '.pagination',
		description: '.description',
		containerClick: true, // Click container for next slide
		autoStart: 0, // Set to positive number for auto interval and interval time
		slidespeed: 300, // Speed of slide animation
		fadespeed: 300, // Speed of fade animation
		autoHeight: 300, // Set to positive number for auto height and animation speed
		descriptionFade: false,
		descriptionAutoHeight: false
	};

	this.each(function() {

		var obj = $j(this);
		var o = $j.extend(defaults, options);
		var pagination = $j(o.pagination+' li a',obj);
		var m = 0;
		var t = 1;
		var s = $j(o.slides,obj).children().size();
		var w = $j(o.slides,obj).children().outerWidth();
		var p = 0;
		var u = false;
		var n = 0;

		$j(o.slides,obj).css({width:(s*w)});

		$j(o.slides,obj).children().each(function(){
			$j(this).css({position:'absolute',left:p,display:'block'});
			p=p+w;
		});

		if (o.descriptionFade) {
			descriptionAutoHeight(0);
			$j(o.description,obj).children(':eq(0)').fadeIn('slow',
				function() { 
				if ($j.browser.msie)
					this.style.removeAttribute('filter'); 
				}
			).css({'z-index':1,'left':0});
		}

		$j(pagination,obj).each(function(){
			n=n+1;
			$j(this).attr('rel',n);
			$j(pagination.eq(0),obj).parent().addClass('active');
		});

		$j(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});

		if (s>3) {
			$j(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});
		}

		if(o.autoHeight){autoHeight(t);}

		$j('.next',obj).click(function(){
			if(u===false) {
				animate('next',true);
				if(o.autoStart){clearInterval(sliderIntervalID);}
			} return false;
		});

		$j('.previous',obj).click(function(){
			if(u===false) {	
				animate('prev',true);
				if(o.autoStart){clearInterval(sliderIntervalID);}
			} return false;
		});

		if (o.containerClick) {
			$j(o.container ,obj).click(function(){
				if(u===false) {
					animate('next',true);
					if(o.autoStart){clearInterval(sliderIntervalID);}
				} return false;
			});
		}

		$j(pagination,obj).click(function(){
			if ($j(this).parent().hasClass('active')) {return false;}
			else {
				t = $j(this).attr('rel');
				$j(pagination,obj).parent().siblings().removeClass('active');
				$j(this).parent().addClass('active');
				animate('fade',t);
				if(o.autoStart){clearInterval(sliderIntervalID);}
			} return false;
		});

		if (o.autoStart) {
			sliderIntervalID = setInterval(function(){
				if(u===false) {animate('next',true);}
			}, o.autoStart);
		}

		function current(t) {
			if(t===s+1){t=1;}
			if(t===0){t=s;}
			$j(pagination,obj).parent().siblings().removeClass('active');
			$j(pagination+'[rel="' + (t) + '"]',obj).parent().addClass('active');
		};

		function autoHeight(t) {
			if(t===s+1){t=1;}
			if(t===0){t=s;}	
			var getHeight = $j(o.slides,obj).children(':eq('+(t-1)+')',obj).outerHeight();
			$j(o.container,obj).animate({height: getHeight},o.autoHeight);			
		};

		function descriptionAutoHeight(t) {
			if(t===s+1){t=1;}
			if(t===0){t=s;}	
			var getHeight = $j(o.description,obj).children(':eq(0)',obj).outerHeight();
			$j(o.description,obj).animate({height: getHeight},o.autoHeight);					
		};	

		function animate(dir,clicked){	
			u = true;	
			switch(dir){
				case 'next':
					t = t+1;
					m = (-(t*w-w));
					current(t);
					if (o.descriptionFade) {
						descriptionAutoHeight(t);
						$j(o.description,obj).children().fadeOut('fast').css({'z-index':0,'left':-9999});
						if (t===s+1) { $j(o.description,obj).children(':eq(0)').fadeIn('slow',
							function() { 
							if ($j.browser.msie)
								this.style.removeAttribute('filter'); 
							}
						).css({'z-index':1,'left':0}); } 
						else { $j(o.description,obj).children(':eq('+(t-1)+')').fadeIn('slow',
							function() { 
							if ($j.browser.msie)
								this.style.removeAttribute('filter'); 
							}
						).css({'z-index':1,'left':0}); }
					}
					if(o.autoHeight){autoHeight(t);}
					if(s<3){
						if (t===3){$j(o.slides,obj).children(':eq(0)').css({left:(s*w)});}
						if (t===2){$j(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(w)});}
					}
					$j(o.slides,obj).animate({left: m}, o.slidespeed,function(){
						if (t===s+1) {
							t = 1;
							$j(o.slides,obj).css({left:0},function(){$j(o.slides,obj).animate({left:m})});							
							$j(o.slides,obj).children(':eq(0)').css({left: 0});
							$j(o.slides,obj).children(':eq('+(s-1)+')').css({ position:'absolute',left:-w});				
						}
						if (t===s) $j(o.slides,obj).children(':eq(0)').css({left:(s*w)});
						if (t===s-1) $j(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});
						u = false;
					});					
					break; 
				case 'prev':
					t = t-1;
					m = (-(t*w-w));
					current(t);
					if (o.descriptionFade) {
						descriptionAutoHeight(t);
						$j(o.description,obj).children().fadeOut('fast').css({'z-index':0,'left':-9999});
						if (t===0) { $j(o.description,obj).children(':eq('+(s-1)+')').fadeIn('slow',
							function() { 
							if ($j.browser.msie)
								this.style.removeAttribute('filter'); 
							}
						).css({'z-index':1,'left':0}); } 
						else { $j(o.description,obj).children(':eq('+(t-1)+')').fadeIn('slow',
							function() { 
							if ($j.browser.msie)
								this.style.removeAttribute('filter'); 
							}
						).css({'z-index':1,'left':0}); }
					}
					if(o.autoHeight){autoHeight(t);}
					if (s<3){
						if(t===0){$j(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(-w)});}
						if(t===1){$j(o.slides,obj).children(':eq(0)').css({position:'absolute',left:0});}
					}
					$j(o.slides,obj).animate({left: m}, o.slidespeed,function(){
						if (t===0) {
							t = s;
							$j(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(s*w-w)});
							$j(o.slides,obj).css({left: -(s*w-w)});
							$j(o.slides,obj).children(':eq(0)').css({left:(s*w)});
						}
						if (t===2 ) $j(o.slides,obj).children(':eq(0)').css({position:'absolute',left:0});
						if (t===1) $j(o.slides,obj).children(':eq('+ (s-1) +')').css({position:'absolute',left:-w});
						u = false;
					});
					break;
				case 'fade':
					t = [t]*1;
					m = (-(t*w-w));
					current(t);
					if (o.descriptionFade) {
						descriptionAutoHeight(t);
						$j(o.description,obj).children().fadeOut('fast').css({'z-index':0,'left':-9999});
						$j(o.description,obj).children(':eq('+(t-1)+')').fadeIn('slow',
							function() { 
							if ($j.browser.msie)
								this.style.removeAttribute('filter'); 
							}
						).css({'z-index':1,'left':0});
					}
					if(o.autoHeight){autoHeight(t);}
					$j(o.slides,obj).children().fadeOut(o.fadespeed, function(){
						$j(o.slides,obj).css({left: m});
						$j(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});
						$j(o.slides,obj).children(':eq(0)').css({left:0});
						if(t===s){$j(o.slides,obj).children(':eq(0)').css({left:(s*w)});}
						if(t===1){$j(o.slides,obj).children(':eq('+(s-1)+')').css({ position:'absolute',left:-w});}
						$j(o.slides,obj).children().fadeIn(o.fadespeed);
						u = false;
					});
					break; 
				default:
					break;
				}					
			};
		});
	};
})(jQuery);

	/*-------------------------------------------------------------------- 
	 * JQuery Plugin: "EqualHeights" & "EqualWidths"
	 * by:	Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
	 *
	 * Copyright (c) 2007 Filament Group
	 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
	 *
	 * Description: Compares the heights or widths of the top-level children of a provided element 
	 		and sets their min-height to the tallest height (or width to widest width). Sets in em units 
	 		by default if pxToEm() method is available.
	 * Dependencies: jQuery library, pxToEm method	(article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/)							  
	 * Usage Example: $j(element).equalHeights();
	   						      Optional: to set min-height in px, pass a true argument: $j(element).equalHeights(true);
	 * Version: 2.0, 07.24.2008
	 * Changelog:
	 *  08.02.2007 initial Version 1.0
	 *  07.24.2008 v 2.0 - added support for widths
	--------------------------------------------------------------------*/

	$j.fn.equalHeights = function(px) {
		$j(this).each(function(){
			var currentTallest = 0;
			$j(this).children().each(function(i){
				if ($j(this).height() > currentTallest) { currentTallest = $j(this).height(); }
			});
			if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
			// for ie6, set height since min-height isn't supported
			if ($j.browser.msie && $j.browser.version == 6.0) { $j(this).children().css({'height': currentTallest}); }
			$j(this).children().css({'min-height': currentTallest}); 
		});
		return this;
	};

	// just in case you need it...
	$j.fn.equalWidths = function(px) {
		$j(this).each(function(){
			var currentWidest = 0;
			$j(this).children().each(function(i){
					if($j(this).width() > currentWidest) { currentWidest = $j(this).width(); }
			});
			if(!px || !Number.prototype.pxToEm) currentWidest = currentWidest.pxToEm(); //use ems unless px is specified
			// for ie6, set width since min-width isn't supported
			if ($j.browser.msie && $j.browser.version == 6.0) { $j(this).children().css({'width': currentWidest}); }
			$j(this).children().css({'min-width': currentWidest}); 
		});
		return this;
	};


	/*-------------------------------------------------------------------- 
	 * javascript method: "pxToEm"
	 * by:
	   Scott Jehl (scott@filamentgroup.com) 
	   Maggie Wachs (maggie@filamentgroup.com)
	   http://www.filamentgroup.com
	 *
	 * Copyright (c) 2008 Filament Group
	 * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
	 *
	 * Description: Extends the native Number and String objects with pxToEm method. pxToEm converts a pixel value to ems depending on inherited font size.  
	 * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
	 * Demo: http://www.filamentgroup.com/examples/pxToEm/	 	
	 *							
	 * Options:  	 								
	 		scope: string or jQuery selector for font-size scoping
	 		reverse: Boolean, true reverses the conversion to em-px
	 * Dependencies: jQuery library						  
	 * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
	 *
	 * Version: 2.0, 08.01.2008 
	 * Changelog:
	 *		08.02.2007 initial Version 1.0
	 *		08.01.2008 - fixed font-size calculation for IE
	--------------------------------------------------------------------*/

	Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
		//set defaults
		settings = jQuery.extend({
			scope: 'body',
			reverse: false
		}, settings);

		var pxVal = (this == '') ? 0 : parseFloat(this);
		var scopeVal;
		var getWindowWidth = function(){
			var de = document.documentElement;
			return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
		};	

		/* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. 
			For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. 	
			When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) 
			to get an accurate em value. */

		if (settings.scope == 'body' && $j.browser.msie && (parseFloat($j('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
			var calcFontSize = function(){		
				return (parseFloat($j('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
			};
			scopeVal = calcFontSize();
		}
		else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };

		var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
		return result;
	};
	
	
	/*
	 * Facebox (for jQuery)
	 * version: 1.2 (05/05/2008)
	 * @requires jQuery v1.2 or later
	 *
	 * Examples at http://famspam.com/facebox/
	 *
	 * Licensed under the MIT:
	 *   http://www.opensource.org/licenses/mit-license.php
	 *
	 * Copyright 2007, 2008 Chris Wanstrath [ chris@ozmm.org ]
	 *
	 */
	(function($) {
	    $j.facebox = function(data, klass) {
	        $j.facebox.loading()

	        if (data.ajax) fillFaceboxFromAjax(data.ajax, klass)
	        else if (data.image) fillFaceboxFromImage(data.image, klass)
	        else if (data.div) fillFaceboxFromHref(data.div, klass)
	        else if ($j.isFunction(data)) data.call($)
	        else $j.facebox.reveal(data, klass)
	    }

	    /*
	    * Public, $j.facebox methods
	    */

	    $j.extend($j.facebox, {
	        settings: {
	            opacity: 0,
	            overlay: true,
	            loadingImage: '/images/loading.gif',
	            closeImage: '/images/closebox.png',
	            imageTypes: ['png', 'jpg', 'jpeg', 'gif'],
	            faceboxHtml: '\
	    <div id="facebox" style="display:none;"> \
	      <div class="popup"> \
	        <table> \
	          <tbody> \
	            <tr> \
	              <td class="tl"/><td class="t"/><td class="tr"/> \
	            </tr> \
	            <tr> \
	              <td class="ml"/> \
	              <td class="body"> \
						<a href="#" class="close"> \
	                        <img src="" title="close" class="close_image" /> \
	                </a> \
	                <div class="content"> \
	                </div> \
	              </td> \
	              <td class="mr"/> \
	            </tr> \
	            <tr> \
	              <td class="bl"/><td class="b"/><td class="br"/> \
	            </tr> \
	          </tbody> \
	        </table> \
	      </div> \
	    </div>'
	        },

	        loading: function() {
	            init()
	            if ($j('#facebox .loading').length == 1) return true
	            showOverlay()

	            $j('#facebox .content').empty()
	            $j('#facebox .body').children().hide().end().
	        append('<div class="loading"><img src="' + $j.facebox.settings.loadingImage + '"/></div>')

	            $j('#facebox').css({
	                top: getPageScroll()[1] + (getPageHeight() / 10),
	                left: $j(window).width() / 2 - 245
	            }).show()

	            $j(document).bind('keydown.facebox', function(e) {
	                if (e.keyCode == 27) $j.facebox.close()
	                return true
	            })
	            $j(document).trigger('loading.facebox')
	        },

	        reveal: function(data, klass) {
	            $j(document).trigger('beforeReveal.facebox')
	            if (klass) $j('#facebox .content').addClass(klass)
	            $j('#facebox .content').append(data)
	            $j('#facebox .loading').remove()
	            $j('#facebox .body').children().fadeIn('normal')
	            $j('#facebox').css('left', $j(window).width() / 2 - ($j('#facebox table').width() / 2))
	            $j(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
	        },

	        close: function() {
	            $j(document).trigger('close.facebox')
	            return false
	        }
	    })

	    /*
	    * Public, $j.fn methods
	    */

	    $j.fn.facebox = function(settings) {
	        if ($j(this).length == 0) return

	        init(settings)

	        function clickHandler() {
	            $j.facebox.loading(true)

	            // support for rel="facebox.inline_popup" syntax, to add a class
	            // also supports deprecated "facebox[.inline_popup]" syntax
	            var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
	            if (klass) klass = klass[1]
	            fillFaceboxFromHref(this.href, klass)
	            return false
	        }

	        return this.bind('click.facebox', clickHandler)
	    }

	    /*
	    * Private methods
	    */

	    // called one time to setup facebox on this page
	    function init(settings) {
	        if ($j.facebox.settings.inited) return true
	        else $j.facebox.settings.inited = true

	        $j(document).trigger('init.facebox')
	        makeCompatible()

	        var imageTypes = $j.facebox.settings.imageTypes.join('|')
	        $j.facebox.settings.imageTypesRegexp = new RegExp('\.(' + imageTypes + ')$', 'i')

	        if (settings) $j.extend($j.facebox.settings, settings)
	        $j('body').append($j.facebox.settings.faceboxHtml)

	        var preload = [new Image(), new Image()]
	        preload[0].src = $j.facebox.settings.closeImage
	        preload[1].src = $j.facebox.settings.loadingImage

	        $j('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function() {
	            preload.push(new Image())
	            preload.slice(-1).src = $j(this).css('background-image').replace(/url\((.+)\)/, '$1')
	        })

	        $j('#facebox .close').click($j.facebox.close)
	        $j('#facebox .close_image').attr('src', $j.facebox.settings.closeImage)
	    }

	    // getPageScroll() by quirksmode.com
	    function getPageScroll() {
	        var xScroll, yScroll;
	        if (self.pageYOffset) {
	            yScroll = self.pageYOffset;
	            xScroll = self.pageXOffset;
	        } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
	            yScroll = document.documentElement.scrollTop;
	            xScroll = document.documentElement.scrollLeft;
	        } else if (document.body) {// all other Explorers
	            yScroll = document.body.scrollTop;
	            xScroll = document.body.scrollLeft;
	        }
	        return new Array(xScroll, yScroll)
	    }

	    // Adapted from getPageSize() by quirksmode.com
	    function getPageHeight() {
	        var windowHeight
	        if (self.innerHeight) {	// all except Explorer
	            windowHeight = self.innerHeight;
	        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
	            windowHeight = document.documentElement.clientHeight;
	        } else if (document.body) { // other Explorers
	            windowHeight = document.body.clientHeight;
	        }
	        return windowHeight
	    }

	    // Backwards compatibility
	    function makeCompatible() {
	        var $s = $j.facebox.settings

	        $s.loadingImage = $s.loading_image || $s.loadingImage
	        $s.closeImage = $s.close_image || $s.closeImage
	        $s.imageTypes = $s.image_types || $s.imageTypes
	        $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
	    }

	    // Figures out what you want to display and displays it
	    // formats are:
	    //     div: #id
	    //   image: blah.extension
	    //    ajax: anything else
	    function fillFaceboxFromHref(href, klass) {
	        // div
	        if (href.match(/#/)) {
	            var url = window.location.href.split('#')[0]
	            var target = href.replace(url, '')
	            if (target == '#') return
	            $j.facebox.reveal($j(target).html(), klass)

	            // image
	        } else if (href.match($j.facebox.settings.imageTypesRegexp)) {
	            fillFaceboxFromImage(href, klass)
	            // ajax
	        } else {
	            fillFaceboxFromAjax(href, klass)
	        }
	    }

	    function fillFaceboxFromImage(href, klass) {
	        var image = new Image()
	        image.onload = function() {
	            $j.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
	        }
	        image.src = href
	    }

	    function fillFaceboxFromAjax(href, klass) {
	        $j.get(href, function(data) { $j.facebox.reveal(data, klass) })
	    }

	    function skipOverlay() {
	        return $j.facebox.settings.overlay == false || $j.facebox.settings.opacity === null
	    }

	    function showOverlay() {
	        if (skipOverlay()) return

	        if ($j('#facebox_overlay').length == 0)
	            $j("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')

	        $j('#facebox_overlay').hide().addClass("facebox_overlayBG")
	      .css('opacity', $j.facebox.settings.opacity)
	      .click(function() { $j(document).trigger('close.facebox') })
	      .fadeIn(200)
	        return false
	    }

	    function hideOverlay() {
	        if (skipOverlay()) return

	        $j('#facebox_overlay').fadeOut(200, function() {
	            $j("#facebox_overlay").removeClass("facebox_overlayBG")
	            $j("#facebox_overlay").addClass("facebox_hide")
	            $j("#facebox_overlay").remove()
	        })

	        return false
	    }

	    /*
	    * Bindings
	    */
	    $(document).bind('close.facebox', function() {
	        $j(document).unbind('keydown.facebox')
	        $j('#facebox').hide();
	        $j('#facebox .content').removeClass().addClass('content')
	        hideOverlay()
	        $j('#facebox .loading').remove()
	    })

	})(jQuery);
	
	/**
	 * jQuery.ScrollTo - Easy element scrolling using jQuery.
	 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
	 * Dual licensed under MIT and GPL.
	 * Date: 5/25/2009
	 * @author Ariel Flesler
	 * @version 1.4.2
	 *
	 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
	 */
	;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
	
	/* 
	  JQuery Truncate (http://www.reindel.com/truncate/ | https://github.com/gravis/jQuery-Truncate/tree)
	  v2.3.1 release
	  Tested with jQuery 1.3                                                                            
	  Author : Brian Reindel
	*/ 

	jQuery.fn.truncate = function( max, settings ) {
	    settings = jQuery.extend( {
	        chars: /\s/,
	        trail: [ "...", "" ]
	    }, settings );
	    var myResults = {};
	    var ie = $j.browser.msie;
	    function fixIE( o ) {
	        if ( ie ) {
	            o.style.removeAttribute( "filter" );
	        }
	    }
	    var original_max = max;
	    return this.each( function() {
	        var $jthis = jQuery(this);
	        var myStrOrig = $jthis.html().replace( /\r\n/gim, "" );
	        var myStr = myStrOrig;
	        var myRegEx = /<\/?[^<>]*\/?>/gim;
	        var myRegExArray;
	        var myRegExHash = {};
	        var myResultsKey = $j("*").index( this );     
	        while ( ( myRegExArray = myRegEx.exec( myStr ) ) != null ) {
	            myRegExHash[ myRegExArray.index ] = myRegExArray[ 0 ];
	        }
	        myStr = jQuery.trim( myStr.split( myRegEx ).join( "" ) );

	        if ( myStr.length > original_max ) {
	            var c;
	            while (( max < myStr.length ) && ( max > 0)) {
	                c = myStr.charAt( max );
	                if ( c.match( settings.chars ) ) {
	                    myStr = myStr.substring( 0, max );
	                    break;
	                }
	                max--;
	            }            
	            if ( max == 0 ) {
	              myStr = myStr.substring( 0, original_max );
	            }              

	            if ( myStrOrig.search( myRegEx ) != -1 ) {
	                var endCap = 0;
	                for ( eachEl in myRegExHash ) {
	                    myStr = [ myStr.substring( 0, eachEl ), myRegExHash[ eachEl ], myStr.substring( eachEl, myStr.length ) ].join( "" );
	                    if ( eachEl < myStr.length ) {
	                        endCap = myStr.length;
	                    }
	                }
	                $jthis.html( [ myStr.substring( 0, endCap ), myStr.substring( endCap, myStr.length ).replace( /<(\w+)[^>]*>.*<\/\1>/gim, "" ).replace( /<(br|hr|img|input)[^<>]*\/?>/gim, "" ) ].join( "" ) );
	            } else {
	                $jthis.html( myStr );
	            }
	            myResults[ myResultsKey ] = myStrOrig;
	            $jthis.html( [ "<div class='truncate_less'>", $jthis.html(), settings.trail[ 0 ], "</div>" ].join( "" ) )
	            .find(".truncate_show",this).click( function() {
	                if ( $jthis.find( ".truncate_more" ).length == 0 ) {
	                    $jthis.append( [ "<div class='truncate_more' style='display: none;'>", myResults[ myResultsKey ], settings.trail[ 1 ], "</div>" ].join( "" ) )
	                    .find( ".truncate_hide" ).click( function() {
	                        $jthis.find( ".truncate_more" ).css( "background", "#fff" ).fadeOut( "normal", function() {
	                            $jthis.find( ".truncate_less" ).css( "background", "#fff" ).fadeIn( "normal", function() {
	                                fixIE( this );
	                                $j(this).css( "background", "none" );
	                            });
	                            fixIE( this );
	                        });
	                        return false;
	                    });
	                }
	                $jthis.find( ".truncate_less" ).fadeOut( "normal", function() {
	                    $jthis.find( ".truncate_more" ).fadeIn( "normal", function() {
	                        fixIE( this );
	                    });
	                    fixIE( this );
	                });
	                jQuery(".truncate_show",$jthis).click( function() {
	                    $jthis.find( ".truncate_less" ).css( "background", "#fff" ).fadeOut( "normal", function() {
	                        $jthis.find( ".truncate_more" ).css( "background", "#fff" ).fadeIn( "normal", function() {
	                            fixIE( this );
	                            $j(this).css( "background", "none" );
	                        });
	                        fixIE( this );
	                    });
	                    return false;
	                });
	                return false;
	            });
	        }
	    });
	};
	
	/*
	 * SimpleModal 1.3.3 - jQuery Plugin
	 * http://www.ericmmartin.com/projects/simplemodal/
	 * Copyright (c) 2009 Eric Martin (http://twitter.com/EricMMartin)
	 * Dual licensed under the MIT and GPL licenses
	 * Revision: $Id: jquery.simplemodal.js 228 2009-10-30 13:34:27Z emartin24 $
	 */
	;(function($){var ie6=$.browser.msie&&parseInt($.browser.version)==6&&typeof window['XMLHttpRequest']!="object",ieQuirks=null,w=[];$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close();};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={appendTo:'body',focus:true,opacity:20,overlayId:'simplemodal-overlay',overlayCss:{},containerId:'simplemodal-container',containerCss:{},dataId:'simplemodal-data',dataCss:{},minHeight:200,minWidth:300,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:'simplemodal-close',escClose:true,overlayClose:false,position:null,persist:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={o:null,d:{},init:function(data,options){var s=this;if(s.d.data){return false;}ieQuirks=$.browser.msie&&!$.boxModel;s.o=$.extend({},$.modal.defaults,options);s.zIndex=s.o.zIndex;s.occb=false;if(typeof data=='object'){data=data instanceof jQuery?data:$(data);if(data.parent().parent().size()>0){s.d.parentNode=data.parent();if(!s.o.persist){s.d.orig=data.clone(true);}}}else if(typeof data=='string'||typeof data=='number'){data=$('<div></div>').html(data);}else{alert('SimpleModal Error: Unsupported data type: '+typeof data);return s;}s.create(data);data=null;s.open();if($.isFunction(s.o.onShow)){s.o.onShow.apply(s,[s.d]);}return s;},create:function(data){var s=this;w=s.getDimensions();if(ie6){s.d.iframe=$('<iframe src="javascript:false;"></iframe>').css($.extend(s.o.iframeCss,{display:'none',opacity:0,position:'fixed',height:w[0],width:w[1],zIndex:s.o.zIndex,top:0,left:0})).appendTo(s.o.appendTo);}s.d.overlay=$('<div></div>').attr('id',s.o.overlayId).addClass('simplemodal-overlay').css($.extend(s.o.overlayCss,{display:'none',opacity:s.o.opacity/100,height:w[0],width:w[1],position:'fixed',left:0,top:0,zIndex:s.o.zIndex+1})).appendTo(s.o.appendTo);s.d.container=$('<div></div>').attr('id',s.o.containerId).addClass('simplemodal-container').css($.extend(s.o.containerCss,{display:'none',position:'fixed',zIndex:s.o.zIndex+2})).append(s.o.close&&s.o.closeHTML?$(s.o.closeHTML).addClass(s.o.closeClass):'').appendTo(s.o.appendTo);s.d.wrap=$('<div></div>').attr('tabIndex',-1).addClass('simplemodal-wrap').css({height:'100%',outline:0,width:'100%'}).appendTo(s.d.container);s.d.data=data.attr('id',data.attr('id')||s.o.dataId).addClass('simplemodal-data').css($.extend(s.o.dataCss,{display:'none'})).appendTo('body');data=null;s.setContainerDimensions();s.d.data.appendTo(s.d.wrap);if(ie6||ieQuirks){s.fixIE();}},bindEvents:function(){var s=this;$('.'+s.o.closeClass).bind('click.simplemodal',function(e){e.preventDefault();s.close();});if(s.o.close&&s.o.overlayClose){s.d.overlay.bind('click.simplemodal',function(e){e.preventDefault();s.close();});}$(document).bind('keydown.simplemodal',function(e){if(s.o.focus&&e.keyCode==9){s.watchTab(e);}else if((s.o.close&&s.o.escClose)&&e.keyCode==27){e.preventDefault();s.close();}});$(window).bind('resize.simplemodal',function(){w=s.getDimensions();s.setContainerDimensions(true);if(ie6||ieQuirks){s.fixIE();}else{s.d.iframe&&s.d.iframe.css({height:w[0],width:w[1]});s.d.overlay.css({height:w[0],width:w[1]});}});},unbindEvents:function(){$('.'+this.o.closeClass).unbind('click.simplemodal');$(document).unbind('keydown.simplemodal');$(window).unbind('resize.simplemodal');this.d.overlay.unbind('click.simplemodal');},fixIE:function(){var s=this,p=s.o.position;$.each([s.d.iframe||null,s.d.overlay,s.d.container],function(i,el){if(el){var bch='document.body.clientHeight',bcw='document.body.clientWidth',bsh='document.body.scrollHeight',bsl='document.body.scrollLeft',bst='document.body.scrollTop',bsw='document.body.scrollWidth',ch='document.documentElement.clientHeight',cw='document.documentElement.clientWidth',sl='document.documentElement.scrollLeft',st='document.documentElement.scrollTop',s=el[0].style;s.position='absolute';if(i<2){s.removeExpression('height');s.removeExpression('width');s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');}else{var te,le;if(p&&p.constructor==Array){var top=p[0]?typeof p[0]=='number'?p[0].toString():p[0].replace(/px/,''):el.css('top').replace(/px/,'');te=top.indexOf('%')==-1?top+' + (t = '+st+' ? '+st+' : '+bst+') + "px"':parseInt(top.replace(/%/,''))+' * (('+ch+' || '+bch+') / 100) + (t = '+st+' ? '+st+' : '+bst+') + "px"';if(p[1]){var left=typeof p[1]=='number'?p[1].toString():p[1].replace(/px/,'');le=left.indexOf('%')==-1?left+' + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"':parseInt(left.replace(/%/,''))+' * (('+cw+' || '+bcw+') / 100) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}}else{te='('+ch+' || '+bch+') / 2 - (this.offsetHeight / 2) + (t = '+st+' ? '+st+' : '+bst+') + "px"';le='('+cw+' || '+bcw+') / 2 - (this.offsetWidth / 2) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}s.removeExpression('top');s.removeExpression('left');s.setExpression('top',te);s.setExpression('left',le);}}});},focus:function(pos){var s=this,p=pos||'first';var input=$(':input:enabled:visible:'+p,s.d.wrap);input.length>0?input.focus():s.d.wrap.focus();},getDimensions:function(){var el=$(window);var h=$.browser.opera&&$.browser.version>'9.5'&&$.fn.jquery<='1.2.6'?document.documentElement['clientHeight']:$.browser.opera&&$.browser.version<'9.5'&&$.fn.jquery>'1.2.6'?window.innerHeight:el.height();return[h,el.width()];},getVal:function(v){return v=='auto'?0:v.indexOf('%')>0?v:parseInt(v.replace(/px/,''));},setContainerDimensions:function(resize){var s=this;if(!resize||(resize&&s.o.autoResize)){var ch=s.getVal(s.d.container.css('height')),cw=s.getVal(s.d.container.css('width')),dh=s.d.data.outerHeight(true),dw=s.d.data.outerWidth(true);var mh=s.o.maxHeight&&s.o.maxHeight<w[0]?s.o.maxHeight:w[0],mw=s.o.maxWidth&&s.o.maxWidth<w[1]?s.o.maxWidth:w[1];if(!ch){if(!dh){ch=s.o.minHeight;}else{if(dh>mh){ch=mh;}else if(dh<s.o.minHeight){ch=s.o.minHeight;}else{ch=dh;}}}else{ch=ch>mh?mh:ch;}if(!cw){if(!dw){cw=s.o.minWidth;}else{if(dw>mw){cw=mw;}else if(dw<s.o.minWidth){cw=s.o.minWidth;}else{cw=dw;}}}else{cw=cw>mw?mw:cw;}s.d.container.css({height:ch,width:cw});if(dh>ch||dw>cw){s.d.wrap.css({overflow:'auto'});}}if(s.o.autoPosition){s.setPosition();}},setPosition:function(){var s=this,top,left,hc=(w[0]/2)-(s.d.container.outerHeight(true)/2),vc=(w[1]/2)-(s.d.container.outerWidth(true)/2);if(s.o.position&&Object.prototype.toString.call(s.o.position)==="[object Array]"){top=s.o.position[0]||hc;left=s.o.position[1]||vc;}else{top=hc;left=vc;}s.d.container.css({left:left,top:top});},watchTab:function(e){var s=this;if($(e.target).parents('.simplemodal-container').length>0){s.inputs=$(':input:enabled:visible:first, :input:enabled:visible:last',s.d.data[0]);if((!e.shiftKey&&e.target==s.inputs[s.inputs.length-1])||(e.shiftKey&&e.target==s.inputs[0])||s.inputs.length==0){e.preventDefault();var pos=e.shiftKey?'last':'first';setTimeout(function(){s.focus(pos);},10);}}else{e.preventDefault();setTimeout(function(){s.focus();},10);}},open:function(){var s=this;s.d.iframe&&s.d.iframe.show();if($.isFunction(s.o.onOpen)){s.o.onOpen.apply(s,[s.d]);}else{s.d.overlay.show();s.d.container.show();s.d.data.show();}s.focus();s.bindEvents();},close:function(){var s=this;if(!s.d.data){return false;}s.unbindEvents();if($.isFunction(s.o.onClose)&&!s.occb){s.occb=true;s.o.onClose.apply(s,[s.d]);}else{if(s.d.parentNode){if(s.o.persist){s.d.data.hide().appendTo(s.d.parentNode);}else{s.d.data.hide().remove();s.d.orig.appendTo(s.d.parentNode);}}else{s.d.data.hide().remove();}s.d.container.hide().remove();s.d.overlay.hide().remove();s.d.iframe&&s.d.iframe.hide().remove();s.d={};}}};})(jQuery);
	
	/**
	* Equal Heights, a jQuery Plugin
	* Written by Nathan Searles
	*/
	if(typeof jQuery != 'undefined') {
		jQuery(function($) {
			$.fn.extend({
				equalheights: function(options) {
					var settings = $.extend({}, $.fn.equalheights.defaults, options);
					return this.each(
						function() {
							if($.fn.jquery < '1.2.6') {return;}
							var $t = $(this);
							var $c = $t.children();
							var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings;
							var height = []
						    for (var i = 0; i < $c.length; i++) {
						        height.push($($c[i]).outerHeight());
						    };
						    var largest = Math.max.apply(Math, height);
						    $c.css({ height: largest });
						}
					);
				}
			});
			$.fn.equalheights.defaults = {};
		});
	}
	/**
	* Fitted: a jQuery Plugin
	* @author: Trevor Morris (trovster)
	* @url: http://www.trovster.com/lab/code/plugins/jquery.fitted.js
	* @documentation: http://www.trovster.com/lab/plugins/fitted/
	* @published: 11/09/2008
	* @updated: 29/09/2008
	* @license Creative Commons Attribution Non-Commercial Share Alike 3.0 Licence
	*		   http://creativecommons.org/licenses/by-nc-sa/3.0/
	* @notes: 
	* Also see BigTarget by Leevi Graham - http://newism.com.au/blog/post/58/bigtarget-js-increasing-the-size-of-clickable-targets/ 
	*
	*/
	if(typeof jQuery != 'undefined') {
		jQuery(function($) {
			$.fn.extend({
				fitted: function(options) {
					var settings = $.extend({}, $.fn.fitted.defaults, options);

					return this.each(
						function() {

							var $t = $(this);
							var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings;

							if($t.find(':has(a)')) {
								/**
								* Find the first Anchor
								* @var object $a
								*/
								var $a = $t.find('a:first');

								/**
								* Get the Anchor Attributes
								*/
								var href = $a.attr('href');
								var title = $a.attr('title');

								/**
								* Setup the Container
								* Add the 'container' class defined in settings
								* @event hover
								* @event click
								*/
								$t.addClass(o['class']['container']).hover(
									function(){
										/**
										* Hovered Element
										*/
										$h = $(this);

										/**
										* Add the 'hover' class defined in settings
										*/
										$h.addClass(o['class']['hover']);

										/**
										* Add the Title Attribute if the option is set, and it's not empty
										*/
										if(typeof o['title'] != 'undefined' && o['title']===true && title != '') {
											$h.attr('title',title);
										}

										/**
										* Set the Status bar string if the option is set
										*/
										if(typeof o['status'] != 'undefined' && o['status']===true) {
											if($.browser.safari) {
												/**
												* Safari Formatted Status bar string
												*/
												window.status = 'Go to "' + href + '"';
											}
											else {
												/**
												* Default Formatted Status bar string
												*/
												window.status = href;
											}
										}
									},
									function(){
										/**
										* "un"-hovered Element
										*/
										$h = $(this);

										/**
										* Remove the Title Attribute if it was set by the Plugin
										*/
										if(typeof o['title'] != 'undefined' && o['title']===true && title != '') {
											$h.removeAttr('title');
										}

										/**
										* Remove the 'hover' class defined in settings
										*/
										$h.removeClass(o['class']['hover']);

										/**
										* Remove the Status bar string
										*/
										window.status = '';
									}
								).click(
									function(){
										/**
										* Clicked!
										* The Container has been Clicked
										* Trigger the Anchor / Follow the Link
										*/
										if($a.is('[rel*=external]')){
											window.open($href);
											return false;
										}
										else {
											//$a.click(); $a.trigger('click');
											window.location = href;
										}
									}
								);
							}
						}
					);
				}
			});

			/**
			* Plugin Defaults
			*/
			$.fn.fitted.defaults = {
				'class' : {
					'container' : 'fitted',
					'hover' : 'hovered'
				},
				'title' : true,
				'status' : false
			};
		});
	}