/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 *
 * Requires: 1.2.2+
 */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(i){var g=i||window.event,f=[].slice.call(arguments,1),j=0,h=true,e=0,d=0;i=c.event.fix(g);i.type="mousewheel";if(i.wheelDelta){j=i.wheelDelta/120}if(i.detail){j=-i.detail/3}d=j;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){d=0;e=-1*j}if(g.wheelDeltaY!==undefined){d=g.wheelDeltaY/120}if(g.wheelDeltaX!==undefined){e=-1*g.wheelDeltaX/120}f.unshift(i,j,e,d);return c.event.handle.apply(this,f)}})(jQuery);;
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 2.1.2
 */

(function($){

$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
    s = $.extend({
        top     : 'auto', // auto == .currentStyle.borderTopWidth
        left    : 'auto', // auto == .currentStyle.borderLeftWidth
        width   : 'auto', // auto == offsetWidth
        height  : 'auto', // auto == offsetHeight
        opacity : true,
        src     : 'javascript:false;'
    }, s);
    var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
                   'style="display:block;position:absolute;z-index:-1;'+
                       (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
                       'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
                       'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
                       'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
                       'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
                '"/>';
    return this.each(function() {
        if ( $(this).children('iframe.bgiframe').length === 0 )
            this.insertBefore( document.createElement(html), this.firstChild );
    });
} : function() { return this; });

// old alias
$.fn.bgIframe = $.fn.bgiframe;

function prop(n) {
    return n && n.constructor === Number ? n + 'px' : n;
}

})(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;
    }
};;
/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
 *
 */

/**
 * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
 * in the JSON will become a property of the element itself.
 *
 * There are three supported types of metadata storage:
 *
 *   attr:  Inside an attribute. The name parameter indicates *which* attribute.
 *          
 *   class: Inside the class attribute, wrapped in curly braces: { }
 *   
 *   elem:  Inside a child element (e.g. a script tag). The
 *          name parameter indicates *which* element.
 *          
 * The metadata for an element is loaded the first time the element is accessed via jQuery.
 *
 * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
 * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
 * 
 * @name $.metadata.setType
 *
 * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("class")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from the class attribute
 * 
 * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("attr", "data")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a "data" attribute
 * 
 * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
 * @before $.metadata.setType("elem", "script")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a nested script element
 * 
 * @param String type The encoding type
 * @param String name The name of the attribute to be used to get metadata (optional)
 * @cat Plugins/Metadata
 * @descr Sets the type of encoding to be used when loading metadata for the first time
 * @type undefined
 * @see metadata()
 */

(function($) {

$.extend({
	metadata : {
		defaults : {
			type: 'class',
			name: 'metadata',
			cre: /({.*})/,
			single: 'metadata'
		},
		setType: function( type, name ){
			this.defaults.type = type;
			this.defaults.name = name;
		},
		get: function( elem, opts ){
			var settings = $.extend({},this.defaults,opts);
			// check for empty string in single property
			if ( !settings.single.length ) settings.single = 'metadata';
			
			var data = $.data(elem, settings.single);
			// returned cached data if it already exists
			if ( data ) return data;
			
			data = "{}";
			
			if ( settings.type == "class" ) {
				var m = settings.cre.exec( elem.className );
				if ( m )
					data = m[1];
			} else if ( settings.type == "elem" ) {
				if( !elem.getElementsByTagName )
					return undefined;
				var e = elem.getElementsByTagName(settings.name);
				if ( e.length )
					data = $.trim(e[0].innerHTML);
			} else if ( elem.getAttribute != undefined ) {
				var attr = elem.getAttribute( settings.name );
				if ( attr )
					data = attr;
			}
			
			if ( data.indexOf( '{' ) <0 )
			data = "{" + data + "}";
			
			data = eval("(" + data + ")");
			
			$.data( elem, settings.single, data );
			return data;
		}
	}
});

/**
 * Returns the metadata object for the first member of the jQuery object.
 *
 * @name metadata
 * @descr Returns element's metadata object
 * @param Object opts An object contianing settings to override the defaults
 * @type jQuery
 * @cat Plugins/Metadata
 */
$.fn.metadata = function( opts ){
	return $.metadata.get( this[0], opts );
};

})(jQuery);;
(function(a){a.fn.customInput=function(){a(this).each(function(){if(a(this).is("[type=checkbox],[type=radio]")){var b=a(this),c=a("label[for="+b.attr("id")+"]"),d=b.is("[type=checkbox]")?"checkbox":"radio";a('<div class="custom-'+d+'"></div>').insertBefore(b).append(b,c);var e=a("input[name="+b.attr("name")+"]");c.hover(function(){a(this).addClass("hover");d=="checkbox"&&b.is(":checked")&&a(this).addClass("checkedHover")},function(){a(this).removeClass("hover checkedHover")});b.bind("updateState",
function(){b.is(":checked")?(b.is(":radio")&&e.each(function(){a("label[for="+a(this).attr("id")+"]").removeClass("checked")}),c.addClass("checked")):c.removeClass("checked checkedHover checkedFocus")}).trigger("updateState").click(function(){a(this).trigger("updateState")}).focus(function(){c.addClass("focus");d=="checkbox"&&b.is(":checked")&&a(this).addClass("checkedFocus")}).blur(function(){c.removeClass("focus checkedFocus")})}})}})(jQuery);
;
(function(d){var i=0;d.widget("ech.multiselect",{options:{header:!0,height:175,minWidth:225,classes:"",checkAllText:"Check all",uncheckAllText:"Uncheck all",noneSelectedText:"Select options",selectedText:"# selected",selectedList:0,show:"",hide:"",autoOpen:!1,multiple:!0,position:{}},_create:function(){var a=this.element.hide(),b=this.options;this.speed=d.fx.speeds._default;this._isOpen=!1;a=(this.button=d('<button type="button"><span class="ui-icon ui-icon-triangle-2-n-s"></span></button>')).addClass("ui-multiselect ui-widget ui-state-default ui-corner-all").addClass(b.classes).attr({title:a.attr("title"),
"aria-haspopup":!0,tabIndex:a.attr("tabIndex")}).insertAfter(a);(this.buttonlabel=d("<span />")).html(b.noneSelectedText).appendTo(a);var a=(this.menu=d("<div />")).addClass("ui-multiselect-menu ui-widget ui-widget-content ui-corner-all").addClass(b.classes).insertAfter(a),c=(this.header=d("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(a);(this.headerLinkContainer=d("<ul />")).addClass("ui-helper-reset").html(function(){return b.header===!0?
'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+b.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+b.uncheckAllText+"</span></a></li>":typeof b.header==="string"?"<li>"+b.header+"</li>":""}).append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>').appendTo(c);(this.checkboxContainer=d("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(a);
this._bindEvents();this.refresh(!0);b.multiple||a.addClass("ui-multiselect-single")},_init:function(){this.options.header===!1&&this.header.hide();this.options.multiple||this.headerLinkContainer.find(".ui-multiselect-all, .ui-multiselect-none").hide();this.options.autoOpen&&this.open();this.element.is(":disabled")&&this.disable()},refresh:function(a){var b=this.options,c=this.menu,e=this.checkboxContainer,h=[],f=[],g=this.element.attr("id")||i++;this.element.find("option").each(function(a){d(this);
var e=this.parentNode,c=this.innerHTML,i=this.value,a=this.id||"ui-multiselect-"+g+"-option-"+a,j=this.disabled,l=this.selected,k=["ui-corner-all"];e.tagName.toLowerCase()==="optgroup"&&(e=e.getAttribute("label"),d.inArray(e,h)===-1&&(f.push('<li class="ui-multiselect-optgroup-label"><a href="#">'+e+"</a></li>"),h.push(e)));j&&k.push("ui-state-disabled");l&&!b.multiple&&k.push("ui-state-active");f.push('<li class="'+(j?"ui-multiselect-disabled":"")+'">');f.push('<label for="'+a+'" class="'+k.join(" ")+
'">');f.push('<input id="'+a+'" name="multiselect_'+g+'" type="'+(b.multiple?"checkbox":"radio")+'" value="'+i+'" title="'+c+'"');l&&(f.push(' checked="checked"'),f.push(' aria-selected="true"'));j&&(f.push(' disabled="disabled"'),f.push(' aria-disabled="true"'));f.push(" /><span>"+c+"</span></label></li>")});e.html(f.join(""));this.labels=c.find("label");this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();a||this._trigger("refresh")},update:function(){var a=this.options,
b=this.labels.find("input"),c=b.filter(":checked"),e=c.length,a=e===0?a.noneSelectedText:d.isFunction(a.selectedText)?a.selectedText.call(this,e,b.length,c.get()):/\d/.test(a.selectedList)&&a.selectedList>0&&e<=a.selectedList?c.map(function(){return this.title}).get().join(", "):a.selectedText.replace("#",e).replace("#",b.length);this.buttonlabel.html(a);return a},_bindEvents:function(){function a(){b[b._isOpen?"close":"open"]();return!1}var b=this,c=this.button;c.find("span").bind("click.multiselect",
a);c.bind({click:a,keypress:function(a){switch(a.which){case 27:case 38:case 37:b.close();break;case 39:case 40:b.open()}},mouseenter:function(){c.hasClass("ui-state-disabled")||d(this).addClass("ui-state-hover")},mouseleave:function(){d(this).removeClass("ui-state-hover")},focus:function(){c.hasClass("ui-state-disabled")||d(this).addClass("ui-state-focus")},blur:function(){d(this).removeClass("ui-state-focus")}});this.header.delegate("a","click.multiselect",function(a){if(d(this).hasClass("ui-multiselect-close"))b.close();
else b[d(this).hasClass("ui-multiselect-all")?"checkAll":"uncheckAll"]();a.preventDefault()});this.menu.delegate("li.ui-multiselect-optgroup-label a","click.multiselect",function(a){a.preventDefault();var c=d(this),f=c.parent().nextUntil("li.ui-multiselect-optgroup-label").find("input:visible:not(:disabled)"),g=f.get(),c=c.parent().text();b._trigger("beforeoptgrouptoggle",a,{inputs:g,label:c})!==!1&&(b._toggleChecked(f.filter(":checked").length!==f.length,f),b._trigger("optgrouptoggle",a,{inputs:g,
label:c,checked:g[0].checked}))}).delegate("label","mouseenter.multiselect",function(){d(this).hasClass("ui-state-disabled")||(b.labels.removeClass("ui-state-hover"),d(this).addClass("ui-state-hover").find("input").focus())}).delegate("label","keydown.multiselect",function(a){a.preventDefault();switch(a.which){case 9:case 27:b.close();break;case 38:case 40:case 37:case 39:b._traverse(a.which,this);break;case 13:d(this).find("input")[0].click()}}).delegate('input[type="checkbox"], input[type="radio"]',
"click.multiselect",function(a){var c=d(this),f=this.value,g=this.checked,i=b.element.find("option");this.disabled||b._trigger("click",a,{value:f,text:this.title,checked:g})===!1?a.preventDefault():(c.attr("aria-selected",g),i.each(function(){if(this.value===f)this.selected=g;else if(!b.options.multiple)this.selected=!1}),b.options.multiple||(b.labels.removeClass("ui-state-active"),c.closest("label").toggleClass("ui-state-active",g),b.close()),setTimeout(d.proxy(b.update,b),10))});d(document).bind("mousedown.multiselect",
function(a){b._isOpen&&!d.contains(b.menu[0],a.target)&&!d.contains(b.button[0],a.target)&&a.target!==b.button[0]&&b.close()});d(this.element[0].form).bind("reset.multiselect",function(){setTimeout(function(){b.update()},10)})},_setButtonWidth:function(){var a=this.element.outerWidth(),b=this.options;if(/\d/.test(b.minWidth)&&a<b.minWidth)a=b.minWidth;this.button.width(a)},_setMenuWidth:function(){var a=this.menu,b=this.button.outerWidth()-parseInt(a.css("padding-left"),10)-parseInt(a.css("padding-right"),
10)-parseInt(a.css("border-right-width"),10)-parseInt(a.css("border-left-width"),10);a.width(b||this.button.outerWidth())},_traverse:function(a,b){var c=d(b),e=a===38||a===37,c=c.parent()[e?"prevAll":"nextAll"]("li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)")[e?"last":"first"]();c.length?c.find("label").trigger("mouseover"):(c=this.menu.find("ul:last"),this.menu.find("label")[e?"last":"first"]().trigger("mouseover"),c.scrollTop(e?c.height():0))},_toggleCheckbox:function(a,b){return function(){!this.disabled&&
(this[a]=b);b?this.setAttribute("aria-selected",!0):this.removeAttribute("aria-selected")}},_toggleChecked:function(a,b){var c=b&&b.length?b:this.labels.find("input"),e=this;c.each(this._toggleCheckbox("checked",a));this.update();var h=c.map(function(){return this.value}).get();this.element.find("option").each(function(){!this.disabled&&d.inArray(this.value,h)>-1&&e._toggleCheckbox("selected",a).call(this)})},_toggleDisabled:function(a){this.button.attr({disabled:a,"aria-disabled":a})[a?"addClass":
"removeClass"]("ui-state-disabled");this.menu.find("input").attr({disabled:a,"aria-disabled":a}).parent()[a?"addClass":"removeClass"]("ui-state-disabled");this.element.attr({disabled:a,"aria-disabled":a})},open:function(){var a=this.button,b=this.menu,c=this.speed,e=this.options;if(!(this._trigger("beforeopen")===!1||a.hasClass("ui-state-disabled")||this._isOpen)){var h=b.find("ul:last"),f=e.show,g=a.position();d.isArray(e.show)&&(f=e.show[0],c=e.show[1]||this.speed);h.scrollTop(0).height(e.height);
d.ui.position&&!d.isEmptyObject(e.position)?(e.position.of=e.position.of||a,b.show().position(e.position).hide().show(f,c)):b.css({top:g.top+a.outerHeight(),left:g.left}).show(f,c);this.labels.eq(0).trigger("mouseover").trigger("mouseenter").find("input").trigger("focus");a.addClass("ui-state-active");this._isOpen=!0;this._trigger("open");this.element.data("index",this.element[0].selectedIndex)}},close:function(){if(this._trigger("beforeclose")!==!1){var a=this.options,b=a.hide,c=this.speed;d.isArray(a.hide)&&
(b=a.hide[0],c=a.hide[1]||this.speed);this.menu.hide(b,c);this.button.removeClass("ui-state-active").trigger("blur").trigger("mouseleave");this._isOpen=!1;this._trigger("close");this.element.data("index")!=this.element[0].selectedIndex&&(this.element.trigger("change"),this._trigger("change"))}},enable:function(){this._toggleDisabled(!1)},disable:function(){this._toggleDisabled(!0)},checkAll:function(){this._toggleChecked(!0);this._trigger("checkAll")},uncheckAll:function(){this._toggleChecked(!1);
this._trigger("uncheckAll")},getChecked:function(){return this.menu.find("input").filter(":checked")},destroy:function(){d.Widget.prototype.destroy.call(this);this.button.remove();this.menu.remove();this.element.show();return this},isOpen:function(){return this._isOpen},widget:function(){return this.menu},_setOption:function(a,b){var c=this.menu;switch(a){case "header":c.find("div.ui-multiselect-header")[b?"show":"hide"]();break;case "checkAllText":c.find("a.ui-multiselect-all span").eq(-1).text(b);
break;case "uncheckAllText":c.find("a.ui-multiselect-none span").eq(-1).text(b);break;case "height":c.find("ul:last").height(parseInt(b,10));break;case "minWidth":this.options[a]=parseInt(b,10);this._setButtonWidth();this._setMenuWidth();break;case "selectedText":case "selectedList":case "noneSelectedText":this.options[a]=b;this.update();break;case "classes":c.add(this.button).removeClass(this.options.classes).addClass(b)}d.Widget.prototype._setOption.apply(this,arguments)}})})(jQuery);

/*
 * jQuery MultiSelect UI Widget Filtering Plugin 1.2
 * Copyright (c) 2011 Eric Hynds
 *
 * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
 *
 * Depends:
 *   - jQuery UI MultiSelect widget
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
*/
;(function(c){var f=/[\-\[\]{}()*+?.,\\^$|#\s]/g;c.widget("ech.multiselectfilter",{options:{label:"Filter:",width:null,placeholder:"Enter keywords"},_create:function(){var e;var a=this,b=this.options,d=this.instance=c(this.element).data("multiselect");this.header=d.menu.find(".ui-multiselect-header").addClass("ui-multiselect-hasfilter");e=this.wrapper=c('<div class="ui-multiselect-filter">'+(b.label.length?b.label:"")+'<input placeholder="'+b.placeholder+'" type="search"'+(/\d/.test(b.width)?'style="width:'+b.width+'px"':"")+" /></div>").prependTo(this.header),b=e;this.inputs=d.menu.find('input[type="checkbox"], input[type="radio"]');this.input=b.find("input").bind({keydown:function(a){a.which===13&&a.preventDefault()},keyup:c.proxy(a._handler,a),click:c.proxy(a._handler,a)});this.updateCache();d._toggleChecked=function(b,d){var e=d&&d.length?d:this.labels.find("input"),i=this,e=e.not(a.instance._isOpen?":disabled, :hidden":":disabled").each(this._toggleCheckbox("checked",b));this.update();var j=e.map(function(){return this.value}).get();this.element.find("option").filter(function(){!this.disabled&&c.inArray(this.value,j)>-1&&i._toggleCheckbox("selected",b).call(this)})};c(document).bind("multiselectrefresh",function(){a.updateCache();a._handler()})},_handler:function(a){var b=c.trim(this.input[0].value.toLowerCase()),d=this.rows,g=this.inputs,h=this.cache;if(b){d.hide();var e=RegExp(b.replace(f,"\\$&"),"gi");this._trigger("filter",a,c.map(h,function(a,b){if(a.search(e)!==-1)return d.eq(b).show(),g.get(b);return null}))}else d.show();this.instance.menu.find(".ui-multiselect-optgroup-label").each(function(){var a=c(this);a[a.nextUntil(".ui-multiselect-optgroup-label").filter(":visible").length?"show":"hide"]()})},updateCache:function(){this.rows=this.instance.menu.find(".ui-multiselect-checkboxes li:not(.ui-multiselect-optgroup-label)");this.cache=this.element.children().map(function(){var a=c(this);this.tagName.toLowerCase()==="optgroup"&&(a=a.children());if(!a.val().length)return null;return a.map(function(){return this.innerHTML.toLowerCase()}).get()}).get()},widget:function(){return this.wrapper},destroy:function(){c.Widget.prototype.destroy.call(this);this.input.val("").trigger("keyup");this.wrapper.remove()}})})(jQuery);

;
/*
	jquery.fbjlike.js - http://socialmediaautomat.com/jquery-fbjlike-js.php
	based on: jQuery OneFBLike v1.1 - http://onerutter.com/open-source/jquery-facebook-like-plugin.html
	Copyright (c) 2010 Jake Rutter modified 2011 by Stephan Helbig
	This plugin available for use in all personal or commercial projects under both MIT and GPL licenses.
*/

(function($){  
$.fn.fbjlike = function(options) {  
	
  //Set the default values, use comma to separate the settings 
  var defaults = {  
	appID: '224229974253687',
	userID: '',
	siteTitle: '',
	siteName: '',
	siteImage: '',
	href:false,
	mode: 'insert',
	buttonWidth: 450,
	buttonHeight: 60,
	showfaces: true,
	font: 'lucida grande',
	layout: 'normal',	//box_count|button_count|standard
	action: 'like',		// like|recommend
	send:false,
	comments:false,
	numPosts:10,
	colorscheme: 'light',
	lang: 'en_US',
	hideafterlike:false,
	googleanalytics:false,							//true|false
	googleanalytics_obj: 'pageTracker',	//pageTracker|_gaq
	onlike: function(){return true;},
	onunlike: function(){return true;}
}  

var options =  $.extend(defaults, options);  
	
  return this.each(function() {  
  var o = options;  
  var obj = $(this);
  if(!o.href)
  	var dynUrl = document.location;
  else
  	var dynUrl = o.href;
  var dynTitle = document.title;
  
  // Add Meta Tags for additional data - options
  if(o.appID!='')$('head').append('<meta property="fb:app_id" content="'+o.appID+'"/>');
  if(o.userID!='')$('head').append('<meta property="fb:admins" content="'+o.userID+'"/>');
  if(o.siteTitle!='')$('head').append('<meta property="og:title" content="'+o.siteTitle+'"/>');
  if(o.siteName!='')$('head').append('<meta property="og:site_name" content="'+o.siteName+'"/>');
  if(o.siteImage!='')$('head').append('<meta property="og:image" content="'+o.siteImage+'"/>');
  
  // Add #fb-root div - mandatory - do not remove
  $('body').append('<div id="fb-root"></div>');
  $('#fb-like iframe').css('height','35px !important');
  
  (function() {
    var e = document.createElement('script');
    e.async = true;
    e.src = document.location.protocol + '//connect.facebook.net/'+o.lang+'/all.js';
    $('#fb-root').append(e);
  }());
	
  // setup FB Developers App Link - do not touch
  window.fbAsyncInit = function() {
    FB.init({appId: o.appID, status: true, cookie: true, xfbml: true});
    FB.Event.subscribe('edge.create', function(response) {
		  if(o.hideafterlike)$(obj).hide();
		  if(o.googleanalytics){
				if(o.googleanalytics_obj!='_gaq'){
					pageTracker._trackEvent('facebook', 'liked', dynTitle);
				} else {
		  		_gaq.push(['_trackEvent','facebook', 'liked', dynTitle]);
		  	}
		  }
		  o.onlike.call(response);
		});
    FB.Event.subscribe('edge.remove', function(response) {
		  if(o.googleanalytics){
				if(o.googleanalytics_obj!='_gaq'){
					pageTracker._trackEvent('facebook', 'unliked', dynTitle);
				} else {
		  		_gaq.push(['_trackEvent','facebook', 'unliked', dynTitle]);
		  	}
		  }
		  o.onunlike.call(response);
		});
  };
  var tSend = '';
  if(o.send)tSend = ' send="true"';
  var thtml = '<fb:like href="'+dynUrl+'" width="'+o.buttonWidth+'" height="'+o.buttonHeight+'" show_faces="'+o.showfaces+'" font="'+o.font+'" layout="'+o.layout+'" action="'+o.action+'" colorscheme="'+o.colorscheme+'"'+tSend+'/>';
  
	if(o.comments){
  	thtml += '<'+'div style="clear:both;"></div><fb:comments href="'+dynUrl+'" num_posts="'+o.numPosts+'" width="'+o.buttonWidth+'"></fb:comments>';
  }
  if(o.mode=='append')$(obj).append(thtml);
  else $(obj).html(thtml);
	
  });  
}  
})(jQuery);;
/*
	jquery.gplusone.js - http://socialmediaautomat.com/jquery-gplusone-js.php
	Copyright (c) 2011 Stephan Helbig
	This plugin available for use in all personal or commercial projects under both MIT and GPL licenses.
*/

(function($){  
	$.fn.gplusone = function(options) {  
	        
	  //Set the default values, use comma to separate the settings 
	  var defaults = {
			mode: 'insert',											//insert|append  
			size: 'standard',										//small|medium|standard|tall
			count: true,												//true|false
			href: false,												//false|url
			lang: 'en-US',											//en-US|en-GB|de|es|fr|...
			hideafterlike:false,								//true|false (only possible with mode: 'insert')
			googleanalytics:false,							//true|false
			googleanalytics_obj: 'pageTracker',	//pageTracker|_gaq
			onlike: "return true;",
			onunlike: "return true;"
		}  
		            
		var options =  $.extend(defaults, options);  
	                        
	  return this.each(function() {  
		  var o = options;  
		  var obj = $(this);
		  var dynUrl = document.location;
		  var dynTitle = document.title.replace("'",'&apos;');
		  
		  if(!o.href){
		  	o.href=dynUrl;
		  }
		  var strcount='false';
		  if(o.count){
		  	strcount='true';
		  }
		  (function() {
		    var e = document.createElement('script');
		    e.async = true;
		    e.src = document.location.protocol + '//apis.google.com/js/plusone.js';
		    $(e).append("{lang: '"+o.lang+"'}");
		    
		    $('head').append(e);
		    var e = document.createElement('script');
		    var hidefunc = '';
		    if(o.hideafterlike){
		    	hidefunc = '$(obj).hide();';
		    }
		    var gfunclike = '';
		    var gfuncunlike = '';
		    if(o.googleanalytics){
		    	if(o.googleanalytics_obj!='_gaq'){
			    	gfunclike = o.googleanalytics_obj+"._trackEvent('google', 'plussed', '"+dynTitle+"');";
			    	gfuncunlike = o.googleanalytics_obj+"._trackEvent('google', 'unplussed', '"+dynTitle+"');";
			    } else {
			    	gfunclike = o.googleanalytics_obj+".push(['_trackEvent','google', 'plussed', '"+dynTitle+"']);";
			    	gfuncunlike = o.googleanalytics_obj+".push(['_trackEvent','google', 'unplussed', '"+dynTitle+"']);";
			    }
		    }
		    $(e).append("function gplus_callback(r){if(r.state=='on'){"+hidefunc+gfunclike+o.onlike+"}else{"+gfuncunlike+o.onunlike+"}}");
		    $('head').append(e);
		  }());
		
			var thtml = '<g:plusone size="'+o.size+'" callback="gplus_callback" href="'+o.href+'" count="'+strcount+'"></g:plusone>';
			if(o.mode=='insert')
				$(obj).html(thtml);
			else
				$(obj).append(thtml);
	  });
	}  
})(jQuery);;
/*
	jquery.twitterbutton.js - http://socialmediaautomat.com/jquery-twitterbutton-js.php
	Copyright (c) 2011 Stephan Helbig
	This plugin available for use in all personal or commercial projects under both MIT and GPL licenses.
*/

(function($){  
$.fn.twitterbutton = function(options) {  
	
  //Set the default values, use comma to separate the settings 
  var defaults = {  
		user: false,
		user_description: false,
		url: false,
		count_url: false,
		title: false,
		mode: 'insert',
		layout: 'vertical', //vertical|horizontal|none
		action: 'tweet',		//tweet|follow
		lang: 'en',					//en|de|ja|fr|es
		hideafterlike:false,
		googleanalytics:false,							//true|false
		googleanalytics_obj: 'pageTracker',	//pageTracker|_gaq
		ontweet: function(){return true;},
		onretweet: function(){return true;},
		onfollow: function(){return true;}
	}  

	var options =  $.extend(defaults, options);  
	var script_loaded = false;
  return this.each(function() {
  var o = options;  
  var obj = $(this);
  if(!o.url) var dynUrl = document.location;
  else var dynUrl = o.url;
  if(!o.title)var dynTitle = document.title;
  else var dynTitle = o.title;
	
	if(!o.count_url)o.count_url=dynUrl;
	
	if(!script_loaded){
		var e = document.createElement('script'); e.type="text/javascript"; e.async = true; 
		e.src = 'http://platform.twitter.com/widgets.js';
		(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(e);
		
		$(e).load(function() {
			function clickEvent(intent_event) {
			  if (intent_event) {
					var label = intent_event.region;
				  if(o.googleanalytics){
						if(o.googleanalytics_obj!='_gaq'){
							_gaq.push(['_trackEvent', 'twitter_web_intents', intent_event.type, label]);
						} else {
							pageTracker._trackEvent('twitter_web_intents', intent_event.type, label);
						}
					}
			  };      
			}       
			function tweetIntent(intent_event) {
			  if (intent_event) {
					var label = intent_event.data.tweet_id;
				  if(o.googleanalytics){
						if(o.googleanalytics_obj!='_gaq'){
							_gaq.push(['_trackEvent', 'twitter_web_intents', intent_event.type, label]);
						} else {
							pageTracker._trackEvent('twitter_web_intents', intent_event.type, label);
						}
					}
			 		o.ontweet.call(intent_event);
			  	if(o.hideafterlike)$(obj).hide();
			  };      
			}       
			function favIntent(intent_event) {
				tweetIntent(intent_event);
			}       
			function retweetIntent(intent_event) {
			  if (intent_event) {
					var label = intent_event.data.source_tweet_id;
				  if(o.googleanalytics){
						if(o.googleanalytics_obj!='_gaq'){
							_gaq.push(['_trackEvent', 'twitter_web_intents', intent_event.type, label]);
						} else {
							pageTracker._trackEvent('twitter_web_intents', intent_event.type, label);
						}
					}
			 		o.onretweet.call(intent_event);
			  	if(o.hideafterlike)$(obj).hide();
			  };      
			}       
			function followIntent(intent_event) {
			  if (intent_event) {
					var label = intent_event.data.user_id + " (" + intent_event.data.screen_name + ")";
				  if(o.googleanalytics){
						if(o.googleanalytics_obj!='_gaq'){
							_gaq.push(['_trackEvent', 'twitter_web_intents', intent_event.type, label]);
						} else {
							pageTracker._trackEvent('twitter_web_intents', intent_event.type, label);
						}
					}
			 		o.onfollow.call(intent_event);
			  	if(o.hideafterlike)$(obj).hide();
			  };      
			}       
			twttr.events.bind('click',    clickEvent);
			twttr.events.bind('tweet',    tweetIntent);
			twttr.events.bind('retweet',  retweetIntent);
			twttr.events.bind('favorite', favIntent);
			twttr.events.bind('follow',   followIntent);
			script_loaded = true;
		});
	}

	
	  if(o.action=='tweet'){
	  	var via = '';
	  	var related = '';
	  	if(o.user!=false){
	  		via = 'data-via="'+o.user+'" ';
	  		if(o.user_description!=false){
	  			related = 'data-related="'+o.user+':'+o.user_description+'" ';
	  		}
	  	}
	  	var counturl = '';
	  	if(o.count_url!=dynUrl)counturl = 'data-counturl="'+o.count_url+'" ';
	  	var thtml = '<div><a href="http://twitter.com/share" class="twitter-share-button" data-url="'+dynUrl+'" '+counturl+''+via+'data-text="'+dynTitle+'" data-lang="'+o.lang+'" '+related+'data-count="'+o.layout+'">Tweet</a></div>';
	  } else {
	  	var thtml = '<div><a href="http://twitter.com/'+o.user+'" class="twitter-follow-button">Follow</a></div>';
	  }
	  if(o.mode=='append')$(obj).append(thtml);
	  else $(obj).html(thtml);

  });  
}  
})(jQuery);






;
;(function($){var L=$.loading=function(show,opts){return $('body').loading(show,opts,true);};$.fn.loading=function(show,opts,page){opts=toOpts(show,opts);var base=page?$.extend(true,{},L,L.pageOptions):L;return this.each(function(){var $el=$(this),l=$.extend(true,{},base,$.metadata?$el.metadata():null,opts);if(typeof l.onAjax=="boolean"){L.setAjax.call($el,l);}else{L.toggle.call($el,l);}});};var fixed={position:$.browser.msie?'absolute':'fixed'};$.extend(L,{version:"1.6.4",align:'top-left',pulse:'working error',mask:false,img:null,element:null,text:'Loading...',onAjax:undefined,delay:0,max:0,classname:'loading',imgClass:'loading-img',elementClass:'loading-element',maskClass:'loading-mask',css:{position:'absolute',whiteSpace:'nowrap',zIndex:1001},maskCss:{position:'absolute',opacity:.15,background:'#333',zIndex:101,display:'block',cursor:'wait'},cloneEvents:true,pageOptions:{page:true,align:'top-center',css:fixed,maskCss:fixed},html:'<div></div>',maskHtml:'<div></div>',maskedClass:'loading-masked',maskEvents:'mousedown mouseup keydown keypress',resizeEvents:'resize',working:{time:10000,text:'Still working...',run:function(l){var w=l.working,self=this;w.timeout=setTimeout(function(){self.height('auto').width('auto').text(l.text=w.text);l.place.call(self,l);},w.time);}},error:{time:100000,text:'Task may have failed...',classname:'loading-error',run:function(l){var e=l.error,self=this;e.timeout=setTimeout(function(){self.height('auto').width('auto').text(l.text=e.text).addClass(e.classname);l.place.call(self,l);},e.time);}},fade:{time:800,speed:'slow',run:function(l){var f=l.fade,s=f.speed,self=this;f.interval=setInterval(function(){self.fadeOut(s).fadeIn(s);},f.time);}},ellipsis:{time:300,run:function(l){var e=l.ellipsis,self=this;e.interval=setInterval(function(){var et=self.text(),t=l.text,i=dotIndex(t);self.text((et.length-i)<3?et+'.':t.substring(0,i));},e.time);function dotIndex(t){var x=t.indexOf('.');return x<0?t.length:x;}}},type:{time:100,run:function(l){var t=l.type,self=this;t.interval=setInterval(function(){var e=self.text(),el=e.length,txt=l.text;self.text(el==txt.length?txt.charAt(0):txt.substring(0,el+1));},t.time);}},toggle:function(l){var old=this.data('loading');if(old){if(l.show!==true)old.off.call(this,old,l);}else{if(l.show!==false)l.on.call(this,l);}},setAjax:function(l){if(l.onAjax){var self=this,count=0,A=l.ajax={start:function(){if(!count++)l.on.call(self,l);},stop:function(){if(!--count)l.off.call(self,l,l);}};this.bind('ajaxStart.loading',A.start).bind('ajaxStop.loading',A.stop);}else{this.unbind('ajaxStart.loading ajaxStop.loading');}},on:function(l,force){var p=l.parent=this.data('loading',l);if(l.max)l.maxout=setTimeout(function(){l.off.call(p,l,l);},l.max);if(l.delay&&!force){return l.timeout=setTimeout(function(){delete l.timeout;l.on.call(p,l,true);},l.delay);}
if(l.mask)l.mask=l.createMask.call(p,l);l.display=l.create.call(p,l);if(l.img){l.initImg.call(p,l);}else if(l.element){l.initElement.call(p,l);}else{l.init.call(p,l);}
p.trigger('loadingStart',[l]);},initImg:function(l){var self=this;l.imgElement=$('<img src="'+l.img+'"/>').bind('load',function(){l.init.call(self,l);});l.display.addClass(l.imgClass).append(l.imgElement);},initElement:function(l){l.element=$(l.element).clone(l.cloneEvents).show();l.display.addClass(l.elementClass).append(l.element);l.init.call(this,l);},init:function(l){l.place.call(l.display,l);if(l.pulse)l.initPulse.call(this,l);},initPulse:function(l){$.each(l.pulse.split(' '),function(){l[this].run.call(l.display,l);});},create:function(l){var el=$(l.html).addClass(l.classname).css(l.css).appendTo(this);if(l.text&&!l.img&&!l.element)el.text(l.originalText=l.text);$(window).bind(l.resizeEvents,l.resizer=function(){l.resize(l);});return el;},resize:function(l){l.parent.box=null;if(l.mask)l.mask.hide();l.place.call(l.display.hide(),l);if(l.mask)l.mask.show().css(l.parent.box);},createMask:function(l){var box=l.measure.call(this.addClass(l.maskedClass),l);l.handler=function(e){return l.maskHandler(e,l);};$(document).bind(l.maskEvents,l.handler);return $(l.maskHtml).addClass(l.maskClass).css(box).css(l.maskCss).appendTo(this);},maskHandler:function(e,l){var $els=$(e.target).parents().andSelf();if($els.filter('.'+l.classname).length!=0)return true;return!l.page&&$els.filter('.'+l.maskedClass).length==0;},place:function(l){var box=l.align,v='top',h='left';if(typeof box=="object"){box=$.extend(l.calc.call(this,v,h,l),box);}else{if(box!='top-left'){var s=box.split('-');if(s.length==1){v=h=s[0];}else{v=s[0];h=s[1];}}
if(!this.hasClass(v))this.addClass(v);if(!this.hasClass(h))this.addClass(h);box=l.calc.call(this,v,h,l);}
this.show().css(l.box=box);},calc:function(v,h,l){var box=$.extend({},l.measure.call(l.parent,l)),H=$.boxModel?this.height():this.innerHeight(),W=$.boxModel?this.width():this.innerWidth();if(v!='top'){var d=box.height-H;if(v=='center'){d/=2;}else if(v!='bottom'){d=0;}else if($.boxModel){d-=css(this,'paddingTop')+css(this,'paddingBottom');}
box.top+=d;}
if(h!='left'){var d=box.width-W;if(h=='center'){d/=2;}else if(h!='right'){d=0;}else if($.boxModel){d-=css(this,'paddingLeft')+css(this,'paddingRight');}
box.left+=d;}
box.height=H;box.width=W;return box;},measure:function(l){return this.box||(this.box=l.page?l.pageBox(l):l.elementBox(this,l));},elementBox:function(e,l){if(e.css('position')=='absolute'){var box={top:0,left:0};}else{var box=e.position();box.top+=css(e,'marginTop');box.left+=css(e,'marginLeft');}
box.height=e.outerHeight();box.width=e.outerWidth();return box;},pageBox:function(l){var full=$.boxModel&&l.css.position!='fixed';return{top:0,left:0,height:get(full,'Height'),width:get(full,'Width')};function get(full,side){var doc=document;if(full){var s=side.toLowerCase(),d=$(doc)[s](),w=$(window)[s]();return d-css($(doc.body),'marginTop')>w?d:w;}
var c='client'+side;return Math.max(doc.documentElement[c],doc.body[c]);}},off:function(old,l){this.data('loading',null);if(old.maxout)clearTimeout(old.maxout);if(old.timeout)return clearTimeout(old.timeout);if(old.pulse)old.stopPulse.call(this,old,l);if(old.originalText)old.text=old.originalText;if(old.mask)old.stopMask.call(this,old,l);$(window).unbind(old.resizeEvents,old.resizer);if(old.display)old.display.remove();if(old.parent)old.parent.trigger('loadingEnd',[old]);},stopPulse:function(old,l){$.each(old.pulse.split(' '),function(){var p=old[this];if(p.end)p.end.call(l.display,old,l);if(p.interval)clearInterval(p.interval);if(p.timeout)clearTimeout(p.timeout);});},stopMask:function(old,l){this.removeClass(l.maskedClass);$(document).unbind(old.maskEvents,old.handler);old.mask.remove();}});function toOpts(s,l){if(l===undefined){l=(typeof s=="boolean")?{show:s}:s;}else{l.show=s;}
if(l&&(l.img||l.element)&&!l.pulse)l.pulse=false;if(l&&l.onAjax!==undefined&&l.show===undefined)l.show=false;return l;}
function css(el,prop){var val=el.css(prop);return val=='auto'?0:parseFloat(val,10);}})(jQuery);

// jquery.loading.overflow.js
;(function($){var L=$.loading;L.maskStretch=true;L.altOverflow='hidden';var createMask=L.createMask;L.createMask=function(opts){var mask=createMask.apply(this,arguments);if($.boxModel&&!opts.maskStretch){opts.parent.oldOverflow=opts.parent.css('overflow')||'auto';opts.parent.css('overflow',opts.altOverflow)}
return mask;};var off=L.off;L.off=function(old,opts){if(old.parent.oldOverflow){old.parent.css('overflow',old.parent.oldOverflow);}
off.apply(this,arguments);};var elementBox=L.elementBox;L.elementBox=function(e,opts){var box=elementBox(e,opts);if($.boxModel&&opts.maskStretch){var b=box.top+box.height,r=box.left+box.width;e.children().each(function(){var kid=opts.elementBox($(this),opts),kb=kid.top+kid.height,kr=kid.left+kid.width;if(kb>b)b=kb;if(kr>r)r=kr;});box.height=b-box.top;box.width=r-box.left;}
return box;};})(jQuery);;
/*
 * Wowwindow, version 0.6.2 beta (2011-11-23)
 * (c) Copyright 2010 Abel Mohler
 * http://wayfarerweb.com/jquery/plugins/wowwindow/
 * Licensed under the MIT license
 * http://wayfarerweb.com/mit.php
 */
(function(f){f.fn.wowwindow=function(m){var l={testMode:false,draggable:false,fixedWindow:false,width:500,height:500,overlay:{background:"#000",opacity:0.6,zIndex:1000,fixed:true,clickToClose:true,destroyOnClose:false},before:function(){},after:function(){},onclose:function(){},zoom:true,rotate:false,rotations:1,clockwise:true,speed:800,autoplay:true,videoIframe:true,showRelated:true,autoYouTubeThumb:null,closeButton:'<a class="wowwindow-close" title="close" href="javascript:void(0)">Close</a>',wrapHTML:'<div id="wowwindow-inner"></div>',beforeHTML:'<div class="wowwindow-controlbar">{%close%} <span class="wowwindow-title">{%title%}</span></div>',afterHTML:"",verticalCenter:true,forceImageFade:false,yabbadabbadoo:false};m=m||{};if(m.overlay===false||m.overlay===null){m.overlay={};m.overlay.overlay=false}if(m.overlay){m.overlay=f.extend(l.overlay,m.overlay)}m=f.extend(l,m);m.overlay.playgroundFixed=m.fixedWindow;m.overlay.onclose=m.onclose;if(m.testMode){if(!window.console){window.console={};window.console.log=function(){}}f.fn.wowwindow.ii=0}var p=a(),j=[],i=Math.round(Math.random()*10000),k=m.clockwise?"+":"-";function n(s){if(this.title){s=s.replace(/\{\%title\%\}/,this.title)}else{if(f(this).find("img").length==1&&f(this).find("*").length==1){var q=f(this).find("img")[0];var r=q.alt||"";s=s.replace(/\{\%title\%\}/,r)}else{s=s.replace(/\{\%title\%\}/,"")}}var o=m.closeButton||"";s=s.replace(/\{\%close\%\}/,o);return s}return this.each(function(){var q=this;this.open=false;var o=(m.closeButton)?f(m.closeButton):f("<span></span>");if(m.closeButton){o.click(function(){f(document.body).overlayPlayground("close");q.open=false})}if(f(this).attr("href").match(/\/\/www\.youtube\.com\/watch\?/)&&m.autoYouTubeThumb&&f(this).find(">img").length>0){var r=(document.location.protocol=="https:")?"https://":"http://";f(this).find(">img").eq(0).attr("src",r+"img.youtube.com/vi/"+this.href.split("v=")[1].split("&")[0]+"/"+m.autoYouTubeThumb+".jpg")}f(this).click(function(t){t.preventDefault();var D=this,v=f(this).attr("href").slice(-4);var u=(v==".jpg"||v==".png"||v==".gif"||v==".bmp");var A=false;if(f(this).attr("href").indexOf("#")===0){m.overlay.html='<div id="wowwindow">'+n.call(this,f(f(this).attr("href")).html())+"</div>"}else{if(u){if(j[this.href]&&!m.forceImageFade){m.overlay.html='<div id="wowwindow"><div id="wowwindow-image"><img src="'+this.href+"?"+i+'"></div></div>'}else{m.overlay.html='<div id="wowwindow"><div id="wowwindow-image"><div id="wowwindow-image-loading">&nbsp;</div></div></div>'}}else{A=true;var I="",y;if(this.href.match(/\/\/www\.youtube\.com\/watch\?/)){I="youtube";y=this.href.split("v=")[1].split("&")[0]}else{if(this.href.match(/\/\/vimeo\.com\/([0-9]+)$/)||this.href.match(/\/\/www\.vimeo\.com\/([0-9]+)$/)){I="vimeo";y=this.href.split("//")[1].split("/")[1]}}m.overlay.html='<div id="wowwindow-image"><div id="wowwindow-image-loading">&nbsp;</div></div>';m.overlay.html='<div id="wowwindow">'+m.overlay.html+"</div>"}}if(typeof m.before=="function"){m.before.call(this)}if(A&&I!=""){m.overlay.onclose=function(){f("#wowwindow iframe, #wowwindow-video-flash").remove();if(typeof m.onclose=="function"){m.onclose.call(this)}}}f(document.body).overlayPlayground(m.overlay);f("#wowwindow")[0].self=q;if(A){var s=this.href,F="";switch(I){case"youtube":s="//www.youtube.com/embed/"+y+"?rel="+(m.showRelated?"1":"0")+(m.autoplay?"&autoplay=1":"");F="wowwindow-video wowwindow-video-youtube";if(!m.videoIframe){f('<div id="wowwindow-video-flash"><object width="'+m.width+'" height="'+m.height+'"><param name="movie" value="http://www.youtube.com/v/'+y+"?fs=1&rel="+(m.showRelated?"1":"0")+(m.autoplay?"&autoplay=1":"")+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+y+"?fs=1&rel="+(m.showRelated?"1":"0")+(m.autoplay?"&autoplay=1":"")+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+m.width+'" height="'+m.height+'"></embed></object></div>').appendTo("#wowwindow")}break;case"vimeo":s="http://player.vimeo.com/video/"+y+"?title=0&byline=0&portrait=0"+(m.autoplay?"&autoplay=1":"");F="wowwindow-video wowwindow-video-vimeo";if(!m.videoIframe){f('<div id="wowwindow-video-flash"><object width="'+m.width+'" height="'+m.height+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+y+"&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1"+(m.autoplay?"&autoplay=1":"&autoplay=0")+'&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id='+y+"&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1"+(m.autoplay?"&autoplay=1":"&autoplay=0")+'&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+m.width+'" height="'+m.height+'"></embed></object></div>').appendTo("#wowwindow")}break}if(I==""||m.videoIframe){f(document.createElement("iframe")).attr({id:"wowwindow-iframe",className:F,src:s,height:m.height,width:m.width,type:"text/html",frameBorder:"0"}).css({display:"none"}).load(function(){f(this).fadeIn(300,function(){if(I=="youtube"){f(this).parent().html(f(this).parent().html())}})}).appendTo("#wowwindow")}}if(!m.fixedWindow){f("body > .overlayPlaygroundPlayground").css({top:f(window).scrollTop()+"px"})}f("#wowwindow").click(function(){f.fn.wowwindow.overLayClickDefault=false});if(m.overlay.clickToClose&&!f.fn.wowwindow.overLayClickEventSet){f(document.body).click(function(){if(f.fn.wowwindow.overLayClickDefault&&f("#wowwindow")[0].self.open){f(document.body).overlayPlayground("close");q.open=false;f("#wowwindow")[0].self=q}f.fn.wowwindow.overLayClickDefault=true});f.fn.wowwindow.overLayClickEventSet=true}f("#wowwindow >*").wrapAll(m.wrapHTML);f("#wowwindow").prepend(n.call(this,m.beforeHTML));f("#wowwindow").append(n.call(this,m.afterHTML));q.open=true;f("#wowwindow .wowwindow-close").click(function(){if(q.open){f(document.body).overlayPlayground("close");q.open=false}return false});if(A){f("#wowwindow-iframe").parent().height(m.height)}if(m.zoom){f("#wowwindow").scale(0)}if(A){f("#wowwindow").width(m.width+20)}else{if(!u){f("#wowwindow").width(m.width)}else{var z=m.forceImageFade;if(f("#wowwindow-image-loading").length==1||m.forceImageFade){f("#wowwindow").width(f("#wowwindow-image-loading").width()+20);f("#wowwindow-image-loading").parent().height(f("#wowwindow-image-loading").height());z=true}else{var x=f("#wowwindow-image img").width();var H=f("#wowwindow-image img").height();if(m.testMode){f.fn.wowwindow.ii+=1;console.log("!"+f.fn.wowwindow.ii+". "+x+","+H)}if(x){f("#wowwindow").width(x+20)}}}}function E(){f("#wowwindow")[0].style.MozTransform="none";f("#wowwindow")[0].style.WebkitTransform="none";f("#wowwindow")[0].style.transform="none"}function G(){if(!m.draggable||f("#wowwindow .wowwindow-controlbar").length==0){return}var O=true,L,K,J,N,M=false;f("#wowwindow .wowwindow-controlbar").mousedown(function(P){if(O){L=P.pageX;K=P.pageY;if(f("#wowwindow")[0].style.top&&f("#wowwindow")[0].style.left){J=Math.round(parseFloat(f("#wowwindow").css("left").replace(/px/,"")));N=Math.round(parseFloat(f("#wowwindow").css("top").replace(/px/,"")))}else{J=Math.round(f("body > .overlayPlaygroundPlayground").width()/2);N=Math.round(f("body > .overlayPlaygroundPlayground").height()/2)}M=true}O=true});f("#wowwindow .wowwindow-controlbar .wowwindow-close").mousedown(function(){O=false});f(document.body).mousemove(function(T){if(M){var S=T.pageX-L,R=T.pageY-K,Q=J+S,P=N+R;f("#wowwindow").css({left:Q+"px",top:P+"px"})}});f(window).mouseup(function(){M=false});f("#wowwindow .wowwindow-controlbar").mouseup(function(){M=false})}function C(){if(m.zoom){f(document.body).overlayPlayground("open");f("#wowwindow").animate({scale:"+=1.00"},{queue:false,duration:m.speed,complete:function(){if(p){E();if(typeof m.after=="function"){m.after.call(D)}G.call(this)}}})}else{f(document.body).overlayPlayground("open")}if(m.rotate){f("#wowwindow").animate({rotate:k+"="+(360*m.rotations)+"deg"},{queue:false,duration:m.speed,complete:function(){if(p&&!m.zoom){E();if(!m.zoom&&typeof m.after=="function"){m.after.call(D)}G.call(this)}}})}f("#wowwindow").css({marginTop:"-"+(f("#wowwindow").outerHeight()/2)+"px",marginLeft:"-"+(f("#wowwindow").outerWidth()/2)+"px"});if(p){f("#wowwindow").css({left:t.clientX+"px",top:t.clientY+"px"}).animate({left:(f("body > .overlayPlaygroundPlayground").width()/2)+"px",top:(f("body > .overlayPlaygroundPlayground").height()/2)+"px"},m.speed)}}if(!u||x||z){C.call(this)}else{var w=setInterval(function(){var K=f("#wowwindow-image img").width();var J=f("#wowwindow-image img").height();if(m.testMode){f.fn.wowwindow.ii+=1;console.log("!"+f.fn.wowwindow.ii+". "+K+","+J)}if(K){f("#wowwindow").width(K+20);C.call(D);clearInterval(w)}},1)}if(z){var B=new Image();f(B).attr({id:"wowwindow-loaded-image",src:f(D).attr("href")+"?"+i}).css({position:"absolute",top:"-999em",bottom:"-999em"});f(B).load(function(){var J=this;f(this).appendTo("#wowwindow-image");var K=setInterval(function(){var L=f(J).height();var M=f(J).width();if(m.testMode){f.fn.wowwindow.ii+=1;console.log(f.fn.wowwindow.ii+". "+M+","+L)}if(M){f("#wowwindow").animate({width:(M+20)+"px",marginTop:"-"+((L+20)/2)+"px",marginLeft:"-"+((M+20)/2)+"px"},{queue:m.yabbadabbadoo,duration:300,complete:function(){f("#wowwindow-loaded-image").css({top:"10px",left:"10px",display:"none"}).fadeIn(300)}});f("#wowwindow-loaded-image").parent().animate({height:L+"px"});f(B).unbind("load");clearInterval(K)}},1);j[D.href]=true})}if(!m.zoom&&!m.rotate&&p&&typeof m.after=="function"){E();m.after.call(this);G.call(this)}if(!p&&typeof m.after=="function"){E();m.after.call(this);G.call(this)}return false})})};f.wowwindow={close:function(){var i=f("#wowwindow");if(i.length>0&&i[0].self.open){f(document.body).overlayPlayground("close");f("#wowwindow")[0].self.open=false}}};f.fn.wowWindow=f.fn.WowWindow=f.fn.wowwindow;f.wowWindow=f.WowWindow=f.wowwindow;f.fn.wowwindow.overLayClickEventSet=false;f.fn.wowwindow.overLayClickDefault=true;f.fn.overlayPlayground=function(l){var k={background:"#000",opacity:0.75,zIndex:1000,fixed:true,playgroundFixed:false,html:"",overlay:true,open:true,destroyOnClose:false,onclose:null};var i=true;if(l=="close"){l={open:false}}if(l=="open"){l={open:true};i=false}l=f.extend(k,l);if(typeof l.onclose=="function"){f.fn.overlayPlayground.onclose=l.onclose}else{if(typeof f.fn.overlayPlayground.onclose=="function"){l.onclose=f.fn.overlayPlayground.onclose}}var j=(typeof document.body.style.maxWidth=="undefined")?true:false;return this.each(function(){if(l.open){var o=false;if(f(this).find("> .overlayPlaygroundOverlay, > .overlayPlaygroundPlayground").length>0){o=true;f(this).find("> .overlayPlaygroundOverlay, > .overlayPlaygroundPlayground").show()}f("html,body").css({height:"100%"});if(!i){return}if(l.overlay){var p={opacity:l.opacity,filter:"alpha(opacity="+(l.opacity*100)+")",background:l.background,zIndex:l.zIndex,padding:0,margin:0,height:f(document).height()+"px",width:"100%",left:0,top:0,position:"absolute"};if(o){f(this).find("> .overlayPlaygroundOverlay").css(p)}else{f('<div class="overlayPlaygroundOverlay">&nbsp;</div>').css(p).appendTo(this)}}var m={zIndex:l.zIndex+10,padding:0,margin:0,height:"100%",width:"100%",left:0,top:0,position:(j||!l.playgroundFixed)?"absolute":"fixed"};if(o){f(this).find("> .overlayPlaygroundPlayground").css(m).html(l.html)}else{f('<div class="overlayPlaygroundPlayground"></div>').css(m).html(l.html).appendTo(this);if(j&&l.playgroundFixed){var n=this;f(window).scroll(function(){f(n).find("> .overlayPlaygroundPlayground").css("top",f(window).scrollTop()+"px")});f(window).scroll()}}}else{if(!l.destroyOnClose){f(this).find(".overlayPlaygroundOverlay,.overlayPlaygroundPlayground").hide()}else{f(this).find(".overlayPlaygroundOverlay,.overlayPlaygroundPlayground").remove()}if(typeof l.onclose=="function"){l.onclose.call(this)}}})};function a(){var i=["transform","WebkitTransform","MozTransform","msTransform","OTransform"],j;while(j=i.shift()){if(typeof document.body.style[j]!="undefined"){return true}}return false}function h(j){var i=["transform","WebkitTransform","msTransform","MozTransform","OTransform"];var k;while(k=i.shift()){if(typeof j.style[k]!="undefined"){return k}}return"transform"}var g=null;var d=f.fn.css;f.fn.css=function(i,j){if(g===null){if(typeof f.cssProps!="undefined"){g=f.cssProps}else{if(typeof f.props!="undefined"){g=f.props}else{g={}}}}if(typeof g.transform=="undefined"&&(i=="transform"||(typeof i=="object"&&typeof i.transform!="undefined"))){g.transform=h(this.get(0))}if(g.transform!="transform"){if(i=="transform"){i=g.transform;if(typeof j=="undefined"&&jQuery.style){return jQuery.style(this.get(0),i)}}else{if(typeof i=="object"&&typeof i.transform!="undefined"){i[g.transform]=i.transform;delete i.transform}}}return d.apply(this,arguments)};var e="deg";f.fn.rotate=function(k){var j=f(this).css("transform")||"none";if(typeof j=="undefined"){return this}if(typeof k=="undefined"){if(j){var i=j.match(/rotate\(([^)]+)\)/);if(i&&i[1]){return i[1]}}return 0}var i=k.toString().match(/^(-?\d+(\.\d+)?)(.+)?$/);if(i){if(i[3]){e=i[3]}f(this).css("transform",j.replace(/none|rotate\([^)]*\)/,"")+"rotate("+i[1]+e+")")}return this};f.fn.scale=function(n,l,j){var k=f(this).css("transform");if(typeof k=="undefined"){return this}if(typeof n=="undefined"){if(k){var i=k.match(/scale\(([^)]+)\)/);if(i&&i[1]){return i[1]}}return 1}f(this).css("transform",k.replace(/none|scale\([^)]*\)/,"")+"scale("+n+")");return this};var c=f.fx.prototype.cur;f.fx.prototype.cur=function(){if(this.prop=="rotate"){return parseFloat(f(this.elem).rotate())}else{if(this.prop=="scale"){return parseFloat(f(this.elem).scale())}}return c.apply(this,arguments)};f.fx.step.rotate=function(i){f(i.elem).rotate(i.now+e)};f.fx.step.scale=function(i){f(i.elem).scale(i.now)};var b=f.fn.animate;f.fn.animate=function(j){if(typeof j!="undefined"&&typeof j.rotate!="undefined"){var i=j.rotate.toString().match(/^(([+-]=)?(-?\d+(\.\d+)?))(.+)?$/);if(i&&i[5]){e=i[5]}j.rotate=i[1]}return b.apply(this,arguments)}})(jQuery);;
(function(a){a.fn.popupWindow=function(e){return this.each(function(){a(this).click(function(){a.fn.popupWindow.defaultSettings={centerBrowser:0,centerScreen:0,height:500,left:0,location:0,menubar:0,resizable:0,scrollbars:0,status:0,width:500,windowName:null,windowURL:null,top:0,toolbar:0};settings=a.extend({},a.fn.popupWindow.defaultSettings,e||{});var d="height="+settings.height+",width="+settings.width+",toolbar="+settings.toolbar+",scrollbars="+settings.scrollbars+",status="+settings.status+",resizable="+
settings.resizable+",location="+settings.location+",menuBar="+settings.menubar;settings.windowName=this.name||settings.windowName;settings.windowURL=this.href||settings.windowURL;var b,c;settings.centerBrowser?(a.browser.msie?(b=window.screenTop-120+((document.documentElement.clientHeight+120)/2-settings.height/2),c=window.screenLeft+((document.body.offsetWidth+20)/2-settings.width/2)):(b=window.screenY+(window.outerHeight/2-settings.height/2),c=window.screenX+(window.outerWidth/2-settings.width/
2)),window.open(settings.windowURL,settings.windowName,d+",left="+c+",top="+b).focus()):settings.centerScreen?(b=(screen.height-settings.height)/2,c=(screen.width-settings.width)/2,window.open(settings.windowURL,settings.windowName,d+",left="+c+",top="+b).focus()):window.open(settings.windowURL,settings.windowName,d+",left="+settings.left+",top="+settings.top).focus();return!1})})}})(jQuery);
;

