$(document).ready(function() {

	/*
	* Initialize masonry on load, reload Masonry on resize.
	*/
	masonryInit();
	$(window).resize($.debounce(100, function() {masonryInit();}));

	/*
	* Initialization of the one-page nav.
	*/
	$('.nav').onePageNav({
		currentClass: 'current',
		changeHash: false
	});

	/* 
	* jQuery form initialization.
	*/
	var options = { 
		target:        '#output',
		beforeSubmit:  showRequest,
		success:       showResponse
	}; 
	$('#contactForm').ajaxForm(options);

	/*
	* KyleBox
	*/
	$('.masonry li').click(function(e) {
		e.preventDefault();
		var getBig = '',
			ext = '';
		getBig = $(this).find('img').attr('src');
		ext = getBig.substring(getBig.lastIndexOf('/') + 1).split('.')[1];
		getBig = getBig.substring(getBig.lastIndexOf('/') + 1).split('.')[0];
		$('.kylebox').children('img').attr('src','img/' + getBig + '_large.' + ext).load(function() {
			$('.kylebox').fadeIn('slow');
		}).error(function() {
			$(this).attr('src','img/' + getBig + '.' + ext);
			$('.kylebox').fadeIn('slow');
		});
	});

	$('.kylebox').click(function() {$('.kylebox').fadeOut('slow');});
	$('aside').click(function() {$('.kylebox').fadeOut('slow');});

});

function masonryInit() {
	$('#illustration ul.masonry').imagesLoaded(function(){
		$('#illustration ul.masonry').masonry({
			itemSelector : '.masonry li'
		});
	});
}

function showRequest(formData, jqForm, options) {var queryString = $.param(formData); return true;}
function showResponse(responseText, statusText, xhr, $form)  {}

/**
 * jQuery Masonry v2.1.0
 * A dynamic layout plugin for jQuery
 * The flip-side of CSS Floats
 * http://masonry.desandro.com
 *
 * Licensed under the MIT license.
 * Copyright 2011 David DeSandro
 */
(function(a,b,c){var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind("resize",d.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",d.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",e&&clearTimeout(e),e=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()};var f=["position","height"];b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).css({position:"absolute"}).addClass("masonry-brick");return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[],this.reloadItems();var d=this.element[0].style;this.originalStyle={};for(var e=0,g=f.length;e<g;e++){var h=f[e];this.originalStyle[h]=d[h]||""}this.element.css({position:"relative"}),this.horizontalDirection=this.options.isRTL?"right":"left",this.offset={x:parseInt(this.element.css("padding-"+this.horizontalDirection),10),y:parseInt(this.element.css("padding-top"),10)},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var i=this;setTimeout(function(){i.element.addClass("masonry")},0),this.options.isResizable&&b(a).bind("smartresize.masonry",function(){i.resize()})},_init:function(a){this._getColumns(),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&&(this.options=b.extend(!0,this.options,a))},layout:function(a,b){for(var c=0,d=a.length;c<d;c++)this._placeBrick(a[c]);var e={};e.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var f=0,c=this.cols;while(--c){if(this.colYs[c]!==0)break;f++}e.width=(this.cols-f)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:e});var g=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",h=this.options.animationOptions,i;for(c=0,d=this.styleQueue.length;c<d;c++)i=this.styleQueue[c],i.$el[g](i.style,h);this.styleQueue=[],b&&b.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.isFluid?this.options.columnWidth(b):this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(a){var c=b(a),d,e,f,g,h;d=Math.ceil(c.outerWidth(!0)/(this.columnWidth+this.options.gutterWidth)),d=Math.min(d,this.cols);if(d===1)f=this.colYs;else{e=this.cols+1-d,f=[];for(h=0;h<e;h++)g=this.colYs.slice(h,h+d),f[h]=Math.max.apply(Math,g)}var i=Math.min.apply(Math,f),j=0;for(var k=0,l=f.length;k<l;k++)if(f[k]===i){j=k;break}var m={top:i+this.offset.y};m[this.horizontalDirection]=this.columnWidth*j+this.offset.x,this.styleQueue.push({$el:c,style:m});var n=i+c.outerHeight(!0),o=this.cols+1-l;for(k=0;k<o;k++)this.colYs[j+k]=n},resize:function(){var a=this.cols;this._getColumns(),(this.isFluid||this.cols!==a)&&this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(0);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.height()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var c=this.element[0].style;for(var d=0,e=f.length;d<e;d++){var g=f[d];c[g]=this.originalStyle[g]}this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),b(a).unbind(".masonry")}},b.fn.imagesLoaded=function(a){function h(){--e<=0&&this.src!==f&&(setTimeout(g),d.unbind("load error",h))}function g(){a.call(b,d)}var b=this,d=b.find("img").add(b.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";e||g(),d.bind("load error",h).each(function(){if(this.complete||this.complete===c){var a=this.src;this.src=f,this.src=a}});return b};var g=function(a){this.console&&console.error(a)};b.fn.masonry=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"masonry");if(!d)g("cannot call methods on masonry prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){g("no such method '"+a+"' for masonry instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"masonry");c?(c.option(a||{}),c._init()):b.data(this,"masonry",new b.Mason(a,this))});return this}})(window,jQuery);

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

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

/*
 * jQuery One Page Nav Plugin
 * http://github.com/davist11/jQuery-One-Page-Nav
 *
 * Copyright (c) 2010 Trevor Davis (http://trevordavis.net)
 * Dual licensed under the MIT and GPL licenses.
 * Uses the same license as jQuery, see:
 * http://jquery.org/license
 *
 * @version 0.7
 */
(function(e){e.fn.onePageNav=function(j){var g=e.extend({},e.fn.onePageNav.defaults,j),c={};c.sections={};c.bindNav=function(b,d,a){var f=b.parent(),h=b.attr("href"),i=e(window);if(!f.hasClass(a.currentClass)){a.begin&&a.begin();c.adjustNav(d,f,a.currentClass);i.unbind(".onePageNav");e.scrollTo(h,a.scrollSpeed,{offset:{top:-a.scrollOffset},onAfter:function(){if(a.changeHash)window.location.hash=h;i.bind("scroll.onePageNav",function(){c.scrollChange(d,a)});a.end&&a.end()}})}};c.adjustNav=function(b,
d,a){b.find("."+a).removeClass(a);d.addClass(a)};c.getPositions=function(b,d){b.find("a").each(function(){var a=e(this).attr("href"),f=e(a).offset();f=f.top;c.sections[a.substr(1)]=Math.round(f)-d.scrollOffset})};c.getSection=function(b){var d="",a=Math.round(e(window).height()/2);for(var f in c.sections)if(c.sections[f]-a<b)d=f;return d};c.scrollChange=function(b,d){c.getPositions(b,d);var a=e(window).scrollTop();a=c.getSection(a);a!==""&&c.adjustNav(b,b.find("a[href=#"+a+"]").parent(),d.currentClass)};
c.init=function(b,d){var a=false;b.find("a").bind("click",function(f){c.bindNav(e(this),b,d);f.preventDefault()});c.getPositions(b,d);e(window).bind("scroll.onePageNav",function(){a=true});setInterval(function(){if(a){a=false;c.scrollChange(b,d)}},250)};return this.each(function(){var b=e(this),d=e.meta?e.extend({},g,b.data()):g;c.init(b,d)})};e.fn.onePageNav.defaults={currentClass:"current",changeHash:false,scrollSpeed:750,scrollOffset:0,begin:false,end:false}})(jQuery);

/*
 * jQuery Form Plugin
 * version: 2.40 (26-FEB-2010)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

(function(a){function b(){if(a.fn.ajaxSubmit.debug&&window.console&&window.console.log)window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}a.fn.ajaxSubmit=function(c){function q(){function t(a,b){if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}else b=(new DOMParser).parseFromString(a,"text/xml");return b&&b.documentElement&&b.documentElement.tagName!="parsererror"?b:null}function s(){if(m)return;var c=true;try{if(n)throw"timeout";var d,f;f=i.contentWindow?i.contentWindow.document:i.contentDocument?i.contentDocument:i.document;var g=e.dataType=="xml"||f.XMLDocument||a.isXMLDoc(f);b("isXml="+g);if(!g&&(f.body==null||f.body.innerHTML=="")){if(--r){setTimeout(s,250);return}b("Could not access iframe DOM after 100 tries.");return}m=true;k.responseText=f.body?f.body.innerHTML:null;k.responseXML=f.XMLDocument?f.XMLDocument:f;k.getResponseHeader=function(a){var b={"content-type":e.dataType};return b[a]};if(e.dataType=="json"||e.dataType=="script"){var j=f.getElementsByTagName("textarea")[0];if(j)k.responseText=j.value;else{var o=f.getElementsByTagName("pre")[0];if(o)k.responseText=o.innerHTML}}else if(e.dataType=="xml"&&!k.responseXML&&k.responseText!=null){k.responseXML=t(k.responseText)}d=a.httpData(k,e.dataType)}catch(p){c=false;a.handleError(e,k,"error",p)}if(c){e.success(d,"success");if(l)a.event.trigger("ajaxSuccess",[k,e])}if(l)a.event.trigger("ajaxComplete",[k,e]);if(l&&!--a.active)a.event.trigger("ajaxStop");if(e.complete)e.complete(k,c?"success":"error");setTimeout(function(){h.removeData("form-plugin-onload");h.remove();k.responseXML=null},100)}function q(){var b=j.attr("target"),c=j.attr("action");d.setAttribute("target",g);if(d.getAttribute("method")!="POST")d.setAttribute("method","POST");if(d.getAttribute("action")!=e.url)d.setAttribute("action",e.url);if(!e.skipEncodingOverride){j.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(e.timeout)setTimeout(function(){n=true;s()},e.timeout);var f=[];try{if(e.extraData)for(var i in e.extraData)f.push(a('<input type="hidden" name="'+i+'" value="'+e.extraData[i]+'" />').appendTo(d)[0]);h.appendTo("body");h.data("form-plugin-onload",s);d.submit()}finally{d.setAttribute("action",c);b?d.setAttribute("target",b):j.removeAttr("target");a(f).remove()}}var d=j[0];if(a(":input[name=submit]",d).length){alert('Error: Form elements must not be named "submit".');return}var e=a.extend({},a.ajaxSettings,c);var f=a.extend(true,{},a.extend(true,{},a.ajaxSettings),e);var g="jqFormIO"+(new Date).getTime();var h=a('<iframe id="'+g+'" name="'+g+'" src="'+e.iframeSrc+'" onload="(jQuery(this).data(\'form-plugin-onload\'))()" />');var i=h[0];h.css({position:"absolute",top:"-1000px",left:"-1000px"});var k={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;h.attr("src",e.iframeSrc)}};var l=e.global;if(l&&!(a.active++))a.event.trigger("ajaxStart");if(l)a.event.trigger("ajaxSend",[k,e]);if(f.beforeSend&&f.beforeSend(k,f)===false){f.global&&a.active--;return}if(k.aborted)return;var m=false;var n=0;var o=d.clk;if(o){var p=o.name;if(p&&!o.disabled){e.extraData=e.extraData||{};e.extraData[p]=o.value;if(o.type=="image"){e.extraData[name+".x"]=d.clk_x;e.extraData[name+".y"]=d.clk_y}}}if(e.forceSync)q();else setTimeout(q,10);var r=100;}if(!this.length){b("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof c=="function")c={success:c};var d=a.trim(this.attr("action"));if(d){d=(d.match(/^([^#]+)/)||[])[1]}d=d||window.location.href||"";c=a.extend({url:d,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c||{});var e={};this.trigger("form-pre-serialize",[this,c,e]);if(e.veto){b("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(c.beforeSerialize&&c.beforeSerialize(this,c)===false){b("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f=this.formToArray(c.semantic);if(c.data){c.extraData=c.data;for(var g in c.data){if(c.data[g]instanceof Array){for(var h in c.data[g])f.push({name:g,value:c.data[g][h]})}else f.push({name:g,value:c.data[g]})}}if(c.beforeSubmit&&c.beforeSubmit(f,this,c)===false){b("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[f,this,c,e]);if(e.veto){b("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var i=a.param(f);if(c.type.toUpperCase()=="GET"){c.url+=(c.url.indexOf("?")>=0?"&":"?")+i;c.data=null}else c.data=i;var j=this,k=[];if(c.resetForm)k.push(function(){j.resetForm()});if(c.clearForm)k.push(function(){j.clearForm()});if(!c.dataType&&c.target){var l=c.success||function(){};k.push(function(b){a(c.target).html(b).each(l,arguments)})}else if(c.success)k.push(c.success);c.success=function(a,b,d){for(var e=0,f=k.length;e<f;e++)k[e].apply(c,[a,b,d||j,j])};var m=a("input:file",this).fieldValue();var n=false;for(var o=0;o<m.length;o++)if(m[o])n=true;var p=false;if(m.length&&c.iframe!==false||c.iframe||n||p){if(c.closeKeepAlive)a.get(c.closeKeepAlive,q);else q()}else a.ajax(c);this.trigger("form-submit-notify",[this,c]);return this;};a.fn.ajaxForm=function(b){return this.ajaxFormUnbind().bind("submit.form-plugin",function(c){c.preventDefault();a(this).ajaxSubmit(b)}).bind("click.form-plugin",function(b){var c=b.target;var d=a(c);if(!d.is(":submit,input:image")){var e=d.closest(":submit");if(e.length==0)return;c=e[0]}var f=this;f.clk=c;if(c.type=="image"){if(b.offsetX!=undefined){f.clk_x=b.offsetX;f.clk_y=b.offsetY}else if(typeof a.fn.offset=="function"){var g=d.offset();f.clk_x=b.pageX-g.left;f.clk_y=b.pageY-g.top}else{f.clk_x=b.pageX-c.offsetLeft;f.clk_y=b.pageY-c.offsetTop}}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)})};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(b){var c=[];if(this.length==0)return c;var d=this[0];var e=b?d.getElementsByTagName("*"):d.elements;if(!e)return c;for(var f=0,g=e.length;f<g;f++){var h=e[f];var i=h.name;if(!i)continue;if(b&&d.clk&&h.type=="image"){if(!h.disabled&&d.clk==h){c.push({name:i,value:a(h).val()});c.push({name:i+".x",value:d.clk_x},{name:i+".y",value:d.clk_y})}continue}var j=a.fieldValue(h,true);if(j&&j.constructor==Array){for(var k=0,l=j.length;k<l;k++)c.push({name:i,value:j[k]})}else if(j!==null&&typeof j!="undefined")c.push({name:i,value:j})}if(!b&&d.clk){var m=a(d.clk),n=m[0],i=n.name;if(i&&!n.disabled&&n.type=="image"){c.push({name:i,value:m.val()});c.push({name:i+".x",value:d.clk_x},{name:i+".y",value:d.clk_y})}}return c};a.fn.formSerialize=function(b){return a.param(this.formToArray(b))};a.fn.fieldSerialize=function(b){var c=[];this.each(function(){var d=this.name;if(!d)return;var e=a.fieldValue(this,b);if(e&&e.constructor==Array){for(var f=0,g=e.length;f<g;f++)c.push({name:d,value:e[f]})}else if(e!==null&&typeof e!="undefined")c.push({name:this.name,value:e})});return a.param(c)};a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var f=this[d];var g=a.fieldValue(f,b);if(g===null||typeof g=="undefined"||g.constructor==Array&&!g.length)continue;g.constructor==Array?a.merge(c,g):c.push(g)}return c};a.fieldValue=function(a,b){var c=a.name,d=a.type,e=a.tagName.toLowerCase();if(typeof b=="undefined")b=true;if(b&&(!c||a.disabled||d=="reset"||d=="button"||(d=="checkbox"||d=="radio")&&!a.checked||(d=="submit"||d=="image")&&a.form&&a.form.clk!=a||e=="select"&&a.selectedIndex==-1))return null;if(e=="select"){var f=a.selectedIndex;if(f<0)return null;var g=[],h=a.options;var i=d=="select-one";var j=i?f+1:h.length;for(var k=i?f:0;k<j;k++){var l=h[k];if(l.selected){var m=l.value;if(!m)m=l.attributes&&l.attributes["value"]&&!l.attributes["value"].specified?l.text:l.value;if(i)return m;g.push(m)}}return g}return a.value};a.fn.clearForm=function(){return this.each(function(){a("input,select,textarea",this).clearFields()})};a.fn.clearFields=a.fn.clearInputs=function(){return this.each(function(){var a=this.type,b=this.tagName.toLowerCase();if(a=="text"||a=="password"||b=="textarea")this.value="";else if(a=="checkbox"||a=="radio")this.checked=false;else if(b=="select")this.selectedIndex=-1})};a.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};a.fn.enable=function(a){if(a==undefined)a=true;return this.each(function(){this.disabled=!a})};a.fn.selected=function(b){if(b==undefined)b=true;return this.each(function(){var c=this.type;if(c=="checkbox"||c=="radio")this.checked=b;else if(this.tagName.toLowerCase()=="option"){var d=a(this).parent("select");if(b&&d[0]&&d[0].type=="select-one"){d.find("option").selected(false)}this.selected=b}})};})(jQuery);var is={ie:navigator.appName=="Microsoft Internet Explorer",java:navigator.javaEnabled(),ns:navigator.appName=="Netscape",ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=="Win32"};is.mac=is.ua.indexOf("mac")>=0;if(is.ua.indexOf("opera")>=0){is.ie=is.ns=false;is.opera=true}if(is.ua.indexOf("gecko")>=0){is.ie=is.ns=false;is.gecko=true}
