
/*------------------------------------------------------------------------------
    Javascript Document lala

    project: Lancôme
    created: 2010-10-26
    authors: TBeduneau
			 RDemey
			 SDussaut
			 HMalaud
----------------------------------------------------------------------------- */

/*!
 * jQuery JavaScript Library v1.5.1
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Feb 23 13:55:29 2011 -0500
 */
(function(a,b){function cg(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cd(a){if(!bZ[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bP(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bO(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bq.test(a)?e(a,f):bO(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bO(a+"["+f+"]",b[f],c,e)}function bN(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bH,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bN(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bN(a,c,d,e,"*",g));return l}function bM(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bB),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bo(a,b,c){var e=b==="width"?bi:bj,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function ba(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function _(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function $(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function Z(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function Y(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function O(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(J.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(p,"")===a.type?r.push(g.selector):t.splice(i--,1);f=d(a.target).closest(r,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&q.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=q.length;j<k;j++){f=q[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?D.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){c=1;try{while(a[0])a.shift().apply(d,f)}catch(g){throw g}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(d.isFunction(this.promise)?this.promise():this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),e;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(e)return e;e=a={}}var c=z.length;while(c--)a[z[c]]=b[z[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){var b=arguments.length,c=b<=1&&a&&d.isFunction(a.promise)?a:d.Deferred(),e=c.promise();if(b>1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i<j;i++)h=g[i].name,h.indexOf("data-")===0&&(h=h.substr(5),f(this[0],h,e[h]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=f(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var h=/[\n\t\r]/g,i=/\s+/,j=/\r/g,k=/^(?:href|src|style)$/,l=/^(?:button|input)$/i,m=/^(?:button|input|object|select|textarea)$/i,n=/^a(?:rea)?$/i,o=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(i);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var j=0,k=b.length;j<k;j++)g.indexOf(" "+b[j]+" ")<0&&(h+=" "+b[j]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(i);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var j=(" "+g.className+" ").replace(h," ");for(var k=0,l=c.length;k<l;k++)j=j.replace(" "+c[k]+" "," ");g.className=d.trim(j)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),j=b,k=a.split(i);while(f=k[g++])j=e?j:!h.hasClass(f),h[j?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(h," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k<l;k++){var m=h[k];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(o.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(j,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&o.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var w=s.handle;w&&(w.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,F(a.origType,a.selector),d.extend({},a,{handler:E,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,F(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?w:v):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=w;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=w;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=w,this.stopPropagation()},isDefaultPrevented:v,isPropagationStopped:v,isImmediatePropagationStopped:v};var x=function(a){var b=a.relatedTarget;try{if(b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},y=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?y:x,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?y:x)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&C("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&C("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var z,A=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var D={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=p.exec(h),k="",j&&(k=j[0],h=h.replace(p,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(D[h]+k),h=h+k):h=(D[h]||h)+k;if(c==="live")for(var q=0,r=n.length;q<r;q++)d.event.add(n[q],"live."+F(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+F(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var G=/Until$/,H=/^(?:parents|prevUntil|prevAll)/,I=/,/,J=/^.[^:#\[\.,]*$/,K=Array.prototype.slice,L=d.expr.match.POS,M={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(O(this,a,!1),"not",a)},filter:function(a){return this.pushStack(O(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/<tbody/i,U=/<|&#?\w+;/,V=/<(?:script|object|embed|option|style)/i,W=/checked\s*(?:[^=]|=\s*.checked.)/i,X={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&W.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?Y(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,ba)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!V.test(a[0])&&(d.support.checkClone||!W.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1></$2>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bA=/^(?:select|textarea)/i,bB=/\s+/,bC=/([?&])_=[^&]*/,bD=/(^|\-)([a-z])/g,bE=function(a,b,c){return b+c.toUpperCase()},bF=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bG=d.fn.load,bH={},bI={},bJ,bK;try{bJ=c.location.href}catch(bL){bJ=c.createElement("a"),bJ.href="",bJ=bJ.href}bK=bF.exec(bJ.toLowerCase()),d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bG)return bG.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bz,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bA.test(this.nodeName)||bu.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(br,"\r\n")}}):{name:b.name,value:c.replace(br,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bJ,isLocal:bv.test(bK[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bM(bH),ajaxTransport:bM(bI),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bP(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bQ(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bD,bE)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bt.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bs,"").replace(bx,bK[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bB),e.crossDomain||(q=bF.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bK[1]||q[2]!=bK[2]||(q[3]||(q[1]==="http:"?80:443))!=(bK[3]||(bK[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bN(bH,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bw.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(by.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bC,"$1_="+w);e.url=x+(x===e.url?(by.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bN(bI,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bO(g,a[g],c,f);return e.join("&").replace(bp,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bR=d.now(),bS=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bR++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bS.test(b.url)||f&&bS.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bS,l),b.url===j&&(f&&(k=k.replace(bS,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bT=d.now(),bU,bV;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bX()||bY()}:bX,bV=d.ajaxSettings.xhr(),d.support.ajax=!!bV,d.support.cors=bV&&"withCredentials"in bV,bV=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),(!a.crossDomain||a.hasContent)&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bU[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bU||(bU={},bW()),h=bT++,g.onreadystatechange=bU[h]=c):c()},abort:function(){c&&c(0,1)}}}});var bZ={},b$=/^(?:toggle|show|hide)$/,b_=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ca,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(cc("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cd(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cc("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(cc("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cd(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(b$.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=b_.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:cc("show",1),slideUp:cc("hide",1),slideToggle:cc("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!ca&&(ca=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(ca),ca=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var ce=/^t(?:able|d|h)$/i,cf=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=cg(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!ce.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=cf.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!cf.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=cg(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=cg(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
/**
 * @license 
 * jQuery Tools Validator 1.2.5 - HTML5 is here. Now use it.
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/form/validator/
 * 
 * Since: Mar 2010
 * Date:    Wed Sep 22 06:02:10 2010 +0000 
 */
/*jslint evil: true */ 
(function($) {	

	$.tools = $.tools || {version: '1.2.5'};
		
	// globals
	var typeRe = /\[type=([a-z]+)\]/, 
		numRe = /^-?[0-9]*(\.[0-9]+)?$/,
		dateInput = $.tools.dateinput,
		
		// http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/
		emailRe = /^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,
		urlRe = /^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,
		v;
		 
	v = $.tools.validator = {
		conf: {   
			grouped: false, 				// show all error messages at once inside the container 
			effect: 'default',			// show/hide effect for error message. only 'default' is built-in
			errorClass: 'invalid',		// input field class name in case of validation error		
			
			// when to check for validity?
			inputEvent: null,				// change, blur, keyup, null 
			errorInputEvent: 'keyup',  // change, blur, keyup, null
			formEvent: 'submitFieldset',       // submit, null

			lang: 'en',						// default language for error messages 
			message: '<div/>',
			messageAttr: 'data-message', // name of the attribute for overridden error message
			messageClass: 'error',		// error message element's class name
			offset: [0, 0], 
			position: 'bottom center',
			singleError: false, 			// validate all inputs at once
			speed: 'normal'				// message's fade-in speed			
		},


		/* The Error Messages */
		messages: {
			"*": { en: "Please correct this value" }		
		},
		
		localize: function(lang, messages) { 
			$.each(messages, function(key, msg)  {
				v.messages[key] = v.messages[key] || {};
				v.messages[key][lang] = msg;		
			});
		},
		
		localizeFn: function(key, messages) {
			v.messages[key] = v.messages[key] || {};
			$.extend(v.messages[key], messages);
		},
		
		/** 
		 * Adds a new validator 
		 */
		fn: function(matcher, msg, fn) {
			// no message supplied
			if ($.isFunction(msg)) { 
				fn = msg; 
				
			// message(s) on second argument
			} else {
				if (typeof msg == 'string') { msg = {en: msg}; }
				this.messages[matcher.key || matcher] = msg;
			}

			// check for "[type=xxx]" (not supported by jQuery)
			var test = typeRe.exec(matcher);                                    
			if (test) { matcher = isType(test[1]); }				
			
			// add validator to the arsenal
			fns.push([matcher, fn]);		 
		},

		/* Add new show/hide effect */
		addEffect: function(name, showFn, closeFn) {
			effects[name] = [showFn, closeFn];
		}
		
	};
	
	/* calculate error message position relative to the input */  	
	function getPosition(trigger, el, conf) {	
		
		// get origin top/left position 
		var top = trigger.offset().top, 
			 left = trigger.offset().left,	 
			 pos = conf.position.split(/,?\s+/),
			 y = pos[0],
			 x = pos[1];
		
		top  -= el.outerHeight() - conf.offset[0];
		left += trigger.outerWidth() + conf.offset[1];
		
		
		// iPad position fix
		if (/iPad/i.test(navigator.userAgent)) {
			top -= $(window).scrollTop();
		}
		
		// adjust Y		
		var height = el.outerHeight() + trigger.outerHeight();
		if (y == 'center') 	{ top += height / 2; }
		if (y == 'bottom') 	{ top += height; }
		
		// adjust X
		var width = trigger.outerWidth();
		if (x == 'center') 	{ left -= (width  + el.outerWidth()) / 2; }
		if (x == 'left')  	{ left -= width; }	 
		
		return {top: top, left: left};
	}	
	

	
	// $.is("[type=xxx]") or $.filter("[type=xxx]") not working in jQuery 1.3.2 or 1.4.2
	function isType(type) { 
		function fn() {
			return this.getAttribute("type") == type;  	
		} 
		fn.key = "[type=" + type + "]";
		return fn;
	}	

	
	var fns = [], effects = {
		
		'default' : [
			
			// show errors function
			function(errs) {
				
				var conf = this.getConf();
				
				// loop errors
				$.each(errs, function(i, err) {
						
					// add error class	
					var input = err.input;					
					input.addClass(conf.errorClass);
					
					// get handle to the error container
					var msg = input.data("msg.el"); 
					
					// create it if not present
					if (!msg) { 
						msg = $(conf.message).addClass(conf.messageClass).appendTo(document.body);
						input.data("msg.el", msg);
					}  
					
					// clear the container 
					msg.css({visibility: 'hidden'}).find("p").remove();
					
					// populate messages
					$.each(err.messages, function(i, m) { 
						$("<p/>").html(m).appendTo(msg);			
					});
					
					// make sure the width is not full body width so it can be positioned correctly
					if (msg.outerWidth() == msg.parent().width()) {
						msg.add(msg.find("p")).css({display: 'inline'});		
					} 
					
					// insert into correct position (relative to the field)
					//var pos = getPosition(input, msg, conf); 
					 
					msg.css({ visibility: 'visible', position: 'absolute', 'z-index': 10, top: pos.top, left: pos.left })
						.fadeIn(conf.speed);     
				});
						
				
			// hide errors function
			}, function(inputs) {
				var conf = this.getConf();				
				inputs.removeClass(conf.errorClass).each(function() {
					var msg = $(this).data("msg.el");
					if (msg) { msg.css({visibility: 'hidden'}); }
				});
			}
		]  
	};

	
	/* sperial selectors */
	$.each("email,url,number".split(","), function(i, key) {
		$.expr[':'][key] = function(el) {
			return el.getAttribute("type") === key;
		};
	});
	

	/* 
		oninvalid() jQuery plugin. 
		Usage: $("input:eq(2)").oninvalid(function() { ... });
	*/
	$.fn.oninvalid = function( fn ){
		return this[fn ? "bind" : "trigger"]("OI", fn);
	};
	
	
	/******* built-in HTML5 standard validators *********/
	
	v.fn(":email", "Please enter a valid email address", function(el, v) {
		return !v || emailRe.test(v);
	});
	
	v.fn(":url", "Please enter a valid URL", function(el, v) {
		return !v || urlRe.test(v);
	});
	
	v.fn(":radio[required]", "Please fill one of the radio",function(el,v){
		var oneChecked=false;
		$(":radio[required][name="+el.attr("name")+"]").each(function(i,el){
		if($(el).is(":checked"))oneChecked=true;
		}) ;
		return oneChecked;
	});

	
	v.fn(":number", "Please enter a numeric value.", function(el, v) {
		return numRe.test(v);			
	});
	
	v.fn("[max]", "Please enter a value smaller than $1", function(el, v) {
			
		// skip empty values and dateinputs
		if (v === '' || dateInput && el.is(":date")) { return true; }	
		
		var max = el.attr("max");
		return parseFloat(v) <= parseFloat(max) ? true : [max];
	});
	
	v.fn("[min]", "Please enter a value larger than $1", function(el, v) {

		// skip empty values and dateinputs
		if (v === '' || dateInput && el.is(":date")) { return true; }

		var min = el.attr("min");
		return parseFloat(v) >= parseFloat(min) ? true : [min];
	});
	
	v.fn("[required]", "Please complete this mandatory field.", function(el, v) {
		if (el.is(":checkbox")) { return el.is(":checked"); }
		return !!v; 			
	});
	
	v.fn("[pattern]", function(el) {
		var p = new RegExp("^" + el.attr("pattern") + "$");  
		return p.test(el.val()); 			
	});

	
	function Validator(inputs, form, conf) {		
		
		
		// private variables
		var self = this, 
			 fire = form.add(self);

		// make sure there are input fields available
		inputs = inputs.not(":button, :image, :reset, :submit");			 

		// utility function
		function pushMessage(to, matcher, returnValue) {
			
			// only one message allowed
			if (!conf.grouped && to.length) { return; }
			
			// the error message
			var msg;
			
			// substitutions are returned
			if (returnValue === false || $.isArray(returnValue)) {
				msg = v.messages[matcher.key || matcher] || v.messages["*"];
				msg = msg[conf.lang] || v.messages["*"].en;

				// substitution
				var matches = msg.match(/\$\d/g);
				
				if (matches && $.isArray(returnValue)) {
					$.each(matches, function(i) {
						msg = msg.replace(this, returnValue[i]);
					});
				} 					 
				
			// error message is returned directly
			} else {
				msg = returnValue[conf.lang] || returnValue;
			}
			
			to.push(msg);
		}
		
		
		// API methods  
		$.extend(self, {

			getConf: function() {
				return conf;	
			},
			
			getForm: function() {
				return form;		
			},
			
			getInputs: function() {
				return inputs;	
			},
			getPosition : function(trigger, el, conf){
				return getPosition(trigger, el, conf);
			},
			reflow: function() {
				inputs.each(function()  {
					var input = $(this),
						 msg = input.data("msg.el");
						 
					if (msg) {						
						var pos = getPosition(input, msg, conf);
						msg.css({ top: pos.top, left: pos.left });
					}
				});
				return self;
			},
			
			/* @param e - for internal use only */
			invalidate: function(errs, e) {
				
				// errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' }
				if (!e) {
					var errors = [];
					$.each(errs, function(key, val) {
						var input = inputs.filter("[name='" + key + "']");
						if (input.length) {
							
							// trigger HTML5 ininvalid event
							input.trigger("OI", [val]);
							
							errors.push({ input: input, messages: [val]});				
						}
					});

				  	errs = errors; 
					e = $.Event();
				}
				
				// onFail callback
				e.type = "onFail";					
				fire.trigger(e, [errs]); 
				
				// call the effect
				if (!e.isDefaultPrevented()) {						
					effects[conf.effect][0].call(self, errs, e);													
				}
				
				return self;
			},
			
			reset: function(els) {
				els = els || inputs;
				els.removeClass(conf.errorClass).each(function()  {
					var msg = $(this).data("msg.el");
					if (msg) {
						msg.remove();
						$(this).data("msg.el", null);
					}
				}).unbind(conf.errorInputEvent || '');
				return self;
			},
			
			destroy: function() { 
				form.unbind(conf.formEvent + ".V").unbind("reset.V"); 
				inputs.unbind(conf.inputEvent + ".V").unbind("change.V");
				return self.reset();	
			}, 
			
			
//{{{  checkValidity() - flesh and bone of this tool
						
			/* @returns boolean */
			checkValidity: function(els, e) {				
				els = els || inputs;    
				els = els.not(":disabled");
				if (!els.length) { return true; }

				e = e || $.Event();

				// onBeforeValidate
				e.type = "onBeforeValidate";
				fire.trigger(e, [els]);				
				if (e.isDefaultPrevented()) { return e.result; }				
					
				// container for errors
				var errs = [];
 
				// loop trough the inputs
				els.each(function(i, el) {
					
					// field and it's error message container						
					var msgs = [], 
						 el = $(this).data("messages", msgs),
						 event = dateInput && el.is(":date") ? "onHide.v" : conf.errorInputEvent + ".v";					
					
					// cleanup previous validation event
					el.unbind(event);
					
					
					// loop all validator functions
					$.each(fns, function() {
						var fn = this, match = fn[0]; 
					
						// match found
						if (el.filter(match).length)  {  
							
							// execute a validator function
							var returnValue = fn[1].call(self, el, el.val());
							
							// validation failed. multiple substitutions can be returned with an array
							if (returnValue !== true) {								
								
								// onBeforeFail
								e.type = "onBeforeFail";
								fire.trigger(e, [el, match]);
								if (e.isDefaultPrevented()) { return false; }
								
								// overridden custom message
								var msg = el.attr(conf.messageAttr);
								if (msg) { 
									msgs = [msg];
									return false;
								} else {
									pushMessage(msgs, match, returnValue);
								}
							}							
						}
					});
					
					if (msgs.length) { 
						
						errs.push({input: el, messages: msgs});  
						
						// trigger HTML5 ininvalid event
						el.trigger("OI", [msgs]);
						
						// begin validating upon error event type (such as keyup) 
						if (conf.errorInputEvent) {							
							el.bind(event, function(e) {
								self.checkValidity(el, e);		
							});							
						} 					
					}
					
					if (conf.singleError && errs.length) { return false; }
					
				});
				
				
				// validation done. now check that we have a proper effect at hand
				var eff = effects[conf.effect];
				if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; }
				
				// errors found
				if (errs.length) {
					self.invalidate(errs, e); 
					return false;
					
				// no errors
				} else {
					// call the effect
					eff[1].call(self, els, e);
					// onSuccess callback
					e.type = "onSuccess";					
					fire.trigger(e, [els]);
					
					els.unbind(conf.errorInputEvent + ".v");
				}
				
				return true;				
			}
//}}} 
			
		});
		
		// callbacks	
		$.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) {
			// configuration
			
			if ($.isFunction(conf[name]))  {
				$(self).bind(name, conf[name]);	
			}
			
			// API methods				
			self[name] = function(fn) {
				if (fn) { $(self).bind(name, fn); }
				return self;
			};
		});	
		
		
		// form validation
		if (conf.formEvent) {
			form.bind(conf.formEvent + ".V", function(e) {
				if (!self.checkValidity(null, e)) {
					form.trigger("submitFieldsetKo");
					return e.preventDefault(); 
				}else{
					// -> valid here
					form.trigger("submitFieldsetOk");
				}
			});
		}
		
		// form reset
		form.bind("reset.V", function()  {
			self.reset();			
		});
		
		// disable browser's default validation mechanism
		if (inputs[0] && inputs[0].validity) {
			inputs.each(function()  {
				this.oninvalid = function() { 
					return false; 
				};		
			});
		}
		
		// Web Forms 2.0 compatibility
		if (form[0]) {
			form[0].checkValidity = self.checkValidity;
		}
		
		// input validation               
		if (conf.inputEvent) {
			inputs.bind(conf.inputEvent + ".V", function(e) {
				self.checkValidity($(this), e);
			});	
		} 
	
		// checkboxes, selects and radios are checked separately
		inputs.filter(":checkbox, select").filter("[required]").bind("change.V", function(e) {
			var el = $(this);
			if (this.checked || (el.is("select") && $(this).val())) {
				effects[conf.effect][1].call(self, el, e); 
			}
		});		
		
		inputs.filter(":radio").filter("[required]").change(function(e) {			
			self.checkValidity($(":radio[required][name="+$(this).attr("name")+"]"), e);
		});
		
		// reposition tooltips when window is resized
		$(window).resize(function() {
			self.reflow();		
		});
	}

	
	// jQuery plugin initialization
	$.fn.validator = function(conf) {
		var instance = this.data("validator");
		
		// destroy existing instance
		if (instance) { 
			instance.destroy();
			this.removeData("validator");
		} 
		
		// configuration
		conf = $.extend(true, {}, v.conf, conf);
		// selector is a form		
		if (this.is(".formSection")) {
			return this.each(function() {			
				var form = $(this); 
				instance = new Validator(form.find(":input"), form, conf);	 
				form.data("validator", instance);
			});
			
		} else {
			instance = new Validator(this, this.eq(0).closest(".formSection"), conf);
			return this.data("validator", instance);
		}     
		
	};   
		
})(jQuery);
/* Errors messages */

var l10n = {
	'errorMsg': {
		'required': {
			'lname': 'Veuillez inscrire votre nom',
			'fname': 'Veuillez inscrire votre pr�nom',
			'password': 'Veuillez inscire votre mot de passe',
			'birthdate': 'inscrivez votre date de naissance',
			'email': 'Veuillez inscrire votre email',
			'address': 'Veuillez inscrire votre adresse',
			'zipcode': 'Veuillez inscrire votre code postal',
			'city': 'Veuillez inscrire votre ville',
			'country': 'Veuillez sélectionner votre pays'
		},
		'invalid': {
			'email': 'e-mail non valide'
		},
		'confirm': {
			'email': 'Cet e-mail est différent du premier',
			'password': 'Ce mot de passe est différent du premier'
		}
	}
};

var formPatterns = {
	empty: /^\s*$/,
	email: /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/,
	zip: /^[0-9]{5}$/,
	day : /^(([123][01])|([012]?[1-9]))$/,
	month : /^((1[012])|(0?[1-9]))$/,
	year : /^((19[0-9]{2})|(20[0-9]{2}))$/,
	mobilephone: /^((06[0-9]{8})|(07[0-9]{8}))$/,
	phone: /^(0[0-9]{9})$/,
	password: /^[A-Za-z0-9!@#$%^&*()_]{6,30}$/
};
	
	
// Extended Methods for forms validations

	//Check data isEqual for confirm mail and password
	$.tools.validator.fn("[data-equals]", "Value not equal with the $1 field", function(input) {
		var name = input.attr("data-equals"),
		 field = this.getInputs().filter("[name$=" + name + "]"); 
		return input.val() == field.val() ? true : [name]; 
	});
	
	$.tools.validator.fn("[data-equals-edit-password]", "Value not equal with the $1 field", function(input) {
		var name = input.attr("data-equals-edit-password"),
		 field = this.getInputs().filter("#passwordFields [name$=" + name + "]"); 
		return input.val() == field.val() ? true : [name]; 
	});
	
	$.tools.validator.fn("[data-email]", "Incorrect Email address", function(input) {
		var name = input.attr("data-email"),
		field = this.getInputs().filter("[name$=" + name + "]"); 
		return input.val().match(formPatterns.email) ? true : [name];
	});
	
	$.tools.validator.fn("[data-zip]", "Incorrect Zip Code", function(input) {
		var name = input.attr("data-zip"),
		field = this.getInputs().filter("[name$=" + name + "]"); 
		return input.val().match(formPatterns.zip) ? true : [name];
	});
	
	$.tools.validator.fn("[data-phone]", "Incorrect Phone Number", function(input) {
		var name = input.attr("data-phone"),
		field = this.getInputs().filter("[name$=" + name + "]"); 
		return input.val().match(formPatterns.phone) ? true : [name];
	});
	
	$.tools.validator.fn("[data-mobilephone]", "Incorrect Mobile Phone Number", function(input) {
		var name = input.attr("data-phone"),
		field = this.getInputs().filter("[name$=" + name + "]"); 
		return input.val().match(formPatterns.mobilephone) ? true : [name];
	});
	
	$.tools.validator.fn("[data-password]", "Incorrect Password", function(input) {
		var name = input.attr("data-phone"),
		field = this.getInputs().filter("[name$=" + name + "]"); 
		return input.val().match(formPatterns.password) ? true : [name];
	});
	
	
	jQuery.tools.validator.fn("[data-date-required]", "Please enter a valid date", function(input) {
			
			var validDate = true;
			
			var group_members = input.parent().find("[data-date-required]");
			
			var year = $('input[name$=birthyear]'); 
			var month = $('input[name$=birthmonth]'); 
			var day = $('input[name$=birthday]'); 
			
			if (year.val().length && month.val().length && !day.length) {
				
				var dateNow = new Date();
				var monthChoice = parseInt(month.val(),10) - 1;
				var testDate = new Date(year.val(), monthChoice);
				
				if ( dateNow > testDate) {
					validDate = true
				}
				else{
					validDate = false
				}
				
			}
			else{
				if (year.val().length && month.val().length && day.val().length) {
					var monthChoice = parseInt(month.val(),10) - 1;
					var testDate = new Date(year.val(), monthChoice, day.val());
					
					if(testDate.getDate() != parseInt(day.val(),10) || testDate.getMonth() != monthChoice || testDate.getFullYear() !=  year.val() || (!year.val().match(formPatterns.year))){
						validDate = false;
					}
					else{
						validDate = true;
					}
				}
				else{
					validDate = false;
				}
			}
			
			var errorMsg = "Veuillez saisir une date correcte";
			
            return validDate !== false ? true: {
            	fr: errorMsg
            };
		});
	
	/*$.tools.validator.fn("[name=title_list]", "you must choose a civility!", function(el, val) {
		return val == 'female';
	});*/

	jQuery.tools.validator.addEffect("onvalidate",
		function(errs, event) {
			var cc = this;
			var conf = this.getConf();
			var form = this.getForm().closest("form");
			var containerTop = form.offset().top;
			var containerLeft = form.offset().left;
			
			var splitedInputs = {
				"radio":false,
				"birthDate":false
			}
		    jQuery.each(errs,function(index, err) {
		    	
				// add error class	
				var input = err.input;				
				input.addClass(conf.errorClass);
				
				// get handle to the error container
				var msg = input.data("msg.el"); 
				
				// create it if not present
				if (!msg) { 
					msg = $(conf.message).addClass(conf.messageClass).appendTo(form);
					input.data("msg.el", msg);
				}  
				
				// clear the container 
				msg.css({visibility: 'hidden'}).find("p").remove();
				
				// populate messages
				$.each(err.messages, function(i, m) {
					$("<p/>").html(m).appendTo(msg);			
				});
				
				// make sure the width is not full body width so it can be positioned correctly
				//if (msg.outerWidth() == msg.parent().width()) {
					msg.add(msg.find("p")).css({display: 'inline'});
				//} 
				
				if (input.is(":radio")) {
	        		input.parents('.radioGroup').find(".legend").addClass(conf.messageClass);
					var pos = cc.getPosition(input.parents('.radioGroup'), msg, {
						"position": "bottom left",
						"offset": [0,0]
					});
					msg.addClass("radioError");
	        	}else if(input.is('[data-date-required]')){
					var pos = cc.getPosition(input.parents('#birthFields'), msg, {
						"position": "bottom left",
						"offset": [0,26]
					}); 
					msg.addClass("birthdateError");
				}else{
					// insert into correct position (relative to the field)
					var pos = cc.getPosition(input, msg, conf);
				}
				
				msg.hide();
				
				if (msg.attr("class") == 'error' || (input.is(":radio") && form.find('.radioError:visible').length == 0) || (input.is('[data-date-required]') && form.find('.birthdateError:visible').length == 0) ){
					
					//alert(input.offset().left)
					msg.css({
						display: 'inline',
						visibility: 'visible',
						position: 'absolute',
						top: (pos.top - jQuery(window).scrollTop()) - (containerTop - jQuery(window).scrollTop()),
						left: (pos.left - containerLeft)
					}).fadeIn(conf.speed);
				}
			});
			if(form.closest('#popin').length == 0){//scrollTop only on page form, not layers form
				jQuery("html,body").animate({scrollTop : jQuery('.invalid:first').offset().top-10},500);
			}
			//jQuery('.invalid:first').animate({scrollTop:0}, 'slow');
			
		},
		function(inputs) {
			var conf = this.getConf();		
				inputs.removeClass(conf.errorClass).each(function() {
					var input = jQuery(this);
					if (input.is(":radio")) {
		        		input.parents('.radioGroup').find(".legend").removeClass(conf.messageClass);
		        	}
					if(input.is('[data-date-required]')){//birthday register
						input.parents('#birthFields').find('input').not(input).removeClass(conf.errorClass);
						var msg = input.parents('#birthFields').find('input').data("msg.el");
						if (msg) { msg.css({visibility: 'hidden'}); }
					}
					var msg = input.data("msg.el");
					if (msg) { msg.css({visibility: 'hidden'}); }
			});
		});


	//validator settings
	jQuery.tools.validator.localize("fr", {
		'*'						: 'Queira digitar um valor correcto',
		'[required]' 			: 'Queira digitar um valor',
		':email'  				: 'Queira digitar um endereço de e-mail correcto',
		'[data-email]'			: 'Queira digitar um endereço de e-mail correcto',
		':radio[required]'  	: 'Queira informar um valor',
		':url'			 		: 'Queira digitar um URL correcto',
		':number'			 	: 'Este campo só pode conter números.',
		'[max]'	 				: 'Este campo não pode conter mais de $1 caracteres',
		'[min]'					: 'Este campo deve conter pelo menos $1 caracteres',
		'[data-zip]'			: 'Código postal incorrecto',
		'[data-date-required]'	: 'Queira digitar uma data válida',
		'[data-equals]'			: 'O valor é diferente do campo $1',
		'[data-equals-edit-password]' : 'O valor é diferente do campo da palavra-passe',
		'[data-phone]'			: 'Queira digitar um número de telefone correcto',
		'[data-mobilephone]'	: 'Queira digitar um número de telemóvel correcto',
		'[data-password]'		: 'Queira digitar uma palavra-passe correcta'
	});
/*
Stylish Select 0.4.1 - $ plugin to replace a select drop down box with a stylable unordered list
http://github.com/sko77sun/Stylish-Select

Requires: jQuery 1.3 or newer

Contributions from Justin Beasley: http://www.harvest.org/ & Anatoly Ressin: http://www.artazor.lv/

Dual licensed under the MIT and GPL licenses.

*/
(function(a){a("html").addClass("stylish-select");Array.prototype.indexOf=function(c,d){for(var b=(d||0);b<this.length;b++){if(this[b]==c){return b}}};a.fn.extend({getSetSSValue:function(b){if(b){a(this).val(b).change();return this}else{return a(this).find(":selected").val()}},resetSS:function(){var b=a(this).data("ssOpts");$this=a(this);$this.next().remove();$this.unbind(".sSelect").sSelect(b)}});a.fn.sSelect=function(b){return this.each(function(){var i={defaultText:"Please select",animationSpeed:0,ddMaxHeight:"",containerClass:""};var l=a.extend(i,b),e=a(this),j=a('<div class="selectedTxt"></div>'),r=a('<div class="newListSelected '+l.containerClass+'"></div>'),z=a('<ul class="newList" style="visibility:hidden;"></ul>'),t=-1,d=-1,m=[],w=false,v=false,x;a(this).data("ssOpts",b);r.insertAfter(e);r.attr("tabindex",e.attr("tabindex")||"0");j.prependTo(r);z.appendTo(r);e.hide();j.data("ssReRender",!j.is(":visible"));if(e.children("optgroup").length==0){e.children().each(function(B){var C=a(this).html();var A=a(this).val();m.push(C.charAt(0).toLowerCase());if(a(this).attr("selected")==true){l.defaultText=C;d=B}z.append(a('<li><a href="JavaScript:void(0);">'+C+"</a></li>").data("key",A))});x=z.children().children()}else{e.children("optgroup").each(function(){var A=a(this).attr("label"),C=a('<li class="newListOptionTitle">'+A+"</li>");C.appendTo(z);var B=a("<ul></ul>");B.appendTo(C);a(this).children().each(function(){++t;var E=a(this).html();var D=a(this).val();m.push(E.charAt(0).toLowerCase());if(a(this).attr("selected")==true){l.defaultText=E;d=t}B.append(a('<li><a href="JavaScript:void(0);">'+E+"</a></li>").data("key",D))})});x=z.find("ul li a")}var o=z.height(),n=r.height(),y=x.length;if(d!=-1){h(d,true)}else{j.text(l.defaultText)}function p(){var B=r.offset().top,A=jQuery(window).height(),C=jQuery(window).scrollTop();if(o>parseInt(l.ddMaxHeight)){o=parseInt(l.ddMaxHeight)}B=B-C;if(B+o>=A){z.css({top:"-"+o+"px",height:o});e.onTop=true}else{z.css({top:n+"px",height:o});e.onTop=false}}p();a(window).bind("resize.sSelect scroll.sSelect",p);function s(){r.css("position","relative")}function c(){r.css("position","static")}j.bind("click.sSelect",function(A){A.stopPropagation();if(a(this).data("ssReRender")){o=z.height("").height();n=r.height();a(this).data("ssReRender",false);p()}a(".newList").not(a(this).next()).hide().parent().css("position","static").removeClass("newListSelFocus");z.toggle();s();x.eq(d).focus()});x.bind("click.sSelect",function(B){var A=a(B.target);d=x.index(A);v=true;h(d);z.hide();r.css("position","static")});x.bind("mouseenter.sSelect",function(B){var A=a(B.target);A.addClass("newListHover")}).bind("mouseleave.sSelect",function(B){var A=a(B.target);A.removeClass("newListHover")});function h(A,E){x.removeClass("hiLite").eq(A).addClass("hiLite");if(z.is(":visible")){x.eq(A).focus()}var D=x.eq(A).html();var C=x.eq(A).parent().data("key");if(E==true){e.val(C);j.text(D);return false}try{e.val(C)}catch(B){e[0].selectedIndex=A}e.change();j.text(D)}e.bind("change.sSelect",function(A){$targetInput=a(A.target);if(v==true){v=false;return false}$currentOpt=$targetInput.find(":selected");d=$targetInput.find("option").index($currentOpt);h(d,true)});function q(A){a(A).unbind("keydown.sSelect").bind("keydown.sSelect",function(D){var C=D.which;v=true;switch(C){case 40:case 39:u();return false;break;case 38:case 37:k();return false;break;case 33:case 36:g();return false;break;case 34:case 35:f();return false;break;case 13:case 27:z.hide();c();return false;break}keyPressed=String.fromCharCode(C).toLowerCase();var B=m.indexOf(keyPressed);if(typeof B!="undefined"){++d;d=m.indexOf(keyPressed,d);if(d==-1||d==null||w!=keyPressed){d=m.indexOf(keyPressed)}h(d);w=keyPressed;return false}})}function u(){if(d<(y-1)){++d;h(d)}}function k(){if(d>0){--d;h(d)}}function g(){d=0;h(d)}function f(){d=y-1;h(d)}r.bind("click.sSelect",function(A){A.stopPropagation();q(this)});r.bind("focus.sSelect",function(){a(this).addClass("newListSelFocus");q(this)});r.bind("blur.sSelect",function(){a(this).removeClass("newListSelFocus")});a(document).bind("click.sSelect",function(){r.removeClass("newListSelFocus");z.hide();c()});j.bind("mouseenter.sSelect",function(B){var A=a(B.target);A.parent().addClass("newListSelHover")}).bind("mouseleave.sSelect",function(B){var A=a(B.target);A.parent().removeClass("newListSelHover")});z.css({left:"0",display:"none",visibility:"visible"})})}})(jQuery);
if(!this.JSON)this.JSON={};
(function(){function l(b){return b<10?"0"+b:b}function o(b){p.lastIndex=0;return p.test(b)?'"'+b.replace(p,function(f){var c=r[f];return typeof c==="string"?c:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function m(b,f){var c,d,g,j,i=h,e,a=f[b];if(a&&typeof a==="object"&&typeof a.toJSON==="function")a=a.toJSON(b);if(typeof k==="function")a=k.call(f,b,a);switch(typeof a){case "string":return o(a);case "number":return isFinite(a)?String(a):"null";case "boolean":case "null":return String(a);
case "object":if(!a)return"null";h+=n;e=[];if(Object.prototype.toString.apply(a)==="[object Array]"){j=a.length;for(c=0;c<j;c+=1)e[c]=m(c,a)||"null";g=e.length===0?"[]":h?"[\n"+h+e.join(",\n"+h)+"\n"+i+"]":"["+e.join(",")+"]";h=i;return g}if(k&&typeof k==="object"){j=k.length;for(c=0;c<j;c+=1){d=k[c];if(typeof d==="string")if(g=m(d,a))e.push(o(d)+(h?": ":":")+g)}}else for(d in a)if(Object.hasOwnProperty.call(a,d))if(g=m(d,a))e.push(o(d)+(h?": ":":")+g);g=e.length===0?"{}":h?"{\n"+h+e.join(",\n"+h)+
"\n"+i+"}":"{"+e.join(",")+"}";h=i;return g}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,n,r={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function")JSON.stringify=function(b,f,c){var d;n=h="";if(typeof c==="number")for(d=0;d<c;d+=1)n+=" ";else if(typeof c==="string")n=c;if((k=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number"))throw Error("JSON.stringify");return m("",
{"":b})};if(typeof JSON.parse!=="function")JSON.parse=function(b,f){function c(g,j){var i,e,a=g[j];if(a&&typeof a==="object")for(i in a)if(Object.hasOwnProperty.call(a,i)){e=c(a,i);if(e!==undefined)a[i]=e;else delete a[i]}return f.call(g,j,a)}var d;b=String(b);q.lastIndex=0;if(q.test(b))b=b.replace(q,function(g){return"\\u"+("0000"+g.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+b+")");return typeof f==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse");}})();

// main config
var Browser = {
	"sessionStorage" : function(){
		try { 
			return 'sessionStorage' in window && window['sessionStorage'] !== null; 
		} catch (e) { 
			return false; 
		}
	}
};

/**
 * Tests browser capabilities such as HTML5 attributes like "placeholder" 
 * @class
 */
BrowserHandles = function() {
	
	var cc = this;
	
	/**
	 * Launches object methods to build main config file
	 * @method
	 */
	cc.init = function(context) {
		cc.context = context || document;
		if(!context){ // the first browserhandles is initiated on the document, no need to re-detect opacity on an area of the page
			cc.opacity();
		}
		cc.attribute(['input','textarea'], 'placeholder');
	};
	
	/**
	 * Test attribute existence on given element
	 * @method
	 * @param	{Array}		element		an array of elements to test attribute for
	 * @param	{String}	attribute	attribute to test
	 */
	cc.attribute = function(tags, attribute) {
		for (var i = 0,aLength = tags.length; i < aLength; i++) {
			var elmt = document.createElement(tags[i]);
			var attrib = attribute.toLowerCase();
			
			if (!(attrib in elmt) && typeof(cc.correct[attrib]) === "function") {
				if (cc.context === document) {
					Browser.placeholder = false;
				}
				cc.correct[attrib](tags[i]);
			}
			else 
				if (cc.context === document) {
				
					Browser.placeholder = true;
				}
		}
	};//attribute
		
	/**
	 * Enhance browsers with lacking features such as "placeholder" if needed
	 * @method
	 */
	cc.correct = {
		
		/**
		 * Adds "placeholder" behaviour to browsers that need it
		 * @method
		 */
		placeholder: function(tag) {
			jQuery(tag+'[placeholder]',cc.context).each(function() {
					
					var elmt = jQuery(this);
					if(jQuery.trim(elmt.val()) == ''){
						elmt.val(elmt.attr('placeholder'));
					}					
					
					elmt.bind('focus', function(evt){
						// focus
						if (evt.type = "focus" && elmt.val() == elmt.attr('placeholder')) {
							elmt.bind('blur',function(evt){
								elmt.unbind('blur');
								if (evt.type = "blur" && jQuery.trim(elmt.val()) == '') {
									elmt.val(elmt.attr('placeholder'));
								}
							})
						 	elmt.val('');
						}
					});
				});
		}//placeholder
		
	};//cc.correct
	
	/**
	 * Test if opacity is supported (IE detect)
	 * @method
	 */
	cc.opacity = function() {
		Browser.opacity = jQuery.support.opacity;
	};
};



/**
 * Handles universes nav hover effect
 * @class
 */
NavHeader = function(){
	var cc = this;
	
	/**
	 * Sets and binds rollover block 
	 * @method
	 */
	cc.init = function(){
		
		cc.flashLinks();
		cc.handleLayers();
		cc.forgotPass();
		cc.mainNavigation();
		cc.offers();
	};//init
	
	cc.flashLinks = function footbridge(){
		if(document.brand && SWFAddress){ //flash page
			jQuery('a[href*="#/"]','#header').bind('click',function(e){
				e.preventDefault();
				SWFAddress.setValue(this.hash.substr(2));
			});
		};
	};//flashLinks
		
	/**
	 * Manages newsletter, account and cart layers
	 * @method
	 */
	cc.handleLayers = function() {
		
		var elmt = jQuery('#quickLinks .newsletter, #quickLinks .account, #quickLinks .shoppingCart'),
			propsDefault = {
				display: 'block',
				opacity: 0
			},
			propsAnim = {
				top: '38px',
				opacity: 1
			},
			propsRevertAnim = {
				top: '30px',
				opacity: 0
			},
			propsRevertDefault = {
				display: 'none'
			},
			delay,
			openedLayer = false;
		
		
		elmt.each(function(){
			
			var currentElmt = jQuery(this);
					
			currentElmt.find('.topLink').bind('click', function(e){
				e.stopImmediatePropagation();
				e.preventDefault();
				
				if (!openedLayer) {
					if(document.brand){
						document.brand.pause_flash();
					}
	
					delay = window.setTimeout(function(){
						
						openedLayer = true;
						
						// handling echap key
						jQuery(document).bind('keyup', cc.closeHeaderLayer = function(e){
							if(e.keyCode == "27"){
								jQuery('#quickLinks li > div:visible .closeLayer').trigger('click');
							}
						});
						
			
						// binding close button
						currentElmt.find('.closeLayer').bind('click', cc.closeLayer = function(e){ // changed bind to live for cart layer who's rewritten after a new product is added
						
							var closeLink = jQuery(this).find('.closeLayer');
							e.stopImmediatePropagation();
							e.preventDefault();
							
							if (Browser.opacity) { // modern browsers
								jQuery(this).blur()
										.parent().animate(propsRevertAnim, 300, function(){
												 	jQuery(this).css(propsRevertDefault);
													if(document.brand){
														document.brand.play_flash();
													}

												});
							} else { // Internet Explorer < 9
								PIE.detach(jQuery(this).parents('.animated')[0]);
								jQuery(this).blur()
											.parents('.animated').hide().removeClass('animated');
								if(document.brand){
									document.brand.play_flash();
								}
								
							}
							openedLayer = false;
							jQuery(document).unbind('keyup', cc.closeHeaderLayer);
						});
						
						/*currentElmt.bind('mouseleave', function(){
							if (typeof(delay) != undefined) {
								window.clearTimeout(delay);	
							}
						});*/
						
						if (Browser.opacity) { // modern browsers
							// change default state
							currentElmt.find('div:first').addClass('jsed');
							// animate it
							currentElmt.find('.jsed').css(propsDefault).animate(propsAnim, 400);
							
						} else { // Internet Explorer < 9
							currentElmt.find('div:first').addClass('animated').css('top','38px').show();
							PIE.attach(currentElmt.find('div.animated')[0]);
						}
						//test if there is a formsection
						if(currentElmt.find('.formSection').length && !currentElmt.find('.formSection:first a[href*=doPostBack]').data("events")){
							//init the form handling
							var headerForm = new AjaxForm();
							headerForm.init(currentElmt.find('.formSection:first'),currentElmt.find('.formSection:first').data("ajax"));
							delete headerForm;
						}
					}
					, 1);
				}
			});
		});
		
	};//handleLayers
	
	
	/**
	 * Handles forgot pass layer
	 * @method
	 */
	cc.forgotPass = function(elmt) {
		context = elmt || document;
		jQuery('#account .forgotPassword',context).click(function(e){
			e.preventDefault();
						
			var elmt = jQuery(this),
				delay = 200;
					
			elmt.parents('#account').addClass('getBackPass');
			
			// hide: login layer
			// show: password recovery layer
			if (Browser.opacity) { // modern browsers
				elmt.parents('#account').find('.formSection:first').fadeOut(delay, function(){
											jQuery(this).next().fadeIn(delay);
										});
										
			} else { // Internet Explorer < 9
				elmt.parents('#account').find('.formSection:first').hide()
																   .next().show();
			}
			
			
			//test if there is a formsection
			if(elmt.parents('#account').find('.formSection:last').length && !elmt.parents('#account').find('.formSection:last a[href*=doPostBack]').data("events")){
				//init the form handling
				var lostPassForm = new AjaxForm();
				lostPassForm.init(elmt.parents('#account').find('.formSection:last'),elmt.parents('#account').find('.formSection:last').data("ajax"));
				delete lostPassForm;
			}
			
			// unbind close layer button action
			// bind close password recovery button
			elmt.parents('#account').find('.closeLayer').unbind('click')
								  						.bind('click', cc.closePass = function(e){
															
															// closing password recovery function
															// hide: password recovery layer
															// show: login layer
															e.preventDefault();
															var passwordForm = elmt.parents('#account').find('.passwordForm');
															if (Browser.opacity) { // modern browsers
																passwordForm.fadeOut(delay, function(){
																							jQuery(this).prev().fadeIn(delay)
																											   .parent().removeClass('getBackPass');
																						});
																
															} else { // Internet Explorer < 9
																passwordForm.hide()
																											  .prev().show()
																											  .parent().removeClass('getBackPass');
															}
															// unbind close password recovery button
															// bind close layer button action
													  		elmt.parents('#account').find('.closeLayer').unbind('click', cc.closePass);
															if(elmt.parents('#popin').length != 0){
																elmt.parents('#account').find('.closeLayer').hide();
															}
															elmt.parents('#account').find('.closeLayer').bind('click', cc.closeLayer);
															
															//reset the forgot password form to the default display
															passwordForm.find('.template').removeAttr('style');
															passwordForm.find('.show').removeClass('show');
															passwordForm.find('.success').remove();
																										
														});
		});
		
		
	};//forgotPass
	
	
	/**
	 * Handles main navigation
	 * @method
	 */
	cc.delay;
	cc.mainNavigation = function(){
		
		if (!Browser.opacity) {
			var PIEnavItems = {};
		}
		
		jQuery('#nav').addClass('jsed');
		jQuery('#nav > li:not(.link)').bind('mouseenter mouseleave', function(evt){
			evt.preventDefault();
			
			var currentItem = jQuery(this);
			switch(evt.type) {
				
				case "mouseenter": 
					if(document.brand){
						document.brand.pause_flash();
					}
					window.clearTimeout(cc.delay);
					
					
					cc.delay = setTimeout(function(){
						
						currentItem.addClass('active')
								   .siblings().removeClass('active');
						
						if (!Browser.opacity) { // Internet Explorer < 9
							currentItem.find('.submenu').andSelf().addClass('animated')
									   .siblings().find('.submenu').andSelf().removeClass('animated');
								
								jQuery('css3-container',jQuery('#nav')).each(function(){ //detach olders if there are some before attach new ones
									PIE.detach(jQuery(this).next()[0]);//using next() for pointing the real DOM node, not the css3-container node
								});								
								
								PIE.attach(currentItem.find('.submenu')[0]);
								PIE.attach(currentItem[0]);
						}
								   							   
					},150);
					
					break;
					
				case "mouseleave": 
					window.clearTimeout(cc.delay);
					
					cc.delay = setTimeout(function(){
						if (!Browser.opacity) { // Internet Explorer < 9
								PIE.detach(currentItem.find('.submenu')[0]);
								PIE.detach(currentItem[0]);								
						}
						currentItem.removeClass('active')
								   .find('.submenu').andSelf().removeClass('animated');
						
						if(!jQuery('#popin').length){
							if(document.brand){
								document.brand.play_flash();
							};
						}
					},50);
					
					break;
			}
						
		});
	};//navigation
	cc.delayShortcut;
	cc.offers = function offers(){
		jQuery('#shortcutsOffer').bind('mouseenter mouseleave', function(e){
			e.preventDefault();
			
			var offerItem = jQuery(this);
			switch(e.type) {
				case "mouseenter": 
					
					window.clearTimeout(cc.delayShortcut);
					
					cc.delayShortcut = setTimeout(function(){
						offerItem.addClass('active')
							
							if (!Browser.opacity) { // Internet Explorer < 9
								offerItem.find('.submenu').andSelf().addClass('animated');
								PIE.attach(offerItem.find('.submenu')[0]);
								PIE.attach(offerItem[0]);
							}
					},150);
					break;
				case "mouseleave": 
					window.clearTimeout(cc.delayShortcut);
					
					cc.delayShortcut = setTimeout(function(){
					
						if (!Browser.opacity) { // Internet Explorer < 9
							PIE.detach(offerItem.find('.submenu')[0]);
							PIE.detach(offerItem[0]);
						}
						offerItem.removeClass('active')
								   .find('.submenu').andSelf().removeClass('animated');
					},50);
					
					break;
			}
			
		});
	};//offers
	
};


/**
 * Handles showcase
 * @class
 */
Showcase = function(){
	var cc = this,
		showcase = jQuery('.showcase'),
		showcaseNavItem = showcase.find('.showcaseNav li'),
		showcaseItem = showcase.find('> div li'),
		currentItemHash,
		timer;
	
	/**
	 * Inits showcase
	 * @method
	 */
	cc.init = function(){
		
		// enables default state
		showcaseItem.closest('div').addClass('jsed');
		showcaseNavItem.filter(':first').addClass('active');
		showcaseItem.filter(':first').addClass('active');
		
		if (showcaseNavItem.length > 1) {
			cc.change();
			cc.timer();
			cc.stopTimer();	
		}
		
	};//init
	
	/**
	 * Binds changing item mechanics
	 * @method
	 */
	cc.change = function(){
		
		showcaseNavItem.find('a').click(function(evt){
			
			evt.preventDefault();
			evt.stopPropagation();
			
			currentItemHash = jQuery(this.hash);
			
			// toggling nav item active state
			jQuery(this).parent().addClass('active')
								 .siblings().removeClass('active');
								 
			currentItemHash.show();
			showcaseItem.filter('.active').fadeOut(function(){
				jQuery(this).removeClass('active');
				currentItemHash.addClass('active')
			});
			
			jQuery(this).blur();
		});
		
	
	};//change
	
	/**
	 * Timer
	 * @method
	 */
	cc.timer = function(){
		
		
		timer = window.setInterval(function() {
						
			var currentItem = showcaseNavItem.filter('.active');
			
			if (currentItem.next().length) {
				currentItem.next().find('a').trigger('click');
			} else {
				currentItem.siblings().filter(':first').find('a').trigger('click');
			}
		},3400);
		
		
	};//timer
	
	cc.stopTimer = function() {
				
		jQuery('.showcaseNav li, .showcase .jsed li').bind('mouseenter mouseleave', function(evt){
			
			switch(evt.type) {
				
				case 'mouseenter':
					window.clearInterval(timer);
					break;
					
				case 'mouseleave':
					cc.timer();
					break;
			}
			
		});
	};//stopTimer
};


/**
 * Customer login management: handles login and lost password
 * @class
 */
Customer = function(){
	
	var cc = this;
	
	/**
	 * Binds
	 * @method
	 */
	cc.init = function(){
		
		jQuery('.passwordForm .btNavigation input').click(function(e){
			e.preventDefault();
			cc.password(jQuery(this));			
		});
		
	}();//cc.init
	
	/**
	 * Handles password retrieval process
	 * @method
	 * @param	{object}	elmt	jQuery collection
	 */
	cc.password = function(elmt) {
				
		var regEmail = new RegExp(/^([a-zA-Z0-9]+(([\.\-\_]?[a-zA-Z0-9]+)+)?)\@(([a-zA-Z0-9]+[\.\-\_])+[a-zA-Z]{2,4})$/),
			errorBox = elmt.closest('p').nextAll('.errorBox')
			emailVal = jQuery('.passwordForm input[type=text]').val();
		
		
		if (emailVal.match(regEmail)) {
			
			errorBox.slideUp();
			
			// Ajax launch
			jQuery('.passwordForm .confirmPass strong').text(emailVal);
			
			
			// hide: login layer
			// show: password recovery layer
			if (Browser.opacity) { // modern browsers
				jQuery('.passwordForm p:not(.confirmPass), .passwordForm ul').fadeOut(function(){
					jQuery('.passwordForm .confirmPass').fadeIn();
				});
										
			} else { // Internet Explorer < 9
				jQuery('.passwordForm p:not(.confirmPass), .passwordForm ul').hide();
				jQuery('.passwordForm .confirmPass').show();
			}
			
			
		} else {
			if (Browser.opacity) { // modern browsers
				errorBox.slideDown();
			} else { // Internet Explorer < 9
				errorBox.show();
			}
		}
		
		
		
	};//cc.password
	
	
};//Customer;



(function(jQuery){
	jQuery.fn.carrousel = function(liveConfig){
		var defaults;
		defaults = {
			"animated" : false,
			"fade" : 150,
			"delay" : 200,
			"lines" : 1,
			"itemElmt" : ".inner>ul>li",
			"pagingElmt" : ".paging ul",
			"arrowsElmt" : ".previous, .next",
			"animatePerLines" : false,
			"hasDifferentSize" : false,
			"previousCarrousel" : ""
		}
		jQuery.extend(defaults, liveConfig)
		
		return this.each(function(){
			var moduleElmt = jQuery(this), //cache the current element in the set of matched elements.
			currentCollection;
			
			options = jQuery.extend({},defaults, moduleElmt.data('carrousel')); //data-carrousel must be a valid object for update the defaults settings
			
			init = function(){
				jQuery(moduleElmt).addClass('jsed');
				inner();
				paging();
			}();//init
			
			function inner(){
				var containerWidth, maxItems, firstItem, secondItem, i, j, firstItemWidth, itemWidth, pos, itemShowed;
				
				if(!jQuery(moduleElmt).is(":visible")){ //set the display to block so we can compute the values
					jQuery(moduleElmt).parent().css({
						"display" : "block",
						"visibility" : "hidden",
						"height" : 0
					});

					options.hidden = true;
				}
				
				containerWidth = jQuery(moduleElmt).width();
				
				
				maxItems = false;
				
				i = 0;
				j = options.lines;
				pos = {};
				
				pos.top = 0;
				if (options.updated) {
					jQuery(options.itemElmt, moduleElmt).removeClass('firstItem');
				}
				currentCollection = jQuery(options.itemElmt, moduleElmt).filter(':visible');
				
				currentCollection.each(function(index){
					/*if(options.updated && typeof(itemWidth) == "undefined"){
						jQuery(this).addClass('firstItem');
					}*/
					
					firstItem = jQuery(options.itemElmt, moduleElmt).filter(':visible:first');
					secondItem = firstItem.next();
					
					firstItem.addClass("firstItem");					
					
					
					if(!maxItems && ((~~firstItem.outerWidth(true) + ~~secondItem.outerWidth(true)) > containerWidth)){ //one item to show
						options.itemsPerLines = 1;
						options.oneItemPerLines = true
						maxItems = true;
					}else if (itemWidth + ~~jQuery(this).outerWidth(true) > containerWidth && !maxItems) {
						options.itemsPerLines = currentCollection.index(this);
						maxItems = true;
					};
					
					
					if (!options.oneItemPerLines) { //if there is more than one item per line then position absolute 
						if (i >= options.itemsPerLines && options.lines > 1) {
							pos.top = ~~jQuery(this).outerHeight(true) * (options.lines - j);
						}
						
						if (i >= options.itemsPerLines || i == 0) { //first item in the line
							jQuery(this).addClass('firstItem');
							pos.left = 0;
							i = 0;
							if (j > 1) {
								j--
							}
							else {
								j = options.lines;
							}
						}
						else {
							pos.left = ~~pos.left + ~~jQuery(this).prev().outerWidth(true);
						}
						
						jQuery(this).css({
							"position": "absolute",
							"top": pos.top,
							"left": pos.left
						});
						i++
					}
					
					
					if(options.lines > 1 && jQuery(options.itemElmt, moduleElmt).length > options.itemsPerLines){
						if (!options.updated) {
							jQuery(".inner", moduleElmt).height(options.lines * ~~jQuery(options.itemElmt, moduleElmt).outerHeight(true));
						}
					}else if(options.lines > 1){
						if (!options.updated) {
							jQuery(".inner", moduleElmt).height(jQuery(options.itemElmt, moduleElmt).outerHeight(true));
						}
					}
					
					itemWidth = ~~itemWidth + ~~jQuery(this).outerWidth(true);
				});
				
				if(!options.itemsPerLines){
					options.itemsPerLines = currentCollection.length;
				}
				if(options.updated && options.itemsPerLines < currentCollection.length){
					jQuery(".inner",moduleElmt).animate({
						"height" : options.lines *~~currentCollection.outerHeight(true)
					},300);
				}else if(options.updated && options.itemsPerLines >= currentCollection.length){
					jQuery(".inner",moduleElmt).animate({
						"height" : sizes(currentCollection)
					},300);
				}
				
				options.pages = Math.ceil((itemWidth / options.lines) / containerWidth);
				options.currentPage = 1;
					currentCollection.not(':gt(' + ((options.itemsPerLines - 1) * options.lines) + ')').show()
					currentCollection.not(':lt(' + (options.itemsPerLines * options.lines) + ')').hide();
				if(options.hidden){ //hide the element after values are computed 
					jQuery(moduleElmt).parent().removeAttr("style");
				}
				
			};//inner
			
			function paging(){
				if(jQuery(options.pagingElmt, moduleElmt).length){ //default carrousel
					var anchors, innerPaging;
					anchors = jQuery(options.pagingElmt, moduleElmt).find('a');
					
					innerPaging = '<li>';
						innerPaging += '<a class="previous" href="'+ jQuery(anchors[0]).attr("href") +'"> </a>';
					innerPaging += '</li>';
					innerPaging += '<li class="pages">1 / '+ options.pages + '</li>';
					innerPaging += '<li>';
						innerPaging += '<a class="next" href="'+ jQuery(anchors[1]).attr("href") +'"> </a>';
					innerPaging += '</li>';
					
					jQuery(options.pagingElmt, moduleElmt).html(innerPaging);
					updatePaging(options, moduleElmt);
					
					(function(moduleElmt,options){
						jQuery(options.pagingElmt, moduleElmt).find('a').click(function(e){
							e.preventDefault();
							if (!options.animated) {
								options.animated = true; // animation start
								transition(e, this, moduleElmt, options)
							}
						});
					})(moduleElmt,options);
					
					
				}else if(jQuery(options.arrowsElmt, moduleElmt).length){ //range carrousel
					updatePaging(options, moduleElmt);
					(function(moduleElmt,options){
						jQuery(options.arrowsElmt, moduleElmt).click(function(e){
							e.preventDefault();
							if (!options.animated) {
								options.animated = true; // animation start
								transition(e, this, moduleElmt, options)
							}
						});
					})(moduleElmt,options);
				}
			};//paging
			
			function transition(e,elmt,moduleElmt,options){
				var nextPage,isNext, currentStart, currentEnd, nextStart, nextEnd, //next stand for the next to be moved, not the next items in the array
					factorOut, factorIn;
				currentStart = (options.currentPage-1)*(options.itemsPerLines*options.lines);
				currentEnd = currentStart + (options.itemsPerLines*options.lines);
				
				currentElmt = currentCollection.slice(currentStart,currentEnd); // carrousel init

				
				nextPage = options.currentPage;
				isNext = true;
				
				if (jQuery(elmt).attr("class") === "previous") {
					currentElmt = jQuery(jQuery.makeArray(currentElmt).reverse());
					isNext = false;
					nextPage--
				}else{
					nextPage++
				}
				
				if((nextPage > 1 && nextPage <= options.pages) || (nextPage <= options.pages && nextPage > 0)){ // test the edges
				
					factorOut = 0;
					for (var i = 0, iLength = currentElmt.length; i < iLength; i++) { // loop on every element in the set matched elements
						if (!options.animatePerLines) {
							if (i == 0 || factorOut == options.itemsPerLines) {
								factorOut = 0;
							}
						}
						fadeOut = false;
						
						jQuery(currentElmt[i]).delay(options.delay * factorOut/2).fadeOut(options.fade,function(){
							
							if(currentElmt.index(this) == 1 || (currentElmt.index(this) == 0 && currentElmt.length == 1)){// || test if there is a single element in the set of matched element
								if (!isNext) {
									nextStart = (options.currentPage-2)*(options.itemsPerLines*options.lines);
									options.currentPage--
								}else{
									nextStart = options.currentPage*(options.itemsPerLines*options.lines);
								}
								nextEnd = nextStart + (options.itemsPerLines*options.lines);
								
								if (isNext) {
									options.currentPage++;
								}
											
								updatePaging(options,moduleElmt);
								
								var nextElmt = currentCollection.slice(nextStart,nextEnd);
								//nextElmt.css('opacity', '0').show();
								
								if (!isNext) {
									nextElmt = jQuery(jQuery.makeArray(nextElmt).reverse());
								}
								
								factorIn = 0;
								for (var j = 0, iLength = nextElmt.length; j < iLength; j++) {	
									if (!options.animatePerLines) {
										if (j == 0 || factorIn == options.itemsPerLines) {
											factorIn = 0;
										}
									}
									
									jQuery(nextElmt[j]).delay(options.delay * factorIn/2).fadeIn(options.fade,function(){ //callback
										if (nextElmt.index(this) == nextElmt.length-1 ) {//last item animated
											if (!currentElmt.is(":animated")) {//animation complete
												currentElmt.hide();
												options.animated = false;
												if (!isNext) {
													currentElmt = jQuery(jQuery.makeArray(nextElmt).reverse());
												}
												else {
													currentElmt = nextElmt;
												}
												
												
												if(options.hasDifferentSize){ //update the height of the item
													
													jQuery(".inner",moduleElmt).animate({
														"height" : sizes(currentElmt)
													},300);
												}
												
												
											}else{
												var waiter = setInterval(function(){
													if (!currentElmt.is(":animated")) {
														clearInterval(waiter)
														currentElmt.hide();
														options.animated = false;
														if (!isNext) {
															currentElmt = jQuery(jQuery.makeArray(nextElmt).reverse());
														}
														else {
															currentElmt = nextElmt;
														}
													}
												},options.fade)
											}
										}
									});
									factorIn++
								}
							}
						});
						factorOut++
					};
				}else{ // when on edges
					options.animated = false;
				}
			};//transition
			
			function sizes(currentElmt){
				var newHeight = 0,
					prevHeight = 0,
					tempHeight = 0,
					j = options.itemsPerLines,
					elmts = jQuery.makeArray(currentElmt);
					for (var i = 0,aLength = elmts.length; i < aLength; i++){
						if(i < options.itemsPerLines && newHeight < jQuery(elmts[i]).outerHeight(true)){
							newHeight = jQuery(elmts[i]).outerHeight(true);;
							if(j == 1){
								j = options.itemsPerLines;
							}
						}else if(j == 0){
							j = options.itemsPerLines;
							if (prevHeight < jQuery(elmts[i]).outerHeight(true)) {
								newHeight = newHeight+jQuery(elmts[i]).outerHeight(true)
							}else {
								newHeight = newHeight+tempHeight	
							}
						}else if(i > options.itemsPerLines && j < options.itemsPerLines && tempHeight < jQuery(elmts[i]).outerHeight(true)){
							tempHeight = jQuery(elmts[i]).outerHeight(true);
						}
						j--
					}
					return newHeight;
			}
			
			function updatePaging(options, moduleElmt){
				if(options.pages > 1 && jQuery(options.pagingElmt, moduleElmt).length){
					if(jQuery("body").hasClass('msie6') || jQuery("body").hasClass('msie7')){
						jQuery(options.pagingElmt, moduleElmt).parent().css("display","inline");
					}else{
						jQuery(options.pagingElmt, moduleElmt).parent().css("display","inline-block");
					}
					
					var newPaging = options.currentPage+' / '+options.pages;
					jQuery(options.pagingElmt, moduleElmt).find(".pages").html(newPaging);
					
				}else if(options.pages == 1 && jQuery(options.pagingElmt, moduleElmt).length){
					jQuery(options.pagingElmt, moduleElmt).parent().hide();
				}
				
				jQuery(options.arrowsElmt, moduleElmt).parents("li").removeClass("edge");
				if(options.currentPage == options.pages){
					jQuery(options.arrowsElmt, moduleElmt).parents('ul').find("li:last").addClass("edge");
				}
				if(options.currentPage == 1){
					jQuery(options.arrowsElmt, moduleElmt).parents('ul').find("li:first").addClass("edge");
				}	
							
			};//updatePaging
			
		});//this.each
		
	};//carrousel
	
	jQuery.fn.tabulate = function(){
		return this.each(function(){
			var tabElmt = jQuery(this);
			if(tabElmt.find('a')[0].hash.length > 0){
				var itemElmt = tabElmt.next();
				
				tabElmt.find("a").bind("click",function(e){
					e.preventDefault();
					var elmt = jQuery(this);
					elmt.parent().siblings().removeClass('active');
					elmt.parent().addClass('active');
					itemElmt.children('li.active').removeClass('active');
					if(!elmt.parent().hasClass('noShop')){
						jQuery('.descriptionContent .shop').appendTo(jQuery(elmt[0].hash));	
					}
					jQuery(elmt[0].hash).addClass('active');
					
				});//bind click
			}
		});//this.each
	};//tabulate
	
	jQuery.fn.filterElmt = function(){
		return this.each(function(){
			var elmt = jQuery(this);
			elmt.find('a').bind('click',function(e){
				e.preventDefault();
				jQuery(this).closest('ul').find('.active').removeClass('active');
				jQuery(this).parent().addClass("active");
				if (jQuery(this).data('filter') == "all") {
					jQuery(this).parents('ul').next().find('.inner li').show();
				}
				else {
					jQuery(this).parents('ul').next().find('.inner li').not('.' + jQuery(this).data('filter')).hide();
					jQuery('.'+jQuery(this).data('filter')).show();
				}
				jQuery(this).parents('ul').next().carrousel({"updated":true});//flag filtering 
			});//bind click
			if(elmt.find('li.active').length){
				elmt.find('.active a').trigger('click');
			}else{
				elmt.find('li:first').addClass('active');
			}
		})
	};//filterElmt
	
	
	jQuery.url = {};
	jQuery.extend(jQuery.url, {
		_params: {},
		init: function(){
			var paramsRaw = "";
			try{
				paramsRaw = 
					(document.location.href.split("?", 2)[1] || "").split("#")[0].split("&") || [];
				for(var i = 0; i< paramsRaw.length; i++){
					var single = paramsRaw[i].split("=");
					if(single[0])
						this._params[single[0]] = unescape(single[1].replace(/\+/g, " "));
				}
			}
			catch(e){
				alert(e);
			}
		},
		param: function(name){
			return this._params[name] || "";
		},
		paramAll: function(){
			return this._params;
		}
	});//url parameters
	jQuery.url.init();
	
})(jQuery);


(function(){
	Popin = function(){
		var cc = this;
		cc.options = {
			"top" : 185,
			"background" : true,
			"animate" : true
		}
		
		cc.init = function(elmt){
			if (jQuery('#header .closeLayer:visible').length > 0) {
				jQuery('#header div:visible .closeLayer').trigger("click");// close header layers
			}
			cc.elmt = elmt;
			
			if (cc.elmt.data && typeof(cc.elmt.data) == "function") { //cc.elmt == DOM elmt
				link = elmt.attr('href');
				jQuery.extend(cc.options, elmt.data('popin'));
				cc.call(link,elmt.data('popin'));
			}else{ //cc.elmt == object
				link = cc.elmt.url;
				jQuery.extend(cc.options, elmt.data);
				if(cc.elmt.data.callback){//clean datas to send
					delete cc.elmt.data.callback;
				}
				cc.call(link,cc.elmt.data);
			}
		};//init
		
		cc.loader = {
			add : function(elmt){
				if (elmt && typeof(elmt.data) == "function" && elmt.find(".ajax-loader").length) {
					elmt.find('.ajax-loader').show();
				}else if (elmt && typeof(elmt.data) == "function") {
					elmt.parent().find('.ajax-loader').show();
				}
			},
			remove : function(elmt){
				if (elmt && typeof(elmt.data) == "function" && elmt.find(".ajax-loader").length) {
					elmt.find(".ajax-loader").hide();
				}else if (elmt && typeof(elmt.data) == "function") {
					elmt.parent().find('.ajax-loader').hide();
				}
			}
		};//loader
		
		cc.call = function(url,data){
			var response;
			cc.lastCall = {};
			cc.lastCall.url = url;
			if(data){
				cc.lastCall.data = data;
			}
			if(cc.elmt.button){
				cc.loader.add(jQuery(cc.elmt.button));
			}else{
				cc.loader.add(cc.elmt);
			}
			if (url != '#') {
				jQuery.ajax({
					"type": "GET",
					"url": url,
					"data": data,
					success: function(data){
						response = data
						cc.elements(response);
					},
					error: function(data){
						window.console ? console.log('error') : alert('error');
					},
					complete: function(){
						if(cc.elmt.button){
							cc.loader.remove(cc.elmt.button);
						}else{
							cc.loader.remove(cc.elmt);
						}
						if (cc.elmt.data && typeof(cc.elmt.data) == "function") {
							cc.elmt.blur();//used for community share
						}
					}
				});
			}else{ // debug only
				response = '<div class="popinContent"><a href="#header" class="closeLayer">fermer</a></div>';
				cc.elements(response);
				if(cc.elmt.button){
					cc.loader.remove(cc.elmt.button);
				}else{
					cc.loader.remove(cc.elmt);
				}
			}
		}
		
		cc.elements = function(content){
			var bHeiht,hHeight,fHeight,currentPopin;
			if(jQuery('#popin').length == 0){
				if(document.brand){//flash
					jQuery('body').append('<div id="popin"></div>');
				}else{
					jQuery('#aspnetForm').append('<div id="popin"></div>');
				}
			}
			if(jQuery('.msie6').length && jQuery('#popin iframe').length == 0){
				jQuery('#popin').append('<iframe></iframe>');
			}
			if (cc.options.background && jQuery('#popin .background').length == 0) {
				jQuery('#popin').append('<div class="background"> </div>');	
			}
			
			jQuery('#popin').append(content);
			currentPopin = jQuery('#popin .popinContent:last');
						
			bHeiht = jQuery('body').outerHeight(true);
			hHeight = jQuery('html').outerHeight(true);
			
			if(bHeiht > hHeight){
				fHeight = bHeiht;
			}else{
				fHeight = hHeight;
			}
			
			jQuery('#popin .background, #popin iframe').height(fHeight);
			currentPopin.attr('id',cc.options.type);
			if(cc.options.callback) cc.callback();
			
			if(jQuery('.popinContent:last form').length > 0){//popin contains a webbox form
				var popinForm = new AjaxForm();
				popinForm.init(jQuery('.popinContent:last form'),cc.lastCall);
				delete popinForm;
			}			
			
			var PopinCapabilites = new BrowserHandles();
			PopinCapabilites.init(currentPopin);
			delete PopinCapabilites;
			
			
			if(jQuery('.popinContent').length > 1){
				cc.switchPopins("up");
			}else{
				cc.show();
			}
			
			cc.events('loaded');
			
			if(document.brand){
				document.brand.pause_flash();
			}
		};//elements
		
		cc.callback = function(){
			if(typeof(cc.options.callback) == "object"){
				if(typeof(CallBacked[cc.options.callback.name]) === "function"){
					return CallBacked[cc.options.callback.name](cc.options.callback.options);
				}
			}else{
				if(typeof(CallBacked[cc.options.callback]) === "function"){
					return CallBacked[cc.options.callback](cc.options[cc.options.callback]);
				}
			}
		};//callback
		
		cc.show = function(ladder){
			var topContent,currentPopin, popHeight;
			topContent = cc.options.top;
			currentPopin = jQuery('#popin .popinContent:last');
			currentPopin.css({
				"display":"block",
				"visibility" : "hidden"
			});
			popHeight = currentPopin.outerHeight(true);

			
			if(jQuery(window).scrollTop() >= 0 && popHeight < jQuery(window).height()){
				
				if (((popHeight + cc.options.top) > jQuery(window).height()) || ((popHeight + cc.options.top*2) > jQuery(window).height())) {
					topContent = ((jQuery(window).height() - popHeight) / 2) + jQuery(window).scrollTop();
					cc.options.top = topContent-jQuery(window).scrollTop();
				}
				else {
					topContent = topContent + jQuery(window).scrollTop();
				}
				cc.options.follow = cc.options.animate;
			}else if(popHeight > jQuery(window).height()){
				topContent = 20;
				cc.options.follow = false;
			}
			jQuery('#popin .background').fadeTo(500, 0.2);
			if (Browser.opacity) {
				currentPopin.css({
					"top": topContent + 20,
					"opacity": 0,
					"visibility": "visible"
				})
				currentPopin.delay(200).animate({
					"top": topContent,
					"opacity": 1
				}, 200);
			}else{ //ie lt9
				jQuery('#popin iframe').fadeTo(0, 0.2);
				currentPopin.css({
					"top": topContent,
					"visibility": "visible"
				});
			
				PIE.attach(currentPopin[0]);
				//currentPopin.prev().attr("style",currentPopin.prev().data("css3-container"));
				currentPopin.delay(200).fadeTo(200,1);
			}

			if (cc.options.follow) {
				jQuery(window).bind("scroll", cc.scrollPopin = function(e){
					cc.move(e);
				});
			}
			if(jQuery('#popin .popinContent').length == 1 && !ladder){
				cc.binds();
			}
			
		};//show
		
		cc.binds = function(){
			jQuery(window).bind("resize", cc.resizePopin = function(e){
					cc.resize(e);
			});
			jQuery(document).bind("keyup", cc.closePopin = function(e){
				if(e.keyCode == "27"){
					jQuery("#popin .closeLayer:visible:last").trigger('click');
				}
			});
			
			jQuery("#popin .background").live('click',function(){ //use kill class on a link if you want to exit all the popins
				cc.close();
			});jQuery("#popin .popinContent .kill").live('click',function(e){ //use kill class on a link if you want to exit all the popins
				e.preventDefault();
				cc.close();
			});
			
			jQuery("#popin .popinContent > .closeLayer").live('click',function(e){ //back class stands for confirmation buttons to exit the popin
				e.preventDefault();
				if(jQuery("#popin .popinContent").length > 1){
					cc.switchPopins("down");
				}else{
					cc.close();	
				}
			});jQuery("#popin .popinContent .back").live('click',function(e){ //back class stands for confirmation buttons to exit the popin
				e.preventDefault();
				jQuery("#popin .popinContent:last > .closeLayer").trigger('click');
			});
		};//binds
		
		cc.move = function(e){
			clearTimeout(cc.timeout)
			cc.timeout = setTimeout(function(){
				if( (jQuery('#popin .popinContent:last').outerHeight(true) + cc.options.top + jQuery(window).scrollTop()) < jQuery('body').height()){
					jQuery('#popin .popinContent:last').stop(true).animate({
						"top" : cc.options.top + jQuery(window).scrollTop()
					},600,"easeInOutCubic");
				}
			},100);
		};//move
		
		cc.resize = function(e){
			var topContent, popHeight;
			topContent = cc.options.top;
			popHeight = jQuery('#popin .popinContent:last').height();
			
			if((popHeight > jQuery(window).height()) || ((topContent + popHeight) > jQuery(window).height()) ){
				jQuery(window).unbind("scroll");
				cc.options.resizedHeight = true;
			}else{
				if(cc.options.resizedHeight){
					cc.options.resizedHeight = false;
					if(cc.options.animate){
						jQuery(window).bind("scroll", function(e){
							cc.move(e);
						});
					}
				}
			}
			
			if(jQuery("#core").outerWidth() > jQuery(window).width()){
				cc.options.resizedWidth = true;
				//console.log(jQuery("#core").outerWidth())
				
				var leftContent = (jQuery("#core").outerWidth() - jQuery('#popin .popinContent:last').outerWidth())/2;
				
				jQuery('#popin').width(jQuery("#core").outerWidth()); //dont pass the true argument because the margin is set to auto /bug on webkit
				
				jQuery('#popin .popinContent:last').css({
					"left": leftContent,
					"margin-left": 0
				});
				
			}else{
				if (cc.options.resizedWidth) {
					cc.options.resizedWidth = false;
					
					jQuery('#popin').width('100%');
					var marginLeft = (jQuery('#popin .popinContent:last').outerWidth()/2)*-1
					jQuery('#popin .popinContent:last').css({
						"left": "50%",
						"margin-left": marginLeft
					});
				}
			}
		};//resize
		
		cc.switchPopins = function(ladder){
			
			jQuery(window).unbind("scroll", cc.scrollPopin);
			
			var currentPopin,animationsParams = {};
			
			if(ladder == "down"){
				currentPopin = 	jQuery('#popin .popinContent:last');
			}else{
				currentPopin = 	jQuery('#popin .popinContent:last').prev('.popinContent');
			}
			if (Browser.opacity) {
				if(document.brand){
					animationsParams = {
						"opacity": 0
					}
				}else{
					animationsParams = {
						"top": cc.options.top + jQuery(window).scrollTop() + 20,
						"opacity": 0
					}
				}
				
				currentPopin.animate(animationsParams, 200,function(){
						if (ladder === "down") {
							currentPopin.remove();
						}
						cc.show(ladder);
					});
				
			}else{ //ie lt9
				currentPopin.hide();
				PIE.detach(currentPopin[0]);
				if (ladder === "down") {
					currentPopin.remove();
				}
				cc.show(ladder);
			};
			cc.events('switched');
				
		};//switchPopins
		
		cc.close = function(){
			
			if (Browser.opacity) {
				if(document.brand){
					animationsParams = {
						"opacity": 0
					}
				}else{
					animationsParams = {
						"top": cc.options.top + jQuery(window).scrollTop() + 20,
						"opacity": 0
					}
				}			
			
				jQuery('#popin .popinContent').animate(animationsParams, 200);
				jQuery('#popin').fadeTo(500,0,function(){
					/*if (cc.options.type == "login") {
						jQuery('#quickLinks .account').append(jQuery('#account'));
						jQuery('#account .closeLayer').show();
						jQuery('#account .forgotPassword').unbind('click', cc.handleLogin);
						if (typeof(jQuery('#account').data("appliedStyle")) != undefined) {
							jQuery('#account').attr("style", jQuery('#account').data("appliedStyle"));
						}
					}*/
					jQuery('#popin').remove();
					if(document.brand){
						document.brand.play_flash();
					}
				});
			}else{ //ie lt9
				/*if (cc.options.type == "login") {
					jQuery('#quickLinks .account').append(jQuery('#account'));
					jQuery('#account .closeLayer').show();
					jQuery('#account .forgotPassword').unbind('click', cc.handleLogin);
					if (typeof(jQuery('#account').data("appliedStyle")) != undefined) {
						jQuery('#account').attr("style", jQuery('#account').data("appliedStyle"));
					}
				}*/
				jQuery('#popin').remove();
				if(document.brand){
					document.brand.play_flash();
				}
			}
			jQuery(window).unbind("scroll", cc.scrollPopin);
			jQuery(window).unbind("resize", cc.resizePopin);
			jQuery(document).unbind('keyup', cc.closePopin);
			jQuery("#popin .popinContent").die('resize');
			jQuery("#popin .popinContent > .closeLayer").die('click');
			jQuery("#popin .back").die('click');
			jQuery("#popin .background").die('click');
			jQuery("#popin .kill").die('click');
			cc.events('closed');			
		};//close
		
		cc.events = function(e){
			jQuery(document).trigger('popin',{
				"target": cc.elmt,
				"type": e
			});
		};//events
	};//Popin
	
	
	Product = function(){
		var cc = this;
		
		cc.init = function(context,params){
			cc.context = context;
			//bind add2basket
			if(params && params.multiple){
				cc.params = params;
				jQuery('#SubmitPurchase',cc.context).bind('click',cc.handleMultiple.call);
			}else{
				var submitPurchase = false;
				if(jQuery('#SubmitPurchase',cc.context).length){
					submitPurchase = jQuery('#SubmitPurchase',cc.context)
				}else if(cc.context.closest('#popin').find('#SubmitPurchase').length){
					submitPurchase = cc.context.closest('#popin').find('#SubmitPurchase');
				}
				if(submitPurchase){
					var add2basket = new Basket();				
					add2basket.init(submitPurchase,params);
					delete add2basket;
				}
			}
			//cc.priceByUnit(jQuery("option[data-variant]:first").data("variant"));
						
			// community share
			if(jQuery('#core .product .community:visible').length){
				jQuery(".community .sharer").bind("click",function(e){
					e.preventDefault();
				});
				jQuery(".community [data-social]").bind("click",cc.social);
				
				jQuery('.community #sharer',cc.context).parent().bind("mouseenter mouseleave",function(e){
					switch(e.type){
						case 'mouseenter':
							cc.sharer.show(jQuery(this));
							break;
						case 'mouseleave':
							cc.sharer.hide(jQuery(this));
							break;
					}
				})
				cc.sharer.load();
			
				//cc.facebook();
			}
		
			// /community share
			
			// shades
			jQuery('.bigShades ul',cc.context).addClass('jsed')
			jQuery('.colours .shades a',cc.context).bind("click",function(e,param){
				cc.shades(e,jQuery(this),param);
			});
			// /shades
			
			
			// variants
			jQuery('.variant select',cc.context).bind('change',function(e){
				//console.log('select')
				cc.variant(e,jQuery(this));
			});/*			
			jQuery('.quantity select',cc.context).bind('change',function(e){
				cc.quantity(e,jQuery(this));
			});*/
			// /variants
			
			//buyable (stock / ispurchasable)
			cc.buyable.init();			
			
			// left and right arrow keys
			jQuery('.colours .shades a',cc.context).bind('focus blur', cc.keys = function(e){
				if (e.type == "focus") {
					jQuery('.colours .shades a').not(jQuery(this)).unbind('focus');
					jQuery(this).bind('keyup', function(e){
						e.preventDefault();
						cc.browse(e,jQuery(this));
					})
				}else if (e.type == "blur") {
					jQuery('.colours .shades a',cc.context).bind('focus', cc.keys);
				};
			});
			// /left and right arrow keys
			
			jQuery("a#add2fav").bind("click",function(e){
				e.preventDefault();
				cc.favorites(jQuery('.variant select',cc.context).val(),jQuery(this));
			})
			
			
			var getVariantData = jQuery(".variant select",cc.elmt);
			if(getVariantData.find('option[value='+getVariantData.val()+']').length){
				var getPriceAtLoad = getVariantData.find('option[value='+getVariantData.val()+']').data('variant').price;
			}			
			if (getPriceAtLoad == 0) {
				jQuery('#price',cc.elmt).parent().hide();
				jQuery('li.quantity',cc.elmt).hide();
				if (jQuery("#notPurchasable",cc.elmt).length) {
					jQuery("#notPurchasable",cc.elmt).remove();
				}
				jQuery("<li id='notPurchasable'>Exclusivo na loja!</li>").insertAfter(jQuery('#price',cc.elmt).parent());
			}
			
			//display a selected ean code from the url
			if(ean = jQuery.url.param("var")){
				jQuery('a[href=#s'+ean+']').trigger('click');
			}
			delete ean;
			
		};//init
		
		cc.handleMultiple = {
			"call" : function(e){
				e.preventDefault();
				var prds = "",
					multiple = new Popin();
				
				cc.context.find('li.row').each(function(){
					prds += jQuery(this).data('product') + ';'
				});
				
				multiple.init({
					"button" : jQuery(this),
					"url" : "/_pt/_pt/ajax/quickshop.aspx",
					"data": {
						"type": "multipleBasket",
						"prdcode": prds,
						"callback": {
							"name": "addMultipleBasket",
							"options": {
								"method": "multiple"
							}
						
						}
					}
				})
			}
		};//showMultiple
		
		cc.productNav = function(e,elmt){
			e.preventDefault();
			elmt.parent().siblings().removeClass('active');
			elmt.parent().addClass('active');
			//jQuery('.descriptionContent > li.active').removeClass('active');
			elmt.closest("ul").next().find("li.active").removeClass('active');
			if(!elmt.parent().hasClass('noShop')){
				jQuery('.descriptionContent .shop',cc.context).appendTo(jQuery(elmt[0].hash));	
			}
			jQuery(elmt[0].hash).addClass('active');
		};//productNav
		
		cc.browse = function(e, elmt){
			if (e.keyCode == "39") {
				var next = elmt.parent().next().find("a");
				if (next.length > 0) {
					next.trigger("click");
					next.trigger("focus");
					next.bind('keyup', function(e){
						cc.browse(e, jQuery(this));
					})
					elmt.unbind('focus blur keyup');
				}
			}else if (e.keyCode == "37") {
				var prev = elmt.parent().prev().find("a");
				if (prev.length > 0) {
					prev.trigger("click");
					prev.trigger("focus");
					prev.bind('keyup', function(e){
						cc.browse(e, jQuery(this));
					})
					elmt.unbind('focus blur keyup');
				}
			};
		};//browse
		
		cc.sharer = {
			delay : "",
			clicked : false,
			show : function(elmt){
				if(typeof(cc.sharer.delay) != undefined ){
					window.clearTimeout(cc.sharer.delay);	
				};
				cc.sharer.delay = window.setTimeout(function(){
					if (Browser.opacity) {
						jQuery("#sharer",cc.context).css({
							"display": "block",
							"opacity": 0,
							"top": "-24px"
						}).animate({
							"top": "-34px",
							"opacity": 1
						}, 175);
					}else{
						jQuery("#sharer",cc.context).show();
					}
				},200);
			},
			hide : function(elmt){
				//prevent the sharer to be hidden when the ajax loads the page
				if(!cc.sharer.clicked){
					if(typeof(cc.sharer.delay) != undefined ){
						window.clearTimeout(cc.sharer.delay);	
					};
					
					cc.sharer.delay = window.setTimeout(function(){
						if (Browser.opacity) {
							jQuery("#sharer",cc.context).animate({
								"top": "-24px",
								"opacity": 0,
								"display": "none"
							}, 175);
						}else{
							jQuery("#sharer").hide();
						}
					},200);
				}
			},
			load : function(){
				//fix sharer when the ajax loads the page 
				jQuery("#sharer a[data-popin]",cc.context).bind('focus',function(e){
					cc.sharer.clicked = true
					jQuery("#sharer a[data-popin]",cc.context).bind('blur',function(e){
						cc.sharer.clicked = false;
						cc.sharer.hide("#sharer");
					});
				});
			}
		};//sharer
		
		cc.facebook = function(){		
			(function() {
				jQuery(cc.context).find('.sharer').parent().after('<li class="fblike"><fb:like layout="button_count" show_faces="false" width="100" font="arial"></fb:like></li>');
				var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
				s.type = 'text/javascript';
				s.async = true;
				s.src = 'http://connect.facebook.net/en_US/all.js#xfbml=1';
				s1.parentNode.insertBefore(s, s1);
			})();
		};//facebook
		
		cc.social = function(e){
			e.preventDefault();
			window.social=window.social || {};
			var social = jQuery(this).data('social'),
			D=550,A=450,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,url;
			switch(social.type){
				case 'facebook':
					url = 'http://www.facebook.com/sharer.php?u='+encodeURIComponent(social.url);
					break;
				case 'twitter':
					url = 'http://twitter.com/share?url='+encodeURIComponent(social.url);
					break;
			}
			window.social=window.open(url,'shareSocial','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');
			
		};//social
		
		cc.shades = function(e, elmt, param){
			e.preventDefault();
			var variant = elmt[0].hash.replace('#s',''),
				context = elmt.closest('.shop');
			//dispatch the new shade on the select elmt & the hidden input for the sale only if triggered by the user (onlyShade == false)
			if(typeof(param) === "undefined"){
				jQuery('.currentVariant',context).val(variant);
				jQuery('.variant select',context).val(variant);
				jQuery('.variant select',context).triggerHandler("change");
			};
			elmt.closest('ul').find(".selected").removeClass('selected')
			elmt.parent().addClass("selected");
			jQuery('.bigShades .active',context).removeClass("active");
			jQuery(elmt[0].hash).addClass('active');
			
			
		};//shade
				
		cc.variant = function(e, elmt){
			e.preventDefault();
			var variantDatas = elmt.find('option[value='+elmt.val()+']').data('variant');
				unitPrice = variantDatas.price.replace(',','.')*1,
				context = elmt.closest('.shop'),
				quantity = jQuery('.quantity select',context).val();
			//cc.priceByUnit(elmt.find('option[value='+elmt.val()+']').data('variant'),context);
			
			jQuery('.variant select',context).val(elmt.val());
			jQuery('.currentVariant',context).val(elmt.val());
			//cc.updatePrice((parseInt(unitPrice*100*quantity)/100).toFixed(2));
			cc.updatePrice(unitPrice.toFixed(2),context);
			
			//dispatch the new selected variant on the shades
			if(jQuery('.colours',context).length > 0){
				jQuery('#c'+ elmt.val() +' a').triggerHandler('click',{"onlyShade":true})
			}
			cc.buyable.check(elmt,variantDatas);
			
		};//variant
		
		cc.buyable = {
			init : function stockInit(){
				jQuery('.formSection ul',cc.context).append("<li class='stockError'>Este produto n&#227;o est&#225; dispon&#237;vel para venda online.</li><li class='notPurchasable'>Exclusivo na loja!</li>");
				cc.buyable.check(jQuery('.variant select',cc.context));
			},
			check : function stockCheck(elmt){
				if(window.console) console.log(elmt);
				elmt.each(function(){
					if(window.console) console.log(jQuery(this),jQuery(this).find('option[value='+jQuery(this).val()+']').data('variant'));
					var cElmt = jQuery(this),
						o = cElmt.find('option[value='+cElmt.val()+']').data('variant');
					if((o.price.replace(',','.')*1 == 0) || o.isPurchasable == 0){
						cElmt.closest('.product').addClass('nopurchase');
						cElmt.closest('.product').removeClass('outofstock');
					}else if(o.stock <= 0 && cc.params && cc.params.multiple){
						cElmt.closest('.product').addClass('outofstock');
						cElmt.closest('.product').removeClass('nopurchase');
					}else if(cElmt.closest('.product').is('.outofstock')){
						cElmt.closest('.product').removeClass('outofstock');
					}else if(cElmt.closest('.product').is('.nopurchase')){
						cElmt.closest('.product').removeClass('nopurchase');
					}
				});
				
			}
		}
		
		cc.quantity = function(e,elmt){
			e.preventDefault();
			var context = elmt.closest('.shop');
			if(jQuery('.variant select',context).length){
				var unitPrice = jQuery('.variant select',context).find('option[value='+jQuery('.variant select',context).val()+']').data('variant').price.replace(',','.')*1;
			}else{
				var unitPrice = parseInt(jQuery("#unitPriceContainer").val().replace("€",""))
					if(isNaN(unitPrice)) unitPrice = 0;
			}
			var quantity = elmt.val();
			//cc.updatePrice((parseInt(unitPrice*100*quantity)/100).toFixed(2));
			//cc.updatePrice((unitPrice*quantity).toFixed(2));
			
		};//quantity
		
		cc.updatePrice = function(price,context){
			jQuery('#price',context).text(price.replace(".",",") + " €");
		};//updatePrice
		
		cc.priceByUnit = function(datas,context){
			if (datas) {
				var priceByUnit;
				if (datas.computePriceByUnit) {
					datas.refCalcQuantity = datas.refCalcQuantity.replace(",", ".")
					datas.refQuantity = datas.refQuantity.replace(",", ".")
					datas.price = datas.price.replace(",", ".")
					
					priceByUnit = ((datas.refCalcQuantity / datas.refQuantity) * datas.price.replace(",", ".")).toFixed(2);
					jQuery(".priceByUnit .quantity", context).html(datas.refCalcQuantity + datas.refUnit);
					jQuery(".priceByUnit .price", context).html(priceByUnit.replace(".", ","));
					jQuery(".priceByUnit", context).show();
				}
			}
		};//priceByUnit
		
		cc.favorites = function(varcode,elmt){
			if(elmt){
				var params = elmt.data("ajax");
				elmt.find(".ajax-loader").show();;
			}
			cc.ajax = jQuery.ajax({
				type: "get",
				url: "/_pt/_pt/ajax/favorites.aspx",
				data: {"action":"add","varcode":varcode},
				dataFilter: function(data){
					try{
						return jQuery.parseJSON(data); 
					}catch(e){
						return data 
					}
				},
				success: function(data){
					if(typeof data == "object"){
						if(data.success){
							var redirect;
							if(params && params.redirect){
								redirect = params.redirect;
							}else if(data.success.redirect){
								redirect = data.success.redirect;
							}
							switch(redirect){
								case "reload":
									window.location.reload();
									break;
								case "popin":
									if(elmt){
										elmt.find(".ajax-loader").hide();
									}
									break;
								default:
									window.location.href = data.success.redirect;
							}
							
						}
						
					}
				},
				error: function(data){
					if(elmt){
						elmt.find(".ajax-loader").hide();
					}
				}
			})
		}
		
	};//Product
	
	
	Basket = function(){
		var cc = this;
		cc.called;
		cc.init = function(elmt, params){
			cc.elmt = elmt;
			cc.params = params;
			cc.elmt.bind('click',cc.handleProduct);
		};//init
		
		cc.setParameters = function(params){//used for set some parameters if you skip the init method
			cc.params = params;
		};//serParameters
		
		cc.handleProduct = function(e){
			e.preventDefault();
			cc.currentElmt = jQuery(this);
			var shop, variant,qty, stock, basketConf;
			if (!cc.called) {
				cc.called = true;
				if(cc.params && cc.params.method && cc.params.method == "multiple"){ //multiple add2bag
					variant = "",qty = "";
					shop = cc.currentElmt.closest('#multipleBasket');
					jQuery('.shop select',shop).each(function(){
						variant += jQuery(this).val() + ":";
						qty += "1:"
					});
					variant = variant.substr(0,variant.length-1)
					qty = qty.substr(0,qty.length-1)
					cc.call(variant, qty);
					
				}else{//simple add2bag
					if(cc.currentElmt.data("basket") === undefined){ // product page
						shop = cc.currentElmt.closest('.shop');
						variant = jQuery('.currentVariant', shop).val();
						stock = ~~jQuery('option[value=' + variant + ']').data('variant').stock;
					}else{ // carrousel add2basket
						basketConf = cc.currentElmt.data("basket")
						stock = ~~basketConf.stock;
						variant = basketConf.varcode;
						qty = basketConf.qty;
					}
					if (stock > 0) {
						cc.call(variant, jQuery('.quantity select', shop).val());
					}
					else {
						cc.loader.add();
						cc.manageErrors({"errorcode":"outofstock","varcode":variant});
						cc.called = false;
					}
				}
				
			};
		};//handleProduct
		
		cc.loader = {
			add : function(){
				if (cc.currentElmt) {
					cc.currentElmt.find(".ajax-loader").show();
				}
			},
			remove : function(){
				if (cc.currentElmt) {
					cc.currentElmt.find(".ajax-loader").hide();
				}
			}
		};//loader
		cc.call = function(varcode,qty){
			cc.loader.add();
			jQuery.ajax({
				type : "get",
				url : "/_pt/_pt/ajax/addsingleproduct.aspx",
				data : {
					"varcode" : varcode,
					"qty" : qty
				},
				dataFilter :function(data){
					try{
						return jQuery.parseJSON(data); 
					}catch(e){
						return data 
					}
				},
				success : function(data){
					if (typeof(data) == "object") { //error from the server
						//window.console ? console.log(data.errorcode) : alert(data.errorcode);
						cc.manageErrors(data);
					}else{
						cc.manageCart(data);
						cc.loader.remove();
					}
						cc.called = false;
				},
				error : function(data, status){
					cc.manageErrors({"errorcode":"error"});
					cc.called = false;
				},
				complete : function(data, status){
				}
			});
		};//call
		
		cc.manageCart = function(response){
			var qty, currentStyles;
			qtyWithoutGift = jQuery('.cartTotal table',response).data('items').excludeGift;
			qtySamples = jQuery('.cartTotal table',response).data('items').samples;
			qty = qtyWithoutGift - qtySamples;
			jQuery(".shoppingCart > span").text(qty);
			
			jQuery("#shoppingCart").remove();
			
			jQuery(".shoppingCart").append(response);
			jQuery("#shoppingCart").addClass('jsed').attr("style", currentStyles);
			
			if (cc.params && cc.params.dontShowCart) { // cart wont be displayed
				if(cc.params.showSuccess){
					cc.manageSuccess();
				}else{//fade to the previous popin
					new Popin().switchPopins("down"); //ugly
				}				
			}else if (cc.params && cc.params.showSuccess){
				cc.manageSuccess();
			}else{
				new Popin().close(); //ugly
				currentStyles = jQuery("#shoppingCart").attr("style")
				jQuery(".shoppingCart").find("> a").trigger("click");
				jQuery('html, body').animate({scrollTop:0}, 'slow');
			}
		};//manageCart
		
		cc.manageErrors = function(datas){
			cc.loader.add();
			var params = {
				"type" : datas.errorcode.toLowerCase()
			}
			if(datas.varcode){
				if(datas.varcode.indexOf(':') != -1){
					params.multiple = true;
				}else{
					params.varcode = datas.varcode;
				}
			};
			var responseError = new Popin();
			responseError.init({
				"url": "/_pt/_pt/ajax/popinBasket.aspx",
				"data": params
			});
			delete responseError;
			cc.loader.remove();
		}
		
		cc.manageSuccess = function(datas){
			var params = {
				"type" : "success"
			}			
			var responseSuccess = new Popin();
			responseSuccess.init({
				"url": "/_pt/_pt/ajax/popinBasket.aspx",
				"data": params
			});
			delete responseSuccess;
		};//manageSuccess
		
	};//Basket
	
	CallBacked = {
		quickshop : function(params){
			var quickProduct = new Product();
			quickProduct.init(jQuery("#quickshop .product"),params);
			delete quickProduct;
		},
		add2favorites : function(varcode){
			var favs = new Product();
			favs.favorites(varcode);
			delete favs;
		},
		addMultipleBasket : function(params){
			var quickProducts = new Product();
			quickProducts.init(jQuery("#multipleBasket li.product"),params);
			delete quickProducts;
		},
		loginBrand : function(params){
			if(params in window){
				window[params].close();
			}
			if(document.brand){
				if (window.console) console.log('logged')
				/* insert javascript/flash bridge and delete the line previous line (console.log)*/
			}
		}
	};//Callbacked
	
	AjaxForm = function(){
		var cc = this;
		cc.called = false;
		cc.init = function(context,callDatas){ // if callDatas empty, context becomes the form targeted and the whole page must be submit 
			cc.callDatas = callDatas || {"url":window.location.href,"page":true};
			cc.context = context; //context can be a form or a fieldset.formSection
			cc.parent = context.parent();
			cc.callback = context.find('.formSection').data("callback");//when loading a form
			
			var fieldsetForm;
			if(context.find('.formSection').length){
				fieldsetForm = context.find('.formSection');
			}else{
				fieldsetForm = context;
			}
			var inputs = fieldsetForm.validator({
        		"lang": "fr",
				"errorInputEvent": "keyup blur",
				"formEvent": "submitFieldset",
	            "effect": "onvalidate"
			});
			
			
			if(callDatas.type){
				cc.ajax = jQuery.ajax({
					type: "get",
					dataType: "html",
					url: callDatas.url,
					data: "type="+callDatas.type,
					success: function(data){
						cc.distantForm = data;
						cc.bind();
						jQuery(cc.context).append('<form class="tempForm" style="display:none"></form>');
						jQuery('.tempForm',cc.context).append(jQuery('input,textarea,select',data));//bug with jQuery('form',data);
						cc.form = cc.context.find('.tempForm',cc.context);
						
					},
					error: function(){//if there is an error on the call, bind the form
						//cc.bind();
					}
				})
			}else{
				cc.bind();
			}
			
		};//init
		
		cc.process = function(){
			jQuery('input,textarea,select',cc.context).each(function(){
				var currentId = jQuery(this).attr("id"),
				lookFor = currentId.substr(currentId.lastIndexOf("_"));
				jQuery('[id$='+lookFor+']',cc.form).val( jQuery(this).val());
			});
			jQuery("input[name=__EVENTTARGET]",cc.form).val(cc.distantSubmitName);
			
			//after processed, bind form
			//cc.bind();
		};//process
		
		cc.bind = function(context){
			if (jQuery("[href*=doPostBack]", cc.context).length || jQuery("[onclick*=doPostBack]", cc.context).length) {
				if (jQuery("[onclick*=doPostBack]", cc.context).length) {
					cc.submitWebbox = jQuery("[onclick*=doPostBack]", cc.context);//assume that the submit button has an onclick attribute for the doPostBack function
					cc.submitWebbox.removeAttr("onclick");//remove the onclick attribute so the form is not submited
					cc.submitName = cc.submitWebbox.attr("name");
					if(cc.callDatas.type){
						cc.distantSubmitName = jQuery("[onclick*=doPostBack]", cc.distantForm).attr("name")
					}
				}
				else {
					cc.submitWebbox = jQuery("[href*=doPostBack]", cc.context);
					cc.submitName = cc.submitWebbox.attr('id').replace(/_/g, "$");
					if(cc.callDatas.type){
						cc.distantSubmitName = jQuery("[href*=doPostBack]", cc.distantForm).attr('id').replace(/_/g, "$");
					}
				}
				cc.submitWebbox.bind("click", function(e){
					e.preventDefault();
					var initSubmit = new InputsHandler();
					initSubmit.submitForm(jQuery(this));/*
					console.log(jQuery(this).parents('.formSection'));
					console.log(jQuery(this).parents('.formSection').data("events"));
					jQuery(this).parents('.formSection').trigger("submitFieldset");*/
				});
				cc.context.bind('submitFieldsetOk',function(){
					/*if(cc.callDatas.type == "login"){
						console.log("binded")
						jQuery('form:first').bind("submit",function(e){
							console.log("clicked")
							e.preventDefault();
						})
						jQuery('form:first').trigger('submit')
					}*/
					cc.submitForm(cc.submitWebbox)
				});
			}
		};//bind
		
		cc.loader = {
			
			add : function(elmt){
				if (elmt && typeof(elmt.data) == "function" && elmt.find(".ajax-loader").length) {
					elmt.find('.ajax-loader').show();
				}else if (elmt && typeof(elmt.data) == "function") {
					elmt.parent().find('.ajax-loader').show();
				}
			},
			remove : function(elmt){
				if (elmt && typeof(elmt.data) == "function" && elmt.find(".ajax-loader").length) {
					elmt.find(".ajax-loader").hide();
				}else if (elmt && typeof(elmt.data) == "function") {
					elmt.parent().find('.ajax-loader').hide();
				}
			}
		};//loader
		
		cc.validateForm = function(e){
			e.preventDefault();
			if (!cc.called) {
				var validate = new SubmitFieldset();
				switch(validate.validate(cc.context)){
					case "success":
						cc.submitForm(jQuery(this));
						break;
					case "error":
						cc.error();
						break
				};
				delete validate;
			}
		};//validateForm
		
		cc.currentForm = {
			disable : function(){
				jQuery('input, textarea, select',cc.context).attr("disabled","disabled");
				jQuery('input, textarea, select',cc.context).attr("readonly","readonly");
			},
			enable : function(){
				jQuery('input, textarea, select',cc.context).removeAttr("disabled");
				jQuery('input, textarea, select',cc.context).removeAttr("readonly");
			}
		};//currentForm
		
		cc.submitForm = function(elmt){
			cc.called = true;
			cc.loader.add(elmt);
			if (cc.callDatas.type) { //submit the distant page
				
				cc.process();//pair the form elements to the form elements to be submited
				
				cc.callDatas.paramedUrl = cc.callDatas.url + "?type="+cc.callDatas.type;
				cc.callDatas.paramedData = jQuery('.tempForm',cc.context).serialize();
			}else{ //submit a sub form (form in a popin)
			
				jQuery("input[name=__EVENTTARGET]", cc.context).val(cc.submitName);
				if(cc.callDatas.data){
					if(cc.callDatas.url.indexOf("?") != -1){
						cc.callDatas.paramedUrl = cc.callDatas.url + "&" + jQuery.param(cc.callDatas.data);
					}else{
						cc.callDatas.paramedUrl = cc.callDatas.url + "?" + jQuery.param(cc.callDatas.data);
					}
					
				}else{
					cc.callDatas.paramedUrl = cc.callDatas.url;
				}
				
				//do not post placeholder values FF<4 IE<9
				jQuery('input[placeholder],textarea[placeholder]', cc.context).not('[required]').each(function(){
					if(jQuery(this).val() == jQuery(this).attr('placeholder')){
						jQuery(this).val(null);
					}
				});
				
				cc.callDatas.paramedData = cc.context.serialize();
			};
			cc.currentForm.disable();
			jQuery.ajax({
				"type" : "POST",
				"url" : cc.callDatas.paramedUrl,
				"dataType" : "html",
				"data" : cc.callDatas.paramedData,
				dataFilter :function(data){
					try{
						return jQuery.parseJSON(data); 
					}catch(e){
						return data 
					}
				},
				success : function(data){
					if (typeof(data) == "object") {
						if(data.success){
							cc.successResponse(data.success);
						}else{
							cc.errorResponse(data.error)
						}
					}else{
						var formResponded;
						if (cc.callDatas.page) {
							//console.log(cc.parent.attr('id'))
							formResponded = jQuery("#"+cc.parent.attr('id'), data);//look for the fieldset that contains the inputs needed
						}else{
							formResponded = jQuery('input',data).parents('form');//look for the form on the popin page
						}
						//console.log(formResponded);
						cc.loader.remove(elmt);
						cc.handleResponse(formResponded);
					}
					
				},
				error : function(data){
					cc.errorResponse();
					cc.loader.remove(elmt);
				},
				complete : function(data,status){
					cc.called = false;
				}
			});
		};//submitForm
		
		cc.errorForm = function(){
			
		};//errorForm
		
		cc.errorResponse = function(){
			cc.currentForm.enable();
			var responseError = new Popin();
			responseError.init({
				"url": "/_pt/_pt/ajax/popinBasket.aspx",
				"data": {"type":"error"}
			});
			delete responseError;
		};//errorResponse
		
		cc.successResponse = function(data){
			if(data.type == "login" && data.status == "logged"){
				if(!document.brand){
					afterLoad.save({"logged":true})
				}
			}
			if(data.type == "login" && data.status == "logged" && jQuery.url.param("ReturnUrl").length > 0){
				window.location.href = jQuery.url.param("ReturnUrl");
			}else{
				var redirect;			
				if ((redirect = data.redirect) || (redirect = cc.callDatas.redirect)) {
					jQuery(cc.context).find('.show').removeClass('show');
					if (redirect == "reload") {
						window.location.reload();
					}
					else {
						window.location.href = redirect;
					}
				}
				else {
					if (cc.callback && typeof(CallBacked[cc.callback.name]) === "function") {
						return CallBacked[cc.callback.name](cc.callback.param);
					}
					else {
						cc.loader.remove(cc.context);
						cc.currentForm.enable();
						var responseSuccess = new Popin();
						responseSuccess.init({
							"url": data.url,
							"data": {
								"type": data.type
							}
						});
						delete responseSuccess;
					}
				}
			}
			
			
			
		};//successResponse
		
		cc.handleResponse = function(elmt){
			cc.answered = true;
			//console.log(elmt)
			if(cc.callDatas.type){//page
				if(elmt.find('ul.show').length){
					jQuery(cc.context).find('ul.errorBox').addClass('show');
					cc.currentForm.enable();
				}else if(elmt.find('.success').length){
					jQuery(cc.context).find('.show').removeClass('show');
					jQuery(cc.context).find('.template').hide();
					jQuery(cc.context).append(elmt.find('.success'));
					jQuery(cc.context).find('.success').show();
					cc.currentForm.enable();
				}
			}else{ //popin
				cc.context.remove();
				cc.parent.append(elmt);
				cc.init(elmt,{
					"url": cc.callDatas.url
				});
				
				var newFormCapabilites = new BrowserHandles();
				newFormCapabilites.init(elmt);
				delete newFormCapabilites;
			}
		};//handleResponse
		
	};//AjaxForm
})();

Outline = function(){
	var cc = this;
	cc.outlined = {
		add : function(){
			jQuery('body').addClass('no-outline');
		},
		remove : function(){
			jQuery('body').removeClass('no-outline');
			jQuery(document).unbind('keyup',cc.tabPressed);
		}
	};//outlined
	
	cc.start = function(){
		cc.outlined.add();
		jQuery(document).bind('keyup',cc.tabPressed = function(e){
			if(e.keyCode == "9"){
				cc.outlined.remove();
			}
		});
	}();
};

filterCatalog = function(){
	var cc = this;
	cc.init = function(){
		jQuery("#all-products .nav a").click(function(e){
			e.preventDefault();
			cc.filtering(jQuery(this));
		})
	};//init
	cc.filtering = function(elmt){
		var parUl = elmt.parents("ul"),
		filteredList = parUl.siblings(".product-list");
		parUl.find(".active").removeClass("active");
		elmt.parent().addClass("active");
		if (elmt.data("filter") == "all") {
			jQuery("#all-products .product-displayer")
				.stop(true,true)
				.slideUp(700,function(){
					jQuery(this).find(".wrapper").css("display","none");
				});
			filteredList.find(".firstItem").removeClass("firstItem");
			filteredList.find("li").show();			
		}
		else {
			jQuery("#all-products .product-displayer .wrapper")
				.stop(true,true)
				.slideUp(400);
			jQuery("#all-products .product-displayer").show(0,function(){
				jQuery(this).find("div[id=w_"+elmt.data("filter")+"]").slideDown(700)
			});
			filteredList.find(".firstItem").removeClass("firstItem");
			filteredList.find("li").not("." + elmt.data("filter")).hide();
			jQuery("."+elmt.data("filter")).show();
		}
		filteredList.find("li:visible:first").addClass("firstItem");
		filteredList.find("li:visible").each(function(i){
			if (i % 4 == 0) $(this).addClass("firstItem");
		})
	};//filter
};

filterFAQ = function(){
	var cc = this;
	cc.init = function(){
		cc.inHalter = jQuery("#servicesDisplay .inhalt");
		jQuery("li, dl",cc.inHalter).addClass("jsed");
		jQuery("li:first",cc.inHalter).addClass("active");
		
			//if (cc.inHalter.find("li .faq")) {
				jQuery("li.jsed",cc.inHalter).find("dl.faq").after("<div id='container'></div>");
			//}
		
		jQuery("dd",cc.inHalter).hide();
		jQuery("#servicesDisplay dt a").click(function(e){
			e.preventDefault();
			cc.faqfiltering(jQuery(this));
		})
		jQuery(".faq",cc.inHalter).each(function(){
			jQuery("dt:first a",this).trigger("click");
		})
		
		if(jQuery.url.param("subject")){
			jQuery("a[href*=#"+jQuery.url.param("subject")+"]",jQuery('#servicesDisplay .servicesMenu')).trigger("click");
		}
		
	};//init
	cc.faqfiltering = function(elmt){
		elmt.parent()
					.addClass("active")
					.siblings(".active").removeClass("active");
		elmt.parents(".jsed").find("#container").html(elmt.parent().next("dd").html());
	};//filter faqs
};
filterSearch = function(){
	var cc = this;
	
	cc.init = function filterSearch(){
		cc.elmt = jQuery('#searchResults .filters fieldset input:checkbox');
		cc.elmt.attr('checked','checked');//set all the checkboxes to checked
		cc.elmt.bind('click',cc.change);//bind change		
	};//init
	
	cc.change = function(e){
		var filter = jQuery(this);
		if(cc.elmt.filter(':checked').length < 1){
			e.preventDefault();
		}else{
			jQuery('#productResults .inner li').hide();
			cc.elmt.filter(':checked').each(function(){
				jQuery('#productResults .inner li.'+jQuery(this).val()).show();
			});
			jQuery('#productResults h2 span').text(jQuery('#productResults .inner li:visible').length);
			jQuery('#productResults .carousel').carrousel({"updated":true});//flag filtering 
		}
		
	};	
};//filterSearch


InputsHandler = function(){
	var cc = this;
	
	cc.init = function(){
		jQuery('input[type=text],input[type=password]').live('keypress',function(e){
			if(e.keyCode == 13){
				e.preventDefault();
				cc.submitForm(jQuery(this));
			}
		});
		jQuery('button.searchButton').bind('click',cc.searchForm);
		
		///////////////////////////////////////////////////////////////////
		//////// CHANGE ME ////////////////////////////////////////////////
		var inputs = jQuery("#main .formSection").has('[href*=doPostBack]').validator({
        	"lang": "fr",
			"errorInputEvent": "keyup blur",
			"formEvent": "submitFieldset",
            "effect": "onvalidate"/*,
            "onBeforeValidate": function(e, els){
				jQuery.each(els, function(){
					jQuery(this).closest("p").find(".error-msg").remove();
					jQuery(this).closest("p").removeClass("error");
				});
			}*/
		});
		jQuery("#main .formSection").each(function(){
			jQuery(this).find('[href*=doPostBack]').bind("click",function(e){
				e.preventDefault();
				if (jQuery(this).find('#shippingAddress')) {
					if ($("#billingShipping .sameAsBilling").is(':checked')) {
						$("#billingShipping #personalInfos").CopyValueTo("#billingShipping #shippingAddress");
						if ($("#billingShipping #personalInfos span input[name$=title_list]:eq(0)").is(':checked')) {
							$("#billingShipping #shippingAddress span input[name$=title_list]:eq(0)").attr("checked", "checked");
						}
						if ($("#billingShipping #personalInfos span input[name$=title_list]:eq(1)").is(':checked')) {
							$("#billingShipping #shippingAddress span input[name$=title_list]:eq(1)").attr("checked", "checked");
						}
						if ($("#billingShipping #personalInfos span input[name$=title_list]:eq(2)").is(':checked')) {
							$("#billingShipping #shippingAddress span input[name$=title_list]:eq(2)").attr("checked", "checked");
						}
					}	
				}
				jQuery(this).parents('.formSection').trigger("submitFieldset");
			})
		});
		
		///////////////////////////////////////////////////////////////////
		
	};//init
	
	cc.submitForm = function(elmt){
		elmt.parents('.formSection').find("[placeholder]").each(function(){
			if(jQuery(this).val() == jQuery(this).attr("placeholder")){
				jQuery(this).val('')
			}
		});
		if(elmt.parents('.formSection').has('[href*=doPostBack]').length > 0 || elmt.parents('.formSection').has('input[id*=ubmit]').length > 0){
			elmt.parents('.formSection').trigger("submitFieldset");
		}else{
			elmt.parents('.formSection').find('[id*=ubmit]').trigger('click');
		}
		
	};//submitForm
	
	cc.searchForm = function(e){
		e.preventDefault();
		var oForm,searchInput;
		oForm = jQuery(this).parents('.formSection');
		searchInput = oForm.find('input[name=search]');
		if(searchInput.val() == '' || searchInput.val() ==  searchInput.attr('placeholder')){
			searchInput.data('color',searchInput.css('color')); 
			searchInput.css('color','red');
			searchInput.bind('focus', cc.searchError = function(){
				jQuery(this).css('color',jQuery(this).data("color"))
				jQuery(this).unbind(cc.searchError);
			})
		}else{
			window.location.href = '/_pt/_pt/ecommerce/services/search.aspx?for='+searchInput.val();
		}
	};//searchForm
	
};


SubmitFieldset = function(){
	var cc = this;
	
	cc.eventSubmit = function(){
		jQuery('#main fieldset.formSection').bind("submitFieldsetOk",function(e){
			var oForm, oSubmit;
			oForm = jQuery(this);
			//jQuery(this).blur();
			if(oSubmit = oForm.find('*[href*=doPostBack]'),oSubmit.length){ //a element
				oSubmit.unbind();
				if (oSubmit.data('events') && oSubmit.data('events').click) { //click event on the submit button
					oSubmit.trigger('click');
				}else {
					var doSafePostback = new Function(oSubmit.attr('href').substr(11))(); // remove the "javascript:" string and execute the function
				}
			}else if((oSubmit = oForm.find('*[onclick*=doPostBack]'),oSubmit.length) || (oSubmit = oForm.find('*[id*=ubmit]'),oSubmit.length)){ //input element || button element
				oSubmit.unbind();
				oSubmit.trigger('click');
			}
		})
	};//eventSubmit
}

afterLoad = {
	save : function(key,storage){
		var container = storage || 'afterLoad'; 
		if(Browser.sessionStorage()){
			if(window.sessionStorage.getItem(container)){
				window.sessionStorage.setItem(container,JSON.stringify(jQuery.extend({},JSON.parse(sessionStorage[container]),key)));
			}else{
				window.sessionStorage.setItem(container,JSON.stringify(key))
			}
		}else{
			if(window.name == ""){
				var session = {};
				session[container] = key;
				window.name = JSON.stringify(session)
			}else{
				var session = JSON.stringify(window.name);
				if(session[container]){
					jQuery.extend(session[container],key);
				}else{
					session[container] = key;
				}
				window.name = JSON.stringify(session);
			}
		}
	},
	fire : function(){
		var params,persistant;
		if (Browser.sessionStorage()){
			if (window.sessionStorage.afterLoad) {
				params = JSON.parse(window.sessionStorage.afterLoad)
				window.sessionStorage.removeItem('afterLoad');
			}
			if(window.sessionStorage.persistant) {
				persistant = JSON.parse(window.sessionStorage.persistant)
			}
		}else if(window.name != ""){
			var session = JSON.parse(window.name);
			if (session.afterLoad) {
				params = session.afterLoad;
				delete session.afterLoad;
				window.name = JSON.stringify(session);			
			}
			if (session.persistant) {
				persistant = session.persistant;
			}
		}
		if(params){
			if (params.logged){// success login
				jQuery('a[href=#account]').trigger('click')
			};
		}
		if((persistant && !persistant.landed) || !persistant ){//first landing on website
			afterLoad.save({"landed":true},'persistant');
			if(jQuery('#shortcutsOffer').length){
				jQuery('#shortcutsOffer').addClass('active');//show offers layer
				var userIsReadingOfferLayer = false;
				if (!Browser.opacity) { // Internet Explorer < 9
					jQuery('#shortcutsOffer').find('.submenu').andSelf().addClass('animated');
					PIE.attach(jQuery('#shortcutsOffer').find('.submenu')[0]);
					PIE.attach(jQuery('#shortcutsOffer')[0]);
				}
				jQuery('#shortcutsOffer .submenu').bind("mouseenter", offerFirstLanding = function(e){
					jQuery('#shortcutsOffer .submenu').unbind("mouseenter",offerFirstLanding)
					userIsReadingOfferLayer = true;
				});
				window.setTimeout(function(){
					jQuery('#shortcutsOffer .submenu').unbind("mouseenter",offerFirstLanding)
					if(jQuery('#shortcutsOffer').is('.active') && !userIsReadingOfferLayer){
						jQuery('#shortcutsOffer').removeClass('active');//show offers layer
						if (!Browser.opacity) { // Internet Explorer < 9
							jQuery('#shortcutsOffer').find('.submenu').andSelf().removeClass('animated');
							PIE.detach(jQuery('#shortcutsOffer').find('.submenu')[0]);
							PIE.detach(jQuery('#shortcutsOffer')[0]);
						}
					}
				},5000)
			}
		}
		
	}
}

/* shortcut functions */
function showLayer(o){
	var showLayer = new Popin();
	showLayer.init(o);
	delete showLayer;
};

function shareBrand(o){
	o = jQuery.parseJSON(o);
	var params = {"from":"flash","type":"share"},
		url = "/_pt/_pt/ajax/popinShareBrand.aspx";

	var sharer = new Popin();
	sharer.init({
		"url":url,
		"data":params
	});
	jQuery(document).bind('popin',function(e,params){
		//console.log(params.type);
		if(params.type == "loaded"){
			var thePopin = jQuery('#popin');
				jQuery('input[id*=title]',thePopin).val(o.title);
				jQuery('input[id*=desc]',thePopin).val(o.desc);
				jQuery('input[id*=thumb]',thePopin).val(o.thumb);
				jQuery('input[id*=url]',thePopin).val("http://www.lancome.pt/_pt/_pt/index.aspx#"+SWFAddress.getValue());
				jQuery('.permalink',thePopin).val("http://www.lancome.pt/_pt/_pt/index.aspx#"+SWFAddress.getValue());
				
				
		}else if(params.type == "closed"){
			document.brand.closePopin(); //tell the flash the popin is closed
			jQuery(document).unbind('popin');
		};
	});
	delete sharer;
};

function loginBrand(o){
	o = jQuery.parseJSON(o);
	var params = {"type":"login"},
		url = "/_pt/_pt/ajax/login.aspx?callback=loginBrand&param=logger"
	
	window.logger = new Popin();
	logger.init({
		"url": url,
		"data": params
	});
	
}


jQuery(function(event) {
	var BrowserCapabilites = new BrowserHandles();
	BrowserCapabilites.init();
	delete BrowserCapabilites;
	
	var header = new NavHeader();
	header.init();
	delete header;
	
	Outline();
	
	var inputs = new InputsHandler();
	inputs.init();
	delete inputs;
	
	
	if (Browser.opacity) {
		jQuery('*[data-carrousel]').carrousel();
	}
	else {
		jQuery('*[data-carrousel*=]').carrousel();
	}
	
	if (Browser.opacity) {
		jQuery('ul[data-tabulate]').tabulate();
	}
	else {
		jQuery('ul').each(function(){
			if (typeof(jQuery(this).data('tabulate')) != "undefined") {
				jQuery(this).tabulate();
			}
		});
	}
	
	if (Browser.opacity) {
		jQuery('ul [data-filter]').closest('ul').filterElmt();
	}
	else {
		jQuery('ul [data-filter*=]').closest('ul').filterElmt();
	}
	
	
	if(jQuery(".button[data-basket]").length > 0){
	    var carouselBasket = new Basket();
	    carouselBasket.init(jQuery(".button[data-basket]"))
	}
	
	var forms = new SubmitFieldset();
	forms.eventSubmit();
	delete forms;
	
	//product page
	if(jQuery("#core div.product").length){
		var prd = new Product();
		prd.init(jQuery("#core div.product"),jQuery("#core div.product").data('product'));
	}
	
	//popins
	jQuery('*[data-popin]').live("click",function(e){
			e.preventDefault();
			var pop = new Popin();
			pop.init(jQuery(this))
	});
	
	// read sessionStorage (or window.name) to fire some actions
	afterLoad.fire();
	
	// home showcase
	if (jQuery('.showcase').length) {
		var showcase = new Showcase().init();
		
	}
	
	//service page
	if(jQuery('#servicesDisplay').length){
		var filterFAQs = new filterFAQ();
		filterFAQs.init();
	}
	
	//all products page
	if (jQuery('#all-products').length){
		var filterAllProducts = new filterCatalog();
		filterAllProducts.init();
	}
	//search page
	if(jQuery('#searchResults').length){
		var searchResult = new filterSearch();
		searchResult.init();		
	}
	
	
	//$('select').not('.product select').sSelect();
	$("a.externalVideo").attr('data-popin', '{"type":"flashPlayer"}');
	
	// Ignore gifts and samples in header basket count items
	if ($(".cartTotal table").length) {
		var noGift = $(".cartTotal table").data('items').excludeGift;
		var sampleCount = $(".cartTotal table").data('items').samples;
		
		properQty = noGift-sampleCount;
		
		if (noGift <= 0) {
			properQty = 0;
		}
		
		jQuery(".shoppingCart > span").text(properQty);
	}
	
	// generic error webbox messages
	if ($("#formError").hasClass("errorAlreadySigned")) {
		$("#formError").html("Já foi criada uma conta com esse endereço de e-mail, queira digitar outro endereço de e-mail.");
		$("#formError").show();
	}
	if ($("#formError").hasClass("globalErrors")) {
		$("#formError").html("Queira corrigir os erros abaixo...");
		$("#formError").show();
	}
	
}); 






 







