/*! elastic.js - v1.1.1 - 2013-05-24
 * https://github.com/fullscale/elastic.js
 * Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */

!function(){"use strict";var a,b=this;a="undefined"!=typeof exports?exports:null==b.ejs?b.ejs={}:b.ejs,a.jQueryClient=function(a){var b={contentType:"application/json",dataType:"json",processData:!1},c=function(b){return"/"!==b.charAt(0)&&(b="/"+b),a+b};return null==a?a="":"/"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1)),{server:function(b){return null==b?a:(a="/"===b.charAt(b.length-1)?b.substring(0,b.length-1):b,this)},option:function(a,c){return null==a?b:null==c?b[a]:(b[a]=c,void 0)},get:function(a,d,e,f){var g=jQuery.extend({},b);return g.type="GET",g.url=c(a),g.data=d,g.success=e,g.error=f,jQuery.ajax(g)},post:function(a,d,e,f){var g=jQuery.extend({},b);return g.type="POST",g.url=c(a),g.data=d,g.success=e,g.error=f,jQuery.ajax(g)},put:function(a,d,e,f){var g=jQuery.extend({},b);return g.type="PUT",g.url=c(a),g.data=d,g.success=e,g.error=f,jQuery.ajax(g)},del:function(a,d,e,f){var g=jQuery.extend({},b);return g.type="DELETE",g.url=c(a),g.data=d,g.success=e,g.error=f,jQuery.ajax(g)},head:function(a,d,e,f){var g=jQuery.extend({},b);return g.type="HEAD",g.url=c(a),g.data=d,g.error=f,g.complete=function(a,b){if("success"===b){var c,d,f=a.getAllResponseHeaders().split("\n"),g={};for(d=0;d<f.length;d++)c=f[d].split(":"),2!==c.length&&(g[c[0]]=c[1]);null!=e&&e(g)}},jQuery.ajax(g)}}}}.call(this);