/***---------------------------------------------------------------------------------------------------------------------------***\
|****-------------------------------------------------------------------------------------------------------------------------****|
|******																														******|
|*******		transParent UI : a Progressively Enhanced Frameworking - jQuery UI / HTML5 / CSS3 Enhancements			   *******|
|*********		[ http://www.keithparent.com/transparentui/																 *********|
|***********-----------------------------------------------------------------------------------------------------------***********|
|*******																												   *******|
*				A CSS/jQuery UI Framework that focuses on rapid UI production & progressive enhancement
*				techniques to extend and maintain reusable code via industry mark-up naming conventions
*				for quicker development.
*				Copyright [c] 2010, Keith Parent  [ keithparent@me.com  [ http://www.keithparent.com
--------------------------------------------------------------------------------------------------------------------------------**|
--------------------------------------------------------------------------------------------------------------------------------**|
*
* 	C O N T E N T S		:		[  T A B L E   O F  ]
*	-----------------------------------------------------------------------------
*	[ jQuery Function & Namespace Definitions									]
*	:	HTML5 Enabling
*	:	Monkey-Patches
*	:	jQuery bigTarget
*	:	jQuery Penner Easing Functions 1.3
*	:	jQuery LiveFilter v.1.1
*	:	jQuery UI Selectmenu
*	:	jQuery Uniform
*	:	dPassword (delayed password masking - like iPhone)
*	:	CSS Background Animation
*	:	Smooth Scrolling
*	:	Google Webfont
*	:
*	-----------------------------------------------------------------------------
*	[ jQuery Function & Namespace Application Controllers						]
*	:	Initialization of UI Enhancement Object of Functions
*	:	Conditional Testing  & Instantiation of all UI Enhancements
*	:
--------------------------------------------------------------------------------------------------------------------------------**|
--------------------------------------------------------------------------------------------------------------------------------**/

/***------------------------------------------------------------------------------------------------
	Assorted jQuery feature enhancements (monkey-patches) by Ralph Holzmann. MIT License.
------------------------------------------------------------------------------------------------***/
(function($){var _next=$.fn.next;$.fn.next=function(selector) {if(typeof(selector)==="number"&&selector>1){return $(jQuery.nth(this[0],(selector+1),"nextSibling"));}return _next.apply(this,arguments); };var _prev=$.fn.prev;$.fn.prev=function(selector){if(typeof(selector)==="number"&&selector>1){return $(jQuery.nth(this[0],(selector+1),"previousSibling"));}return _prev.apply(this,arguments); }; var _parent = $.fn.parent;$.fn.parent=function(selector){	if(typeof(selector)==="number"&&selector>1){var parent=this[0].parentNode;while(--selector){parent=parent.parentNode;}return parent && parent.nodeType !== 11 ? $(parent) : null; }return _parent.apply(this,arguments);}})(jQuery);(function($){var _clone=$.fn.clone;$.fn.clone=function(n,withDataAndEvents){if(typeof(n)==="number"&&n>1){var stack=[];while(n--){ stack.push(_clone.call(this, withDataAndEvents)); }	return stack; }	return _clone.call(this, withDataAndEvents); }})(jQuery); (function($){var _fadeIn=$.fn.fadeIn;$.fn.fadeIn=function(easing,callback,cancel){return _fadeIn.call(this,easing,function(){if(jQuery.browser.msie && !cancel) $(this).get(0).style.removeAttribute('filter');if($.isFunction(callback))callback();});};var _fadeOut=$.fn.fadeOut;$.fn.fadeOut =function(easing,callback,cancel){return _fadeOut.call(this, easing,function(){if(jQuery.browser.msie && !cancel) $(this).get(0).style.removeAttribute('filter'); if($.isFunction(callback)) callback(); }); }})(jQuery);(function($){$.fn.extend({outerHtml:function(replacement){if(replacement){return this.each(function (){ $(this).replaceWith(replacement); }); }	var tmp_node = $("<div></div>").append( $(this).clone() );var markup=tmp_node.html();tmp_node.remove();return markup;}});})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery bgiframe Version 2.1.1
	Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) MIT & GPL Licenses
------------------------------------------------------------------------------------------------***/
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},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($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
	Open source under the BSD License. Copyright © 2001 Robert Penner, All rights reserved. 
------------------------------------------------------------------------------------------------***/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});

/***------------------------------------------------------------------------------------------------
	Google Webfont : Copyright 2010 Small Batch, Inc.
------------------------------------------------------------------------------------------------***/
;(function(window,document,undefined){webfont={};webfont.Q=function(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):[];return function(){c.push.apply(c,arguments);return b.apply(a,c)}};webfont.z=function(a){this.R=a};webfont.z.prototype.createElement=function(a,b,c){a=this.R.createElement(a);if(b)for(var d in b)b.hasOwnProperty(d)&&a.setAttribute(d,b[d]);c&&a.appendChild(this.R.createTextNode(c));return a};function i(a,b,c){a=a.R.getElementsByTagName(b)[0];if(!a)a=document.documentElement;if(a&&a.lastChild){a.insertBefore(c,a.lastChild);return true}return false}function m(a,b){function c(){document.body?b():setTimeout(c,0)}c()}function n(a,b){if(b.parentNode){b.parentNode.removeChild(b);return true}return false}function o(a,b){return a.createElement("link",{rel:"stylesheet",href:b})}function p(a,b,c){a=b.className.split(/\s+/);for(var d=0,e=a.length;d<e;d++)if(a[d]==c)return;a.push(c);b.className=a.join(" ").replace(/^\s+/,"")}function q(a,b,c){a=b.className.split(/\s+/);for(var d=[],e=0,f=a.length;e<f;e++)a[e]!=c&&d.push(a[e]);b.className=d.join(" ").replace(/^\s+/,"").replace(/\s+$/,"")};webfont.o=function(a,b,c,d,e,f){this.Aa=a;this.Ga=b;this.Fa=c;this.Ea=d;this.Ca=e;this.Z=f};webfont.o.prototype.getName=function(){return this.Aa};webfont.e=function(a){this.a=a};webfont.e.f="Unknown";webfont.e.sa=new webfont.o(webfont.e.f,webfont.e.f,webfont.e.f,false);webfont.e.prototype.parse=function(){return this.a.indexOf("MSIE")!=-1?r(this):this.a.indexOf("Opera")!=-1?s(this):this.a.indexOf("AppleWebKit")!=-1?t(this):this.a.indexOf("Gecko")!=-1?u(this):webfont.e.sa};function v(a){var b=w(a,a.a,/(iPod|iPad|iPhone|Android)/);if(b!="")return b;a=w(a,a.a,/(Linux|Mac_PowerPC|Macintosh|Windows)/);if(a!=""){if(a=="Mac_PowerPC")a="Macintosh";return a}return webfont.e.f}function r(a){var b=w(a,a.a,/(MSIE [\d\w\.]+)/);if(b!=""){var c=b.split(" ");b=c[0];c=c[1];return new webfont.o(b,c,b,c,v(a),x(a,c)>=6)}return new webfont.o("MSIE",webfont.e.f,"MSIE",webfont.e.f,v(a),false)}function s(a){var b=webfont.e.f,c=webfont.e.f,d=w(a,a.a,/(Presto\/[\d\w\.]+)/);if(d!=""){c=d.split("/");b=c[0];c=c[1]}else{if(a.a.indexOf("Gecko")!=-1)b="Gecko";d=w(a,a.a,/rv:([^\)]+)/);if(d!="")c=d}if(a.a.indexOf("Version/")!=-1){d=w(a,a.a,/Version\/([\d\.]+)/);if(d!="")return new webfont.o("Opera",d,b,c,v(a),x(a,d)>=10)}d=w(a,a.a,/Opera[\/ ]([\d\.]+)/);if(d!="")return new webfont.o("Opera",d,b,c,v(a),x(a,d)>=10);return new webfont.o("Opera",webfont.e.f,b,c,v(a),false)}function t(a){var b=v(a),c=w(a,a.a,/AppleWebKit\/([\d\.\+]+)/);if(c=="")c=webfont.e.f;var d=webfont.e.f;if(a.a.indexOf("Chrome")!=-1)d="Chrome";else if(a.a.indexOf("Safari")!=-1)d="Safari";var e=webfont.e.f;if(a.a.indexOf("Version/")!=-1)e=w(a,a.a,/Version\/([\d\.\w]+)/);else if(d=="Chrome")e=w(a,a.a,/Chrome\/([\d\.]+)/);var f=w(a,c,/\d+\.(\d+)/);return new webfont.o(d,e,"AppleWebKit",c,b,x(a,c)>=526||x(a,c)>=525&&parseInt(f)>=13)}function u(a){var b=webfont.e.f,c=webfont.e.f,d=false;if(a.a.indexOf("Firefox")!=-1){b="Firefox";var e=w(a,a.a,/Firefox\/([\d\w\.]+)/);if(e!=""){d=w(a,e,/\d+\.(\d+)/);c=e;d=e!=""&&x(a,e)>=3&&parseInt(d)>=5}}else if(a.a.indexOf("Mozilla")!=-1)b="Mozilla";e=w(a,a.a,/rv:([^\)]+)/);if(e=="")e=webfont.e.f;else if(!d){d=x(a,e);var f=parseInt(w(a,e,/\d+\.(\d+)/)),h=parseInt(w(a,e,/\d+\.\d+\.(\d+)/));d=d>1||d==1&&f>9||d==1&&f==9&&h>=2||e.match(/1\.9\.1b[123]/)!=null||e.match(/1\.9\.1\.[\d\.]+/)!=null}return new webfont.o(b,c,"Gecko",e,v(a),d)}function x(a,b){a=w(a,b,/(\d+)/);if(a!="")return parseInt(a);return-1}function w(a,b,c){if((a=b.match(c))&&a[1])return a[1];return""};webfont.d=function(a,b,c,d){this.c=a;this.j=b;this.ba=c;this.q=d||webfont.d.oa;this.p=new webfont.F("-")};webfont.d.oa="wf";webfont.d.u="loading";webfont.d.D="active";webfont.d.I="inactive";webfont.d.O="font";function y(a){p(a.c,a.j,a.p.h(a.q,webfont.d.u));A(a,webfont.d.u)}function B(a,b,c){q(a.c,a.j,a.p.h(a.q,b,c,webfont.d.u));p(a.c,a.j,a.p.h(a.q,b,c,webfont.d.D));A(a,webfont.d.O+webfont.d.D,b,c)}function C(a){p(a.c,a.j,a.p.h(a.q,webfont.d.I));A(a,webfont.d.I)}function D(a){q(a.c,a.j,a.p.h(a.q,webfont.d.u));p(a.c,a.j,a.p.h(a.q,webfont.d.D));A(a,webfont.d.D)}function A(a,b,c,d){a.ba[b]&&a.ba[b](c,d)};webfont.qa=function(){this.ia={}};function E(a,b){var c=[];for(var d in b)if(b.hasOwnProperty(d)){var e=a.ia[d];e&&c.push(e(b[d]))}return c};webfont.t=function(a,b,c,d,e){this.c=a;this.v=b;this.S=c;this.L=d;this.fa=e;this.ca=0;this.X=this.ha=false;this.za=new webfont.$;this.M=new webfont.g};webfont.t.aa="DEFAULT_FONT";webfont.t.pa="n4";webfont.t.prototype.watch=function(a,b,c){for(var d=a.length,e=0;e<d;e++){var f=a[e];b[f]||(b[f]=[webfont.t.pa]);this.ca+=b[f].length}if(c)this.ha=c;for(e=0;e<d;e++){f=a[e];c=b[f];for(var h=0,k=c.length;h<k;h++){var g=c[h],j=F(this,webfont.t.aa,g),z=this.S.T(j);n(this.c,j);j=f;var l=this.v;p(l.c,l.j,l.p.h(l.q,j,g,webfont.d.u));A(l,webfont.d.O+webfont.d.u,j,g);l=F(this,j,g);if(z!=this.S.T(l)){n(this.c,l);B(this.v,j,g);this.X=true;G(this)}else H(this,this.fa(),z,l,j,g)}}};function G(a){if(--a.ca==0&&a.ha)a.X?D(a.v):C(a.v)}webfont.t.prototype.wa=function(a,b,c,d,e){if(b!=this.S.T(c)){n(this.c,c);B(this.v,d,e);this.X=true;G(this)}else if(this.fa()-a<5E3)H(this,a,b,c,d,e);else{n(this.c,c);a=this.v;q(a.c,a.j,a.p.h(a.q,d,e,webfont.d.u));p(a.c,a.j,a.p.h(a.q,d,e,webfont.d.I));A(a,webfont.d.O+webfont.d.I,d,e);G(this)}};function H(a,b,c,d,e,f){a.L(function(h,k){return function(){k.call(h,b,c,d,e,f)}}(a,a.wa),50)}function F(a,b,c){b=a.za.quote(b);c=a.M.expand(c);c=a.c.createElement("span",{style:"position:absolute;top:-999px;font-size:300px;font-family:"+b+","+webfont.t.aa+";"+c},"Mm");i(a.c,"html",c);return c};webfont.C=function(a,b,c,d,e){this.c=a;this.da=b;this.j=c;this.L=d;this.a=e;this.V=this.W=0};webfont.C.prototype.K=function(a,b){this.da.ia[a]=b};webfont.C.prototype.load=function(a){var b=new webfont.d(this.c,this.j,a);this.a.Z?I(this,b,a):C(b)};webfont.C.prototype.xa=function(a,b,c,d){if(d)a.load(webfont.Q(this,this.Ba,b,c));else{a=--this.W==0;this.V--;if(a)this.V==0?C(b):y(b);c.watch([],{},a)}};webfont.C.prototype.Ba=function(a,b,c,d){var e=--this.W==0;e&&y(a);this.L(webfont.Q(this,function(f,h,k,g){f.watch(h,k||{},g)},b,c,d,e))};function I(a,b,c){c=E(a.da,c);a.V=a.W=c.length;for(var d=new webfont.t(a.c,b,{T:function(k){return k.offsetWidth}},a.L,function(){return+new Date}),e=0,f=c.length;e<f;e++){var h=c[e];h.Y(a.a,webfont.Q(a,a.xa,h,b,d))}};webfont.F=function(a){this.ya=a||webfont.F.na};webfont.F.na="-";webfont.F.prototype.h=function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b].replace(/[\W_]+/g,"").toLowerCase());return a.join(this.ya)};webfont.$=function(){this.ka='"'};webfont.$.prototype.quote=function(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");d.indexOf(" ")==-1?b.push(d):b.push(this.ka+d+this.ka)}return b.join(",")};webfont.g=function(){this.N=webfont.g.ra;this.s=webfont.g.ta};webfont.g.ra=["font-style","font-weight"];webfont.g.ta={"font-style":[["n","normal"],["i","italic"],["o","oblique"]],"font-weight":[["1","100"],["2","200"],["3","300"],["4","400"],["5","500"],["6","600"],["7","700"],["8","800"],["9","900"],["4","normal"],["7","bold"]]};webfont.g.J=function(a,b,c){this.ga=a;this.Da=b;this.s=c};webfont.g.J.prototype.compact=function(a,b){for(var c=0;c<this.s.length;c++)if(b==this.s[c][1]){a[this.ga]=this.s[c][0];return}};webfont.g.J.prototype.expand=function(a,b){for(var c=0;c<this.s.length;c++)if(b==this.s[c][0]){a[this.ga]=this.Da+":"+this.s[c][1];return}};webfont.g.prototype.compact=function(a){var b=["n","4"];a=a.split(";");for(var c=0,d=a.length;c<d;c++){var e=a[c].replace(/\s+/g,"").split(":");if(e.length==2){var f=e[1];a:{e=e[0];for(var h=0;h<this.N.length;h++)if(e==this.N[h]){e=new webfont.g.J(h,e,this.s[e]);break a}e=null}e&&e.compact(b,f)}}return b.join("")};webfont.g.prototype.expand=function(a){if(a.length!=2)return null;for(var b=[null,null],c=0,d=this.N.length;c<d;c++){var e=this.N[c],f=a.substr(c,1);(new webfont.g.J(c,e,this.s[e])).expand(b,f)}return b[0]&&b[1]?b.join(";")+";":null};window.WebFont=function(){var a=new webfont.z(document),b=(new webfont.e(navigator.userAgent)).parse();return new webfont.C(a,new webfont.qa,document.documentElement,function(c,d){setTimeout(c,d)},b)}();window.WebFont.load=window.WebFont.load;window.WebFont.addModule=window.WebFont.K;webfont.H=function(a){this.va=a||webfont.H.ma;this.m=null};webfont.H.ma="//fonts.googleapis.com/css";webfont.H.prototype.h=function(){if(!this.m)throw new Error("No fonts to load !");for(var a=this.m.length,b=[],c=0;c<a;c++)b.push(this.m[c].replace(/ /g,"+"));return this.va+"?family="+b.join("%7C")};webfont.G=function(a){this.m=a;this.ja=[];this.la={};this.M=new webfont.g};webfont.G.ua={ultralight:"n2",light:"n3",regular:"i4",bold:"i7",italic:"i4",bolditalic:"i7",ul:"n2",l:"n3",r:"n4",b:"n7",i:"i4",bi:"i7"};webfont.G.prototype.parse=function(){for(var a=this.m.length,b=0;b<a;b++){var c=this.m[b].split(":"),d=c[0],e=null;if(c.length==2){var f=[];c=c[1].split(",");for(var h=c.length,k=0;k<h;k++){var g;g=c[k];if(g.match(/^[\w ]+$/)){var j=webfont.G.ua[g];if(j)g=j;else{j=g.match(/^(\d*)(\w*)$/);g=j[1];j=j[2];g=(g=this.M.expand([j?j:"n",g?g.substr(0,1):"4"].join("")))?this.M.compact(g):null}}else g="";g&&f.push(g)}if(f.length>0)e=f}else e=["n4"];this.ja.push(d);this.la[d]=e}};webfont.A=function(a,b,c){this.a=a;this.c=b;this.k=c};webfont.A.B="google";webfont.A.prototype.Y=function(a,b){a.Ca.match(/iPad|iPod|iPhone/)!=null&&b(false);return b(a.Z)};webfont.A.prototype.load=function(a){var b=new webfont.H(this.k.api),c=this.k.families,d=this.c,e=this.a.getName()=="MSIE"&&this.k.blocking!=true;b.m=c;e?m(d,function(){i(d,"head",o(d,b.h()))}):i(d,"head",o(d,b.h()));c=new webfont.G(c);c.parse();a(c.ja,c.la)};WebFont.K(webfont.A.B,function(a){var b=(new webfont.e(navigator.userAgent)).parse();return new webfont.A(b,new webfont.z(document),a)});webfont.w=function(a,b){this.c=a;this.k=b};webfont.w.B="custom";webfont.w.prototype.load=function(a){for(var b=this.k.urls||[],c=this.k.families||[],d=0,e=b.length;d<e;d++)i(this.c,"head",o(this.c,b[d]));a(c)};webfont.w.prototype.Y=function(a,b){return b(a.Z)};WebFont.K(webfont.w.B,function(a){return new webfont.w(new webfont.z(document),a)});webfont.n=function(a,b,c){this.U=a;this.c=b;this.k=c;this.m=[];this.ea={}};webfont.n.B="typekit";webfont.n.P="__webfonttypekitmodule__";webfont.n.prototype.Y=function(a,b){var c=this.k.id,d=this.k,e=this;if(c){this.U[webfont.n.P]||(this.U[webfont.n.P]={});this.U[webfont.n.P][c]=function(f){f(a,d,function(h,k,g){e.m=k;e.ea=g;b(h)})};i(this.c,"head",this.c.createElement("script",{src:(this.k.api||"http://use.typekit.com")+"/"+c+".js"}))}else b(true)};webfont.n.prototype.load=function(a){a(this.m,this.ea)};WebFont.K(webfont.n.B,function(a){return new webfont.n(window,new webfont.z(document),a)});})(this,document);
/* jQuery anchor handler - 0.5
  http://code.google.com/p/jquery-utils/
  (c) Maxime Haineault <haineault@gmail.com> ~ http://haineault.com ~ MIT License

(function($){
    var hash = window.location.hash;
    var handlers  = [];
    var opt = {};
	$.extend({
		anchorHandler: {
            apply: function() {
                $.map(handlers, function(handler){
                    var match = hash.match(handler.r) && hash.match(handler.r)[0] || false;
                    if (match)  { handler.cb.apply($('a[href*='+match+']').get(0), [handler.r, hash || '']); }
                });
                return $.anchorHandler;
            },
			add: function(regexp, callback, options) {
                var opt  = $.extend({handleClick: true, preserveHash: true}, options);
                if (opt.handleClick) { 
                    $('a[href*=#]').each(function(i, a){
                        if (a.href.match(regexp)) {
                            $(a).bind('click.anchorHandler', function(){
                                if (opt.preserveHash) { window.location.hash = a.hash; }
                                return callback.apply(this, [regexp, a.href]);
                                });
                        }
                    }); 
                }
				handlers.push({r: regexp, cb: callback});
                $($.anchorHandler.apply);
				return $.anchorHandler;
			}
		}
	});
})(jQuery);*/

/***------------------------------------------------------------------------------------------------
	hoverIntent.js ~ jquery.mb.components ~ Licences: MIT, GPL
 ------------------------------------------------------------------------------------------------***/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity: 7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
/***------------------------------------------------------------------------------------------------
	jquery.metadata.js ~ jquery.mb.components ~ Licences: MIT, GPL
 ------------------------------------------------------------------------------------------------***/
(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);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);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;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);

/***------------------------------------------------------------------------------------------------
	bigTarget.js Version 1.0.1 by Leevi Graham - Newism Web Design & Development : http://newism.com.au
	@Notes: Tooltip code from fitted.js - http://www.trovster.com/lab/plugins/fitted/
 ------------------------------------------------------------------------------------------------***/
(function($){$.fn.bigTarget = function(options){debug(this);var opts=$.extend({},$.fn.bigTarget.defaults,options);return this.each(function(){var $a=$(this),href=$a.attr('href'),title=$a.attr('title'),o=$.meta?$.extend({},opts,$a.data()):opts;$a.parents(o.clickZone).hover(function(){$h=$(this);$h.addClass(o.hoverClass);if(typeof o.title!='undefined'&&o.title===true&&title!=''){$h.attr('title',title);}}, function(){$h.removeClass(o.hoverClass);if(typeof o.title != 'undefined' && o.title === true && title != ''){$h.removeAttr('title');}}).click(function(){if(getSelectedText() == ""){/*if($a.is('[rel*=external]')){window.open(href);return false;} else { window.location = href;}*/}});});};function debug($obj){if(window.console&&window.console.log)window.console.log('bigTarget selection count: '+$obj.size());};function getSelectedText(){if(window.getSelection){return window.getSelection().toString();}else if(document.getSelection){return document.getSelection();}else if(document.selection){ return document.selection.createRange().text;}};$.fn.bigTarget.defaults={hoverClass:'hover',clickZone:'li:eq(0)',title:true};})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery LiveFilter v.1.1
------------------------------------------------------------------------------------------------***/
(function(a){a.fn.liveFilter=function(d){var b="#"+a(this).attr("id");if(d=="table"){var c="tr"}else{var c="li"}a("input.filter").keyup(function(){var e=a(this).val();a(b+" "+d+" "+c).hide();if(d=="table"){a(b+" "+d+" tr.header").show()}a(b+" "+d+" "+c+':Contains("'+e+'")').show()});jQuery.expr[":"].Contains=function(f,g,e){return jQuery(f).text().toUpperCase().indexOf(e[3].toUpperCase())>=0}}})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery UI Masking	http://docs.jquery.com/UI/Mask	( Depends: ui.core.js )
	Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about). Dual MIT and GPL licenses.
	Based on the jquery.maskedinput.js plugin by Josh Bush (digitalbush.com).
------------------------------------------------------------------------------------------------***/
(function($) { var pasteEventName = ($.browser.msie ? 'paste' : 'input') + ".mask"; $.widget("ui.mask", { _init: function() { var options = this.options, self = this; $.extend(this, { caret: function(begin, end){ return $.ui.mask.caret(self.element, begin, end); } }); if(!options.mask || !options.mask.length){ return; } if(!options.placeholder || !options.placeholder.length){ options.placeholder = '_'; } this._prepareBuffer(); this._bindEvents(); this._checkVal((this.element.val().length && options.allowPartials));}, destroy: function() { this.element.unbind('.mask').removeData('mask'); }, value: function() { var input = this.element, self = this, res = $.map(self.buffer, function(c, i){ return self.tests[i] ? c : null; }).join(''), r = new RegExp('\\'+this.options.placeholder, 'gi'); return res.replace(r, ''); }, formatted: function(){ var r = new RegExp('\\'+this.options.placeholder, 'gi'), res = this.element.val(); return res.replace(r, ''); }, apply: function(){ this.element.trigger('apply.mask'); }, _setData: function(key, value) { $.widget.prototype._setData.apply(this, arguments); var options = this.options; switch (key) { case 'mask': if(!options.mask || !options.mask.length){ this.element.unbind('.mask'); break; } case 'placeholder': if(!options.placeholder || !options.placeholder.length){ options.placeholder = '_'; } this.element.val(''); this._prepareBuffer(); !this.eventsBound && this._bindEvents(); break; }}, _prepareBuffer: function(){ this._escapeMask(); var self = this, input = this.element, options = this.options, mask = options.mask, defs = $.ui.mask.definitions, tests = [], partialPosition = mask.length, firstNonMaskPos = null, len = mask.length;if(!input.is(':input')) input.val = input.html; $.each(mask.split(""), function(i, c) { if (c == '?') { len--; partialPosition = i; } else if (defs[c]){ tests.push(new RegExp(defs[c])); if(firstNonMaskPos==null) firstNonMaskPos =  tests.length - 1; } else{ tests.push(null); }}); $.extend(this, { buffer: $.map(mask.split(""), function(c, i){ if (c != '?'){ return defs[c] ? options.placeholder : c; }}), tests: tests, firstNonMaskPos: firstNonMaskPos, partialPosition: partialPosition }); this.buffer = $.map(this.buffer, function(c, i){ if(c == "\t"){ return self.maskEscaped[i]; } return c; }); this.options.mask = mask = this.maskEscaped; }, _bindEvents: function(){ var self = this, input = this.element, ignore = false, focusText = input.val(); function keydownEvent(e) { e = e || window.event; var pos = self.caret(), k = e.keyCode, keyCode = $.ui.keyCode; ignore = (k < keyCode.SHIFT || (k > keyCode.SHIFT && k < keyCode.SPACE) || (k > keyCode.SPACE && k < 41)); if ((pos.begin - pos.end) != 0 && (!ignore || k == keyCode.BACKSPACE || k == keyCode.DELETE)) self._clearBuffer(pos.begin, pos.end); if (k == keyCode.BACKSPACE || k == keyCode.DELETE) { self._shiftL(pos.begin + ((k == keyCode.DELETE || (k == keyCode.BACKSPACE && pos.begin!=pos.end))  ? 0 : -1), Math.abs(pos.begin - pos.end)); return false; } else if (k == keyCode.ESCAPE) { input.val(focusText); self.caret(0, self._checkVal()); return false; }}; function keypressEvent(e) { e = e || window.event; var k = e.charCode || e.keyCode || e.which, keyCode = $.ui.keyCode, len = self.options.mask.length; if (ignore) { ignore = false; return (e.keyCode == keyCode.BACKSPACE) ? false : null; } var pos = self.caret(); if (e.ctrlKey || e.altKey || e.metaKey) { return true; } else if ((k >= keyCode.SPACE && k <= 125) || k > 186) { var p = self._seekNext(pos.begin - 1); if (p < len) { var c = String.fromCharCode(k); if (self.tests[p] && self.tests[p].test(c)) { self._shiftR(p); self.buffer[p] = c; self._writeBuffer(); var next = self._seekNext(p); self.caret(next); self.options.completed && next == len && self.options.completed.call(input); }}} return false; }; if (!input.attr("readonly")){ input.bind("focus.mask", function() { focusText = input.val(); var pos = self._checkVal(); self._writeBuffer(); setTimeout(function() { if (pos == self.options.mask.length){self.caret(0, pos);}else{self.caret(pos);}}, 0); }).bind("blur.mask", function() { self._checkVal(); if (input.val() != focusText) { input.change();}}).bind('apply.mask', function(){ focusText = input.val(); var pos = self._checkVal(); self._writeBuffer(); }).bind("keydown.mask", keydownEvent).bind("keypress.mask", keypressEvent).bind(pasteEventName, function() { setTimeout(function() { self.caret(self._checkVal(true)); }, 0);}); this.eventsBound = true; }}, _writeBuffer: function(){ return this.element.val(this.buffer.join('')).val(); }, _clearBuffer: function(start, end){ var len = this.options.mask.length; for (var i = start; i < end && i < len; i++) { if (this.tests[i]){ this.buffer[i] = this.options.placeholder;}}}, _seekNext: function(pos){ var len = this.options.mask.length; while (++pos <= len && !this.tests[pos]); return pos; }, _shiftR: function(pos){ var len = this.options.mask.length; for (var i = pos, c = this.options.placeholder; i < len; i++) { if (this.tests[i]) { var j = this._seekNext(i); var t = this.buffer[i]; this.buffer[i] = c; if (j < len && this.tests[j].test(t)){ c = t; } else{ break; }}}}, _shiftL: function(pos, length){ while (!this.tests[pos] && --pos >= 0); var originalPos = pos, len = this.options.mask.length, placeholder = this.options.placeholder; for(var i = pos; i < len && (i >= 0 || length > 1); i++) { if (this.tests[i]) { this.buffer[i] = placeholder; var j = this._seekNext(i); if (j < len && this.tests[i].test(this.buffer[j])) { this.buffer[pos] = this.buffer[j]; this.buffer[j] = placeholder; pos++; while(!this.tests[pos]) pos++; }}} this._writeBuffer(); this.caret(Math.max(this.firstNonMaskPos, originalPos)); }, _checkVal: function(allow){ var input = this.element, test = input.val(), len = this.options.mask.length, lastMatch = -1; for (var i = 0, pos = 0; i < len; i++) { if (this.tests[i]) { this.buffer[i] = this.options.placeholder; while (pos++ < test.length) { var c = test.charAt(pos - 1); if (this.tests[i].test(c)) { this.buffer[i] = c; lastMatch = i; break; }} if (pos > test.length) break; } else if (this.buffer[i] == test[pos] && i != this.partialPosition) { pos++; lastMatch = i; }} if (!allow && lastMatch + 1 < this.partialPosition) { if(!this.options.allowPartials || !this.value().length){ input.val(""); this._clearBuffer(0, len); } else if(!input.is(':input')) this._writeBuffer(); } else if (allow || lastMatch + 1 >= this.partialPosition) { this._writeBuffer(); if (!allow) input.val(input.val().substring(0, lastMatch + 1)); } return (this.partialPosition ? i : this.firstNonMaskPos); }, _escapeMask: function(){ var mask = this.options.mask, literals = [], replacements = []; for(var i = 0; i < mask.length; i++){ var c, temp = mask[i] || mask.charAt(i); if(temp != "\\" || mask[i-1] == "\\"){ if(mask[i-1] == "\\"){ c = "\t"; replacements[literals.length] = temp; } else{ c = temp; } literals[literals.length] = c; }} this.options.mask = literals.join(''); for(var i = 0; i < literals.length; i++){ if(replacements[i] !== undefined){ literals[i] = replacements[i]; }} this.maskEscaped = literals.join(''); }}); $.extend($.ui.mask, { version: "@VERSION", getter: "value formatted", defaults: { mask: '', placeholder: '_', completed: null, allowPartials: false }, definitions: { '#': "[\\d]", 'a': "[A-Za-z]", '*': "[A-Za-z0-9]" }, caret: function(element, begin, end) { var input = element[0]; if (typeof begin == 'number') { end = (typeof end == 'number') ? end : begin; if (input.setSelectionRange) { input.focus(); input.setSelectionRange(begin, end); } else if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', begin); range.select(); } return element; } else { if (input.setSelectionRange) { begin = input.selectionStart; end = input.selectionEnd; } else if (document.selection && document.selection.createRange) { var range = document.selection.createRange(); begin = 0 - range.duplicate().moveStart('character', -100000);end=begin+range.text.length;}return{begin:begin,end:end};}}});})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery UI Selectmenu	http://docs.jquery.com/UI	( Depends: ui.core.js )
	Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about). Dual MIT and GPL licenses.
------------------------------------------------------------------------------------------------***/
(function($){ $.widget("ui.selectmenu", { _init: function(){ var self = this, o = this.options; var num = Math.round(Math.random() * 1000); this.ids = [this.element.attr('id') + '_' + 'button' + '_' + num, this.element.attr('id') + '_' + 'menu' + '_' + num]; this._safemouseup = true; this.newelement = $('<a class="'+ this.widgetBaseClass +' ui-widget ui-state-default ui-corner-all" id="'+this.ids[0]+'" role="button" href="#" aria-haspopup="true" aria-owns="'+this.ids[1]+'" aria-expanded="false"></a>').insertAfter(this.element); var tabindex = this.element.attr('tabindex') || '0'; this.newelement.attr('tabindex', tabindex); this.newelement.data('selectelement', this.element); this.selectmenuIcon = $('<span class="'+ this.widgetBaseClass +'-icon ui-icon"></span>').prependTo(this.newelement).addClass( (o.style == "popup")? 'ui-icon-triangle-2-n-s' : 'ui-icon-triangle-1-s' ); $('label[for='+this.element.attr('id')+']').attr('for', this.ids[0]).bind('click', function(){ self.newelement.focus(); return false; }); this.newelement.bind('mousedown', function(event){ self._toggle(event); if(o.style == "popup"){ self._safemouseup = false; setTimeout(function(){self._safemouseup = true;}, 300); } return false; }).bind('click',function(){ return false; }).keydown(function(event){ var ret = true; switch (event.keyCode) { case $.ui.keyCode.ENTER: ret = true; break; case $.ui.keyCode.SPACE: ret = false; self._toggle(event); break; case $.ui.keyCode.UP: case $.ui.keyCode.LEFT: ret = false; self._moveSelection(-1); break; case $.ui.keyCode.DOWN: case $.ui.keyCode.RIGHT: ret = false; self._moveSelection(1); break; case $.ui.keyCode.TAB: ret = true; break; default: ret = false; self._typeAhead(event.keyCode, 'mouseup'); break;	} return ret; }).bind('mouseover focus', function(){ $(this).addClass(self.widgetBaseClass+'-focus ui-state-hover'); }).bind('mouseout blur', function(){ $(this).removeClass(self.widgetBaseClass+'-focus ui-state-hover'); }); $(document).mousedown(function(event){ self.close(event); }); this.element.click(function(){ this._refreshValue(); }).focus(function(){ this.newelement.focus(); }); var cornerClass = (o.style == "dropdown")? " ui-corner-bottom" : " ui-corner-all"; this.list = $('<ul class="' + self.widgetBaseClass + '-menu ui-widget ui-widget-content'+cornerClass+'" aria-hidden="true" role="listbox" aria-multiselectable="false" aria-labelledby="'+this.ids[0]+'" id="'+this.ids[1]+'"></ul>').appendTo('body'); var selectOptionData = []; this.element.find('option').each(function(){ selectOptionData.push({ value: $(this).attr('value'), text: self._formatText(jQuery(this).text()), selected: $(this).attr('selected'), classes: $(this).attr('class'), parentOptGroup: $(this).parent('optgroup').attr('label') }); }); var activeClass = (self.options.style == "popup") ? " ui-state-active" : ""; for(var i in selectOptionData){ var thisLi = $('<li><a href="#" tabindex="-1" role="option" aria-selected="false">'+ selectOptionData[i].text +'</a></li>').data('index',i).addClass(selectOptionData[i].classes).data('optionClasses', selectOptionData[i].classes|| '').mouseup(function(event){ if(self._safemouseup){ var changed = $(this).data('index') != self._selectedIndex(); self.value($(this).data('index')); self.select(event); if(changed){ self.change(event); } self.close(event,true); } return false; }).click(function(){ return false; }).bind('mouseover focus', function(){ self._selectedOptionLi().addClass(activeClass); self._focusedOptionLi().removeClass(self.widgetBaseClass+'-item-focus ui-state-hover'); $(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover'); }).bind('mouseout blur', function(){ if($(this).is( self._selectedOptionLi() )){ $(this).addClass(activeClass); } $(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover'); }); if(selectOptionData[i].parentOptGroup){ var optGroupName = self.widgetBaseClass + '-group-' + selectOptionData[i].parentOptGroup; if(this.list.find('li.' + optGroupName).size()){ this.list.find('li.' + optGroupName + ':last ul').append(thisLi); } else{ $('<li class="'+self.widgetBaseClass+'-group '+optGroupName+'"><span class="'+self.widgetBaseClass+'-group-label">'+selectOptionData[i].parentOptGroup+'</span><ul></ul></li>').appendTo(this.list).find('ul').append(thisLi); } } else{ thisLi.appendTo(this.list); } this.list.bind('mousedown mouseup', function(){return false;}); if(o.icons){ for(var j in o.icons){ if(thisLi.is(o.icons[j].find)){ thisLi.data('optionClasses', selectOptionData[i].classes + ' ' + self.widgetBaseClass + '-hasIcon').addClass(self.widgetBaseClass + '-hasIcon'); var iconClass = o.icons[j].icon || ""; thisLi.find('a:eq(0)').prepend('<span class="'+self.widgetBaseClass+'-item-icon ui-icon '+iconClass + '"></span>'); }}}} this.list.find('li:last').addClass("ui-corner-bottom"); if(o.style == 'popup'){ this.list.find('li:first').addClass("ui-corner-top"); } if(o.transferClasses){ var transferClasses = this.element.attr('class') || ''; this.newelement.add(this.list).addClass(transferClasses); } var selectWidth = this.element.width(); this.newelement.width( (o.width) ? o.width : selectWidth); if(o.style == 'dropdown'){ this.list.width( (o.menuWidth) ? o.menuWidth : ((o.width) ? o.width : selectWidth)); } else { this.list.width( (o.menuWidth) ? o.menuWidth : ((o.width) ? o.width - o.handleWidth : selectWidth - o.handleWidth)); } if(o.maxHeight && o.maxHeight < this.list.height()){ this.list.height(o.maxHeight); } this._optionLis = this.list.find('li:not(.'+ self.widgetBaseClass +'-group)'); this.list.keydown(function(event){ var ret = true; switch (event.keyCode) { case $.ui.keyCode.UP: case $.ui.keyCode.LEFT: ret = false; self._moveFocus(-1); break; case $.ui.keyCode.DOWN: case $.ui.keyCode.RIGHT: ret = false; self._moveFocus(1); break; case $.ui.keyCode.HOME: ret = false; self._moveFocus(':first'); break; case $.ui.keyCode.PAGE_UP: ret = false; self._scrollPage('up'); break; case $.ui.keyCode.PAGE_DOWN: ret = false; self._scrollPage('down'); break; case $.ui.keyCode.END: ret = false; self._moveFocus(':last'); break; case $.ui.keyCode.ENTER: case $.ui.keyCode.SPACE: ret = false; self.close(event,true); $(event.target).parents('li:eq(0)').trigger('mouseup'); break; case $.ui.keyCode.TAB: ret = true; self.close(event); break; case $.ui.keyCode.ESCAPE: ret = false; self.close(event,true); break; default: ret = false; self._typeAhead(event.keyCode,'focus'); break; } return ret; }); if(o.style == 'dropdown'){ this.newelement.addClass(self.widgetBaseClass+"-dropdown"); this.list.addClass(self.widgetBaseClass+"-menu-dropdown"); } else { this.newelement.addClass(self.widgetBaseClass+"-popup"); this.list.addClass(self.widgetBaseClass+"-menu-popup");	} this.newelement.prepend('<span class="'+self.widgetBaseClass+'-status">'+ selectOptionData[this._selectedIndex()].text +'</span>'); this.element.hide(); if(this.element.attr('disabled') == true){ this.disable(); } this.value(this._selectedIndex()); }, destroy: function() { this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled').removeAttr('aria-disabled'); $('label[for='+this.newelement.attr('id')+']').attr('for',this.element.attr('id')).unbind('click'); this.newelement.remove(); this.list.remove(); this.element.show(); }, _typeAhead: function(code, eventType){ var self = this; if(!self._prevChar){ self._prevChar = ['',0]; } var C = String.fromCharCode(code); c = C.toLowerCase(); var focusFound = false; function focusOpt(elem, ind){ focusFound = true; $(elem).trigger(eventType); self._prevChar[1] = ind; }; this.list.find('li a').each(function(i){ if(!focusFound){ var thisText = $(this).text(); if( thisText.indexOf(C) == 0 || thisText.indexOf(c) == 0){ if(self._prevChar[0] == C){ if(self._prevChar[1] < i){ focusOpt(this,i); } } else{ focusOpt(this,i);}}}}); this._prevChar[0] = C; }, _uiHash: function(){ return { value: this.value() }; }, open: function(event){ var self = this; this._refreshPosition(); this._closeOthers(event); this.newelement.attr('aria-expanded', true).addClass('ui-state-active'); this.list.appendTo('body').addClass(self.widgetBaseClass + '-open').attr('aria-hidden', false).find('li:not(.'+ self.widgetBaseClass +'-group):eq('+ this._selectedIndex() +') a').focus();	if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top'); }	this._refreshPosition(); this._trigger("open", event, this._uiHash()); }, close: function(event, retainFocus){ if(this.newelement.is('.ui-state-active')){ this.newelement.attr('aria-expanded', false).removeClass('ui-state-active'); this.list.attr('aria-hidden', true).removeClass(this.widgetBaseClass+'-open'); if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all'); } if(retainFocus){this.newelement.focus();} this._trigger("close", event, this._uiHash()); }}, change: function(event) { this.element.trigger('change'); this._trigger("change", event, this._uiHash()); }, select: function(event) { this._trigger("select", event, this._uiHash()); }, _closeOthers: function(event){ $('.'+ this.widgetBaseClass +'.ui-state-active').not(this.newelement).each(function(){ $(this).data('selectelement').selectmenu('close',event); }); $('.'+ this.widgetBaseClass +'.ui-state-hover').trigger('mouseout'); }, _toggle: function(event,retainFocus){ if(this.list.is('.'+ this.widgetBaseClass +'-open')){ this.close(event,retainFocus); } else { this.open(event); } }, _formatText: function(text){ return this.options.format ? this.options.format(text) : text; }, _selectedIndex: function(){ return this.element[0].selectedIndex; }, _selectedOptionLi: function(){ return this._optionLis.eq(this._selectedIndex()); }, _focusedOptionLi: function(){ return this.list.find('.'+ this.widgetBaseClass +'-item-focus'); }, _moveSelection: function(amt){ var currIndex = parseInt(this._selectedOptionLi().data('index'), 10); var newIndex = currIndex + amt; return this._optionLis.eq(newIndex).trigger('mouseup'); }, _moveFocus: function(amt){ if(!isNaN(amt)){ var currIndex = parseInt(this._focusedOptionLi().data('index'), 10); var newIndex = currIndex + amt; } else { var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10); } if(newIndex < 0){ newIndex = 0; } if(newIndex > this._optionLis.size()-1){ newIndex =  this._optionLis.size()-1; } this._focusedOptionLi().find('a:eq(0)').blur(); this._optionLis.eq(newIndex).find('a:eq(0)').focus(); }, _scrollPage: function(direction){ var numPerPage = Math.floor(this.list.outerHeight() / this.list.find('li:first').outerHeight()); numPerPage = (direction == 'up') ? -numPerPage : numPerPage; this._moveFocus(numPerPage); }, setData: function(key, value) { this.options[key] = value; if (key == 'disabled') { this.element.add(this.newelement).add(this.list) [value ? 'addClass' : 'removeClass']( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled').attr("aria-disabled", value); }}, value: function(newValue) { if (arguments.length) { this.element[0].selectedIndex = newValue; this._refreshValue(); this._refreshPosition(); } return this.element[0].selectedIndex; }, _refreshValue: function() { var activeClass = (this.options.style == "popup") ? " ui-state-active" : ""; this.list.find('.'+ this.widgetBaseClass +'-item-selected').removeClass(this.widgetBaseClass + "-item-selected" + activeClass).find('a').attr('aria-selected', 'false'); this._selectedOptionLi().addClass(this.widgetBaseClass + "-item-selected"+activeClass).find('a').attr('aria-selected', 'true'); var currentOptionClasses = this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : ""; var newOptionClasses = this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : ""; this.newelement.removeClass(currentOptionClasses).data('optionClasses', newOptionClasses).addClass( newOptionClasses ).find('.'+this.widgetBaseClass+'-status').html(this._selectedOptionLi().find('a:eq(0)').html()); }, _refreshPosition: function(){ this.list.css('left', this.newelement.offset().left); var menuTop = this.newelement.offset().top; var scrolledAmt = this.list[0].scrollTop; this.list.find('li:lt('+this._selectedIndex()+')').each(function(){ scrolledAmt -= $(this).outerHeight();}); if(this.newelement.is('.'+this.widgetBaseClass+'-popup')){ menuTop+=scrolledAmt; this.list.css('top', menuTop); } else { menuTop += this.newelement.height(); this.list.css('top', menuTop); }}}); $.extend($.ui.selectmenu,{getter:"value", version:"@VERSION",eventPrefix: "selectmenu",defaults:{transferClasses:true,style:'popup',width:null,menuWidth:null,handleWidth:26,maxHeight:null,icons:null,format:null}});})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery UI Autocomplete/Combobox	http://docs.jquery.com/UI	( Depends: ui.core.js )
	Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about). Dual MIT and GPL licenses.
------------------------------------------------------------------------------------------------***/
(function($){
		$.widget("ui.combobox",{
			_create:function(){
				var self = this;
				var select = this.element.hide(),
					selected = select.children( ":selected" ),
					value = selected.val() ? selected.text() : "";
				var input = $( "<input>" )
					.insertAfter( select )
					.val( value )
					.autocomplete({
						delay: 0,
						minLength: 0,
						source: function( request, response ) {
							var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
							response( select.children( "option" ).map(function() {
								var text = $( this ).text();
								if ( this.value && ( !request.term || matcher.test(text) ) )
									return {
										label: text.replace(
											new RegExp(
												"(?![^&;]+;)(?!<[^<>]*)(" +
												$.ui.autocomplete.escapeRegex(request.term) +
												")(?![^<>]*>)(?![^&;]+;)", "gi"
											), "<strong>$1</strong>" ),
										value: text,
										option: this
									};
							}) );
						},
						select: function( event, ui ) {
							ui.item.option.selected = true;
							//select.val( ui.item.option.value );
							self._trigger( "selected", event, {
								item: ui.item.option
							});
						},
						change: function( event, ui ) {
							if ( !ui.item ) {
								var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
									valid = false;
								select.children( "option" ).each(function() {
									if ( this.value.match( matcher ) ) {
										this.selected = valid = true;
										return false;
									}
								});
								if ( !valid ) {
									// remove invalid value, as it didn't match anything
									$( this ).val( "" );
									select.val( "" );
									return false;
								}
							}
						}
					})
					.addClass( "ui-widget ui-widget-content ui-corner-left" );
				input.data( "autocomplete" )._renderItem = function( ul, item ) {
					return $( "<li></li>" )
						.data( "item.autocomplete", item )
						.append( "<a>" + item.label + "</a>" )
						.appendTo( ul );
				};
				$( "<button>&nbsp;</button>" )
					.attr( "tabIndex", -1 )
					.attr( "title", "Show All Items" )
					.insertAfter( input )
					.button({
						icons: { primary: "ui-icon-triangle-1-s" },
						text: false
					})
					.removeClass( "ui-corner-all" )
					.addClass( "ui-corner-right ui-button-icon left" )
					.click(function(e) {
						// close if already visible
						if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
							input.autocomplete( "close" );
							return;
						}
						e.preventDefault();
						// pass empty string as value to search for, displaying all results
						input.autocomplete( "search", "" );
						input.focus();
					});
			}
		});
	})(jQuery);
/*
 * jQuery UI Multiselect
 *
 * Authors:
 *  Michael Aufreiter (quasipartikel.at)
 *  Yanick Rochon (yanick.rochon[at]gmail[dot]com)
 * 
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://www.quasipartikel.at/multiselect/
 *
 * 
 * Depends:
 *	ui.core.js
 *	ui.sortable.js
 *
 * Optional:
 * localization (http://plugins.jquery.com/project/localisation)
 * scrollTo (http://plugins.jquery.com/project/ScrollTo)
 * 
 * Todo:
 *  Make batch actions faster
 *  Implement dynamic insertion through remote calls
 */


(function($) {

$.widget("ui.multiselect", {
  options: {
		sortable: true,
		searchable: true,
		animated: 'fast',
		show: 'slideDown',
		hide: 'slideUp',
		dividerLocation: 0.6,
		nodeComparator: function(node1,node2) {
			var text1 = node1.text(),
			    text2 = node2.text();
			return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
		}
	},
	_create: function() {
		this.element.hide();
		this.id = this.element.attr("id");
		this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget ui-widget-content ui-corner-all"></div>').insertAfter(this.element);
		this.count = 0; // number of currently selected options
		this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
		this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
		this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix uc"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
		this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all uc"/><a href="#" class="add-all uc">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
		this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
		this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
		
		var that = this;

		// set dimensions
		this.container.width(this.element.width()+1);
		this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
		this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));

		// fix list height to match <option> depending on their individual header's heights
		this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
		this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
		
		if ( !this.options.animated ) {
			this.options.show = 'show';
			this.options.hide = 'hide';
		}
		
		// init lists
		this._populateLists(this.element.find('option'));
		
		// make selection sortable
		if (this.options.sortable) {
			this.selectedList.sortable({
				placeholder: 'ui-state-highlight',
				axis: 'y',
				update: function(event, ui) {
					// apply the new sort order to the original selectbox
					that.selectedList.find('li').each(function() {
						if ($(this).data('optionLink'))
							$(this).data('optionLink').remove().appendTo(that.element);
					});
				},
				receive: function(event, ui) {
					ui.item.data('optionLink').attr('selected', true);
					// increment count
					that.count += 1;
					that._updateCount();
					// workaround, because there's no way to reference 
					// the new element, see http://dev.jqueryui.com/ticket/4303
					that.selectedList.children('.ui-draggable').each(function() {
						$(this).removeClass('ui-draggable');
						$(this).data('optionLink', ui.item.data('optionLink'));
						$(this).data('idx', ui.item.data('idx'));
						that._applyItemState($(this), true);
					});
			
					// workaround according to http://dev.jqueryui.com/ticket/4088
					setTimeout(function() { ui.item.remove(); }, 1);
				}
			});
		}
		
		// set up livesearch
		if (this.options.searchable) {
			this._registerSearchEvents(this.availableContainer.find('input.search'));
		} else {
			$('.search').hide();
		}
		
		// batch actions
		this.container.find(".remove-all").click(function() {
			that._populateLists(that.element.find('option').removeAttr('selected'));
			return false;
		});
		
		this.container.find(".add-all").click(function() {
			that._populateLists(that.element.find('option').attr('selected', 'selected'));
			return false;
		});
	},
	destroy: function() {
		this.element.show();
		this.container.remove();

		$.Widget.prototype.destroy.apply(this, arguments);
	},
	_populateLists: function(options) {
		this.selectedList.children('.ui-element').remove();
		this.availableList.children('.ui-element').remove();
		this.count = 0;

		var that = this;
		var items = $(options.map(function(i) {
	      var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();

			if (this.selected) that.count += 1;
			that._applyItemState(item, this.selected);
			item.data('idx', i);
			return item[0];
    }));
		
		// update count
		this._updateCount();
  },
	_updateCount: function() {
		this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
	},
	_getOptionNode: function(option) {
		option = $(option);
		var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
		node.data('optionLink', option);
		return node;
	},
	// clones an item with associated data
	// didn't find a smarter away around this
	_cloneWithData: function(clonee) {
		var clone = clonee.clone();
		clone.data('optionLink', clonee.data('optionLink'));
		clone.data('idx', clonee.data('idx'));
		return clone;
	},
	_setSelected: function(item, selected) {
		item.data('optionLink').attr('selected', selected);

		if (selected) {
			var selectedItem = this._cloneWithData(item);
			item[this.options.hide](this.options.animated, function() { $(this).remove(); });
			selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
			
			this._applyItemState(selectedItem, true);
			return selectedItem;
		} else {
			
			// look for successor based on initial option index
			var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
			var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));

			// TODO: test needed for dynamic list populating
			if ( direction ) {
				while (i>=0 && i<items.length) {
					direction > 0 ? i++ : i--;
					if ( direction != comparator(item, $(items[i])) ) {
						// going up, go back one item down, otherwise leave as is
						succ = items[direction > 0 ? i : i+1];
						break;
					}
				}
			} else {
				succ = items[i];
			}
			
			var availableItem = this._cloneWithData(item);
			succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
			item[this.options.hide](this.options.animated, function() { $(this).remove(); });
			availableItem.hide()[this.options.show](this.options.animated);
			
			this._applyItemState(availableItem, false);
			return availableItem;
		}
	},
	_applyItemState: function(item, selected) {
		if (selected) {
			if (this.options.sortable)
				item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
			else
				item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
			item.find('a.action span').addClass('ui-icon-circle-minus').removeClass('ui-icon-circle-plus');
			this._registerRemoveEvents(item.find('a.action'));
			
		} else {
			item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
			item.find('a.action span').addClass('ui-icon-circle-plus').removeClass('ui-icon-circle-minus');
			this._registerAddEvents(item.find('a.action'));
		}
		
		this._registerHoverEvents(item);
	},
	// taken from John Resig's liveUpdate script
	_filter: function(list) {
		var input = $(this);
		var rows = list.children('li'),
			cache = rows.map(function(){
				return $(this).text().toLowerCase();
			});
		
		var term = $.trim(input.val().toLowerCase()), scores = [];
		
		if (!term) {
			rows.show();
		} else {
			rows.hide();

			cache.each(function(i) {
				if (this.indexOf(term)>-1) { scores.push(i); }
			});

			$.each(scores, function() {
				$(rows[this]).show();
			});
		}
	},
	_registerHoverEvents: function(elements) {
		elements.removeClass('ui-state-hover');
		elements.mouseover(function() {
			$(this).addClass('ui-state-hover');
		});
		elements.mouseout(function() {
			$(this).removeClass('ui-state-hover');
		});
	},
	_registerAddEvents: function(elements) {
		var that = this;
		elements.click(function() {
			var item = that._setSelected($(this).parent(), true);
			that.count += 1;
			that._updateCount();
			return false;
		});
		
		// make draggable
		if (this.options.sortable) {
  		elements.each(function() {
  			$(this).parent().draggable({
  	      connectToSortable: that.selectedList,
  				helper: function() {
  					var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
  					selectedItem.width($(this).width());
  					return selectedItem;
  				},
  				appendTo: that.container,
  				containment: that.container,
  				revert: 'invalid'
  	    });
  		});		  
		}
	},
	_registerRemoveEvents: function(elements) {
		var that = this;
		elements.click(function() {
			that._setSelected($(this).parent(), false);
			that.count -= 1;
			that._updateCount();
			return false;
		});
 	},
	_registerSearchEvents: function(input) {
		var that = this;
		input.focus(function() {
			$(this).addClass('ui-state-active');
		})
		.blur(function() {
			$(this).removeClass('ui-state-active');
		})
		.keypress(function(e) {
			if (e.keyCode == 13)
				return false;
		})
		.keyup(function() {
			that._filter.apply(this, [that.availableList]);
		});
	}
});	
$.extend($.ui.multiselect, {
	locale: {
		addAll:'Add all',
		removeAll:'Remove all',
		itemsCount:'items selected'
	}
});
})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery Uniform
------------------------------------------------------------------------------------------------***/
(function(a){a.uniform={options:{selectClass:"selector",radioClass:"radio",checkboxClass:"checker",fileClass:"uploader",filenameClass:"filename",fileBtnClass:"action",fileDefaultText:"No file selected",fileBtnText:"Choose File",checkedClass:"checked",focusClass:"focus",disabledClass:"disabled",activeClass:"active",hoverClass:"hover",useID:true,idPrefix:"uniform",resetSelector:false},elements:[]};if(a.browser.msie&&a.browser.version<7){a.support.selectOpacity=false}else{a.support.selectOpacity=true}a.fn.uniform=function(c){c=a.extend(a.uniform.options,c);var e=this;if(c.resetSelector!=false){a(c.resetSelector).mouseup(function(){function i(){a.uniform.update(e)}setTimeout(i,10)})}function b(j){var k=a("<div />"),i=a("<span />");k.addClass(c.selectClass);if(c.useID){k.attr("id",c.idPrefix+"-"+j.attr("id"))}i.html(j.find(":selected").text());j.css("opacity",0);j.wrap(k);j.before(i);k=j.parent("div");i=j.siblings("span");j.change(function(){i.text(j.find(":selected").text());k.removeClass(c.activeClass)}).focus(function(){k.addClass(c.focusClass)}).blur(function(){k.removeClass(c.focusClass);k.removeClass(c.activeClass)}).mousedown(function(){k.addClass(c.activeClass)}).mouseup(function(){k.removeClass(c.activeClass)}).click(function(){k.removeClass(c.activeClass)}).hover(function(){k.addClass(c.hoverClass)},function(){k.removeClass(c.hoverClass)}).keyup(function(){i.text(j.find(":selected").text())});if(a(j).attr("disabled")){k.addClass(c.disabledClass)}a.uniform.noSelect(i);h(j)}function d(j){var k=a("<div />"),i=a("<span />");k.addClass(c.checkboxClass);if(c.useID){k.attr("id",c.idPrefix+"-"+j.attr("id"))}a(j).wrap(k);a(j).wrap(i);i=j.parent();k=i.parent();a(j).css("opacity",0).focus(function(){k.addClass(c.focusClass)}).blur(function(){k.removeClass(c.focusClass)}).click(function(){if(!a(j).attr("checked")){i.removeClass(c.checkedClass)}else{i.addClass(c.checkedClass)}}).mousedown(function(){k.addClass(c.activeClass)}).mouseup(function(){k.removeClass(c.activeClass)}).hover(function(){k.addClass(c.hoverClass)},function(){k.removeClass(c.hoverClass)});if(a(j).attr("checked")){i.addClass(c.checkedClass)}if(a(j).attr("disabled")){k.addClass(c.disabledClass)}h(j)}function f(j){var k=a("<div />"),i=a("<span />");k.addClass(c.radioClass);if(c.useID){k.attr("id",c.idPrefix+"-"+j.attr("id"))}a(j).wrap(k);a(j).wrap(i);i=j.parent();k=i.parent();a(j).css("opacity",0).focus(function(){k.addClass(c.focusClass)}).blur(function(){k.removeClass(c.focusClass)}).click(function(){if(!a(j).attr("checked")){i.removeClass(c.checkedClass)}else{a("."+c.radioClass+" span."+c.checkedClass+":has([name='"+a(j).attr("name")+"'])").removeClass(c.checkedClass);i.addClass(c.checkedClass)}}).mousedown(function(){if(!a(j).is(":disabled")){k.addClass(c.activeClass)}}).mouseup(function(){k.removeClass(c.activeClass)}).hover(function(){k.addClass(c.hoverClass)},function(){k.removeClass(c.hoverClass)});if(a(j).attr("checked")){i.addClass(c.checkedClass)}if(a(j).attr("disabled")){k.addClass(c.disabledClass)}h(j)}function g(l){$el=a(l);var m=a("<div />"),k=a("<span>"+c.fileDefaultText+"</span>"),j=a("<span>"+c.fileBtnText+"</span>");m.addClass(c.fileClass);k.addClass(c.filenameClass);j.addClass(c.fileBtnClass);if(c.useID){m.attr("id",c.idPrefix+"-"+$el.attr("id"))}$el.wrap(m);$el.after(j);$el.after(k);m=$el.closest("div");k=$el.siblings("."+c.filenameClass);j=$el.siblings("."+c.fileBtnClass);if(!$el.attr("size")){var i=m.width();$el.attr("size",i/10)}$el.css("opacity",0).focus(function(){m.addClass(c.focusClass)}).blur(function(){m.removeClass(c.focusClass)}).change(function(){var n=a(this).val();n=n.split(/[\/\\]+/);n=n[(n.length-1)];k.text(n)}).mousedown(function(){if(!a(l).is(":disabled")){m.addClass(c.activeClass)}}).mouseup(function(){m.removeClass(c.activeClass)}).hover(function(){m.addClass(c.hoverClass)},function(){m.removeClass(c.hoverClass)});if($el.attr("disabled")){m.addClass(c.disabledClass)}a.uniform.noSelect(k);a.uniform.noSelect(j);h(l)}function h(i){i=a(i).get();if(i.length>1){a.each(i,function(j,k){a.uniform.elements.push(k)})}else{a.uniform.elements.push(i)}}a.uniform.noSelect=function(i){function j(){return false}a(i).each(function(){this.onselectstart=this.ondragstart=j;a(this).mousedown(j).css({MozUserSelect:"none"})})};a.uniform.update=function(i){if(i==undefined){i=a(a.uniform.elements)}i=a(i);i.each(function(){$e=a(this);if($e.is("select")){spanTag=$e.siblings("span");divTag=$e.parent("div");divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);spanTag.html($e.find(":selected").text());if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}else{if($e.is(":checkbox")){spanTag=$e.closest("span");divTag=$e.closest("div");divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);spanTag.removeClass(c.checkedClass);if($e.is(":checked")){spanTag.addClass(c.checkedClass)}if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}else{if($e.is(":radio")){spanTag=$e.closest("span");divTag=$e.closest("div");divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);spanTag.removeClass(c.checkedClass);if($e.is(":checked")){spanTag.addClass(c.checkedClass)}if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}else{if($e.is(":file")){divTag=$e.parent("div");filenameTag=$e.siblings(c.filenameClass);btnTag=$e.siblings(c.fileBtnClass);divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);filenameTag.text($e.val());if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}}}}})};return this.each(function(){if(a.support.selectOpacity){var i=a(this);if(i.is("select")){if(i.attr("multiple")!=true){b(i)}}else{if(i.is(":checkbox")){d(i)}else{if(i.is(":radio")){f(i)}else{if(i.is(":file")){g(i)}}}}}})}})(jQuery);

/***------------------------------------------------------------------------------------------------
	dPassword v0.1 - jQuery delayed password masking (iPhone style), MIT License. Copyright (c) 2009 DECAF°, Stefan Ullrich (http://decaf.de)
------------------------------------------------------------------------------------------------***/
(function($){$.fn.dPassword=function(options){ var defaults={interval:200,duration:3000,replacement:'%u25CF',prefix:'password_',debug:false};var opts=$.extend(defaults,options);var checker=new Array();var timer=new Array();$(this).each(function(){if(opts.debug)console.log('init ['+$(this).attr('id')+']');var name=$(this).attr('name');var id=$(this).attr('id');var cssclass=$(this).attr('class');var style=$(this).attr('style');var size=$(this).attr('size');var maxlength=$(this).attr('maxlength');var disabled=$(this).attr('disabled');var tabindex=$(this).attr('tabindex');var accesskey=$(this).attr('accesskey');var value=$(this).attr('value');checker.push(id);timer.push(id);$(this).hide();if(opts.debug){$(this).after('<span id="debug_'+opts.prefix+name+'" style="color: #f00;"></span>');}$(this).after(' <input name="'+(opts.prefix+name)+'" '+'id="'+(opts.prefix+id)+'" '+'type="text" '+'value="'+value+'" '+(cssclass!=''?'class="'+cssclass+'"':'')+(style!=''?'style="'+style+'"':'')+(size!=''?'size="'+size+'"':'')+(maxlength!=-1?'maxlength="'+maxlength+'"':'')+(disabled!=''?'disabled="'+disabled+'"':'')+(tabindex!=''?'tabindex="'+tabindex+'"':'')+(accesskey!=undefined?'accesskey="'+accesskey+'"':'')+'autocomplete="off" />');$('label[for='+id+']').attr('for',opts.prefix+id);$(this).attr('tabindex','');$(this).attr('accesskey','');$('#'+opts.prefix+id).bind('focus',function(event){if(opts.debug)console.log('event: focus ['+getId($(this).attr('id'))+']');clearTimeout(checker[getId($(this).attr('id'))]);checker[getId($(this).attr('id'))]=setTimeout("check('"+getId($(this).attr('id'))+"', '')",opts.interval);});$('#'+opts.prefix+id).bind('blur',function(event){if(opts.debug)console.log('event: blur ['+getId($(this).attr('id'))+']');clearTimeout(checker[getId($(this).attr('id'))]);});setTimeout("check('"+id+"', '', true);",opts.interval);});getId=function(id){var pattern=opts.prefix+'(.*)';var regex=new RegExp(pattern);regex.exec(id);id=RegExp.$1;return id;};setPassword=function(id,str){if(opts.debug)console.log('setPassword: ['+id+']');var tmp='';for(i=0;i<str.length;i++){if(str.charAt(i)==unescape(opts.replacement)){tmp=tmp+$('#'+id).val().charAt(i);}else{tmp=tmp+str.charAt(i);}}$('#'+id).val(tmp);};check=function(id,oldValue,initialCall){if(opts.debug)console.log('check: ['+id+']');var bullets=$('#'+opts.prefix+id).val();if(oldValue!=bullets){setPassword(id,bullets);if(bullets.length>1){var tmp='';for(i=0;i<bullets.length-1;i++){tmp=tmp+unescape(opts.replacement);}tmp=tmp+bullets.charAt(bullets.length-1);$('#'+opts.prefix+id).val(tmp);}else{}clearTimeout(timer[id]);timer[id]=setTimeout("convertLastChar('"+id+"')",opts.duration);}if(opts.debug){$('#debug_'+opts.prefix+id).text($('#'+id).val());}if(!initialCall){checker[id]=setTimeout("check('"+id+"', '"+$('#'+opts.prefix+id).val()+"', false)",opts.interval);}};convertLastChar=function(id){if($('#'+opts.prefix+id).val()!=''){var tmp='';for(i=0;i<$('#'+opts.prefix+id).val().length;i++){tmp=tmp+unescape(opts.replacement);}$('#'+opts.prefix+id).val(tmp);}}};})(jQuery);

/***------------------------------------------------------------------------------------------------
	CSS BACKGROUND ANIMATION v. 1.1 by Alexander Farkas
------------------------------------------------------------------------------------------------***/
(function($){if(!document.defaultView||!document.defaultView.getComputedStyle){var oldCurCSS=jQuery.curCSS;jQuery.curCSS=function(elem,name,force){if(name!=='backgroundPosition'||!elem.currentStyle||elem.currentStyle[name])return oldCurCSS.apply(this,arguments);var style=elem.style;if(!force&&style&&style[name])return style[name];return oldCurCSS(elem, 'backgroundPositionX',force)+' '+oldCurCSS(elem,'backgroundPositionY',force);};}})(jQuery);(function($){function toArray(strg){strg=strg.replace(/left|top/g,'0px');strg=strg.replace(/right|bottom/g,'100%');strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return [parseFloat(res[1],10), res[2],parseFloat(res[3],10),res[4]];}$.fx.step.backgroundPosition=function(fx){if(!fx.bgPosReady){var start=$.curCSS(fx.elem,'backgroundPosition');if(!start)start='0px 0px';start =toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.options.curAnim.backgroundPosition);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]];fx.bgPosReady=true;}var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+' '+nowPosX[1];};})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery bgFade : Copyright 2010 Jake Lauer with Clarity Design (isthatclear.com) : Released under the MIT and GPL licenses.
------------------------------------------------------------------------------------------------***/
(function($){$.fn.bgFade=function(action,options){if(action=='fadeIn'){var defaults={top:"",left:"",height:"",width:"",fadeSpeed:200,fadeToOpacity:1,animate:false};}else if(action=='fadeOut'){var defaults={top:"",left:"",height:"",width:"",fadeSpeed:200,fadeToOpacity:0,animate:false};}var options=$.extend(defaults,options);return this.each(function(){if(action=='fadeIn'){if($(this).css('position')=="static"){$(this).css({position:'relative'});}$(this).append('<span class="bg_fade"></span>')}var fader=$(this).find('.bg_fade');var aThis=$(this);if(options.top==""){if(fader.css('top')=='0px'){fTop=0;}else{fTop=fader.css('top');}}else{fTop=options.top;}if(options.top!=""&&action!='fadeIn'){fTop=options.top;}else if(options.top==""&&action!='fadeIn'){fTop=0;}if(options.left==0){if(fader.css('left')=='0px'){fLeft=0;}else{fLeft=fader.css('left');}}else{fLeft=options.left;}if(options.left!=""&&action!='fadeIn'){fLeft=options.left;}else if(options.left==""&&action!='fadeIn'){fLeft=0;}if(options.width==""){if(fader.css('width')=='0px'){fWidth=0;}else{fWidth=fader.css('width');}}else{fWidth=options.width;}if(options.width!=""&&action!='fadeIn'){fWidth=options.width;}else if(options.width==""&&action!='fadeIn'){fWidth=$(this).width();}if(options.height==""){if(fader.css('height')=='0px'){fHeight=0;}else{fHeight=fader.css('height');}}else{fHeight=options.height;}if(options.height!=""&&action!='fadeIn'){fHeight=options.height;}else if(options.height==""&&action!='fadeIn'){fHeight=$(this).height();}if(action=='fadeIn'){fader.css({opacity:0});}if(options.animate==false){fader.css({top:fTop,left:fLeft,width:fWidth,height:fHeight});}if(action=='fadeIn'){bgFadeOn(options,fader,aThis);}else if(action=='fadeOut'){bgFadeOff(options,fader,aThis);}});function bgFadeOn(options,fader,aThis){if(options.animate==true){aThis.stop().animate({top:fTop,left:fLeft,width:fWidth,height:fHeight},options.fadeSpeed);fader.stop().animate({opacity: options.fadeToOpacity,width:fWidth,height:fHeight},options.fadeSpeed);}else{fader.stop().fadeTo(options.fadeSpeed,options.fadeToOpacity);}}function bgFadeOff(options,fader,aThis){if(options.animate==true){aThis.stop().animate({top:fTop,left:fLeft,width:fWidth,height:fHeight},options.fadeSpeed);fader.stop().animate({opacity:options.fadeToOpacity},options.fadeSpeed,function(){if(options.fadeToOpacity==0){$(this).remove();}else{$(this).parent().find('.bg_fade').not($(this)).remove();}});}else{fader.stop().fadeTo(options.fadeSpeed,options.fadeToOpacity,function(){if(options.fadeToOpacity==0){$(this).remove();}else{$(this).parent().find('.bg_fade').not($(this)).remove();}});}}};})(jQuery);

/***------------------------------------------------------------------------------------------------
	Enable Smooth Scrolling
------------------------------------------------------------------------------------------------***/
(function enable_smooth_scroll(){function filterPath(string){return string.replace(/^\//,'').replace(/(index|default).[a-zA-Z]{3,4}$/,'').replace(/\/$/,'');}var locationPath=filterPath(location.pathname),scrollElement='html,body';$('html,body').each(function(){var initScrollTop=$(this).attr('scrollTop');$(this).attr('scrollTop', initScrollTop+1);if($(this).attr('scrollTop')==initScrollTop+1){scrollElement=this.nodeName.toLowerCase();$(this).attr('scrollTop',initScrollTop); return false;}});$('a[href*=#]').each(function(){var thisPath=filterPath(this.pathname)||locationPath;if(locationPath==thisPath&&(location.hostname==this.hostname||!this.hostname)&&this.hash.replace(/#/,'')){if($(this.hash).length){$(this).click(function(e){var targetOffset=$(this.hash).offset().top,target=this.hash;e.preventDefault();$(scrollElement).animate({scrollTop:targetOffset},5000,function(){location.hash=target;});});}}});})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery.ScrollTo - Easy element scrolling using jQuery
------------------------------------------------------------------------------------------------***/
if(typeof $.scrollTo != 'function'){ ;(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);}

/***------------------------------------------------------------------------------------------------
	Viewport - jQuery selectors for finding elements in viewport
	Copyright (c) 2008-2009 Mika Tuupola - http://www.appelsiini.net/projects/viewport
------------------------------------------------------------------------------------------------***/
(function($){
	$.belowthefold = function(element,settings){	var fold = $(window).height() + $(window).scrollTop();
		return fold <= $(element).offset().top - settings.threshold;};
	$.abovethetop = function(element,settings){	var top = $(window).scrollTop();
		return top >= $(element).offset().top + $(element).height() - settings.threshold;};
	$.rightofscreen = function(element,settings){	var fold = $(window).width() + $(window).scrollLeft();
		return fold <= $(element).offset().left - settings.threshold;};
	$.leftofscreen = function(element,settings){	var left = $(window).scrollLeft();
		return left >= $(element).offset().left + $(element).width() - settings.threshold;};
	$.inviewport = function(element,settings){
		return !$.rightofscreen(element, settings) && !$.leftofscreen(element, settings) && !$.belowthefold(element, settings) && !$.abovethetop(element, settings);};
	$.extend($.expr[':'], {
		"below-the-fold":	function(a,i,m){return $.belowthefold		(a,{threshold : 0});},
		"above-the-top":	function(a,i,m){return $.abovethetop		(a,{threshold : 0});},
		"left-of-screen":	function(a,i,m){return $.leftofscreen		(a,{threshold : 0});},
		"right-of-screen":	function(a,i,m){return $.rightofscreen	(a,{threshold : 0});},
		"in-viewport":		function(a,i,m){return $.inviewport		(a,{threshold : 0});}
	});
})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery HoverPulse Plugin by M. Alsup ~ http://malsup.com/jquery/hoverpulse/
	Dual licensed MIT and GPL; Requires: jQuery v1.2.6 or later; @version: 1.01  26-FEB-2009
------------------------------------------------------------------------------------------------***/
(function($){$.fn.hoverpulse=function(options){if(this.length==0){if (!$.isReady && this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).hoverpulse(options);});}return this;}var opts = $.extend({},$.fn.hoverpulse.defaults,options);this.parent().css({position:'relative'});this.css({position:'absolute',top:0,left:0});this.each(function(){var $this=$(this),w=$this.width(),h=$this.height();$this.data('hoverpulse.size',{w:parseInt(w),h:parseInt(h)});});return this.hover(function(){var $this=$(this);$this.parent().css('z-index',opts.zIndexActive);var size=$this.data('hoverpulse.size');var w=size.w,h=size.h;$this.stop().animate({top:('-'+opts.size+'px'),left:('-'+opts.size+'px'),height:(h+2*opts.size)+'px',width:(w+2*opts.size)+'px'},opts.speed);},function(){var $this=$(this);var size=$this.data('hoverpulse.size');var w=size.w,h=size.h;$this.stop().animate({top:0,left:0,height:(h+'px'),width:(w+'px')},opts.speed,'easeInOutBounce',function(){$this.parent().css('z-index',opts.zIndexNormal);});});};$.fn.hoverpulse.defaults={size:20,speed:200,zIndexActive:100,zIndexNormal:1};})(jQuery);


/***------------------------------------------------------------------------------------------------
	BubbleUp ~ http://aext.net/2010/04/bubbleup-jquery-plugin/
------------------------------------------------------------------------------------------------***/
(function($){
	$.fn.bubbleup = function(options) {
		var opt = $.extend({}, $.fn.bubbleup.defaults, options),tip = null;
		return this.each(function() {
			var w=$(this).width();
			$(this).mouseover(function(){
				if(opt.tooltip) {
					tip = $('<div>' + $(this).attr('alt') + '</div>').css({
						fontFamily: opt.fontFamily,
						color: opt.color, 
						fontSize: opt.fontSize, 
						fontWeight: opt.fontWeight, 
						position: 'absolute', 
						zIndex: 100000
					}).remove().css({top:0,left: 0,visibility:'hidden',display:'block'}).appendTo(document.body);
					var position = $.extend({},$(this).offset(),{width:this.offsetWidth,height:this.offsetHeight}),tipWidth = tip[0].offsetWidth, tipHeight = tip[0].offsetHeight;
					tip.stop().css({
						top: position.top - tipHeight, 
						left: position.left + position.width / 2 - tipWidth / 2,
						visibility: 'visible'
					}).animate({top:'-='+(opt.scale/2-w/2)},opt.inSpeed); 
				}
				$(this).closest('li').css({'z-index':100000});
				$(this).stop().css({'z-index':100000,'top':0,'left':0,'width':w}).animate({
					left:-opt.scale/2+w/2,
					top:-opt.scale/2+w/2,
					width:opt.scale
				},opt.inSpeed);
			}).mouseout(function(){
				$(this).closest('li').css({'z-index':100});
				$(this).closest('li').next().css({'z-index':0});
				$(this).closest('li').next().children('img').css({'z-index':0});
				if(opt.tooltip){tip.remove()}
				$(this).stop().animate({left:0,top:0,width:w},opt.outSpeed,function(){
					$(this).css({'z-index':0});
				});
			})
		})
	}
	$.fn.bubbleup.defaults = {
		tooltip: false,
		scale:96,
		fontFamily:'"Segoe UI",Segoe,"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif',
		color:'#061324',
		fontSize:12,
		fontWeight:'bold',
		inSpeed:'fast',
		outSpeed:'fast'
	}
})(jQuery);

/***------------------------------------------------------------------------------------------------
	jQuery Before/After Drag Bar
------------------------------------------------------------------------------------------------***/
(function(a){a.fn.extend({beforeAfter:function(b){var d={animateIntro:false,introDelay:1000,introDuration:1000,showFullLinks:true,imagePath:"images/"};var b=a.extend(d,b);var c=Math.round(Math.random()*100000000);return this.each(function(){var e=b;var h=a(this);var n=a("img:first",h).width();var p=a("img:first",h).height();a(h).width(n).height(p).css({overflow:"hidden",position:"relative",padding:"0"});var k=a("<img />").attr("src",a("img:first",h).attr("src"));var j=a("<img />").attr("src",a("img:last",h).attr("src"));a("img:first",h).attr("id","beforeimage"+c);a("img:last",h).attr("id","afterimage"+c);a("div",h).css("float","left");a(h).prepend('<div id="dragwrapper'+c+'"><div id="drag'+c+'"><img width="9" height="56" alt="handle" src="'+e.imagePath+'handle.png" class="boxdrop" title="Drag left or right to see the differences" id="handle'+c+'"></div></div>');a("#dragwrapper"+c).css({position:"absolute",padding:"0",left:(n/2)-(a("#handle"+c).width()/2)+"px","z-index":"20"}).width(a("#handle"+c).width()).height(p);a("#dragwrapper"+c).css({opacity:0.25});a("div:eq(2)",h).height(p).width(n/2).css({position:"absolute",overflow:"hidden",left:"0px","z-index":"10"});a("div:eq(3)",h).height(p).width(n).css({position:"absolute",overflow:"hidden",right:"0px"});a("#drag"+c).width(2).height(p).css({background:"#36f",position:"absolute",left:"3px"});a("#beforeimage"+c).css({position:"absolute",top:"0px",left:"0px"});a("#afterimage"+c).css({position:"absolute",top:"0px",right:"0px"});a("#handle"+c).css({position:"relative",cursor:"col-resize",top:(p/2)-(a("#handle"+c).height()/2)+"px",left:"-3px"});a(h).append('<img src="'+e.imagePath+'x.gif" width="8" height="8" id="lt-arrow'+c+'" class="ui-icon ui-icon-triangle-1-w"><img src="'+e.imagePath+'x.gif" width="8" height="8" id="rt-arrow'+c+'" class="ui-icon ui-icon-triangle-1-e">');if(e.showFullLinks){a(h).after('<div class="balinks p5 ui-widget-header ui-corner-bottom" id="links'+c+'"><a id="showleft'+c+'" href="javascript:void(0)" class="bflinks m0 sml uc">Only iPhone 4G</a><a id="showright'+c+'" href="javascript:void(0)" class="bflinks m0 sml uc">Only HTC Dream</a></div><div class="clearfix"></div>');a("#links"+c).width(n);a("#showleft"+c).css({position:"relative",left:"0px"}).click(function(){a("div:eq(2)",h).animate({width:n},200);a("#dragwrapper"+c).animate({left:n-a("#dragwrapper"+c).width()+"px"},200)});a("#showright"+c).css({position:"absolute",right:"0px"}).click(function(){a("div:eq(2)",h).animate({width:0},200);a("#dragwrapper"+c).animate({left:"0px"},200)})}var g=a("#dragwrapper"+c).offset();var l=g.left;var i=a("div:eq(2)",h).width();var f=a("div:eq(3)",h).width();a("#dragwrapper"+c).draggable({handle:a("#handle"+c),containment:h,axis:"x",drag:function(q,o){var s=a(this).offset();var r=s.left-l;a("div:eq(2)",h).width(i+r);a("#lt-arrow"+c).stop().animate({opacity:0},50);a("#rt-arrow"+c).stop().animate({opacity:0},50)}});if(e.animateIntro){a("div:eq(2)",h).width(n);a("#dragwrapper"+c).css("left",n-(a("#dragwrapper"+c).width()/2)+"px");setTimeout(function(){a("#dragwrapper"+c).css({opacity:1}).animate({left:(n/2)-(a("#dragwrapper"+c).width()/2)+"px"},e.introDuration,function(){a("#dragwrapper"+c).animate({opacity:0.25},1000)});a("div:eq(2)",h).width(n).animate({width:n/2+"px"},e.introDuration,function(){a("div:eq(2)",h).css("overflow","hidden");m()})},e.introDelay)}else{m()}function m(){a(h).hover(function(){a("#lt-arrow"+c).stop().css({"z-index":"20",position:"absolute",top:p/2-a("#lt-arrow"+c).height()/2+"px",left:parseInt(a("#dragwrapper"+c).css("left"))-16+"px"}).animate({opacity:1,left:parseInt(a("#lt-arrow"+c).css("left"))-8+"px"},500);a("#rt-arrow"+c).stop().css({position:"absolute",top:p/2-a("#lt-arrow"+c).height()/2+"px",left:parseInt(a("#dragwrapper"+c).css("left"))+10+"px"}).animate({opacity:1,left:parseInt(a("#rt-arrow"+c).css("left"))+6+"px"},500);a("#dragwrapper"+c).animate({opacity:1},500)},function(){a("#lt-arrow"+c).animate({opacity:0,left:parseInt(a("#lt-arrow"+c).css("left"))-6+"px"},500);a("#rt-arrow"+c).animate({opacity:0,left:parseInt(a("#rt-arrow"+c).css("left"))+6+"px"},500);a("#dragwrapper"+c).animate({opacity:0.25},500)});a(h).click(function(q){var r=q.pageX-this.offsetLeft;var o=n-r;a("#dragwrapper"+c).stop().animate({left:r-(a("#dragwrapper"+c).width()/2)+"px"},600);a("div:eq(2)",h).stop().animate({width:r+"px"},600,function(){a("div:eq(2)",h).css("overflow","hidden")});a("#lt-arrow"+c).stop().animate({opacity:0},50);a("#rt-arrow"+c).stop().animate({opacity:0},50)});a(h).one("mousemove",function(){a("#dragwrapper"+c).stop().animate({opacity:1},500)})}})}})})(jQuery);

/***------------------------------------------------------------------------------------------------
	Character Count jQuery Plug-in by Alen Grakalic	~ http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas
	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com) ~ Dual licensed under the MIT & GPL licenses.
------------------------------------------------------------------------------------------------***/
(function($){
	$.fn.charCount = function(options){
		// config
		var defaults = {	
			allowed: 140,		
			warning: 25,
			css: 'aller b counter inset mt0 ui-widget-content ui-corner-bottom',
			counterElement: 'div',
			cssWarning: 'warning txtdrop ui-state-highlight',
			cssExceeded: 'exceeded txtdrop ui-state-error',
			counterText: '<span class="counterTxt quiet sml">Characters Remaining</span>'
		}; 
		var options = $.extend(defaults,options);
		function updateCount(obj){
			var count = $(obj).val().length;
			var available = options.allowed - count;
			if(available <= options.warning && available >= 0){
				$(obj).next().addClass(options.cssWarning);
			} else {
				$(obj).next().removeClass(options.cssWarning);
			}
			if(available < 0){
				$(obj).next().addClass(options.cssExceeded);
			} else {
				$(obj).next().removeClass(options.cssExceeded);
			}
			$(obj).next().html(options.counterText + available);
		};
		this.each(function() {  			
			var ta = $(this);
			$(ta).after('<'+options.counterElement+' class="'+options.css+'">'+options.counterText+'</'+options.counterElement+'>');
			updateCount(this);
			$(ta).keyup(function(){updateCount(this)});
			$('form').change(function(){updateCount(ta)});
		});
	};
})(jQuery);

/***------------------------------------------------------------------------------------------------
	Misc jQuery Helper Functions
------------------------------------------------------------------------------------------------***/

// Center element: $(element).center();
jQuery.fn.center=function(){
	this.css('position','absolute');
	this.css('top',($(window).height() - this.height() ) / +$(window).scrollTop() + 'px');
	this.css('left',($(window).width() - this.width() ) / 2+$(window).scrollLeft() + 'px');
	return this;
}
	
/*** Attack of the IE Conditional ~ http://ajaxian.com/archives/attack-of-the-ie-conditional-comment
var ie = (function(){
	var undef,v=3,div=document.createElement('div');
	while(div.innerHTML='<!--[if gt IE '+(++v)+']><i></i><![endif]-->',div.getElementsByTagName('i')[0]);
	return v> 4 ? v : undef;
}()); ***/

// background image cache bug for ie6. www.mister-pixel.com/#Content__state=
/*@cc_on   @if (@_win32) { document.execCommand("BackgroundImageCache",false,true) }   @end @*/

//+ Jonas Raoni Soares Silva	@ http://jsfromhell.com/string/rot13 [rev. #1]
String.prototype.rot13=function(){return this.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);});};

// change string to lowercase
function lower(ustr){var str=ustr.value;ustr.value=str.toLowerCase();}

/* Autoscroll to selector arg 
jQuery.fn.autoscroll = function(selector){$('html,body').animate({scrollTop: $(selector).offset().top},1000,'easeInOutBounce');};*/

/* Get URL parameters and hash values 
jQuery.fn.getUrlParams = function(){
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++) {
		hash = hashes[i].split('=');
		vars.push(hash[0]);
		vars[hash[0]] = hash[1];
	}
	return vars;
};
jQuery.fn.getUrlParam = function(name) { return $.getUrlParams()[name];}

jQuery.fn.getUrlParameters = function() {
	var map = {};
	var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
		map[key] = value;
	});
	return map;
}*/

/*** 1 S.E.C. (Speed,Easing,Callback) Animation functions ***/
jQuery.fn.aniIn=function(speed,easing,callback){return this.animate({opacity:'show',height:'toggle'},speed,easing,callback);};
jQuery.fn.aniOut=function(speed,easing,callback){return this.animate({opacity:'hide',height:'toggle'},speed,easing,callback);};

/***------------------------------------------------------------------------------------------------
	jQuery UI : transParent Enhancement
	: jQuery object array to initialize evaluated functions (in alphabetical order)
------------------------------------------------------------------------------------------------***/
var ui = {

	BeforeAfter : function(){
		$('#samediff').beforeAfter({animateIntro:true,introDelay:2000,introDuration:500,showFullLinks:false});
	},
	
	BubbleUp : function(){
		$("#bubbleup li img").bubbleup({tooltip: true, scale:64});
	},
	
	CenterToPage : function(){
		/*$(window).resize(function() {
			var elem = $(this);
			elem.css({ 'position':'absolute', 'left':($(window).width() - elem.outerWidth()) / 2, 'top':($(window).height() - elem.outerHeight()) / 2 });
		});
		$(window).resize();*/
		$(".center").center();
	},
	
	Copyright : function(){
		var copySymbol = '&copy;';
		var thisYear = (new Date).getFullYear();
		var companyName = 'MyCity.org';
		var nbsp = '&nbsp;';
		var copyright = copySymbol + nbsp + thisYear + nbsp + companyName;
		$('#copyright').html('<small class="pb10 mt20">'+copyright+', All Rights Reserved.</small>');
	},
	
	External : function(){
		var thisHost = window.location.host.toLowerCase();
    	$('a[href^="http"]:not(a[href^="http://'+thisHost+'"]):not(a[href^="http://www.'+thisHost+'"]),a[href$=".pdf"],.ext').attr('target','_blank');
		$('a').bind('focus',function(){if(this.blur)this.blur();});

		/*if($("#examples").length){
			$('#examples a[href*="#"]').attr('href', $(this).attr('href').replace('#', '#='));
			var hashname = window.location.hash.replace('#=', '');
			var elem = $('a[name="' + hashname + '"],#' + hashname);
			if(elem.length) {$('html,body').animate({scrollTop: $(elem).offset().top},1000,'easeInOutBounce');}
		}*/
	},
	
	Footer : function(){
		var pgH = $('#main').height();
		var winH = $(window).height();
		if (winH > pgH){
			//$('#footer').hide();
		}
		$('#footer').append(pgH +'<br>'+ winH);
		$('#footer').position({ of:$('body'), at:'bottom'});
	},
	
	Input : function(){
		if($("#searchinput").length){
			$("#searchinput").val('search...');
			$("#searchinput")
				.focus(function(){$("#searchform").addClass('focused');})
				.blur(function(){$("#searchform").removeClass('focused');});
		}
		
		if($("input[type=text],input[type=email]").length){
			$('.required').css({'font-style':'italic'})/*.val('*required')*/;
			$('input[type=text],input[type=email]').each(function(){
				var inputTxt = $(this).val();
				$(this)
					.focus(function(){ if($(this).val() == inputTxt){ $(this).val('').css({'font-style':'normal'});} })
					.blur(function(){ ($(this).val() === '') ? $(this).val(inputTxt).css({'font-style':'italic'}) : null; });
			});
		};
		if($("textarea").length){
			$('textarea').each(function(){
				var inputTxt = $(this).val();
				$(this)
					.focus(function(){ if($(this).val() == inputTxt){ $(this).val('').css({'font-style':'normal'});} })
					.blur(function(){ ($(this).val() === '') ? $(this).val(inputTxt).css({'font-style':'italic'}) : null; });
			});
		};
		// UI Form Enhancements: Uniform (Radios/Checkboxes/FileUpload/SelectBoxes) & Delay Password
		if($("input[type=checkbox]").length){$("input[type=checkbox]").uniform()};
		if($("input[type=radio]").length){$("input[type=radio]").uniform()};
		if($("input[type=file]").length){$("input[type=file]").uniform()};
		//if($("select").length){ $("select").uniform().addClass('ui-menu'); $("option").addClass('ui-menu-item');};
		if($("input[type=password]").length){ $("input[type=password]").dPassword();}
    	
		$('input[type=text],input[type=email],input[type=password],textarea').not('#searchinput')
			.focus(function(){
				$("label[for='" + this.id + "']").addClass("labelfocus");
				var inputH = $(this).outerHeight()*-1; $(this).animate({backgroundPosition:'(0px '+inputH+'px)',backgroundColor:'#fff'},'slow','easeOutBounce').addClass('focus') })
			.blur(function(){
				$("label").removeClass("labelfocus");
				if ($(this).val().length == 0) $(this).animate({backgroundPosition:'(0px 0px)'},'fast','easeInOutBounce').removeClass('focus');
		});
		
	},
	
	Masking : function(){
		$.ui.mask.definitions['~'] = "[+-]";
		//$.ui.mask.defaults.allowPartials = true; //used to allowPartials on all instances of mask() on the page.
		$("#date").mask({mask:"##/##/####"}).change(function(){alert("changed!")}); ;
		$("#n1,#n2").mask({mask:"###"});$("#n3").mask({mask:"####"});
		$("#phoneExt").mask({mask:"(###) ###-#### x#####"});
		$("#phoneExt").mask({mask:"(###) ###-#### x#####"});
		$("#iphone").mask({mask:"+33 ### ### ###"});
		$("#tin").mask({mask:"##-#######"});
		$("#ssn").mask({mask:"###-##-####",allowPartials: true});
		$("#product").mask({mask:"a*-###-a###",placeholder:" "});
		$("#eyescript").mask({mask:"~#.## ~#.## ###"});
		$("#po").mask({mask:"PO: aaa-###-***"});
		$("#pct").mask({mask:"##%"});
		$('#_TextCharacterRange').mask({mask:'[1-9]#%',enableInlineDefs:true});
		$('#_TextEscape').mask({mask:"##-#### \\?\\a\\\\"});
		$('#_TextNoOptions').mask();
		$("input").bind('blur.mask',function(){
			$("#info").html("Unmasked value: "+$(this).mask('value')+'<br/>'+"Masked Value: "+$(this).mask('formatted'));})
			.bind('dblclick.mask',function(){$(this).mask('value'); });
		$('#_ButtonChange').click(function(){$("#ssn").val('123456').mask('apply');});
		$('#_ButtonDestroyMask').click(function(){$("#phone").mask('destroy');});
		$('#_ButtonApply').click(function(){$('#_TextNoOptions').mask("option","mask","###-##-####");});
		$('#_ButtonChangeMask').click(function(){$('#_TextNoOptions').mask("option","mask","##-######");});
		$('#_ButtonRemoveMask').click(function(){$('#_TextNoOptions').mask("option","mask","");});
		$('#_ButtonChangePlaceholder').click(function(){$('#_TextNoOptions').mask("option","placeholder"," ");});
		$('#_ViewTest,#awf_field-10269076').mask({mask:'(###) ###-####'});
	},
	
	Navigation : function(){
		/*$('#nav').addClass('ui-buttonset');
		$('.ui-menu').addClass('ui-corner-bottom').addClass('ui-corner-tr');
		$('.ui-menu').parent().find('a:first').removeClass('ui-corner-all').addClass('ui-corner-top')
			.append('<span class="ui-icon ui-icon-triangle-1-e" style="float:right; margin-top:-2px;" />');*/
		$("#nav li").hover(function() {
			$(this).addClass('on').addClass('txtglow').find("ul.ui-menu").aniIn(200,'easeOutExpo');
			//$(this).find(".ui-icon").removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s");
		},function() { 
			$(this).removeClass('on').removeClass('txtglow').find("ul.ui-menu").aniOut(100,'easeInExpo');
			//$(this).find(".ui-icon").removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e");
		});
		//setInterval(function(){ if(!$('.on').length){$('.ui-menu').aniOut(100,'easeInExpo')}}, 100);
		

		// Side-Sliding Nav
		$('#sidenav a').stop().animate({'marginLeft':'-85px'},1000);
		$('#sidenav > li').hover(function () {
			$('a',$(this)).stop().animate({'marginLeft':'-2px'},200);
		},function () {
			$('a',$(this)).stop().animate({'marginLeft':'-85px'},200);
		});
		
	},
	
	DropDowns : function(){
		$(".menu > li:first-child").addClass("first_menu");
		$(".menu li ul li:has(ul)").addClass("parent_menu");

		var menu=function(){
			var t=15,z=50,s=6,a;
			function dd(n){this.n=n; this.h=[]; this.c=[]}
			dd.prototype.init=function(p,c){
				a=c; //Old code: var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
		
				var w=p, s=w.getElementsByTagName('ul'), l=s.length, i=0;
				for(i;i<l;i++){
					var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
					h.onmouseover=new Function(this.n+'.st('+i+',true)');
					h.onmouseout=new Function(this.n+'.st('+i+')');
				}
			}
		dd.prototype.st=function(x,f){
		var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
		clearInterval(c.t); c.style.overflow='hidden';
		if(f){
		p.className+=' '+a;
		if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
		if(c.mh==c.offsetHeight){c.style.overflow='visible'}
		else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
		}else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
		}
		function sl(c,f){
		var h=c.offsetHeight;
		if((h<=0&&f!=1)||(h>=c.mh&&f==1)){
		if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
		clearInterval(c.t); return
		}
		var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
		c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
		c.style.height=h+(d*f)+'px'
		}
		return{dd:dd}
		}();
		
		document.getElementsByClassName = function (c, t) {
		  t = this.getElementsByTagName(t ? t : "*");
		  for (var i = 0, r = new Array(), l = t.length; i < l; i++)
			if (t[i].className == c)
			  r[r.length] = t[i];
		  return r;
		}
		
		var _Menus = new Array();
		function initializeDateDropDowns(){
		var box = document.getElementsByClassName('menu','ul');
		if (box.length > 0) {
		for(i = 0; i < box.length; i++) {
		var id = box[i];
		_Menus[i] = new menu.dd('_Menus[' + i + ']');
		_Menus[i].init(id,"menuhover");
		}
		}
		}
		window.onload = initializeDateDropDowns;
	},
	
	Obfuscation : function(){
		var rot = '<a href="mailto:support@mycity.org" rel="nofollow" class="boostemail tooltip" title="<strong><span class=\'ui-icon ui-icon-comment\'></span>We Want Your Feedback:</strong><br>Send Us Yours Now!"><span class="ui-icon ui-icon-mail-closed"></span>support@mycity.org</a>';
		$('.support').html(rot.rot13().rot13());
	},
	
	MobileCarousel : function(){
		var incr = 10, degree = 0;
		var images	= $("#phoneStage img").removeClass('mobileInit').addClass('mobileReady');
		var dims		= { width: images.width(), height: images.height() };
		var cnt = images.length;
		var arc = 360/cnt;
		var stageWcenter = $('#phoneStage').width()/2;
		var stageHcenter = $('#phoneStage').height()/2 - dims.height/2;
		var cellEase = "easeOutExpo";
		var cellSpeed = 40;
	
		function circumscribe(incr,arc){
			degree += incr;
			var eSine,eCosine,newW,newH,arcH;
			for(var i = 0; i < cnt; i++){
				arcH = ((360/cnt) * i + degree) * Math.PI/180;
				eSine		= Math.sin(arcH);
				eCosine		= Math.cos(arcH);
				arcH = (0.6 + eSine * 0.4);
				newW	= arcH * dims.width;
				newH	= arcH * dims.height;
				images.eq(i).css({
					top			: stageHcenter + 15 * eSine,
					left		: stageWcenter + 200 * eCosine,
					opacity		: 0.8 + eSine * 0.2,
					marginLeft	: -newW/2,
					zIndex		: Math.round(80 + eSine * 20)
				}).width(newW).height(newH);
			};
			arc -= Math.abs(incr);
			if(arc <= 0) return false;
			setTimeout(function(){circumscribe(incr,arc)},cellSpeed);
		};
		circumscribe(incr,360/cnt);
		$("#phoneCarousel .prevCell").click(function(){circumscribe(-incr,360/cnt);return false;});
		$("#phoneCarousel .nextCell").click(function(){circumscribe(incr,360/cnt);return false;});
	},
	
	Scroll : function(){
		
		$('body').append('<a style="display:none;width:20px;height:20px;position:fixed;bottom:15px;right:45px;padding:.3em .4em .4em;" class="tooltip" id="backToTop" title="Back to Top"></a>')
		/*.addClass('headerOffset')*/;
		$('#backToTop').button({text:false,icons:{primary:'ui-icon-circle-triangle-n'}});
		
		$(window).scroll(function(){
			var scrollTop = $(window).scrollTop();
			if(scrollTop != 0) {
				//$('#header').stop().animate({'opacity':'0.2'},400);
				$('#backToTop')
					.fadeIn('slow')
					.click( function(e){ $('html,body').stop().animate({scrollTop:'0px'},1200,'easeInOutBounce'); });
			} else {
				//$('#header').stop().animate({'opacity':'1'},400);
				$('#backToTop').fadeOut('slow');
			}
			$(window).bind('scrollstart', function(){ $('#backToTop').stop().animate({'opacity':'0.2'});});
			$(window).bind('scrollstop', function(){ $('#backToTop').stop().animate({'opacity':'1'});});
		});
	
		/*$('#header').hover(
			function (e) {
				var scrollTop = $(window).scrollTop();
				if(scrollTop != 0){ $('#header').stop().animate({'opacity':'1'},400); }
			}, function (e) {
				var scrollTop = $(window).scrollTop();
				if(scrollTop != 0){ $('#header').stop().animate({'opacity':'0.2'},400); }
			}
		);*/

	},
	
	Selectmenu : function(){
		$("select:not(#awf_field-10269080):not(.multiChoice):not(#schID)").selectmenu({maxHeight:420,width:220,style:'dropdown',menuWidth:200});
		$("select#schID").selectmenu({maxHeight:420,width:420,style:'dropdown',menuWidth:400});
	},
	
	SimpleSlide : function(){
		$('#simpleslide img:gt(0)').hide();
		setInterval(function(){$('#simpleslide :first-child').fadeOut().next('img').fadeIn().end().appendTo('#simpleslide');}, 5000);
	},
	
	Sprite : function(){
		$(".sprite").append('<span class="hover"/>')
		.each(function(){
			var $span = $('> span.hover', this).css('opacity', 0);
			$(this).hover(function(){
				$span.animate({'opacity':'show'},2400,'easeInOutBounce');
			},function(){
				$span.animate({'opacity':'hide'},1800,'easeInOutBounce');
			})
		});
	},
	
	TxtCounter : function(){
		$(".countTxt").charCount();
	},
	
	TipTool : function() {
		//Tooltips
		var tip;
		$(".tiptool").hover(function(){
			// cache tooltip, remove from container,then append to body
			tip = $(this).find('.tip').remove();
			$('body').append(tip);
			tip.show();
		}, function() {
			tip.hide().remove(); //Hide and remove tooltip appended to the body
			$(this).append(tip); //Return the tooltip to its original position
		}).mousemove(function(e) {
			//console.log(e.pageX)
			var mousex = e.pageX + 20; // get X coodrinates
			var mousey = e.pageY + 20; // get Y coordinates
			var tipWidth = tip.width(); // width of tooltip
			var tipHeight = tip.height(); // height of tooltip
			// distance of element from right edge of viewport
			var tipVisX = $(window).width() - (mousex + tipWidth);
			var tipVisY = $(window).height() - (mousey + tipHeight);
			if ( tipVisX < 20 ) { // if tooltip exceeds the X coordinate of viewport
				mousex = e.pageX - tipWidth - 20;
				$(this).find('.tip').css({  top: mousey, left: mousex });
			} if ( tipVisY < 20 ) { // if tooltip exceeds the Y coordinate of viewport
				mousey = e.pageY - tipHeight - 20;
				tip.css({  top: mousey, left: mousex });
			} else {
				tip.css({  top: mousey, left: mousex });
			}
		});
	},
	
	UI : function(){
		
		// Zebra Stripe a Data Table
		if($("table.data").length){ $("table.data").find("tr:odd,tr:odd td").addClass('alt');}
		if($("#accordion").length){
			$("#accordion").accordion({
				header:'h4',
				//collapsible:true,
				icons:{header:'ui-icon-plusthick',headerSelected:'ui-icon-minusthick'},
				fillSpace:false,
				autoHeight:false,
				navigation:false,
				header:'> h4',
				animated: 'bounceslide',
				//active:false,
				'easing':'easeInOutBounce'
			});
		}
		if($("#datepicker").length){
			$("#datepicker").datepicker({
				showOn: 'both',
				buttonImage: '/images/icon-calendar.gif',
				buttonImageOnly: true,
				numberOfMonths: 3,
				showButtonPanel: true,
				showOtherMonths: true,
				selectOtherMonths: true,
				showAnim: 'slide',
				showOptions: {direction: 'down', easing: 'easeInOutBounce' }
			});
		}
		//if($("#video").length){$('#video').addClass('ui-widget-overlay');}
		if($("#tabs").length){
			$("#tabs").tabs({
				collapsible:true,
				fx: { opacity: 'toggle' },
				/*load: function(event, ui) {
					$('a.in', ui.panel).click(function() {
						$(ui.panel).load(this.href);
						return false;
					});
				},*/
				cookie: { expires: 1 }
			});
		}
		if($("#progressbar").length){$("#progressbar").progressbar({value:1});}
		if($("#rangeslider").length){$('#rangeslider').slider({range:true,values:[25,75]});}
		if($(".autocomplete").length){
			$(".autocomplete").autocomplete({
				source: function(request, response) {
					$.ajax({
						url: "http://ws.geonames.org/searchJSON",
						dataType: "jsonp",
						data: {
							featureClass: "P",
							style: "full",
							maxRows: 13,
							name_startsWith: request.term
						},
						success: function(data) {
							response($.map(data.geonames, function(item) {
								return {
									label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
									value: item.name
								}
							}))
						}
					})
				},
				minLength: 2,
				select: function(event, ui) { ui.item ? (ui.item.label + " (selected)") : "*(nothing selected, was " + this.value +")"; },
				open: function() { $(this).removeClass("ui-corner-all").addClass("ui-corner-top"); },
				close: function() { $(this).removeClass("ui-corner-top").addClass("ui-corner-all"); }
			});
		}
		
		// Rollover Image Swap
		if($(".over").length){
			$("a.over").hover(function(){
				$(this).find('img').attr('src', $(this).find('img').attr('src').split('.').join('_o.'));
			},function(){
				$(this).find('img').attr('src', $(this).find('img').attr('src').split('_o.').join('.'));
			});
		}
		if($(".fade").length){ $(".fade").hover(function() { this.check = this.check || 1; $(this).stop().fadeTo('slow', this.check++ % 2 == 0 ? 1 : 0.5, 'easeInSine'); }); }
		
		// Corner Control
		//if($("#nav").length){ $("#nav>li.ui-button").removeClass('ui-corner-all').addClass('ui-corner-top');}
		if($(".box").length){
			var $box = $(".box");
			$box.addClass("ui-widget").addClass("ui-widget-content").addClass("ui-corner-all");
			$box.find(".boxhead").addClass("ui-widget-header").addClass("ui-corner-top");
			$box.find(".boxbody").addClass("ui-corner-bottom");
			$("#ex").find(".box").hover(function(){$(this).addClass("boxdrop").css({'top':'1px'});},function(){$(this).removeClass("boxdrop").css({'top':'0'});});
			$box.addClass();
		}
		
		if($("#stickToTop").length){
			var stickToTop = parseInt($('#stickToTop').offset().top);
			$(window).scroll(function(){ $("#stickToTop").css((parseInt($(window).scrollTop())+parseInt($("#stickToTop").css('margin-top')) > stickToTop) ? {position:'fixed',top:'0px'} : {position:'relative'}); });
		}
		
		// bigTarget
		if($(".bigTarget").length){ $(".bigTarget").bigTarget({hoverClass:'focus ui-corner-all inset',clickZone:'div:eq(0)'});}
		
		// No Right-Click Context Menu
		$(document).bind("contextmenu",function(event){event.preventDefault()});
		
		// Apply UI Buttons, Buttonsets, and Tooltips
		$(":button,button,:submit,:reset").not('.ui-button').addClass("ui-button");
		if($(".ui-button").length){$(".ui-button").button();}
		if($("form #submit").not('#contact #submit').length){
			$("#submit").button({ icons: { primary : 'ui-icon-unlocked' }});
			/*$("#submit").hover(function(){
				$(this).button({ icons: { primary : 'ui-icon-circle-triangle-e', secondary : 'ui-icon-unlocked' }});
			}, function(){
				$(this).button({ icons: { primary : 'ui-icon-triangle-1-e', secondary : 'ui-icon-locked' }});
			});*/
		}
		if($("#contact-form #submit").length){
			$("#submit").button({ icons: { primary : 'ui-icon-mail-open' }})
			.hover(function(){
				$(this).button({ icons: { primary : 'ui-icon-mail-closed' }});
			}, function(){
				$(this).button({ icons: { primary : 'ui-icon-mail-open' }});
			})/**/;
		}
		//if($(":submit").length){ $(":submit").button({ icons: {primary : 'ui-icon-circle-triangle-e' }});}
		if($("#check_form").length){ $("#check_form button").button({ icons: { primary : 'ui-icon-search' }});}
		if($(".ui-buttonset").length){$(".ui-buttonset").buttonset();}
		if($(".tooltip").length){
			$("#logo.tooltip").attr("title","<span class='ui-icon ui-icon-home'/><span class='ui-icon ui-icon-arrowreturnthick-1-w'/>");
			$(".tooltip:not('.ui-tooltip'),.ui-tooltip").tooltip({
				open:function(){
					var tooltip=$(this).tooltip("widget");
					$(document).mousemove(function(event){ tooltip.position({my:"left top",at:"left bottom",offset:"20 15",of:event}); }).mousemove();
				},
				close:function(){$(document).unbind("mousemove");}
			});
		}
		
		if($(".formsubmit").length){
			$(".formsubmit").click(function(){
				$("form").submit();
				return false;
			});
		}
		
		if($("#mainCol").length && $("#aside").length){
			var mainColH = $("#mainCol").height();
			var subColH = $("#aside").height();
			var offsetH = .96;
			var newColH = mainColH*offsetH;
			if(mainColH > subColH){$("#aside").css({'height': newColH});}
		}
		
		if($("iframe").length){
			var iframeH = $(window).outerHeight()*.64;
			$("iframe").css({'height': iframeH});
		}
		
		/* Bottom Sliding Element*/
		if($("#slidemenu").length){
			
			$(".more #slidemenu-open")
			.hover(function(){$(this).parent().addClass('border-yellow').addClass('glow');},function(){$(this).parent().removeClass('border-yellow').removeClass('glow');})
			.click(function(){
				var menuWidth = $(window).width() - 164;
				$(this).parent().stop().animate({width: menuWidth+'px'},'slow','easeInOutBounce',function(){$("#navmenu").show();}).css({'z-index':'100000'});
				$(this).animate({'opacity':'hide'},'fast','easeInOutBounce');
				$(this).parent().find("#slidemenu-close").animate({'opacity':'show'},'fast','easeInOutBounce');
				return false;
			});
      		$(".more #slidemenu-close")
			.hover(function(){$(this).parent().addClass('border-yellow').addClass('glow');},function(){$(this).parent().removeClass('border-yellow').removeClass('glow');})
			.click(function(){
				$(this).parent().stop().animate({width:'50px'},'fast','easeInOutBounce',function(){$("#navmenu").hide();}).css({'z-index':'1000'});
				$(this).animate({'opacity':'hide'},'fast','easeInOutBounce');
				$(this).parent().find("#slidemenu-open").animate({'opacity':'show'},'fast','easeInOutBounce');
				return false;
			});
		}
		
		if($("#terms").length){
			$('#terms').dialog({
				autoOpen: false,
				height:500,
				width:840,
				position: [ 'center' ],
				modal: true,
				show: "slide",
				hide: "fade",
				buttons: {'CONTINUE': function() { $(this).dialog('close');}
				},
				close: function() { }
			});
			$('#readterms').click(function(event){
				$("#terms").dialog('open');
				event.preventDefault();
			});
		}
		
		if($("#privacypolicy").length){
			$('#privacypolicy').dialog({
				autoOpen: false,
				height:500,
				width: 700,
				position: [ 'center' ],
				modal: true,
				show: "slide",
				hide: "fade",
				buttons: {'CONTINUE': function() { $(this).dialog('close');}
				},
				close: function() { }
			});
			$('#readprivacy').click(function(event){
				$("#privacypolicy").dialog('open');
				event.preventDefault();
			});	
		}
		
		if($("#geoip").length){
			// Build the URL to query
			var url = "http://www.geoplugin.net/json.gp?jsoncallback=?";
			
			// Utilize the JSONP API
			$.getJSON(url, function(data){
				if(data['status'] == 'ok'){
					// Do something with the data
					/*$('#profile #ip')
						.append(data['IP']);
					$('#profile #country')
						.append(data['CountryName']);*/
					$('#geoip').find('p')
						.append(data['City'])
						.append(', ')
						.append(data['RegionName'])
						.append(' ')
						.append(data['ZipPostalCode'])
						.append('<br>')
						.append(data['Latitude'])
						.append(' ')
						.append(data['Longitude']);
				}
			});
		}
		
		$('body').append('<div id="pgl"></div><div id="pgr"></div><div id="pgt"></div><div id="pgb"></div>');//.hide().delay(100).show(1300);
		
		if($("#rays").length) {
			var rays = document.getElementById("rays"), degrees = 0, speed = 0.05;
			setInterval(function() {
				degrees += speed; // degree adjustment each interval
				rays.setAttribute("style","-" + cssPrefix + "-transform:rotate(" + degrees + "deg)");
			},20);
		}
		
		if($("form.ajax").length){
			$("form.ajax").submit(function(e) {
				e.preventDefault();
				var form = $(this);
				form.ajaxSubmit({
					dataType: 'json',
					beforeSubmit: function() {
						var event = jQuery.Event('form:beforeSubmit');
						form.trigger(event);
						if(event.isPropagationStopped())
							return false;
					},
					beforeSend: function() {
						form.trigger('form:beforeSend');
					},
					success: function(json) {
						form.trigger('form:success', [json]);
					},
					error: function(response, status, error) {
						form.trigger('form:error', [response, status, error]);
					},
					complete: function() {
						form.trigger('form:complete');
					}
				});
				return false;
			});
		}
		
	},
	
	Zoom : function(){
		$("img.zoom").hoverpulse({ size:40,speed:200 }).each(function() {
			var $img = $(this);
			if($img.attr('data-link') != undefined){
				var link = $img.attr('data-link');
				$img.addClass('tooltip').attr('title','Goto: ' + link);
				$img.click(function() {
					window.open(link);
					return false;
				});
			}
		});
		$(".zoom").hoverpulse({ size:20,speed:200 });
	}

};

// I N S T A N T I A T I O N //
jQuery(function($){
	if($("#samediff").length)							ui.BeforeAfter();
	if($("#bubbleup").length)							ui.BubbleUp();
	if($(".countTxt").length)							ui.TxtCounter();
	if($(".center").length)							ui.CenterToPage();
	if($("#copyright").length)							ui.Copyright();
	//if($("#nav .dd").length)							ui.DropDowns();
	if($("a,.ext").length)								ui.External();
	if($("input").length)								ui.Input();
	if($("form").length)								ui.Masking();
	if($('#phoneCarousel').length)						ui.MobileCarousel();
	if($("#nav").length)								ui.Navigation();
	if($(".obfuscate").length)							ui.Obfuscation();
	if($("#header:not('#ae #header')").length)			ui.Scroll();
	if($("select").length)								ui.Selectmenu();
	if($('#simpleslide').length)						ui.SimpleSlide();
	if($(".sprite").length)							ui.Sprite();
	//if($(".tiptool").length)							ui.TipTool();
	//if($(".zoom").length)								ui.Zoom();
	// Functions Called Automatically
	ui.UI();	// > ALWAYS call last.								  
});

/* EOF */
