
(function(Al,c){var A=function(Ax,Ay){return new A.fn.init(Ax,Ay)},N=Al.jQuery,r=Al.$,AB=Al.document,x,p=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Av=/^.[^:#\[\.,]*$/,AW=/\S/,m=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,E=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,B=navigator.userAgent,U,k=false,AD=[],Af,AS=Object.prototype.toString,AP=Object.prototype.hasOwnProperty,G=Array.prototype.push,f=Array.prototype.slice,S=Array.prototype.indexOf;A.fn=A.prototype={init:function(Ax,A0){var Az,A1,Ay,A2;if(!Ax){return this}if(Ax.nodeType){this.context=this[0]=Ax;this.length=1;return this}if(Ax==="body"&&!A0){this.context=AB;this[0]=AB.body;this.selector="body";this.length=1;return this}if(typeof Ax==="string"){Az=p.exec(Ax);if(Az&&(Az[1]||!A0)){if(Az[1]){A2=(A0?A0.ownerDocument||A0:AB);Ay=E.exec(Ax);if(Ay){if(A.isPlainObject(A0)){Ax=[AB.createElement(Ay[1])];A.fn.attr.call(Ax,A0,true)}else{Ax=[A2.createElement(Ay[1])]}}else{Ay=j([Az[1]],[A2]);Ax=(Ay.cacheable?Ay.fragment.cloneNode(true):Ay.fragment).childNodes}return A.merge(this,Ax)}else{A1=AB.getElementById(Az[2]);if(A1){if(A1.id!==Az[2]){return x.find(Ax)}this.length=1;this[0]=A1}this.context=AB;this.selector=Ax;return this}}else{if(!A0&&/^\w+$/.test(Ax)){this.selector=Ax;this.context=AB;Ax=AB.getElementsByTagName(Ax);return A.merge(this,Ax)}else{if(!A0||A0.jquery){return(A0||x).find(Ax)}else{return A(A0).find(Ax)}}}}else{if(A.isFunction(Ax)){return x.ready(Ax)}}if(Ax.selector!==c){this.selector=Ax.selector;this.context=Ax.context}return A.makeArray(Ax,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return f.call(this,0)},get:function(Ax){return Ax==null?this.toArray():(Ax<0?this.slice(Ax)[0]:this[Ax])},pushStack:function(Ay,A0,Ax){var Az=A();if(A.isArray(Ay)){G.apply(Az,Ay)}else{A.merge(Az,Ay)}Az.prevObject=this;Az.context=this.context;if(A0==="find"){Az.selector=this.selector+(this.selector?" ":"")+Ax}else{if(A0){Az.selector=this.selector+"."+A0+"("+Ax+")"}}return Az},each:function(Ay,Ax){return A.each(this,Ay,Ax)},ready:function(Ax){A.bindReady();if(A.isReady){Ax.call(AB,A)}else{if(AD){AD.push(Ax)}}return this},eq:function(Ax){return Ax===-1?this.slice(Ax):this.slice(Ax,+Ax+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(f.apply(this,arguments),"slice",f.call(arguments).join(","))},map:function(Ax){return this.pushStack(A.map(this,function(Az,Ay){return Ax.call(Az,Ay,Az)}))},end:function(){return this.prevObject||A(null)},push:G,sort:[].sort,splice:[].splice};A.fn.init.prototype=A.fn;A.extend=A.fn.extend=function(){var A2=arguments[0]||{},A1=1,A0=arguments.length,A4=false,A5,Az,Ax,Ay;if(typeof A2==="boolean"){A4=A2;A2=arguments[1]||{};A1=2}if(typeof A2!=="object"&&!A.isFunction(A2)){A2={}}if(A0===A1){A2=this;--A1}for(;A1<A0;A1++){if((A5=arguments[A1])!=null){for(Az in A5){Ax=A2[Az];Ay=A5[Az];if(A2===Ay){continue}if(A4&&Ay&&(A.isPlainObject(Ay)||A.isArray(Ay))){var A3=Ax&&(A.isPlainObject(Ax)||A.isArray(Ax))?Ax:A.isArray(Ay)?[]:{};A2[Az]=A.extend(A4,A3,Ay)}else{if(Ay!==c){A2[Az]=Ay}}}}}return A2};A.extend({noConflict:function(Ax){Al.$=r;if(Ax){Al.jQuery=N}return A},isReady:false,ready:function(){if(!A.isReady){if(!AB.body){return setTimeout(A.ready,13)}A.isReady=true;if(AD){var Ay,Ax=0;while((Ay=AD[Ax++])){Ay.call(AB,A)}AD=null}if(A.fn.triggerHandler){A(AB).triggerHandler("ready")}}},bindReady:function(){if(k){return }k=true;if(AB.readyState==="complete"){return A.ready()}if(AB.addEventListener){AB.addEventListener("DOMContentLoaded",Af,false);Al.addEventListener("load",A.ready,false)}else{if(AB.attachEvent){AB.attachEvent("onreadystatechange",Af);Al.attachEvent("onload",A.ready);var Ax=false;try{Ax=Al.frameElement==null}catch(Ay){}if(AB.documentElement.doScroll&&Ax){X()}}}},isFunction:function(Ax){return AS.call(Ax)==="[object Function]"},isArray:function(Ax){return AS.call(Ax)==="[object Array]"},isPlainObject:function(Ay){if(!Ay||AS.call(Ay)!=="[object Object]"||Ay.nodeType||Ay.setInterval){return false}if(Ay.constructor&&!AP.call(Ay,"constructor")&&!AP.call(Ay.constructor.prototype,"isPrototypeOf")){return false}var Ax;for(Ax in Ay){}return Ax===c||AP.call(Ay,Ax)},isEmptyObject:function(Ay){for(var Ax in Ay){return false}return true},error:function(Ax){throw Ax},parseJSON:function(Ax){if(typeof Ax!=="string"||!Ax){return null}Ax=A.trim(Ax);if(/^[\],:{}\s]*$/.test(Ax.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return Al.JSON&&Al.JSON.parse?Al.JSON.parse(Ax):(new Function("return "+Ax))()}else{A.error("Invalid JSON: "+Ax)}},noop:function(){},globalEval:function(Az){if(Az&&AW.test(Az)){var Ay=AB.getElementsByTagName("head")[0]||AB.documentElement,Ax=AB.createElement("script");Ax.type="text/javascript";if(A.support.scriptEval){Ax.appendChild(AB.createTextNode(Az))}else{Ax.text=Az}Ay.insertBefore(Ax,Ay.firstChild);Ay.removeChild(Ax)}},nodeName:function(Ay,Ax){return Ay.nodeName&&Ay.nodeName.toUpperCase()===Ax.toUpperCase()},each:function(A0,A4,Az){var Ay,A1=0,A2=A0.length,Ax=A2===c||A.isFunction(A0);if(Az){if(Ax){for(Ay in A0){if(A4.apply(A0[Ay],Az)===false){break}}}else{for(;A1<A2;){if(A4.apply(A0[A1++],Az)===false){break}}}}else{if(Ax){for(Ay in A0){if(A4.call(A0[Ay],Ay,A0[Ay])===false){break}}}else{for(var A3=A0[0];A1<A2&&A4.call(A3,A1,A3)!==false;A3=A0[++A1]){}}}return A0},trim:function(Ax){return(Ax||"").replace(m,"")},makeArray:function(Az,Ay){var Ax=Ay||[];if(Az!=null){if(Az.length==null||typeof Az==="string"||A.isFunction(Az)||(typeof Az!=="function"&&Az.setInterval)){G.call(Ax,Az)}else{A.merge(Ax,Az)}}return Ax},inArray:function(Az,A0){if(A0.indexOf){return A0.indexOf(Az)}for(var Ax=0,Ay=A0.length;Ax<Ay;Ax++){if(A0[Ax]===Az){return Ax}}return -1},merge:function(A1,Az){var A0=A1.length,Ay=0;if(typeof Az.length==="number"){for(var Ax=Az.length;Ay<Ax;Ay++){A1[A0++]=Az[Ay]}}else{while(Az[Ay]!==c){A1[A0++]=Az[Ay++]}}A1.length=A0;return A1},grep:function(Ay,A2,Ax){var Az=[];for(var A0=0,A1=Ay.length;A0<A1;A0++){if(!Ax!==!A2(Ay[A0],A0)){Az.push(Ay[A0])}}return Az},map:function(Ay,A3,Ax){var Az=[],A2;for(var A0=0,A1=Ay.length;A0<A1;A0++){A2=A3(Ay[A0],A0,Ax);if(A2!=null){Az[Az.length]=A2}}return Az.concat.apply([],Az)},guid:1,proxy:function(Az,Ay,Ax){if(arguments.length===2){if(typeof Ay==="string"){Ax=Az;Az=Ax[Ay];Ay=c}else{if(Ay&&!A.isFunction(Ay)){Ax=Ay;Ay=c}}}if(!Ay&&Az){Ay=function(){return Az.apply(Ax||this,arguments)}}if(Az){Ay.guid=Az.guid=Az.guid||Ay.guid||A.guid++}return Ay},uaMatch:function(Ay){Ay=Ay.toLowerCase();var Ax=/(webkit)[ \/]([\w.]+)/.exec(Ay)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(Ay)||/(msie) ([\w.]+)/.exec(Ay)||!/compatible/.test(Ay)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(Ay)||[];return{browser:Ax[1]||"",version:Ax[2]||"0"}},browser:{}});U=A.uaMatch(B);if(U.browser){A.browser[U.browser]=true;A.browser.version=U.version}if(A.browser.webkit){A.browser.safari=true}if(S){A.inArray=function(Ax,Ay){return S.call(Ay,Ax)}}x=A(AB);if(AB.addEventListener){Af=function(){AB.removeEventListener("DOMContentLoaded",Af,false);A.ready()}}else{if(AB.attachEvent){Af=function(){if(AB.readyState==="complete"){AB.detachEvent("onreadystatechange",Af);A.ready()}}}}function X(){if(A.isReady){return }try{AB.documentElement.doScroll("left")}catch(Ax){setTimeout(X,1);return }A.ready()}function Au(Ax,Ay){if(Ay.src){A.ajax({url:Ay.src,async:false,dataType:"script"})}else{A.globalEval(Ay.text||Ay.textContent||Ay.innerHTML||"")}if(Ay.parentNode){Ay.parentNode.removeChild(Ay)}}function AN(Ax,A5,A3,Az,A2,A4){var Ay=Ax.length;if(typeof A5==="object"){for(var A0 in A5){AN(Ax,A0,A5[A0],Az,A2,A3)}return Ax}if(A3!==c){Az=!A4&&Az&&A.isFunction(A3);for(var A1=0;A1<Ay;A1++){A2(Ax[A1],A5,Az?A3.call(Ax[A1],A1,A2(Ax[A1],A5)):A3,A4)}return Ax}return Ay?A2(Ax[0],A5):c}function Ao(){return(new Date).getTime()}(function(){A.support={};var A3=AB.documentElement,A2=AB.createElement("script"),Ax=AB.createElement("div"),Ay="script"+Ao();Ax.style.display="none";Ax.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var A5=Ax.getElementsByTagName("*"),A4=Ax.getElementsByTagName("a")[0];if(!A5||!A5.length||!A4){return }A.support={leadingWhitespace:Ax.firstChild.nodeType===3,tbody:!Ax.getElementsByTagName("tbody").length,htmlSerialize:!!Ax.getElementsByTagName("link").length,style:/red/.test(A4.getAttribute("style")),hrefNormalized:A4.getAttribute("href")==="/a",opacity:/^0.55$/.test(A4.style.opacity),cssFloat:!!A4.style.cssFloat,checkOn:Ax.getElementsByTagName("input")[0].value==="on",optSelected:AB.createElement("select").appendChild(AB.createElement("option")).selected,parentNode:Ax.removeChild(Ax.appendChild(AB.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};A2.type="text/javascript";try{A2.appendChild(AB.createTextNode("window."+Ay+"=1;"))}catch(A0){}A3.insertBefore(A2,A3.firstChild);if(Al[Ay]){A.support.scriptEval=true;delete Al[Ay]}try{delete A2.test}catch(A0){A.support.deleteExpando=false}A3.removeChild(A2);if(Ax.attachEvent&&Ax.fireEvent){Ax.attachEvent("onclick",function A6(){A.support.noCloneEvent=false;Ax.detachEvent("onclick",A6)});Ax.cloneNode(true).fireEvent("onclick")}Ax=AB.createElement("div");Ax.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var Az=AB.createDocumentFragment();Az.appendChild(Ax.firstChild);A.support.checkClone=Az.cloneNode(true).cloneNode(true).lastChild.checked;A(function(){var A7=AB.createElement("div");A7.style.width=A7.style.paddingLeft="1px";AB.body.appendChild(A7);A.boxModel=A.support.boxModel=A7.offsetWidth===2;AB.body.removeChild(A7).style.display="none";A7=null});var A1=function(A7){var A9=AB.createElement("div");A7="on"+A7;var A8=(A7 in A9);if(!A8){A9.setAttribute(A7,"return;");A8=typeof A9[A7]==="function"}A9=null;return A8};A.support.submitBubbles=A1("submit");A.support.changeBubbles=A1("change");A3=A2=Ax=A5=A4=null})();A.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var Ah="jQuery"+Ao(),Ag=0,As={};A.extend({cache:{},expando:Ah,noData:{"embed":true,"object":true,"applet":true},data:function(Az,Ay,A1){if(Az.nodeName&&A.noData[Az.nodeName.toLowerCase()]){return }Az=Az==Al?As:Az;var A2=Az[Ah],Ax=A.cache,A0;if(!A2&&typeof Ay==="string"&&A1===c){return null}if(!A2){A2=++Ag}if(typeof Ay==="object"){Az[Ah]=A2;A0=Ax[A2]=A.extend(true,{},Ay)}else{if(!Ax[A2]){Az[Ah]=A2;Ax[A2]={}}}A0=Ax[A2];if(A1!==c){A0[Ay]=A1}return typeof Ay==="string"?A0[Ay]:A0},removeData:function(Az,Ay){if(Az.nodeName&&A.noData[Az.nodeName.toLowerCase()]){return }Az=Az==Al?As:Az;var A1=Az[Ah],Ax=A.cache,A0=Ax[A1];if(Ay){if(A0){delete A0[Ay];if(A.isEmptyObject(A0)){A.removeData(Az)}}}else{if(A.support.deleteExpando){delete Az[A.expando]}else{if(Az.removeAttribute){Az.removeAttribute(A.expando)}}delete Ax[A1]}}});A.fn.extend({data:function(Ax,Az){if(typeof Ax==="undefined"&&this.length){return A.data(this[0])}else{if(typeof Ax==="object"){return this.each(function(){A.data(this,Ax)})}}var A0=Ax.split(".");A0[1]=A0[1]?"."+A0[1]:"";if(Az===c){var Ay=this.triggerHandler("getData"+A0[1]+"!",[A0[0]]);if(Ay===c&&this.length){Ay=A.data(this[0],Ax)}return Ay===c&&A0[1]?this.data(A0[0]):Ay}else{return this.trigger("setData"+A0[1]+"!",[A0[0],Az]).each(function(){A.data(this,Ax,Az)})}},removeData:function(Ax){return this.each(function(){A.removeData(this,Ax)})}});A.extend({queue:function(Ay,Ax,A0){if(!Ay){return }Ax=(Ax||"fx")+"queue";var Az=A.data(Ay,Ax);if(!A0){return Az||[]}if(!Az||A.isArray(A0)){Az=A.data(Ay,Ax,A.makeArray(A0))}else{Az.push(A0)}return Az},dequeue:function(A0,Az){Az=Az||"fx";var Ax=A.queue(A0,Az),Ay=Ax.shift();if(Ay==="inprogress"){Ay=Ax.shift()}if(Ay){if(Az==="fx"){Ax.unshift("inprogress")}Ay.call(A0,function(){A.dequeue(A0,Az)})}}});A.fn.extend({queue:function(Ax,Ay){if(typeof Ax!=="string"){Ay=Ax;Ax="fx"}if(Ay===c){return A.queue(this[0],Ax)}return this.each(function(A0,A1){var Az=A.queue(this,Ax,Ay);if(Ax==="fx"&&Az[0]!=="inprogress"){A.dequeue(this,Ax)}})},dequeue:function(Ax){return this.each(function(){A.dequeue(this,Ax)})},delay:function(Ay,Ax){Ay=A.fx?A.fx.speeds[Ay]||Ay:Ay;Ax=Ax||"fx";return this.queue(Ax,function(){var Az=this;setTimeout(function(){A.dequeue(Az,Ax)},Ay)})},clearQueue:function(Ax){return this.queue(Ax||"fx",[])}});var AO=/[\n\t]/g,s=/\s+/,AU=/\r/g,Ap=/href|src|style/,D=/(button|input)/i,Z=/(button|input|object|select|textarea)/i,J=/^(a|area)$/i,i=/radio|checkbox/;A.fn.extend({attr:function(Ax,Ay){return AN(this,Ax,Ay,true,A.attr)},removeAttr:function(Ax,Ay){return this.each(function(){A.attr(this,Ax,"");if(this.nodeType===1){this.removeAttribute(Ax)}})},addClass:function(A4){if(A.isFunction(A4)){return this.each(function(A7){var A6=A(this);A6.addClass(A4.call(this,A7,A6.attr("class")))})}if(A4&&typeof A4==="string"){var Ax=(A4||"").split(s);for(var A0=0,Az=this.length;A0<Az;A0++){var Ay=this[A0];if(Ay.nodeType===1){if(!Ay.className){Ay.className=A4}else{var A1=" "+Ay.className+" ",A3=Ay.className;for(var A2=0,A5=Ax.length;A2<A5;A2++){if(A1.indexOf(" "+Ax[A2]+" ")<0){A3+=" "+Ax[A2]}}Ay.className=A.trim(A3)}}}}return this},removeClass:function(A2){if(A.isFunction(A2)){return this.each(function(A6){var A5=A(this);A5.removeClass(A2.call(this,A6,A5.attr("class")))})}if((A2&&typeof A2==="string")||A2===c){var A3=(A2||"").split(s);for(var Az=0,Ay=this.length;Az<Ay;Az++){var A1=this[Az];if(A1.nodeType===1&&A1.className){if(A2){var A0=(" "+A1.className+" ").replace(AO," ");for(var A4=0,Ax=A3.length;A4<Ax;A4++){A0=A0.replace(" "+A3[A4]+" "," ")}A1.className=A.trim(A0)}else{A1.className=""}}}}return this},toggleClass:function(A0,Ay){var Az=typeof A0,Ax=typeof Ay==="boolean";if(A.isFunction(A0)){return this.each(function(A2){var A1=A(this);A1.toggleClass(A0.call(this,A2,A1.attr("class"),Ay),Ay)})}return this.each(function(){if(Az==="string"){var A3,A2=0,A1=A(this),A4=Ay,A5=A0.split(s);while((A3=A5[A2++])){A4=Ax?A4:!A1.hasClass(A3);A1[A4?"addClass":"removeClass"](A3)}}else{if(Az==="undefined"||Az==="boolean"){if(this.className){A.data(this,"__className__",this.className)}this.className=this.className||A0===false?"":A.data(this,"__className__")||""}}})},hasClass:function(Ax){var A0=" "+Ax+" ";for(var Az=0,Ay=this.length;Az<Ay;Az++){if((" "+this[Az].className+" ").replace(AO," ").indexOf(A0)>-1){return true}}return false},val:function(A4){if(A4===c){var Ay=this[0];if(Ay){if(A.nodeName(Ay,"option")){return(Ay.attributes.value||{}).specified?Ay.value:Ay.text}if(A.nodeName(Ay,"select")){var A2=Ay.selectedIndex,A5=[],A6=Ay.options,A1=Ay.type==="select-one";if(A2<0){return null}for(var Az=A1?A2:0,A3=A1?A2+1:A6.length;Az<A3;Az++){var A0=A6[Az];if(A0.selected){A4=A(A0).val();if(A1){return A4}A5.push(A4)}}return A5}if(i.test(Ay.type)&&!A.support.checkOn){return Ay.getAttribute("value")===null?"on":Ay.value}return(Ay.value||"").replace(AU,"")}return c}var Ax=A.isFunction(A4);return this.each(function(A9){var A8=A(this),BA=A4;if(this.nodeType!==1){return }if(Ax){BA=A4.call(this,A9,A8.val())}if(typeof BA==="number"){BA+=""}if(A.isArray(BA)&&i.test(this.type)){this.checked=A.inArray(A8.val(),BA)>=0}else{if(A.nodeName(this,"select")){var A7=A.makeArray(BA);A("option",this).each(function(){this.selected=A.inArray(A(this).val(),A7)>=0});if(!A7.length){this.selectedIndex=-1}}else{this.value=BA}}})}});A.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(Ay,Ax,A3,A6){if(!Ay||Ay.nodeType===3||Ay.nodeType===8){return c}if(A6&&Ax in A.attrFn){return A(Ay)[Ax](A3)}var Az=Ay.nodeType!==1||!A.isXMLDoc(Ay),A2=A3!==c;Ax=Az&&A.props[Ax]||Ax;if(Ay.nodeType===1){var A1=Ap.test(Ax);if(Ax==="selected"&&!A.support.optSelected){var A4=Ay.parentNode;if(A4){A4.selectedIndex;if(A4.parentNode){A4.parentNode.selectedIndex}}}if(Ax in Ay&&Az&&!A1){if(A2){if(Ax==="type"&&D.test(Ay.nodeName)&&Ay.parentNode){A.error("type property can't be changed")}Ay[Ax]=A3}if(A.nodeName(Ay,"form")&&Ay.getAttributeNode(Ax)){return Ay.getAttributeNode(Ax).nodeValue}if(Ax==="tabIndex"){var A5=Ay.getAttributeNode("tabIndex");return A5&&A5.specified?A5.value:Z.test(Ay.nodeName)||J.test(Ay.nodeName)&&Ay.href?0:c}return Ay[Ax]}if(!A.support.style&&Az&&Ax==="style"){if(A2){Ay.style.cssText=""+A3}return Ay.style.cssText}if(A2){Ay.setAttribute(Ax,""+A3)}var A0=!A.support.hrefNormalized&&Az&&A1?Ay.getAttribute(Ax,2):Ay.getAttribute(Ax);return A0===null?c:A0}return A.style(Ay,Ax,A3)}});var Ab=/\.(.*)$/,a=function(Ax){return Ax.replace(/[^\w\s\.\|`]/g,function(Ay){return"\\"+Ay})};A.event={add:function(A0,A4,A9,A2){if(A0.nodeType===3||A0.nodeType===8){return }if(A0.setInterval&&(A0!==Al&&!A0.frameElement)){A0=Al}var Ay,A8;if(A9.handler){Ay=A9;A9=Ay.handler}if(!A9.guid){A9.guid=A.guid++}var A5=A.data(A0);if(!A5){return }var BA=A5.events=A5.events||{},A3=A5.handle,A3;if(!A3){A5.handle=A3=function(){return typeof A!=="undefined"&&!A.event.triggered?A.event.handle.apply(A3.elem,arguments):c}}A3.elem=A0;A4=A4.split(" ");var A7,A1=0,Ax;while((A7=A4[A1++])){A8=Ay?A.extend({},Ay):{handler:A9,data:A2};if(A7.indexOf(".")>-1){Ax=A7.split(".");A7=Ax.shift();A8.namespace=Ax.slice(0).sort().join(".")}else{Ax=[];A8.namespace=""}A8.type=A7;A8.guid=A9.guid;var Az=BA[A7],A6=A.event.special[A7]||{};if(!Az){Az=BA[A7]=[];if(!A6.setup||A6.setup.call(A0,A2,Ax,A3)===false){if(A0.addEventListener){A0.addEventListener(A7,A3,false)}else{if(A0.attachEvent){A0.attachEvent("on"+A7,A3)}}}}if(A6.add){A6.add.call(A0,A8);if(!A8.handler.guid){A8.handler.guid=A9.guid}}Az.push(A8);A.event.global[A7]=true}A0=null},global:{},remove:function(BC,A7,Ay,A3){if(BC.nodeType===3||BC.nodeType===8){return }var BF,A2,A4,BA=0,A0,A5,A8,A1,A6,Ax,BE,BB=A.data(BC),Az=BB&&BB.events;if(!BB||!Az){return }if(A7&&A7.type){Ay=A7.handler;A7=A7.type}if(!A7||typeof A7==="string"&&A7.charAt(0)==="."){A7=A7||"";for(A2 in Az){A.event.remove(BC,A2+A7)}return }A7=A7.split(" ");while((A2=A7[BA++])){BE=A2;Ax=null;A0=A2.indexOf(".")<0;A5=[];if(!A0){A5=A2.split(".");A2=A5.shift();A8=new RegExp("(^|\\.)"+A.map(A5.slice(0).sort(),a).join("\\.(?:.*\\.)?")+"(\\.|$)")}A6=Az[A2];if(!A6){continue}if(!Ay){for(var A9=0;A9<A6.length;A9++){Ax=A6[A9];if(A0||A8.test(Ax.namespace)){A.event.remove(BC,BE,Ax.handler,A9);A6.splice(A9--,1)}}continue}A1=A.event.special[A2]||{};for(var A9=A3||0;A9<A6.length;A9++){Ax=A6[A9];if(Ay.guid===Ax.guid){if(A0||A8.test(Ax.namespace)){if(A3==null){A6.splice(A9--,1)}if(A1.remove){A1.remove.call(BC,Ax)}}if(A3!=null){break}}}if(A6.length===0||A3!=null&&A6.length===1){if(!A1.teardown||A1.teardown.call(BC,A5)===false){AG(BC,A2,BB.handle)}BF=null;delete Az[A2]}}if(A.isEmptyObject(Az)){var BD=BB.handle;if(BD){BD.elem=null}delete BB.events;delete BB.handle;if(A.isEmptyObject(BB)){A.removeData(BC)}}},trigger:function(Ax,A1,Az){var A6=Ax.type||Ax,A0=arguments[3];if(!A0){Ax=typeof Ax==="object"?Ax[Ah]?Ax:A.extend(A.Event(A6),Ax):A.Event(A6);if(A6.indexOf("!")>=0){Ax.type=A6=A6.slice(0,-1);Ax.exclusive=true}if(!Az){Ax.stopPropagation();if(A.event.global[A6]){A.each(A.cache,function(){if(this.events&&this.events[A6]){A.event.trigger(Ax,A1,this.handle.elem)}})}}if(!Az||Az.nodeType===3||Az.nodeType===8){return c}Ax.result=c;Ax.target=Az;A1=A.makeArray(A1);A1.unshift(Ax)}Ax.currentTarget=Az;var A2=A.data(Az,"handle");if(A2){A2.apply(Az,A1)}var A7=Az.parentNode||Az.ownerDocument;try{if(!(Az&&Az.nodeName&&A.noData[Az.nodeName.toLowerCase()])){if(Az["on"+A6]&&Az["on"+A6].apply(Az,A1)===false){Ax.result=false}}}catch(A4){}if(!Ax.isPropagationStopped()&&A7){A.event.trigger(Ax,A1,A7,true)}else{if(!Ax.isDefaultPrevented()){var A3=Ax.target,Ay,A8=A.nodeName(A3,"a")&&A6==="click",A5=A.event.special[A6]||{};if((!A5._default||A5._default.call(Az,Ax)===false)&&!A8&&!(A3&&A3.nodeName&&A.noData[A3.nodeName.toLowerCase()])){try{if(A3[A6]){Ay=A3["on"+A6];if(Ay){A3["on"+A6]=null}A.event.triggered=true;A3[A6]()}}catch(A4){}if(Ay){A3["on"+A6]=Ay}A.event.triggered=false}}}},handle:function(Ax){var A5,Az,Ay,A0,A6;Ax=arguments[0]=A.event.fix(Ax||Al.event);Ax.currentTarget=this;A5=Ax.type.indexOf(".")<0&&!Ax.exclusive;if(!A5){Ay=Ax.type.split(".");Ax.type=Ay.shift();A0=new RegExp("(^|\\.)"+Ay.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var A6=A.data(this,"events"),Az=A6[Ax.type];if(A6&&Az){Az=Az.slice(0);for(var A2=0,A1=Az.length;A2<A1;A2++){var A4=Az[A2];if(A5||A0.test(A4.namespace)){Ax.handler=A4.handler;Ax.data=A4.data;Ax.handleObj=A4;var A3=A4.handler.apply(this,arguments);if(A3!==c){Ax.result=A3;if(A3===false){Ax.preventDefault();Ax.stopPropagation()}}if(Ax.isImmediatePropagationStopped()){break}}}}return Ax.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 originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(A0){if(A0[Ah]){return A0}var Ay=A0;A0=A.Event(Ay);for(var Az=this.props.length,A2;Az;){A2=this.props[--Az];A0[A2]=Ay[A2]}if(!A0.target){A0.target=A0.srcElement||AB}if(A0.target.nodeType===3){A0.target=A0.target.parentNode}if(!A0.relatedTarget&&A0.fromElement){A0.relatedTarget=A0.fromElement===A0.target?A0.toElement:A0.fromElement}if(A0.pageX==null&&A0.clientX!=null){var A1=AB.documentElement,Ax=AB.body;A0.pageX=A0.clientX+(A1&&A1.scrollLeft||Ax&&Ax.scrollLeft||0)-(A1&&A1.clientLeft||Ax&&Ax.clientLeft||0);A0.pageY=A0.clientY+(A1&&A1.scrollTop||Ax&&Ax.scrollTop||0)-(A1&&A1.clientTop||Ax&&Ax.clientTop||0)}if(!A0.which&&((A0.charCode||A0.charCode===0)?A0.charCode:A0.keyCode)){A0.which=A0.charCode||A0.keyCode}if(!A0.metaKey&&A0.ctrlKey){A0.metaKey=A0.ctrlKey}if(!A0.which&&A0.button!==c){A0.which=(A0.button&1?1:(A0.button&2?3:(A0.button&4?2:0)))}return A0},guid:100000000,proxy:A.proxy,special:{ready:{setup:A.bindReady,teardown:A.noop},live:{add:function(Ax){A.event.add(this,Ax.origType,A.extend({},Ax,{handler:v}))},remove:function(Ay){var Ax=true,Az=Ay.origType.replace(Ab,"");A.each(A.data(this,"events").live||[],function(){if(Az===this.origType.replace(Ab,"")){Ax=false;return false}});if(Ax){A.event.remove(this,Ay.origType,v)}}},beforeunload:{setup:function(Az,Ay,Ax){if(this.setInterval){this.onbeforeunload=Ax}return false},teardown:function(Ay,Ax){if(this.onbeforeunload===Ax){this.onbeforeunload=null}}}}};var AG=AB.removeEventListener?function(Ay,Ax,Az){Ay.removeEventListener(Ax,Az,false)}:function(Ay,Ax,Az){Ay.detachEvent("on"+Ax,Az)};A.Event=function(Ax){if(!this.preventDefault){return new A.Event(Ax)}if(Ax&&Ax.type){this.originalEvent=Ax;this.type=Ax.type}else{this.type=Ax}this.timeStamp=Ao();this[Ah]=true};function Aq(){return false}function F(){return true}A.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var Ax=this.originalEvent;if(!Ax){return }if(Ax.preventDefault){Ax.preventDefault()}Ax.returnValue=false},stopPropagation:function(){this.isPropagationStopped=F;var Ax=this.originalEvent;if(!Ax){return }if(Ax.stopPropagation){Ax.stopPropagation()}Ax.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F;this.stopPropagation()},isDefaultPrevented:Aq,isPropagationStopped:Aq,isImmediatePropagationStopped:Aq};var q=function(Ay){var Ax=Ay.relatedTarget;try{while(Ax&&Ax!==this){Ax=Ax.parentNode}if(Ax!==this){Ay.type=Ay.data;A.event.handle.apply(this,arguments)}}catch(Az){}},AX=function(Ax){Ax.type=Ax.data;A.event.handle.apply(this,arguments)};A.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(Ay,Ax){A.event.special[Ay]={setup:function(Az){A.event.add(this,Ax,Az&&Az.selector?AX:q,Ay)},teardown:function(Az){A.event.remove(this,Ax,Az&&Az.selector?AX:q)}}});if(!A.support.submitBubbles){A.event.special.submit={setup:function(Ay,Ax){if(this.nodeName.toLowerCase()!=="form"){A.event.add(this,"click.specialSubmit",function(A1){var A0=A1.target,Az=A0.type;if((Az==="submit"||Az==="image")&&A(A0).closest("form").length){return AZ("submit",this,arguments)}});A.event.add(this,"keypress.specialSubmit",function(A1){var A0=A1.target,Az=A0.type;if((Az==="text"||Az==="password")&&A(A0).closest("form").length&&A1.keyCode===13){return AZ("submit",this,arguments)}})}else{return false}},teardown:function(Ax){A.event.remove(this,".specialSubmit")}}}if(!A.support.changeBubbles){var AQ=/textarea|input|select/i,Ar,I=function(Ay){var Ax=Ay.type,Az=Ay.value;if(Ax==="radio"||Ax==="checkbox"){Az=Ay.checked}else{if(Ax==="select-multiple"){Az=Ay.selectedIndex>-1?A.map(Ay.options,function(A0){return A0.selected}).join("-"):""}else{if(Ay.nodeName.toLowerCase()==="select"){Az=Ay.selectedIndex}}}return Az},o=function o(Az){var Ax=Az.target,Ay,A0;if(!AQ.test(Ax.nodeName)||Ax.readOnly){return }Ay=A.data(Ax,"_change_data");A0=I(Ax);if(Az.type!=="focusout"||Ax.type!=="radio"){A.data(Ax,"_change_data",A0)}if(Ay===c||A0===Ay){return }if(Ay!=null||A0){Az.type="change";return A.event.trigger(Az,arguments[1],Ax)}};A.event.special.change={filters:{focusout:o,click:function(Az){var Ay=Az.target,Ax=Ay.type;if(Ax==="radio"||Ax==="checkbox"||Ay.nodeName.toLowerCase()==="select"){return o.call(this,Az)}},keydown:function(Az){var Ay=Az.target,Ax=Ay.type;if((Az.keyCode===13&&Ay.nodeName.toLowerCase()!=="textarea")||(Az.keyCode===32&&(Ax==="checkbox"||Ax==="radio"))||Ax==="select-multiple"){return o.call(this,Az)}},beforeactivate:function(Ay){var Ax=Ay.target;A.data(Ax,"_change_data",I(Ax))}},setup:function(Az,Ay){if(this.type==="file"){return false}for(var Ax in Ar){A.event.add(this,Ax+".specialChange",Ar[Ax])}return AQ.test(this.nodeName)},teardown:function(Ax){A.event.remove(this,".specialChange");return AQ.test(this.nodeName)}};Ar=A.event.special.change.filters}function AZ(Ay,Az,Ax){Ax[0].type=Ay;return A.event.handle.apply(Az,Ax)}if(AB.addEventListener){A.each({focus:"focusin",blur:"focusout"},function(Az,Ax){A.event.special[Ax]={setup:function(){this.addEventListener(Az,Ay,true)},teardown:function(){this.removeEventListener(Az,Ay,true)}};function Ay(A0){A0=A.event.fix(A0);A0.type=Ax;return A.event.handle.call(this,A0)}})}A.each(["bind","one"],function(Ay,Ax){A.fn[Ax]=function(A4,A5,A3){if(typeof A4==="object"){for(var A1 in A4){this[Ax](A1,A5,A4[A1],A3)}return this}if(A.isFunction(A5)){A3=A5;A5=c}var A2=Ax==="one"?A.proxy(A3,function(A6){A(this).unbind(A6,A2);return A3.apply(this,arguments)}):A3;if(A4==="unload"&&Ax!=="one"){this.one(A4,A5,A3)}else{for(var A0=0,Az=this.length;A0<Az;A0++){A.event.add(this[A0],A4,A2,A5)}}return this}});A.fn.extend({unbind:function(A1,A0){if(typeof A1==="object"&&!A1.preventDefault){for(var Az in A1){this.unbind(Az,A1[Az])}}else{for(var Ay=0,Ax=this.length;Ay<Ax;Ay++){A.event.remove(this[Ay],A1,A0)}}return this},delegate:function(Ax,Ay,A0,Az){return this.live(Ay,A0,Az,Ax)},undelegate:function(Ax,Ay,Az){if(arguments.length===0){return this.unbind("live")}else{return this.die(Ay,null,Az,Ax)}},trigger:function(Ax,Ay){return this.each(function(){A.event.trigger(Ax,Ay,this)})},triggerHandler:function(Ax,Az){if(this[0]){var Ay=A.Event(Ax);Ay.preventDefault();Ay.stopPropagation();A.event.trigger(Ay,Az,this[0]);return Ay.result}},toggle:function(Az){var Ax=arguments,Ay=1;while(Ay<Ax.length){A.proxy(Az,Ax[Ay++])}return this.click(A.proxy(Az,function(A0){var A1=(A.data(this,"lastToggle"+Az.guid)||0)%Ay;A.data(this,"lastToggle"+Az.guid,A1+1);A0.preventDefault();return Ax[A1].apply(this,arguments)||false}))},hover:function(Ax,Ay){return this.mouseenter(Ax).mouseleave(Ay||Ax)}});var AV={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};A.each(["live","die"],function(Ay,Ax){A.fn[Ax]=function(A6,A3,A8,A1){var A7,A4=0,A5,A0,A9,A2=A1||this.selector,Az=A1?this:A(this.context);if(A.isFunction(A3)){A8=A3;A3=c}A6=(A6||"").split(" ");while((A7=A6[A4++])!=null){A5=Ab.exec(A7);A0="";if(A5){A0=A5[0];A7=A7.replace(Ab,"")}if(A7==="hover"){A6.push("mouseenter"+A0,"mouseleave"+A0);continue}A9=A7;if(A7==="focus"||A7==="blur"){A6.push(AV[A7]+A0);A7=A7+A0}else{A7=(AV[A7]||A7)+A0}if(Ax==="live"){Az.each(function(){A.event.add(this,M(A7,A2),{data:A3,selector:A2,handler:A8,origType:A7,origHandler:A8,preType:A9})})}else{Az.unbind(M(A7,A2),A8)}}return this}});function v(Ax){var A7,Ay=[],BA=[],A6=arguments,A9,A5,A8,A0,A2,A4,A1,A3,BB=A.data(this,"events");if(Ax.liveFired===this||!BB||!BB.live||Ax.button&&Ax.type==="click"){return }Ax.liveFired=this;var Az=BB.live.slice(0);for(A2=0;A2<Az.length;A2++){A8=Az[A2];if(A8.origType.replace(Ab,"")===Ax.type){BA.push(A8.selector)}else{Az.splice(A2--,1)}}A5=A(Ax.target).closest(BA,Ax.currentTarget);for(A4=0,A1=A5.length;A4<A1;A4++){for(A2=0;A2<Az.length;A2++){A8=Az[A2];if(A5[A4].selector===A8.selector){A0=A5[A4].elem;A9=null;if(A8.preType==="mouseenter"||A8.preType==="mouseleave"){A9=A(Ax.relatedTarget).closest(A8.selector)[0]}if(!A9||A9!==A0){Ay.push({elem:A0,handleObj:A8})}}}}for(A4=0,A1=Ay.length;A4<A1;A4++){A5=Ay[A4];Ax.currentTarget=A5.elem;Ax.data=A5.handleObj.data;Ax.handleObj=A5.handleObj;if(A5.handleObj.origHandler.apply(A5.elem,A6)===false){A7=false;break}}return A7}function M(Ay,Ax){return"live."+(Ay&&Ay!=="*"?Ay+".":"")+Ax.replace(/\./g,"`").replace(/ /g,"&")}A.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(Ay,Ax){A.fn[Ax]=function(Az){return Az?this.bind(Ax,Az):this.trigger(Ax)};if(A.attrFn){A.attrFn[Ax]=true}});if(Al.attachEvent&&!Al.addEventListener){Al.attachEvent("onunload",function(){for(var Ay in A.cache){if(A.cache[Ay].handle){try{A.event.remove(A.cache[Ay].handle.elem)}catch(Ax){}}}})}(function(){var A8=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,A9=0,BB=Object.prototype.toString,A3=false,A2=true;[0,0].sort(function(){A2=false;return 0});var Az=function(BK,BF,BN,BO){BN=BN||[];var BQ=BF=BF||AB;if(BF.nodeType!==1&&BF.nodeType!==9){return[]}if(!BK||typeof BK!=="string"){return BN}var BL=[],BH,BS,BV,BG,BJ=true,BI=A0(BF),BP=BK;while((A8.exec(""),BH=A8.exec(BP))!==null){BP=BH[3];BL.push(BH[1]);if(BH[2]){BG=BH[3];break}}if(BL.length>1&&A4.exec(BK)){if(BL.length===2&&A5.relative[BL[0]]){BS=BC(BL[0]+BL[1],BF)}else{BS=A5.relative[BL[0]]?[BF]:Az(BL.shift(),BF);while(BL.length){BK=BL.shift();if(A5.relative[BK]){BK+=BL.shift()}BS=BC(BK,BS)}}}else{if(!BO&&BL.length>1&&BF.nodeType===9&&!BI&&A5.match.ID.test(BL[0])&&!A5.match.ID.test(BL[BL.length-1])){var BR=Az.find(BL.shift(),BF,BI);BF=BR.expr?Az.filter(BR.expr,BR.set)[0]:BR.set[0]}if(BF){var BR=BO?{expr:BL.pop(),set:A7(BO)}:Az.find(BL.pop(),BL.length===1&&(BL[0]==="~"||BL[0]==="+")&&BF.parentNode?BF.parentNode:BF,BI);BS=BR.expr?Az.filter(BR.expr,BR.set):BR.set;if(BL.length>0){BV=A7(BS)}else{BJ=false}while(BL.length){var BU=BL.pop(),BT=BU;if(!A5.relative[BU]){BU=""}else{BT=BL.pop()}if(BT==null){BT=BF}A5.relative[BU](BV,BT,BI)}}else{BV=BL=[]}}if(!BV){BV=BS}if(!BV){Az.error(BU||BK)}if(BB.call(BV)==="[object Array]"){if(!BJ){BN.push.apply(BN,BV)}else{if(BF&&BF.nodeType===1){for(var BM=0;BV[BM]!=null;BM++){if(BV[BM]&&(BV[BM]===true||BV[BM].nodeType===1&&A6(BF,BV[BM]))){BN.push(BS[BM])}}}else{for(var BM=0;BV[BM]!=null;BM++){if(BV[BM]&&BV[BM].nodeType===1){BN.push(BS[BM])}}}}}else{A7(BV,BN)}if(BG){Az(BG,BQ,BN,BO);Az.uniqueSort(BN)}return BN};Az.uniqueSort=function(BG){if(BA){A3=A2;BG.sort(BA);if(A3){for(var BF=1;BF<BG.length;BF++){if(BG[BF]===BG[BF-1]){BG.splice(BF--,1)}}}}return BG};Az.matches=function(BF,BG){return Az(BF,null,null,BG)};Az.find=function(BM,BF,BN){var BL,BJ;if(!BM){return[]}for(var BI=0,BH=A5.order.length;BI<BH;BI++){var BK=A5.order[BI],BJ;if((BJ=A5.leftMatch[BK].exec(BM))){var BG=BJ[1];BJ.splice(1,1);if(BG.substr(BG.length-1)!=="\\"){BJ[1]=(BJ[1]||"").replace(/\\/g,"");BL=A5.find[BK](BJ,BF,BN);if(BL!=null){BM=BM.replace(A5.match[BK],"");break}}}}if(!BL){BL=BF.getElementsByTagName("*")}return{set:BL,expr:BM}};Az.filter=function(BQ,BP,BT,BJ){var BH=BQ,BV=[],BN=BP,BL,BF,BM=BP&&BP[0]&&A0(BP[0]);while(BQ&&BP.length){for(var BO in A5.filter){if((BL=A5.leftMatch[BO].exec(BQ))!=null&&BL[2]){var BG=A5.filter[BO],BU,BS,BI=BL[1];BF=false;BL.splice(1,1);if(BI.substr(BI.length-1)==="\\"){continue}if(BN===BV){BV=[]}if(A5.preFilter[BO]){BL=A5.preFilter[BO](BL,BN,BT,BV,BJ,BM);if(!BL){BF=BU=true}else{if(BL===true){continue}}}if(BL){for(var BK=0;(BS=BN[BK])!=null;BK++){if(BS){BU=BG(BS,BL,BK,BN);var BR=BJ^!!BU;if(BT&&BU!=null){if(BR){BF=true}else{BN[BK]=false}}else{if(BR){BV.push(BS);BF=true}}}}}if(BU!==c){if(!BT){BN=BV}BQ=BQ.replace(A5.match[BO],"");if(!BF){return[]}break}}}if(BQ===BH){if(BF==null){Az.error(BQ)}else{break}}BH=BQ}return BN};Az.error=function(BF){throw"Syntax error, unrecognized expression: "+BF};var A5=Az.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(BF){return BF.getAttribute("href")}},relative:{"+":function(BL,BG){var BI=typeof BG==="string",BK=BI&&!/\W/.test(BG),BM=BI&&!BK;if(BK){BG=BG.toLowerCase()}for(var BH=0,BF=BL.length,BJ;BH<BF;BH++){if((BJ=BL[BH])){while((BJ=BJ.previousSibling)&&BJ.nodeType!==1){}BL[BH]=BM||BJ&&BJ.nodeName.toLowerCase()===BG?BJ||false:BJ===BG}}if(BM){Az.filter(BG,BL,true)}},">":function(BL,BG){var BJ=typeof BG==="string";if(BJ&&!/\W/.test(BG)){BG=BG.toLowerCase();for(var BH=0,BF=BL.length;BH<BF;BH++){var BK=BL[BH];if(BK){var BI=BK.parentNode;BL[BH]=BI.nodeName.toLowerCase()===BG?BI:false}}}else{for(var BH=0,BF=BL.length;BH<BF;BH++){var BK=BL[BH];if(BK){BL[BH]=BJ?BK.parentNode:BK.parentNode===BG}}if(BJ){Az.filter(BG,BL,true)}}},"":function(BI,BG,BK){var BH=A9++,BF=BD;if(typeof BG==="string"&&!/\W/.test(BG)){var BJ=BG=BG.toLowerCase();BF=Ax}BF("parentNode",BG,BH,BI,BJ,BK)},"~":function(BI,BG,BK){var BH=A9++,BF=BD;if(typeof BG==="string"&&!/\W/.test(BG)){var BJ=BG=BG.toLowerCase();BF=Ax}BF("previousSibling",BG,BH,BI,BJ,BK)}},find:{ID:function(BG,BH,BI){if(typeof BH.getElementById!=="undefined"&&!BI){var BF=BH.getElementById(BG[1]);return BF?[BF]:[]}},NAME:function(BH,BK){if(typeof BK.getElementsByName!=="undefined"){var BG=[],BJ=BK.getElementsByName(BH[1]);for(var BI=0,BF=BJ.length;BI<BF;BI++){if(BJ[BI].getAttribute("name")===BH[1]){BG.push(BJ[BI])}}return BG.length===0?null:BG}},TAG:function(BF,BG){return BG.getElementsByTagName(BF[1])}},preFilter:{CLASS:function(BI,BG,BH,BF,BL,BM){BI=" "+BI[1].replace(/\\/g,"")+" ";if(BM){return BI}for(var BJ=0,BK;(BK=BG[BJ])!=null;BJ++){if(BK){if(BL^(BK.className&&(" "+BK.className+" ").replace(/[\t\n]/g," ").indexOf(BI)>=0)){if(!BH){BF.push(BK)}}else{if(BH){BG[BJ]=false}}}}return false},ID:function(BF){return BF[1].replace(/\\/g,"")},TAG:function(BG,BF){return BG[1].toLowerCase()},CHILD:function(BF){if(BF[1]==="nth"){var BG=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(BF[2]==="even"&&"2n"||BF[2]==="odd"&&"2n+1"||!/\D/.test(BF[2])&&"0n+"+BF[2]||BF[2]);BF[2]=(BG[1]+(BG[2]||1))-0;BF[3]=BG[3]-0}BF[0]=A9++;return BF},ATTR:function(BJ,BG,BH,BF,BK,BL){var BI=BJ[1].replace(/\\/g,"");if(!BL&&A5.attrMap[BI]){BJ[1]=A5.attrMap[BI]}if(BJ[2]==="~="){BJ[4]=" "+BJ[4]+" "}return BJ},PSEUDO:function(BJ,BG,BH,BF,BK){if(BJ[1]==="not"){if((A8.exec(BJ[3])||"").length>1||/^\w/.test(BJ[3])){BJ[3]=Az(BJ[3],null,null,BG)}else{var BI=Az.filter(BJ[3],BG,BH,true^BK);if(!BH){BF.push.apply(BF,BI)}return false}}else{if(A5.match.POS.test(BJ[0])||A5.match.CHILD.test(BJ[0])){return true}}return BJ},POS:function(BF){BF.unshift(true);return BF}},filters:{enabled:function(BF){return BF.disabled===false&&BF.type!=="hidden"},disabled:function(BF){return BF.disabled===true},checked:function(BF){return BF.checked===true},selected:function(BF){BF.parentNode.selectedIndex;return BF.selected===true},parent:function(BF){return !!BF.firstChild},empty:function(BF){return !BF.firstChild},has:function(BH,BG,BF){return !!Az(BF[3],BH).length},header:function(BF){return/h\d/i.test(BF.nodeName)},text:function(BF){return"text"===BF.type},radio:function(BF){return"radio"===BF.type},checkbox:function(BF){return"checkbox"===BF.type},file:function(BF){return"file"===BF.type},password:function(BF){return"password"===BF.type},submit:function(BF){return"submit"===BF.type},image:function(BF){return"image"===BF.type},reset:function(BF){return"reset"===BF.type},button:function(BF){return"button"===BF.type||BF.nodeName.toLowerCase()==="button"},input:function(BF){return/input|select|textarea|button/i.test(BF.nodeName)}},setFilters:{first:function(BG,BF){return BF===0},last:function(BH,BG,BF,BI){return BG===BI.length-1},even:function(BG,BF){return BF%2===0},odd:function(BG,BF){return BF%2===1},lt:function(BH,BG,BF){return BG<BF[3]-0},gt:function(BH,BG,BF){return BG>BF[3]-0},nth:function(BH,BG,BF){return BF[3]-0===BG},eq:function(BH,BG,BF){return BF[3]-0===BG}},filter:{PSEUDO:function(BL,BH,BI,BM){var BG=BH[1],BJ=A5.filters[BG];if(BJ){return BJ(BL,BI,BH,BM)}else{if(BG==="contains"){return(BL.textContent||BL.innerText||Ay([BL])||"").indexOf(BH[3])>=0}else{if(BG==="not"){var BK=BH[3];for(var BI=0,BF=BK.length;BI<BF;BI++){if(BK[BI]===BL){return false}}return true}else{Az.error("Syntax error, unrecognized expression: "+BG)}}}},CHILD:function(BF,BI){var BL=BI[1],BG=BF;switch(BL){case"only":case"first":while((BG=BG.previousSibling)){if(BG.nodeType===1){return false}}if(BL==="first"){return true}BG=BF;case"last":while((BG=BG.nextSibling)){if(BG.nodeType===1){return false}}return true;case"nth":var BH=BI[2],BO=BI[3];if(BH===1&&BO===0){return true}var BK=BI[0],BN=BF.parentNode;if(BN&&(BN.sizcache!==BK||!BF.nodeIndex)){var BJ=0;for(BG=BN.firstChild;BG;BG=BG.nextSibling){if(BG.nodeType===1){BG.nodeIndex=++BJ}}BN.sizcache=BK}var BM=BF.nodeIndex-BO;if(BH===0){return BM===0}else{return(BM%BH===0&&BM/BH>=0)}}},ID:function(BG,BF){return BG.nodeType===1&&BG.getAttribute("id")===BF},TAG:function(BG,BF){return(BF==="*"&&BG.nodeType===1)||BG.nodeName.toLowerCase()===BF},CLASS:function(BG,BF){return(" "+(BG.className||BG.getAttribute("class"))+" ").indexOf(BF)>-1},ATTR:function(BK,BI){var BH=BI[1],BF=A5.attrHandle[BH]?A5.attrHandle[BH](BK):BK[BH]!=null?BK[BH]:BK.getAttribute(BH),BL=BF+"",BJ=BI[2],BG=BI[4];return BF==null?BJ==="!=":BJ==="="?BL===BG:BJ==="*="?BL.indexOf(BG)>=0:BJ==="~="?(" "+BL+" ").indexOf(BG)>=0:!BG?BL&&BF!==false:BJ==="!="?BL!==BG:BJ==="^="?BL.indexOf(BG)===0:BJ==="$="?BL.substr(BL.length-BG.length)===BG:BJ==="|="?BL===BG||BL.substr(0,BG.length+1)===BG+"-":false},POS:function(BJ,BG,BH,BK){var BF=BG[2],BI=A5.setFilters[BF];if(BI){return BI(BJ,BH,BG,BK)}}}};var A4=A5.match.POS;for(var A1 in A5.match){A5.match[A1]=new RegExp(A5.match[A1].source+/(?![^\[]*\])(?![^\(]*\))/.source);A5.leftMatch[A1]=new RegExp(/(^(?:.|\r|\n)*?)/.source+A5.match[A1].source.replace(/\\(\d+)/g,function(BG,BF){return"\\"+(BF-0+1)}))}var A7=function(BG,BF){BG=Array.prototype.slice.call(BG,0);if(BF){BF.push.apply(BF,BG);return BF}return BG};try{Array.prototype.slice.call(AB.documentElement.childNodes,0)[0].nodeType}catch(BE){A7=function(BJ,BI){var BG=BI||[];if(BB.call(BJ)==="[object Array]"){Array.prototype.push.apply(BG,BJ)}else{if(typeof BJ.length==="number"){for(var BH=0,BF=BJ.length;BH<BF;BH++){BG.push(BJ[BH])}}else{for(var BH=0;BJ[BH];BH++){BG.push(BJ[BH])}}}return BG}}var BA;if(AB.documentElement.compareDocumentPosition){BA=function(BG,BF){if(!BG.compareDocumentPosition||!BF.compareDocumentPosition){if(BG==BF){A3=true}return BG.compareDocumentPosition?-1:1}var BH=BG.compareDocumentPosition(BF)&4?-1:BG===BF?0:1;if(BH===0){A3=true}return BH}}else{if("sourceIndex" in AB.documentElement){BA=function(BG,BF){if(!BG.sourceIndex||!BF.sourceIndex){if(BG==BF){A3=true}return BG.sourceIndex?-1:1}var BH=BG.sourceIndex-BF.sourceIndex;if(BH===0){A3=true}return BH}}else{if(AB.createRange){BA=function(BI,BG){if(!BI.ownerDocument||!BG.ownerDocument){if(BI==BG){A3=true}return BI.ownerDocument?-1:1}var BH=BI.ownerDocument.createRange(),BF=BG.ownerDocument.createRange();BH.setStart(BI,0);BH.setEnd(BI,0);BF.setStart(BG,0);BF.setEnd(BG,0);var BJ=BH.compareBoundaryPoints(Range.START_TO_END,BF);if(BJ===0){A3=true}return BJ}}}}function Ay(BF){var BG="",BI;for(var BH=0;BF[BH];BH++){BI=BF[BH];if(BI.nodeType===3||BI.nodeType===4){BG+=BI.nodeValue}else{if(BI.nodeType!==8){BG+=Ay(BI.childNodes)}}}return BG}(function(){var BG=AB.createElement("div"),BH="script"+(new Date).getTime();BG.innerHTML="<a name='"+BH+"'/>";var BF=AB.documentElement;BF.insertBefore(BG,BF.firstChild);if(AB.getElementById(BH)){A5.find.ID=function(BJ,BK,BL){if(typeof BK.getElementById!=="undefined"&&!BL){var BI=BK.getElementById(BJ[1]);return BI?BI.id===BJ[1]||typeof BI.getAttributeNode!=="undefined"&&BI.getAttributeNode("id").nodeValue===BJ[1]?[BI]:c:[]}};A5.filter.ID=function(BK,BI){var BJ=typeof BK.getAttributeNode!=="undefined"&&BK.getAttributeNode("id");return BK.nodeType===1&&BJ&&BJ.nodeValue===BI}}BF.removeChild(BG);BF=BG=null})();(function(){var BF=AB.createElement("div");BF.appendChild(AB.createComment(""));if(BF.getElementsByTagName("*").length>0){A5.find.TAG=function(BG,BK){var BJ=BK.getElementsByTagName(BG[1]);if(BG[1]==="*"){var BI=[];for(var BH=0;BJ[BH];BH++){if(BJ[BH].nodeType===1){BI.push(BJ[BH])}}BJ=BI}return BJ}}BF.innerHTML="<a href='#'></a>";if(BF.firstChild&&typeof BF.firstChild.getAttribute!=="undefined"&&BF.firstChild.getAttribute("href")!=="#"){A5.attrHandle.href=function(BG){return BG.getAttribute("href",2)}}BF=null})();if(AB.querySelectorAll){(function(){var BF=Az,BH=AB.createElement("div");BH.innerHTML="<p class='TEST'></p>";if(BH.querySelectorAll&&BH.querySelectorAll(".TEST").length===0){return }Az=function(BL,BK,BI,BJ){BK=BK||AB;if(!BJ&&BK.nodeType===9&&!A0(BK)){try{return A7(BK.querySelectorAll(BL),BI)}catch(BM){}}return BF(BL,BK,BI,BJ)};for(var BG in BF){Az[BG]=BF[BG]}BH=null})()}(function(){var BF=AB.createElement("div");BF.innerHTML="<div class='test e'></div><div class='test'></div>";if(!BF.getElementsByClassName||BF.getElementsByClassName("e").length===0){return }BF.lastChild.className="e";if(BF.getElementsByClassName("e").length===1){return }A5.order.splice(1,0,"CLASS");A5.find.CLASS=function(BG,BH,BI){if(typeof BH.getElementsByClassName!=="undefined"&&!BI){return BH.getElementsByClassName(BG[1])}};BF=null})();function Ax(BG,BL,BK,BO,BM,BN){for(var BI=0,BH=BO.length;BI<BH;BI++){var BF=BO[BI];if(BF){BF=BF[BG];var BJ=false;while(BF){if(BF.sizcache===BK){BJ=BO[BF.sizset];break}if(BF.nodeType===1&&!BN){BF.sizcache=BK;BF.sizset=BI}if(BF.nodeName.toLowerCase()===BL){BJ=BF;break}BF=BF[BG]}BO[BI]=BJ}}}function BD(BG,BL,BK,BO,BM,BN){for(var BI=0,BH=BO.length;BI<BH;BI++){var BF=BO[BI];if(BF){BF=BF[BG];var BJ=false;while(BF){if(BF.sizcache===BK){BJ=BO[BF.sizset];break}if(BF.nodeType===1){if(!BN){BF.sizcache=BK;BF.sizset=BI}if(typeof BL!=="string"){if(BF===BL){BJ=true;break}}else{if(Az.filter(BL,[BF]).length>0){BJ=BF;break}}}BF=BF[BG]}BO[BI]=BJ}}}var A6=AB.compareDocumentPosition?function(BG,BF){return !!(BG.compareDocumentPosition(BF)&16)}:function(BG,BF){return BG!==BF&&(BG.contains?BG.contains(BF):true)};var A0=function(BF){var BG=(BF?BF.ownerDocument||BF:0).documentElement;return BG?BG.nodeName!=="HTML":false};var BC=function(BF,BM){var BI=[],BJ="",BK,BH=BM.nodeType?[BM]:BM;while((BK=A5.match.PSEUDO.exec(BF))){BJ+=BK[0];BF=BF.replace(A5.match.PSEUDO,"")}BF=A5.relative[BF]?BF+"*":BF;for(var BL=0,BG=BH.length;BL<BG;BL++){Az(BF,BH[BL],BI)}return Az.filter(BJ,BI)};A.find=Az;A.expr=Az.selectors;A.expr[":"]=A.expr.filters;A.unique=Az.uniqueSort;A.text=Ay;A.isXMLDoc=A0;A.contains=A6;return ;Al.Sizzle=Az})();var n=/Until$/,y=/^(?:parents|prevUntil|prevAll)/,Ak=/,/,f=Array.prototype.slice;var AI=function(A0,Az,Ax){if(A.isFunction(Az)){return A.grep(A0,function(A2,A1){return !!Az.call(A2,A1,A2)===Ax})}else{if(Az.nodeType){return A.grep(A0,function(A2,A1){return(A2===Az)===Ax})}else{if(typeof Az==="string"){var Ay=A.grep(A0,function(A1){return A1.nodeType===1});if(Av.test(Az)){return A.filter(Az,Ay,!Ax)}else{Az=A.filter(Az,Ay)}}}}return A.grep(A0,function(A2,A1){return(A.inArray(A2,Az)>=0)===Ax})};A.fn.extend({find:function(Ax){var Az=this.pushStack("","find",Ax),A2=0;for(var A0=0,Ay=this.length;A0<Ay;A0++){A2=Az.length;A.find(Ax,this[A0],Az);if(A0>0){for(var A3=A2;A3<Az.length;A3++){for(var A1=0;A1<A2;A1++){if(Az[A1]===Az[A3]){Az.splice(A3--,1);break}}}}}return Az},has:function(Ay){var Ax=A(Ay);return this.filter(function(){for(var A0=0,Az=Ax.length;A0<Az;A0++){if(A.contains(this,Ax[A0])){return true}}})},not:function(Ax){return this.pushStack(AI(this,Ax,false),"not",Ax)},filter:function(Ax){return this.pushStack(AI(this,Ax,true),"filter",Ax)},is:function(Ax){return !!Ax&&A.filter(Ax,this).length>0},closest:function(A6,Ax){if(A.isArray(A6)){var A3=[],A5=this[0],A2,A1={},Az;if(A5&&A6.length){for(var A0=0,Ay=A6.length;A0<Ay;A0++){Az=A6[A0];if(!A1[Az]){A1[Az]=A.expr.match.POS.test(Az)?A(Az,Ax||this.context):Az}}while(A5&&A5.ownerDocument&&A5!==Ax){for(Az in A1){A2=A1[Az];if(A2.jquery?A2.index(A5)>-1:A(A5).is(A2)){A3.push({selector:Az,elem:A5});delete A1[Az]}}A5=A5.parentNode}}return A3}var A4=A.expr.match.POS.test(A6)?A(A6,Ax||this.context):null;return this.map(function(A7,A8){while(A8&&A8.ownerDocument&&A8!==Ax){if(A4?A4.index(A8)>-1:A(A8).is(A6)){return A8}A8=A8.parentNode}return null})},index:function(Ax){if(!Ax||typeof Ax==="string"){return A.inArray(this[0],Ax?A(Ax):this.parent().children())}return A.inArray(Ax.jquery?Ax[0]:Ax,this)},add:function(Ax,Ay){var A0=typeof Ax==="string"?A(Ax,Ay||this.context):A.makeArray(Ax),Az=A.merge(this.get(),A0);return this.pushStack(Y(A0[0])||Y(Az[0])?Az:A.unique(Az))},andSelf:function(){return this.add(this.prevObject)}});function Y(Ax){return !Ax||!Ax.parentNode||Ax.parentNode.nodeType===11}A.each({parent:function(Ay){var Ax=Ay.parentNode;return Ax&&Ax.nodeType!==11?Ax:null},parents:function(Ax){return A.dir(Ax,"parentNode")},parentsUntil:function(Ay,Ax,Az){return A.dir(Ay,"parentNode",Az)},next:function(Ax){return A.nth(Ax,2,"nextSibling")},prev:function(Ax){return A.nth(Ax,2,"previousSibling")},nextAll:function(Ax){return A.dir(Ax,"nextSibling")},prevAll:function(Ax){return A.dir(Ax,"previousSibling")},nextUntil:function(Ay,Ax,Az){return A.dir(Ay,"nextSibling",Az)},prevUntil:function(Ay,Ax,Az){return A.dir(Ay,"previousSibling",Az)},siblings:function(Ax){return A.sibling(Ax.parentNode.firstChild,Ax)},children:function(Ax){return A.sibling(Ax.firstChild)},contents:function(Ax){return A.nodeName(Ax,"iframe")?Ax.contentDocument||Ax.contentWindow.document:A.makeArray(Ax.childNodes)}},function(Ax,Ay){A.fn[Ax]=function(A1,Az){var A0=A.map(this,Ay,A1);if(!n.test(Ax)){Az=A1}if(Az&&typeof Az==="string"){A0=A.filter(Az,A0)}A0=this.length>1?A.unique(A0):A0;if((this.length>1||Ak.test(Az))&&y.test(Ax)){A0=A0.reverse()}return this.pushStack(A0,Ax,f.call(arguments).join(","))}});A.extend({filter:function(Az,Ax,Ay){if(Ay){Az=":not("+Az+")"}return A.find.matches(Az,Ax)},dir:function(Az,Ay,A1){var Ax=[],A0=Az[Ay];while(A0&&A0.nodeType!==9&&(A1===c||A0.nodeType!==1||!A(A0).is(A1))){if(A0.nodeType===1){Ax.push(A0)}A0=A0[Ay]}return Ax},nth:function(A1,Ax,Az,A0){Ax=Ax||1;var Ay=0;for(;A1;A1=A1[Az]){if(A1.nodeType===1&&++Ay===Ax){break}}return A1},sibling:function(Az,Ay){var Ax=[];for(;Az;Az=Az.nextSibling){if(Az.nodeType===1&&Az!==Ay){Ax.push(Az)}}return Ax}});var t=/ jQuery\d+="(?:\d+|null)"/g,z=/^\s+/,h=/(<([\w:]+)[^>]*?)\/>/g,AL=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,C=/<([\w:]+)/,T=/<tbody/i,l=/<|&#?\w+;/,e=/<script|<object|<embed|<option|<style/i,L=/checked\s*(?:[^=]|=\s*.checked.)/i,P=function(Ay,Az,Ax){return AL.test(Ax)?Ay:Az+"></"+Ax+">"},AC={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,"",""]};AC.optgroup=AC.option;AC.tbody=AC.tfoot=AC.colgroup=AC.caption=AC.thead;AC.th=AC.td;if(!A.support.htmlSerialize){AC._default=[1,"div<div>","</div>"]}A.fn.extend({text:function(Ax){if(A.isFunction(Ax)){return this.each(function(Az){var Ay=A(this);Ay.text(Ax.call(this,Az,Ay.text()))})}if(typeof Ax!=="object"&&Ax!==c){return this.empty().append((this[0]&&this[0].ownerDocument||AB).createTextNode(Ax))}return A.text(this)},wrapAll:function(Ax){if(A.isFunction(Ax)){return this.each(function(Az){A(this).wrapAll(Ax.call(this,Az))})}if(this[0]){var Ay=A(Ax,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){Ay.insertBefore(this[0])}Ay.map(function(){var Az=this;while(Az.firstChild&&Az.firstChild.nodeType===1){Az=Az.firstChild}return Az}).append(this)}return this},wrapInner:function(Ax){if(A.isFunction(Ax)){return this.each(function(Ay){A(this).wrapInner(Ax.call(this,Ay))})}return this.each(function(){var Ay=A(this),Az=Ay.contents();if(Az.length){Az.wrapAll(Ax)}else{Ay.append(Ax)}})},wrap:function(Ax){return this.each(function(){A(this).wrapAll(Ax)})},unwrap:function(){return this.parent().each(function(){if(!A.nodeName(this,"body")){A(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(Ax){if(this.nodeType===1){this.appendChild(Ax)}})},prepend:function(){return this.domManip(arguments,true,function(Ax){if(this.nodeType===1){this.insertBefore(Ax,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(Ay){this.parentNode.insertBefore(Ay,this)})}else{if(arguments.length){var Ax=A(arguments[0]);Ax.push.apply(Ax,this.toArray());return this.pushStack(Ax,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(Ay){this.parentNode.insertBefore(Ay,this.nextSibling)})}else{if(arguments.length){var Ax=this.pushStack(this,"after",arguments);Ax.push.apply(Ax,A(arguments[0]).toArray());return Ax}}},remove:function(Ax,A0){for(var Ay=0,Az;(Az=this[Ay])!=null;Ay++){if(!Ax||A.filter(Ax,[Az]).length){if(!A0&&Az.nodeType===1){A.cleanData(Az.getElementsByTagName("*"));A.cleanData([Az])}if(Az.parentNode){Az.parentNode.removeChild(Az)}}}return this},empty:function(){for(var Ax=0,Ay;(Ay=this[Ax])!=null;Ax++){if(Ay.nodeType===1){A.cleanData(Ay.getElementsByTagName("*"))}while(Ay.firstChild){Ay.removeChild(Ay.firstChild)}}return this},clone:function(Ay){var Ax=this.map(function(){if(!A.support.noCloneEvent&&!A.isXMLDoc(this)){var A0=this.outerHTML,Az=this.ownerDocument;if(!A0){var A1=Az.createElement("div");A1.appendChild(this.cloneNode(true));A0=A1.innerHTML}return A.clean([A0.replace(t,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(z,"")],Az)[0]}else{return this.cloneNode(true)}});if(Ay===true){Q(this,Ax);Q(this.find("*"),Ax.find("*"))}return Ax},html:function(Az){if(Az===c){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(t,""):null}else{if(typeof Az==="string"&&!e.test(Az)&&(A.support.leadingWhitespace||!z.test(Az))&&!AC[(C.exec(Az)||["",""])[1].toLowerCase()]){Az=Az.replace(h,P);try{for(var Ay=0,Ax=this.length;Ay<Ax;Ay++){if(this[Ay].nodeType===1){A.cleanData(this[Ay].getElementsByTagName("*"));this[Ay].innerHTML=Az}}}catch(A0){this.empty().append(Az)}}else{if(A.isFunction(Az)){this.each(function(A3){var A2=A(this),A1=A2.html();A2.empty().append(function(){return Az.call(this,A3,A1)})})}else{this.empty().append(Az)}}}return this},replaceWith:function(Ax){if(this[0]&&this[0].parentNode){if(A.isFunction(Ax)){return this.each(function(A0){var Az=A(this),Ay=Az.html();Az.replaceWith(Ax.call(this,A0,Ay))})}if(typeof Ax!=="string"){Ax=A(Ax).detach()}return this.each(function(){var Az=this.nextSibling,Ay=this.parentNode;A(this).remove();if(Az){A(Az).before(Ax)}else{A(Ay).append(Ax)}})}else{return this.pushStack(A(A.isFunction(Ax)?Ax():Ax),"replaceWith",Ax)}},detach:function(Ax){return this.remove(Ax,true)},domManip:function(A3,A8,A7){var A0,A1,A6=A3[0],Ay=[],A2,A5;if(!A.support.checkClone&&arguments.length===3&&typeof A6==="string"&&L.test(A6)){return this.each(function(){A(this).domManip(A3,A8,A7,true)})}if(A.isFunction(A6)){return this.each(function(BA){var A9=A(this);A3[0]=A6.call(this,BA,A8?A9.html():c);A9.domManip(A3,A8,A7)})}if(this[0]){A5=A6&&A6.parentNode;if(A.support.parentNode&&A5&&A5.nodeType===11&&A5.childNodes.length===this.length){A0={fragment:A5}}else{A0=j(A3,this,Ay)}A2=A0.fragment;if(A2.childNodes.length===1){A1=A2=A2.firstChild}else{A1=A2.firstChild}if(A1){A8=A8&&A.nodeName(A1,"tr");for(var Az=0,Ax=this.length;Az<Ax;Az++){A7.call(A8?A4(this[Az],A1):this[Az],Az>0||A0.cacheable||this.length>1?A2.cloneNode(true):A2)}}if(Ay.length){A.each(Ay,Au)}}return this;function A4(A9,BA){return A.nodeName(A9,"table")?(A9.getElementsByTagName("tbody")[0]||A9.appendChild(A9.ownerDocument.createElement("tbody"))):A9}}});function Q(Az,Ax){var Ay=0;Ax.each(function(){if(this.nodeName!==(Az[Ay]&&Az[Ay].nodeName)){return }var A4=A.data(Az[Ay++]),A3=A.data(this,A4),A0=A4&&A4.events;if(A0){delete A3.handle;A3.events={};for(var A2 in A0){for(var A1 in A0[A2]){A.event.add(this,A2,A0[A2][A1],A0[A2][A1].data)}}}})}function j(A2,A0,Ay){var A1,Ax,Az,A3=(A0&&A0[0]?A0[0].ownerDocument||A0[0]:AB);if(A2.length===1&&typeof A2[0]==="string"&&A2[0].length<512&&A3===AB&&!e.test(A2[0])&&(A.support.checkClone||!L.test(A2[0]))){Ax=true;Az=A.fragments[A2[0]];if(Az){if(Az!==1){A1=Az}}}if(!A1){A1=A3.createDocumentFragment();A.clean(A2,A3,A1,Ay)}if(Ax){A.fragments[A2[0]]=Az?A1:1}return{fragment:A1,cacheable:Ax}}A.fragments={};A.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(Ax,Ay){A.fn[Ax]=function(Az){var A2=[],A5=A(Az),A4=this.length===1&&this[0].parentNode;if(A4&&A4.nodeType===11&&A4.childNodes.length===1&&A5.length===1){A5[Ay](this[0]);return this}else{for(var A3=0,A0=A5.length;A3<A0;A3++){var A1=(A3>0?this.clone(true):this).get();A.fn[Ay].apply(A(A5[A3]),A1);A2=A2.concat(A1)}return this.pushStack(A2,Ax,A5.selector)}}});A.extend({clean:function(Az,A1,A8,A3){A1=A1||AB;if(typeof A1.createElement==="undefined"){A1=A1.ownerDocument||A1[0]&&A1[0].ownerDocument||AB}var A9=[];for(var A7=0,A2;(A2=Az[A7])!=null;A7++){if(typeof A2==="number"){A2+=""}if(!A2){continue}if(typeof A2==="string"&&!l.test(A2)){A2=A1.createTextNode(A2)}else{if(typeof A2==="string"){A2=A2.replace(h,P);var BA=(C.exec(A2)||["",""])[1].toLowerCase(),A0=AC[BA]||AC._default,A6=A0[0],Ay=A1.createElement("div");Ay.innerHTML=A0[1]+A2+A0[2];while(A6--){Ay=Ay.lastChild}if(!A.support.tbody){var Ax=T.test(A2),A5=BA==="table"&&!Ax?Ay.firstChild&&Ay.firstChild.childNodes:A0[1]==="<table>"&&!Ax?Ay.childNodes:[];for(var A4=A5.length-1;A4>=0;--A4){if(A.nodeName(A5[A4],"tbody")&&!A5[A4].childNodes.length){A5[A4].parentNode.removeChild(A5[A4])}}}if(!A.support.leadingWhitespace&&z.test(A2)){Ay.insertBefore(A1.createTextNode(z.exec(A2)[0]),Ay.firstChild)}A2=Ay.childNodes}}if(A2.nodeType){A9.push(A2)}else{A9=A.merge(A9,A2)}}if(A8){for(var A7=0;A9[A7];A7++){if(A3&&A.nodeName(A9[A7],"script")&&(!A9[A7].type||A9[A7].type.toLowerCase()==="text/javascript")){A3.push(A9[A7].parentNode?A9[A7].parentNode.removeChild(A9[A7]):A9[A7])}else{if(A9[A7].nodeType===1){A9.splice.apply(A9,[A7+1,0].concat(A.makeArray(A9[A7].getElementsByTagName("script"))))}A8.appendChild(A9[A7])}}}return A9},cleanData:function(Ay){var A1,Az,Ax=A.cache,A4=A.event.special,A3=A.support.deleteExpando;for(var A2=0,A0;(A0=Ay[A2])!=null;A2++){Az=A0[A.expando];if(Az){A1=Ax[Az];if(A1.events){for(var A5 in A1.events){if(A4[A5]){A.event.remove(A0,A5)}else{AG(A0,A5,A1.handle)}}}if(A3){delete A0[A.expando]}else{if(A0.removeAttribute){A0.removeAttribute(A.expando)}}delete Ax[Az]}}}});var AR=/z-?index|font-?weight|opacity|zoom|line-?height/i,u=/alpha\([^)]*\)/,AA=/opacity=([^)]*)/,AH=/float/i,AY=/-([a-z])/ig,V=/([A-Z])/g,An=/^-?\d+(?:px)?$/i,At=/^-?\d/,Aj={position:"absolute",visibility:"hidden",display:"block"},w=["Left","Right"],Ad=["Top","Bottom"],AK=AB.defaultView&&AB.defaultView.getComputedStyle,Am=A.support.cssFloat?"cssFloat":"styleFloat",K=function(Ax,Ay){return Ay.toUpperCase()};A.fn.css=function(Ax,Ay){return AN(this,Ax,Ay,true,function(A0,Az,A1){if(A1===c){return A.curCSS(A0,Az)}if(typeof A1==="number"&&!AR.test(Az)){A1+="px"}A.style(A0,Az,A1)})};A.extend({style:function(A1,Ay,A2){if(!A1||A1.nodeType===3||A1.nodeType===8){return c}if((Ay==="width"||Ay==="height")&&parseFloat(A2)<0){A2=c}var A0=A1.style||A1,A3=A2!==c;if(!A.support.opacity&&Ay==="opacity"){if(A3){A0.zoom=1;var Ax=parseInt(A2,10)+""==="NaN"?"":"alpha(opacity="+A2*100+")";var Az=A0.filter||A.curCSS(A1,"filter")||"";A0.filter=u.test(Az)?Az.replace(u,Ax):Ax}return A0.filter&&A0.filter.indexOf("opacity=")>=0?(parseFloat(AA.exec(A0.filter)[1])/100)+"":""}if(AH.test(Ay)){Ay=Am}Ay=Ay.replace(AY,K);if(A3){A0[Ay]=A2}return A0[Ay]},css:function(A0,Ay,A2,Ax){if(Ay==="width"||Ay==="height"){var A4,Az=Aj,A3=Ay==="width"?w:Ad;function A1(){A4=Ay==="width"?A0.offsetWidth:A0.offsetHeight;if(Ax==="border"){return }A.each(A3,function(){if(!Ax){A4-=parseFloat(A.curCSS(A0,"padding"+this,true))||0}if(Ax==="margin"){A4+=parseFloat(A.curCSS(A0,"margin"+this,true))||0}else{A4-=parseFloat(A.curCSS(A0,"border"+this+"Width",true))||0}})}if(A0.offsetWidth!==0){A1()}else{A.swap(A0,Az,A1)}return Math.max(0,Math.round(A4))}return A.curCSS(A0,Ay,A2)},curCSS:function(A3,Ay,Az){var A6,Ax=A3.style,A0;if(!A.support.opacity&&Ay==="opacity"&&A3.currentStyle){A6=AA.test(A3.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return A6===""?"1":A6}if(AH.test(Ay)){Ay=Am}if(!Az&&Ax&&Ax[Ay]){A6=Ax[Ay]}else{if(AK){if(AH.test(Ay)){Ay="float"}Ay=Ay.replace(V,"-$1").toLowerCase();var A5=A3.ownerDocument.defaultView;if(!A5){return null}var A7=A5.getComputedStyle(A3,null);if(A7){A6=A7.getPropertyValue(Ay)}if(Ay==="opacity"&&A6===""){A6="1"}}else{if(A3.currentStyle){var A2=Ay.replace(AY,K);A6=A3.currentStyle[Ay]||A3.currentStyle[A2];if(!An.test(A6)&&At.test(A6)){var A1=Ax.left,A4=A3.runtimeStyle.left;A3.runtimeStyle.left=A3.currentStyle.left;Ax.left=A2==="fontSize"?"1em":(A6||0);A6=Ax.pixelLeft+"px";Ax.left=A1;A3.runtimeStyle.left=A4}}}}return A6},swap:function(A0,Az,A1){var Ax={};for(var Ay in Az){Ax[Ay]=A0.style[Ay];A0.style[Ay]=Az[Ay]}A1.call(A0);for(var Ay in Az){A0.style[Ay]=Ax[Ay]}}});if(A.expr&&A.expr.filters){A.expr.filters.hidden=function(A0){var Ay=A0.offsetWidth,Ax=A0.offsetHeight,Az=A0.nodeName.toLowerCase()==="tr";return Ay===0&&Ax===0&&!Az?true:Ay>0&&Ax>0&&!Az?false:A.curCSS(A0,"display")==="none"};A.expr.filters.visible=function(Ax){return !A.expr.filters.hidden(Ax)}}var AF=Ao(),Ai=/<script(.|\s)*?\/script>/gi,O=/select|textarea/i,Aa=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,R=/=\?(&|$)/,d=/\?/,Aw=/(\?|&)_=.*?(&|$)/,b=/^(\w+:)?\/\/([^\/?#]+)/,H=/%20/g,W=A.fn.load;A.fn.extend({load:function(Az,A2,A3){if(typeof Az!=="string"){return W.call(this,Az)}else{if(!this.length){return this}}var A1=Az.indexOf(" ");if(A1>=0){var Ax=Az.slice(A1,Az.length);Az=Az.slice(0,A1)}var A0="GET";if(A2){if(A.isFunction(A2)){A3=A2;A2=null}else{if(typeof A2==="object"){A2=A.param(A2,A.ajaxSettings.traditional);A0="POST"}}}var Ay=this;A.ajax({url:Az,type:A0,dataType:"html",data:A2,complete:function(A5,A4){if(A4==="success"||A4==="notmodified"){Ay.html(Ax?A("<div />").append(A5.responseText.replace(Ai,"")).find(Ax):A5.responseText)}if(A3){Ay.each(A3,[A5.responseText,A4,A5])}}});return this},serialize:function(){return A.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?A.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||O.test(this.nodeName)||Aa.test(this.type))}).map(function(Ax,Ay){var Az=A(this).val();return Az==null?null:A.isArray(Az)?A.map(Az,function(A1,A0){return{name:Ay.name,value:A1}}):{name:Ay.name,value:Az}}).get()}});A.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(Ax,Ay){A.fn[Ay]=function(Az){return this.bind(Ay,Az)}});A.extend({get:function(Ax,Az,A0,Ay){if(A.isFunction(Az)){Ay=Ay||A0;A0=Az;Az=null}return A.ajax({type:"GET",url:Ax,data:Az,success:A0,dataType:Ay})},getScript:function(Ax,Ay){return A.get(Ax,null,Ay,"script")},getJSON:function(Ax,Ay,Az){return A.get(Ax,Ay,Az,"json")},post:function(Ax,Az,A0,Ay){if(A.isFunction(Az)){Ay=Ay||A0;A0=Az;Az={}}return A.ajax({type:"POST",url:Ax,data:Az,success:A0,dataType:Ay})},ajaxSetup:function(Ax){A.extend(A.ajaxSettings,Ax)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:Al.XMLHttpRequest&&(Al.location.protocol!=="file:"||!Al.ActiveXObject)?function(){return new Al.XMLHttpRequest()}:function(){try{return new Al.ActiveXObject("Microsoft.XMLHTTP")}catch(Ax){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(BC){var A7=A.extend(true,{},A.ajaxSettings,BC);var BH,BB,BG,BI=BC&&BC.context||A7,Az=A7.type.toUpperCase();if(A7.data&&A7.processData&&typeof A7.data!=="string"){A7.data=A.param(A7.data,A7.traditional)}if(A7.dataType==="jsonp"){if(Az==="GET"){if(!R.test(A7.url)){A7.url+=(d.test(A7.url)?"&":"?")+(A7.jsonp||"callback")+"=?"}}else{if(!A7.data||!R.test(A7.data)){A7.data=(A7.data?A7.data+"&":"")+(A7.jsonp||"callback")+"=?"}}A7.dataType="json"}if(A7.dataType==="json"&&(A7.data&&R.test(A7.data)||R.test(A7.url))){BH=A7.jsonpCallback||("jsonp"+AF++);if(A7.data){A7.data=(A7.data+"").replace(R,"="+BH+"$1")}A7.url=A7.url.replace(R,"="+BH+"$1");A7.dataType="script";Al[BH]=Al[BH]||function(BJ){BG=BJ;A2();A5();Al[BH]=c;try{delete Al[BH]}catch(BK){}if(A0){A0.removeChild(BE)}}}if(A7.dataType==="script"&&A7.cache===null){A7.cache=false}if(A7.cache===false&&Az==="GET"){var Ax=Ao();var BF=A7.url.replace(Aw,"$1_="+Ax+"$2");A7.url=BF+((BF===A7.url)?(d.test(A7.url)?"&":"?")+"_="+Ax:"")}if(A7.data&&Az==="GET"){A7.url+=(d.test(A7.url)?"&":"?")+A7.data}if(A7.global&&!A.active++){A.event.trigger("ajaxStart")}var BA=b.exec(A7.url),A1=BA&&(BA[1]&&BA[1]!==location.protocol||BA[2]!==location.host);if(A7.dataType==="script"&&Az==="GET"&&A1){var A0=AB.getElementsByTagName("head")[0]||AB.documentElement;var BE=AB.createElement("script");BE.src=A7.url;if(A7.scriptCharset){BE.charset=A7.scriptCharset}if(!BH){var A9=false;BE.onload=BE.onreadystatechange=function(){if(!A9&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){A9=true;A2();A5();BE.onload=BE.onreadystatechange=null;if(A0&&BE.parentNode){A0.removeChild(BE)}}}}A0.insertBefore(BE,A0.firstChild);return c}var A4=false;var A3=A7.xhr();if(!A3){return }if(A7.username){A3.open(Az,A7.url,A7.async,A7.username,A7.password)}else{A3.open(Az,A7.url,A7.async)}try{if(A7.data||BC&&BC.contentType){A3.setRequestHeader("Content-Type",A7.contentType)}if(A7.ifModified){if(A.lastModified[A7.url]){A3.setRequestHeader("If-Modified-Since",A.lastModified[A7.url])}if(A.etag[A7.url]){A3.setRequestHeader("If-None-Match",A.etag[A7.url])}}if(!A1){A3.setRequestHeader("X-Requested-With","XMLHttpRequest")}A3.setRequestHeader("Accept",A7.dataType&&A7.accepts[A7.dataType]?A7.accepts[A7.dataType]+", */*":A7.accepts._default)}catch(BD){}if(A7.beforeSend&&A7.beforeSend.call(BI,A3,A7)===false){if(A7.global&&!--A.active){A.event.trigger("ajaxStop")}A3.abort();return false}if(A7.global){A8("ajaxSend",[A3,A7])}var A6=A3.onreadystatechange=function(BJ){if(!A3||A3.readyState===0||BJ==="abort"){if(!A4){A5()}A4=true;if(A3){A3.onreadystatechange=A.noop}}else{if(!A4&&A3&&(A3.readyState===4||BJ==="timeout")){A4=true;A3.onreadystatechange=A.noop;BB=BJ==="timeout"?"timeout":!A.httpSuccess(A3)?"error":A7.ifModified&&A.httpNotModified(A3,A7.url)?"notmodified":"success";var BL;if(BB==="success"){try{BG=A.httpData(A3,A7.dataType,A7)}catch(BK){BB="parsererror";BL=BK}}if(BB==="success"||BB==="notmodified"){if(!BH){A2()}}else{A.handleError(A7,A3,BB,BL)}A5();if(BJ==="timeout"){A3.abort()}if(A7.async){A3=null}}}};try{var Ay=A3.abort;A3.abort=function(){if(A3){Ay.call(A3)}A6("abort")}}catch(BD){}if(A7.async&&A7.timeout>0){setTimeout(function(){if(A3&&!A4){A6("timeout")}},A7.timeout)}try{A3.send(Az==="POST"||Az==="PUT"||Az==="DELETE"?A7.data:null)}catch(BD){A.handleError(A7,A3,null,BD);A5()}if(!A7.async){A6()}function A2(){if(A7.success){A7.success.call(BI,BG,BB,A3)}if(A7.global){A8("ajaxSuccess",[A3,A7])}}function A5(){if(A7.complete){A7.complete.call(BI,A3,BB)}if(A7.global){A8("ajaxComplete",[A3,A7])}if(A7.global&&!--A.active){A.event.trigger("ajaxStop")}}function A8(BK,BJ){(A7.context?A(A7.context):A.event).trigger(BK,BJ)}return A3},handleError:function(Ay,A0,Ax,Az){if(Ay.error){Ay.error.call(Ay.context||Ay,A0,Ax,Az)}if(Ay.global){(Ay.context?A(Ay.context):A.event).trigger("ajaxError",[A0,Ay,Az])}},active:0,httpSuccess:function(Ay){try{return !Ay.status&&location.protocol==="file:"||(Ay.status>=200&&Ay.status<300)||Ay.status===304||Ay.status===1223||Ay.status===0}catch(Ax){}return false},httpNotModified:function(A0,Ax){var Az=A0.getResponseHeader("Last-Modified"),Ay=A0.getResponseHeader("Etag");if(Az){A.lastModified[Ax]=Az}if(Ay){A.etag[Ax]=Ay}return A0.status===304||A0.status===0},httpData:function(A2,A0,Az){var Ay=A2.getResponseHeader("content-type")||"",Ax=A0==="xml"||!A0&&Ay.indexOf("xml")>=0,A1=Ax?A2.responseXML:A2.responseText;if(Ax&&A1.documentElement.nodeName==="parsererror"){A.error("parsererror")}if(Az&&Az.dataFilter){A1=Az.dataFilter(A1,A0)}if(typeof A1==="string"){if(A0==="json"||!A0&&Ay.indexOf("json")>=0){A1=A.parseJSON(A1)}else{if(A0==="script"||!A0&&Ay.indexOf("javascript")>=0){A.globalEval(A1)}}}return A1},param:function(Ax,A0){var Ay=[];if(A0===c){A0=A.ajaxSettings.traditional}if(A.isArray(Ax)||Ax.jquery){A.each(Ax,function(){A2(this.name,this.value)})}else{for(var A1 in Ax){Az(A1,Ax[A1])}}return Ay.join("&").replace(H,"+");function Az(A3,A4){if(A.isArray(A4)){A.each(A4,function(A6,A5){if(A0||/\[\]$/.test(A3)){A2(A3,A5)}else{Az(A3+"["+(typeof A5==="object"||A.isArray(A5)?A6:"")+"]",A5)}})}else{if(!A0&&A4!=null&&typeof A4==="object"){A.each(A4,function(A6,A5){Az(A3+"["+A6+"]",A5)})}else{A2(A3,A4)}}}function A2(A3,A4){A4=A.isFunction(A4)?A4():A4;Ay[Ay.length]=encodeURIComponent(A3)+"="+encodeURIComponent(A4)}}});var g={},AE=/toggle|show|hide/,AT=/^([+-]=)?([\d+-.]+)(.*)$/,Ae,AJ=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];A.fn.extend({show:function(Ay,A6){if(Ay||Ay===0){return this.animate(Ac("show",3),Ay,A6)}else{for(var A3=0,A0=this.length;A3<A0;A3++){var Ax=A.data(this[A3],"olddisplay");this[A3].style.display=Ax||"";if(A.css(this[A3],"display")==="none"){var A5=this[A3].nodeName,A4;if(g[A5]){A4=g[A5]}else{var Az=A("<"+A5+" />").appendTo("body");A4=Az.css("display");if(A4==="none"){A4="block"}Az.remove();g[A5]=A4}A.data(this[A3],"olddisplay",A4)}}for(var A2=0,A1=this.length;A2<A1;A2++){this[A2].style.display=A.data(this[A2],"olddisplay")||""}return this}},hide:function(A2,A3){if(A2||A2===0){return this.animate(Ac("hide",3),A2,A3)}else{for(var A1=0,Ay=this.length;A1<Ay;A1++){var Ax=A.data(this[A1],"olddisplay");if(!Ax&&Ax!=="none"){A.data(this[A1],"olddisplay",A.css(this[A1],"display"))}}for(var A0=0,Az=this.length;A0<Az;A0++){this[A0].style.display="none"}return this}},_toggle:A.fn.toggle,toggle:function(Az,Ay){var Ax=typeof Az==="boolean";if(A.isFunction(Az)&&A.isFunction(Ay)){this._toggle.apply(this,arguments)}else{if(Az==null||Ax){this.each(function(){var A0=Ax?Az:A(this).is(":hidden");A(this)[A0?"show":"hide"]()})}else{this.animate(Ac("toggle",3),Az,Ay)}}return this},fadeTo:function(Ax,Az,Ay){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:Az},Ax,Ay)},animate:function(A1,Ay,A0,Az){var Ax=A.speed(Ay,A0,Az);if(A.isEmptyObject(A1)){return this.each(Ax.complete)}return this[Ax.queue===false?"each":"queue"](function(){var A4=A.extend({},Ax),A6,A5=this.nodeType===1&&A(this).is(":hidden"),A2=this;for(A6 in A1){var A3=A6.replace(AY,K);if(A6!==A3){A1[A3]=A1[A6];delete A1[A6];A6=A3}if(A1[A6]==="hide"&&A5||A1[A6]==="show"&&!A5){return A4.complete.call(this)}if((A6==="height"||A6==="width")&&this.style){A4.display=A.css(this,"display");A4.overflow=this.style.overflow}if(A.isArray(A1[A6])){(A4.specialEasing=A4.specialEasing||{})[A6]=A1[A6][1];A1[A6]=A1[A6][0]}}if(A4.overflow!=null){this.style.overflow="hidden"}A4.curAnim=A.extend({},A1);A.each(A1,function(A8,BC){var BB=new A.fx(A2,A4,A8);if(AE.test(BC)){BB[BC==="toggle"?A5?"show":"hide":BC](A1)}else{var BA=AT.exec(BC),BD=BB.cur(true)||0;if(BA){var A7=parseFloat(BA[2]),A9=BA[3]||"px";if(A9!=="px"){A2.style[A8]=(A7||1)+A9;BD=((A7||1)/BB.cur(true))*BD;A2.style[A8]=BD+A9}if(BA[1]){A7=((BA[1]==="-="?-1:1)*A7)+BD}BB.custom(BD,A7,A9)}else{BB.custom(BD,BC,"")}}});return true})},stop:function(Ay,Ax){var Az=A.timers;if(Ay){this.queue([])}this.each(function(){for(var A0=Az.length-1;A0>=0;A0--){if(Az[A0].elem===this){if(Ax){Az[A0](true)}Az.splice(A0,1)}}});if(!Ax){this.dequeue()}return this}});A.each({slideDown:Ac("show",1),slideUp:Ac("hide",1),slideToggle:Ac("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(Ax,Ay){A.fn[Ax]=function(Az,A0){return this.animate(Ay,Az,A0)}});A.extend({speed:function(Az,A0,Ay){var Ax=Az&&typeof Az==="object"?Az:{complete:Ay||!Ay&&A0||A.isFunction(Az)&&Az,duration:Az,easing:Ay&&A0||A0&&!A.isFunction(A0)&&A0};Ax.duration=A.fx.off?0:typeof Ax.duration==="number"?Ax.duration:A.fx.speeds[Ax.duration]||A.fx.speeds._default;Ax.old=Ax.complete;Ax.complete=function(){if(Ax.queue!==false){A(this).dequeue()}if(A.isFunction(Ax.old)){Ax.old.call(this)}};return Ax},easing:{linear:function(Az,A0,Ax,Ay){return Ax+Ay*Az},swing:function(Az,A0,Ax,Ay){return((-Math.cos(Az*Math.PI)/2)+0.5)*Ay+Ax}},timers:[],fx:function(Ay,Ax,Az){this.options=Ax;this.elem=Ay;this.prop=Az;if(!Ax.orig){Ax.orig={}}}});A.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(A.fx.step[this.prop]||A.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(Ay){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var Ax=parseFloat(A.css(this.elem,this.prop,Ay));return Ax&&Ax>-10000?Ax:parseFloat(A.curCSS(this.elem,this.prop))||0},custom:function(A1,A0,Az){this.startTime=Ao();this.start=A1;this.end=A0;this.unit=Az||this.unit||"px";this.now=this.start;this.pos=this.state=0;var Ax=this;function Ay(A2){return Ax.step(A2)}Ay.elem=this.elem;if(Ay()&&A.timers.push(Ay)&&!Ae){Ae=setInterval(A.fx.tick,13)}},show:function(){this.options.orig[this.prop]=A.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());A(this.elem).show()},hide:function(){this.options.orig[this.prop]=A.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(A0){var A5=Ao(),A1=true;if(A0||A5>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var A2 in this.options.curAnim){if(this.options.curAnim[A2]!==true){A1=false}}if(A1){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var Az=A.data(this.elem,"olddisplay");this.elem.style.display=Az?Az:this.options.display;if(A.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){A(this.elem).hide()}if(this.options.hide||this.options.show){for(var Ax in this.options.curAnim){A.style(this.elem,Ax,this.options.orig[Ax])}}this.options.complete.call(this.elem)}return false}else{var Ay=A5-this.startTime;this.state=Ay/this.options.duration;var A3=this.options.specialEasing&&this.options.specialEasing[this.prop];var A4=this.options.easing||(A.easing.swing?"swing":"linear");this.pos=A.easing[A3||A4](this.state,Ay,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};A.extend(A.fx,{tick:function(){var Ay=A.timers;for(var Ax=0;Ax<Ay.length;Ax++){if(!Ay[Ax]()){Ay.splice(Ax--,1)}}if(!Ay.length){A.fx.stop()}},stop:function(){clearInterval(Ae);Ae=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(Ax){A.style(Ax.elem,"opacity",Ax.now)},_default:function(Ax){if(Ax.elem.style&&Ax.elem.style[Ax.prop]!=null){Ax.elem.style[Ax.prop]=(Ax.prop==="width"||Ax.prop==="height"?Math.max(0,Ax.now):Ax.now)+Ax.unit}else{Ax.elem[Ax.prop]=Ax.now}}}});if(A.expr&&A.expr.filters){A.expr.filters.animated=function(Ax){return A.grep(A.timers,function(Ay){return Ax===Ay.elem}).length}}function Ac(Ay,Ax){var Az={};A.each(AJ.concat.apply([],AJ.slice(0,Ax)),function(){Az[this]=Ay});return Az}if("getBoundingClientRect" in AB.documentElement){A.fn.offset=function(A7){var Az=this[0];if(A7){return this.each(function(A8){A.offset.setOffset(this,A7,A8)})}if(!Az||!Az.ownerDocument){return null}if(Az===Az.ownerDocument.body){return A.offset.bodyOffset(Az)}try{var A1=Az.getBoundingClientRect(),A6=Az.ownerDocument,A2=A6.body,Ax=A6.documentElement,A0=Ax.clientTop||A2.clientTop||0,A4=Ax.clientLeft||A2.clientLeft||0,A5=A1.top+(self.pageYOffset||A.support.boxModel&&Ax.scrollTop||A2.scrollTop)-A0,Ay=A1.left+(self.pageXOffset||A.support.boxModel&&Ax.scrollLeft||A2.scrollLeft)-A4}catch(A3){A5=0;Ay=0}return{top:A5,left:Ay}}}else{A.fn.offset=function(A8){var A2=this[0];if(A8){return this.each(function(A9){A.offset.setOffset(this,A8,A9)})}if(!A2||!A2.ownerDocument){return null}if(A2===A2.ownerDocument.body){return A.offset.bodyOffset(A2)}A.offset.initialize();var Az=A2.offsetParent,Ay=A2,A7=A2.ownerDocument,A5,A0=A7.documentElement,A3=A7.body,A4=A7.defaultView,Ax=A4?A4.getComputedStyle(A2,null):A2.currentStyle,A6=A2.offsetTop,A1=A2.offsetLeft;while((A2=A2.parentNode)&&A2!==A3&&A2!==A0){if(A.offset.supportsFixedPosition&&Ax.position==="fixed"){break}A5=A4?A4.getComputedStyle(A2,null):A2.currentStyle;A6-=A2.scrollTop;A1-=A2.scrollLeft;if(A2===Az){A6+=A2.offsetTop;A1+=A2.offsetLeft;if(A.offset.doesNotAddBorder&&!(A.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(A2.nodeName))){A6+=parseFloat(A5.borderTopWidth)||0;A1+=parseFloat(A5.borderLeftWidth)||0}Ay=Az,Az=A2.offsetParent}if(A.offset.subtractsBorderForOverflowNotVisible&&A5.overflow!=="visible"){A6+=parseFloat(A5.borderTopWidth)||0;A1+=parseFloat(A5.borderLeftWidth)||0}Ax=A5}if(Ax.position==="relative"||Ax.position==="static"){A6+=A3.offsetTop;A1+=A3.offsetLeft}if(A.offset.supportsFixedPosition&&Ax.position==="fixed"){A6+=Math.max(A0.scrollTop,A3.scrollTop);A1+=Math.max(A0.scrollLeft,A3.scrollLeft)}return{top:A6,left:A1}}}A.offset={initialize:function(){var Ax=AB.body,Ay=AB.createElement("div"),A1,A3,A2,A4,Az=parseFloat(A.curCSS(Ax,"marginTop",true))||0,A0="<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>";A.extend(Ay.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});Ay.innerHTML=A0;Ax.insertBefore(Ay,Ax.firstChild);A1=Ay.firstChild;A3=A1.firstChild;A4=A1.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(A3.offsetTop!==5);this.doesAddBorderForTableAndCells=(A4.offsetTop===5);A3.style.position="fixed",A3.style.top="20px";this.supportsFixedPosition=(A3.offsetTop===20||A3.offsetTop===15);A3.style.position=A3.style.top="";A1.style.overflow="hidden",A1.style.position="relative";this.subtractsBorderForOverflowNotVisible=(A3.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(Ax.offsetTop!==Az);Ax.removeChild(Ay);Ax=Ay=A1=A3=A2=A4=null;A.offset.initialize=A.noop},bodyOffset:function(Ax){var Az=Ax.offsetTop,Ay=Ax.offsetLeft;A.offset.initialize();if(A.offset.doesNotIncludeMarginInBodyOffset){Az+=parseFloat(A.curCSS(Ax,"marginTop",true))||0;Ay+=parseFloat(A.curCSS(Ax,"marginLeft",true))||0}return{top:Az,left:Ay}},setOffset:function(A2,Ay,Az){if(/static/.test(A.curCSS(A2,"position"))){A2.style.position="relative"}var A1=A(A2),A4=A1.offset(),Ax=parseInt(A.curCSS(A2,"top",true),10)||0,A3=parseInt(A.curCSS(A2,"left",true),10)||0;if(A.isFunction(Ay)){Ay=Ay.call(A2,Az,A4)}var A0={top:(Ay.top-A4.top)+Ax,left:(Ay.left-A4.left)+A3};if("using" in Ay){Ay.using.call(A2,A0)}else{A1.css(A0)}}};A.fn.extend({position:function(){if(!this[0]){return null}var Az=this[0],Ay=this.offsetParent(),A0=this.offset(),Ax=/^body|html$/i.test(Ay[0].nodeName)?{top:0,left:0}:Ay.offset();A0.top-=parseFloat(A.curCSS(Az,"marginTop",true))||0;A0.left-=parseFloat(A.curCSS(Az,"marginLeft",true))||0;Ax.top+=parseFloat(A.curCSS(Ay[0],"borderTopWidth",true))||0;Ax.left+=parseFloat(A.curCSS(Ay[0],"borderLeftWidth",true))||0;return{top:A0.top-Ax.top,left:A0.left-Ax.left}},offsetParent:function(){return this.map(function(){var Ax=this.offsetParent||AB.body;while(Ax&&(!/^body|html$/i.test(Ax.nodeName)&&A.css(Ax,"position")==="static")){Ax=Ax.offsetParent}return Ax})}});A.each(["Left","Top"],function(Ay,Ax){var Az="scroll"+Ax;A.fn[Az]=function(A2){var A0=this[0],A1;if(!A0){return null}if(A2!==c){return this.each(function(){A1=AM(this);if(A1){A1.scrollTo(!Ay?A2:A(A1).scrollLeft(),Ay?A2:A(A1).scrollTop())}else{this[Az]=A2}})}else{A1=AM(A0);return A1?("pageXOffset" in A1)?A1[Ay?"pageYOffset":"pageXOffset"]:A.support.boxModel&&A1.document.documentElement[Az]||A1.document.body[Az]:A0[Az]}}});function AM(Ax){return("scrollTo" in Ax&&Ax.document)?Ax:Ax.nodeType===9?Ax.defaultView||Ax.parentWindow:false}A.each(["Height","Width"],function(Ay,Ax){var Az=Ax.toLowerCase();A.fn["inner"+Ax]=function(){return this[0]?A.css(this[0],Az,false,"padding"):null};A.fn["outer"+Ax]=function(A0){return this[0]?A.css(this[0],Az,false,A0?"margin":"border"):null};A.fn[Az]=function(A0){var A1=this[0];if(!A1){return A0==null?null:this}if(A.isFunction(A0)){return this.each(function(A3){var A2=A(this);A2[Az](A0.call(this,A3,A2[Az]()))})}return("scrollTo" in A1&&A1.document)?A1.document.compatMode==="CSS1Compat"&&A1.document.documentElement["client"+Ax]||A1.document.body["client"+Ax]:(A1.nodeType===9)?Math.max(A1.documentElement["client"+Ax],A1.body["scroll"+Ax],A1.documentElement["scroll"+Ax],A1.body["offset"+Ax],A1.documentElement["offset"+Ax]):A0===c?A.css(A1,Az):this.css(Az,typeof A0==="string"?A0:A0+"px")}});Al.jQuery=Al.$=A})(window);

/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 2.5.6
------------------------------------------------------------------------- */

(function($) {
	$.prettyPhoto = {version: '2.5.6'};
	
	$.fn.prettyPhoto = function(settings) {
		settings = jQuery.extend({
			animationSpeed: 'normal', /* fast/slow/normal */
			opacity: 0.80, /* Value between 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			default_width: 500,
			default_height: 344,
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false, /* If set to true, only the close button will close the window */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){}, /* Called when prettyPhoto is closed */
			markup: '<div class="pp_pic_holder"> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details clearfix"> \
											<a class="pp_close" href="#">Close</a> \
											<p class="pp_description"></p> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay"></div> \
					<div class="ppt"></div>',
			image_markup: '<img id="fullResImage" src="" />',
			flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
			quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
			iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
			inline_markup: '<div class="pp_inline clearfix">{content}</div>'
		}, settings);
		
		// Fallback to a supported theme for IE6
		if($.browser.msie && parseInt($.browser.version) == 6){
			settings.theme = "light_square";
		}
		
		if($('.pp_overlay').size()==0) _buildOverlay(); // If the overlay is not there, inject it!
		
		// Global variables accessible only by prettyPhoto
		var doresize = true, percentBased = false, correctSizes,
		
		// Cached selectors
		$pp_pic_holder, $ppt, $pp_overlay,
		
		// prettyPhoto container specific
		pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
		
		// Window size
		windowHeight = $(window).height(), windowWidth = $(window).width(),
	
		//Gallery specific
		setPosition = 0,

		// Global elements
		scrollPos = _getScroll();
	
		// Window/Keyboard events
		$(window).scroll(function(){ scrollPos = _getScroll(); _centerOverlay(); _resizeOverlay(); });
		$(window).resize(function(){ _centerOverlay(); _resizeOverlay(); });
		$(document).keydown(function(e){
			if($pp_pic_holder.is(':visible'))
			switch(e.keyCode){
				case 37:
					$.prettyPhoto.changePage('previous');
					break;
				case 39:
					$.prettyPhoto.changePage('next');
					break;
				case 27:
					if(!settings.modal)
					$.prettyPhoto.close();
					break;
			};
	    });
	
		// Bind the code to each links
		$(this).each(function(){
			$(this).bind('click',function(){
				_self = this; // Fix scoping
				
				// Find out if the picture is part of a set
				theRel = $(this).attr('rel');
				galleryRegExp = /\[(?:.*)\]/;
				theGallery = galleryRegExp.exec(theRel);
				
				// Build the gallery array
				var images = new Array(), titles = new Array(), descriptions = new Array();
				if(theGallery){
					$('a[rel*='+theGallery+']').each(function(i){
						if($(this)[0] === $(_self)[0]) setPosition = i; // Get the position in the set
						images.push($(this).attr('href'));
						titles.push($(this).find('img').attr('alt'));
						descriptions.push($(this).attr('title'));
					});
				}else{
					images = $(this).attr('href');
					titles = ($(this).find('img').attr('alt')) ?  $(this).find('img').attr('alt') : '';
					descriptions = ($(this).attr('title')) ?  $(this).attr('title') : '';
				}

				$.prettyPhoto.open(images,titles,descriptions);
				return false;
			});
		});
	
		
		/**
		* Opens the prettyPhoto modal box.
		* @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
		* @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
		* @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
		*/
		$.prettyPhoto.open = function(gallery_images,gallery_titles,gallery_descriptions) {
			// To fix the bug with IE select boxes
			if($.browser.msie && $.browser.version == 6){
				$('select').css('visibility','hidden');
			};
			
			if(settings.hideflash) $('object,embed').css('visibility','hidden'); // Hide the flash
			
			// Convert everything to an array in the case it's a single item
			images = $.makeArray(gallery_images);
			titles = $.makeArray(gallery_titles);
			descriptions = $.makeArray(gallery_descriptions);

			image_set = ($(images).size() > 0) ?  true : false; // Find out if it's a set

			// Hide the next/previous links if on first or last images.
			_checkPosition($(images).size());
		
			$('.pp_loaderIcon').show(); // Do I need to explain?
		
			// Fade the content in
			$pp_overlay.show().fadeTo(settings.animationSpeed,settings.opacity);

			// Display the current position
			$pp_pic_holder.find('.currentTextHolder').text((setPosition+1) + settings.counter_separator_label + $(images).size());

			// Set the description
			if(descriptions[setPosition]){
				$pp_pic_holder.find('.pp_description').show().html(unescape(descriptions[setPosition]));
			}else{
				$pp_pic_holder.find('.pp_description').hide().text('');
			};

			// Set the title
			if(titles[setPosition] && settings.showTitle){
				hasTitle = true;
				$ppt.html(unescape(titles[setPosition]));
			}else{
				hasTitle = false;
			};
			
			// Get the dimensions
			movie_width = ( parseFloat(grab_param('width',images[setPosition])) ) ? grab_param('width',images[setPosition]) : settings.default_width.toString();
			movie_height = ( parseFloat(grab_param('height',images[setPosition])) ) ? grab_param('height',images[setPosition]) : settings.default_height.toString();
			
			// If the size is % based, calculate according to window dimensions
			if(movie_width.indexOf('%') != -1 || movie_height.indexOf('%') != -1){
				movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 100);
				movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 100);
				percentBased = true;
			}
			
			// Fade the holder
			$pp_pic_holder.fadeIn(function(){
				imgPreloader = "";
				// Inject the proper content
				switch(_getFileType(images[setPosition])){
					case 'image':
						
						// Set the new image
						imgPreloader = new Image();

						// Preload the neighbour images
						nextImage = new Image();
						if(image_set && setPosition > $(images).size()) nextImage.src = images[setPosition + 1];
						prevImage = new Image();
						if(image_set && images[setPosition - 1]) prevImage.src = images[setPosition - 1];

						$pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup;
						$pp_pic_holder.find('#fullResImage').attr('src',images[setPosition]);

						imgPreloader.onload = function(){
							
							// Fit item to viewport
							correctSizes = _fitToViewport(imgPreloader.width,imgPreloader.height);

							_showContent();
						};

						imgPreloader.onerror = function(){
							alert('Image cannot be loaded. Make sure the path is correct and image exist.');
							$.prettyPhoto.close();
						};
					
						imgPreloader.src = images[setPosition];
					break;
				
					case 'youtube':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport

						movie = 'http://www.youtube.com/v/'+grab_param('v',images[setPosition]);
						if(settings.autoplay) movie += "&autoplay=1&hd=1";
						
						var hT = '<iframe width="560" height="349" src="http://www.youtube.com/embed/' + grab_param('v',images[setPosition]) + '?autoplay=1&hd=1" frameborder="0" allowfullscreen></iframe>';
						toInject = hT;
//						toInject = settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
					break;
				
					case 'vimeo':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						movie_id = images[setPosition];
						movie = 'http://vimeo.com/moogaloop.swf?clip_id='+ movie_id.replace('http://vimeo.com/','');
						if(settings.autoplay) movie += "&autoplay=1";
				
						toInject = settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
					break;
				
					case 'quicktime':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
						correctSizes['height']+=15; correctSizes['contentHeight']+=15; correctSizes['containerHeight']+=15; // Add space for the control bar
				
						toInject = settings.quicktime_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,images[setPosition]).replace(/{autoplay}/g,settings.autoplay);
					break;
				
					case 'flash':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						flash_vars = images[setPosition];
						flash_vars = flash_vars.substring(images[setPosition].indexOf('flashvars') + 10,images[setPosition].length);

						filename = images[setPosition];
						filename = filename.substring(0,filename.indexOf('?'));
					
						toInject =  settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);
					break;
				
					case 'iframe':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
				
						frame_url = images[setPosition];
						frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1);
				
						toInject = settings.iframe_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,frame_url);
					break;
				
					case 'inline':
						// to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete
						myClone = $(images[setPosition]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body'));
						correctSizes = _fitToViewport($(myClone).width(),$(myClone).height());
						$(myClone).remove();
						toInject = settings.inline_markup.replace(/{content}/g,$(images[setPosition]).html());
					break;
				};

				if(!imgPreloader){
					$pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
				
					// Show content
					_showContent();
				};
			});

		};
		
		/**
		* Change page in the prettyPhoto modal box
		* @param direction {String} Direction of the paging, previous or next.
		*/
		$.prettyPhoto.changePage = function(direction){
			if(direction == 'previous') {
				setPosition--;
				if (setPosition < 0){
					setPosition = 0;
					return;
				};
			}else{
				if($('.pp_arrow_next').is('.disabled')) return;
				setPosition++;
			};

			// Allow the resizing of the images
			if(!doresize) doresize = true;

			_hideContent(function(){$.prettyPhoto.open(images,titles,descriptions)});
			$('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed);
		};
		
		/**
		* Closes the prettyPhoto modal box.
		*/
		$.prettyPhoto.close = function(){
			$pp_pic_holder.find('object,embed').css('visibility','hidden');
			
			$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animationSpeed);
			
			$pp_overlay.fadeOut(settings.animationSpeed, function(){
				$('#pp_full_res').html(''); // Kill the opened content
				
				$pp_pic_holder.attr('style','').find('div:not(.pp_hoverContainer)').attr('style',''); // Reset the width and everything that has been set.
				_centerOverlay(); // Center it
			
				// To fix the bug with IE select boxes
				if($.browser.msie && $.browser.version == 6){
					$('select').css('visibility','visible');
				};
				
				// Show the flash
				if(settings.hideflash) $('object,embed').css('visibility','visible');
				
				setPosition = 0;
				settings.callback();
			});
			doresize = true;
		};
	
		/**
		* Set the proper sizes on the containers and animate the content in.
		*/
		_showContent = function(){
			$('.pp_loaderIcon').hide();

			// Calculate the opened top position of the pic holder
			projectedTop = scrollPos['scrollTop'] + ((windowHeight/2) - (correctSizes['containerHeight']/2));
			if(projectedTop < 0) projectedTop = 0 + $ppt.height();

			// Resize the content holder
			$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animationSpeed);
			
			// Resize picture the holder
			$pp_pic_holder.animate({
				'top': projectedTop,
				'left': (windowWidth/2) - (correctSizes['containerWidth']/2),
				'width': correctSizes['containerWidth']
			},settings.animationSpeed,function(){
				
				$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);

				// Fade the new image
				$pp_pic_holder.find('.pp_fade').fadeIn(settings.animationSpeed);

				// Show the nav
//				if(image_set && _getFileType(images[setPosition])=="image") { 
//					$pp_pic_holder.find('.pp_hoverContainer').show(); 
//				}
//				else{ 
//					$pp_pic_holder.find('.pp_hoverContainer').hide(); 
//				}

				$pp_pic_holder.find('.pp_hoverContainer').hide(); 
								
				// Show the title
				if(settings.showTitle && hasTitle){
					$ppt.css({
						'top' : $pp_pic_holder.offset().top - 25,
						'left' : $pp_pic_holder.offset().left + 20,
						'display' : 'none'
					});

					$ppt.fadeIn(settings.animationSpeed);
				};
			
				// Fade the resizing link if the image is resized
				if(correctSizes['resized']) $('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);
				
				// Callback!
				settings.changepicturecallback();
			});
		};
		
		/**
		* Hide the content...DUH!
		*/
		function _hideContent(callback){
			// Fade out the current picture
			$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
			$pp_pic_holder.find('.pp_fade').fadeOut(settings.animationSpeed,function(){
				$('.pp_loaderIcon').show();
				
				if(callback) callback();
			});
			
			// Hide the title
			$ppt.fadeOut(settings.animationSpeed);
		}
	
		/**
		* Check the item position in the gallery array, hide or show the navigation links
		* @param setCount {integer} The total number of items in the set
		*/
		function _checkPosition(setCount){
			// If at the end, hide the next link
			if(setPosition == setCount-1) {
				$pp_pic_holder.find('a.pp_next').css('visibility','hidden');
				$pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');
			}else{ 
				$pp_pic_holder.find('a.pp_next').css('visibility','visible');
				$pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){
					$.prettyPhoto.changePage('next');
					return false;
				});
			};
		
			// If at the beginning, hide the previous link
			if(setPosition == 0) {
				$pp_pic_holder.find('a.pp_previous').css('visibility','hidden');
				$pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');
			}else{
				$pp_pic_holder.find('a.pp_previous').css('visibility','visible');
				$pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){
					$.prettyPhoto.changePage('previous');
					return false;
				});
			};
			
			// Hide the bottom nav if it's not a set.
			if(setCount > 1) {
				$('.pp_nav').show();
			}else{
				$('.pp_nav').hide();
			}
		};
	
		/**
		* Resize the item dimensions if it's bigger than the viewport
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		* @return An array containin the "fitted" dimensions
		*/
		function _fitToViewport(width,height){
			hasBeenResized = false;

			_getDimensions(width,height);
			
			// Define them in case there's no resize needed
			imageWidth = width;
			imageHeight = height;

			if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allowresize && !percentBased) {
				hasBeenResized = true;
				notFitting = true;
			
				while (notFitting){
					if((pp_containerWidth > windowWidth)){
						imageWidth = (windowWidth - 200);
						imageHeight = (height/width) * imageWidth;
					}else if((pp_containerHeight > windowHeight)){
						imageHeight = (windowHeight - 200);
						imageWidth = (width/height) * imageHeight;
					}else{
						notFitting = false;
					};

					pp_containerHeight = imageHeight;
					pp_containerWidth = imageWidth;
				};
			
				_getDimensions(imageWidth,imageHeight);
			};

			return {
				width:Math.floor(imageWidth),
				height:Math.floor(imageHeight),
				containerHeight:Math.floor(pp_containerHeight),
				containerWidth:Math.floor(pp_containerWidth) + 40,
				contentHeight:Math.floor(pp_contentHeight),
				contentWidth:Math.floor(pp_contentWidth),
				resized:hasBeenResized
			};
		};
		
		/**
		* Get the containers dimensions according to the item size
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		*/
		function _getDimensions(width,height){
			width = parseFloat(width);
			height = parseFloat(height);
			
			// Get the details height, to do so, I need to clone it since it's invisible
			$pp_details = $pp_pic_holder.find('.pp_details');
			$pp_details.width(width);
			detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));
			$pp_details = $pp_details.clone().appendTo($('body')).css({
				'position':'absolute',
				'top':-10000
			});
			detailsHeight += $pp_details.height();
			detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details
			if($.browser.msie && $.browser.version==7) detailsHeight+=8;
			$pp_details.remove();
			
			// Get the container size, to resize the holder to the right dimensions
			pp_contentHeight = height + detailsHeight;
			pp_contentWidth = width;
			pp_containerHeight = pp_contentHeight + $ppt.height() + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
			pp_containerWidth = width;
		}
	
		function _getFileType(itemSrc){
			if (itemSrc.match(/youtube\.com\/watch/i)) {
				return 'youtube';
			}else if (itemSrc.match(/vimeo\.com/i)) {
				return 'vimeo';
			}else if(itemSrc.indexOf('.mov') != -1){ 
				return 'quicktime';
			}else if(itemSrc.indexOf('.swf') != -1){
				return 'flash';
			}else if(itemSrc.indexOf('iframe') != -1){
				return 'iframe'
			}else if(itemSrc.substr(0,1) == '#'){
				return 'inline';
			}else{
				return 'image';
			};
		};
	
		function _centerOverlay(){
			if(doresize) {
				titleHeight = $ppt.height();
				contentHeight = $pp_pic_holder.height();
				contentwidth = $pp_pic_holder.width();
				
				projectedTop = (windowHeight/2) + scrollPos['scrollTop'] - ((contentHeight+titleHeight)/2);
				
				$pp_pic_holder.css({
					'top': projectedTop,
					'left': (windowWidth/2) + scrollPos['scrollLeft'] - (contentwidth/2)
				});
				
				$ppt.css({
					'top' : projectedTop - titleHeight,
					'left': (windowWidth/2) + scrollPos['scrollLeft'] - (contentwidth/2) + 20
				});
			};
		};
	
		function _getScroll(){
			if (self.pageYOffset) {
				return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};
			} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
				return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
			} else if (document.body) {// all other Explorers
				return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};
			};
		};
	
		function _resizeOverlay() {
			windowHeight = $(window).height();
			windowWidth = $(window).width();
			
			$pp_overlay.css({
				'height':$(document).height()
			});
		};
	
		function _buildOverlay(){
			// Inject the markup
			$('body').append(settings.markup);
			
			// Set my global selectors
			$pp_pic_holder = $('.pp_pic_holder');
			$ppt = $('.ppt');
			$pp_overlay = $('div.pp_overlay');
			
			$pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme
			
			$pp_overlay
				.css({
					'opacity':0,
					'height':$(document).height()
					})
				.bind('click',function(){
					if(!settings.modal)
					$.prettyPhoto.close();
				});

			$('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });

			$('a.pp_expand').bind('click',function(){
				$this = $(this); // Fix scoping
				
				// Expand the image
				if($this.hasClass('pp_expand')){
					$this.removeClass('pp_expand').addClass('pp_contract');
					doresize = false;
				}else{
					$this.removeClass('pp_contract').addClass('pp_expand');
					doresize = true;
				};
			
				_hideContent(function(){ $.prettyPhoto.open(images,titles,descriptions) });
				
				$pp_pic_holder.find('.pp_fade').fadeOut(settings.animationSpeed);
		
				return false;
			});
		
			$pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){
				$.prettyPhoto.changePage('previous');
				return false;
			});
		
			$pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){
				$.prettyPhoto.changePage('next');
				return false;
			});
		};
		
		_centerOverlay(); // Center it
	};
	
	function grab_param(name,url){
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( url );
	  if( results == null )
	    return "";
	  else
	    return results[1];
	}
})(jQuery);;

/*!
 * jQuery Form Plugin
 * version: 2.80 (25-MAY-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
;(function($) {

/*
	Usage Note:
	-----------
	Do not use both ajaxSubmit and ajaxForm on the same form.  These
	functions are intended to be exclusive.  Use ajaxSubmit if you want
	to bind your own submit handler to the form.  For example,

	$(document).ready(function() {
		$('#myForm').bind('submit', function(e) {
			e.preventDefault(); // <-- important
			$(this).ajaxSubmit({
				target: '#output'
			});
		});
	});

	Use ajaxForm when you want the plugin to manage all the event binding
	for you.  For example,

	$(document).ready(function() {
		$('#myForm').ajaxForm({
			target: '#output'
		});
	});

	When using ajaxForm, the ajaxSubmit function will be invoked for you
	at the appropriate time.
*/

/**
 * ajaxSubmit() provides a mechanism for immediately submitting
 * an HTML form using AJAX.
 */
$.fn.ajaxSubmit = function(options) {
	// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
	if (!this.length) {
		log('ajaxSubmit: skipping submit process - no element selected');
		return this;
	}

	if (typeof options == 'function') {
		options = { success: options };
	}

	var action = this.attr('action');
	var url = (typeof action === 'string') ? $.trim(action) : '';
	url = url || window.location.href || '';
	if (url) {
		// clean url (don't include hash vaue)
		url = (url.match(/^([^#]+)/)||[])[1];
	}

	options = $.extend(true, {
		url:  url,
		success: $.ajaxSettings.success,
		type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
		iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
	}, options);

	// hook for manipulating the form data before it is extracted;
	// convenient for use with rich editors like tinyMCE or FCKEditor
	var veto = {};
	this.trigger('form-pre-serialize', [this, options, veto]);
	if (veto.veto) {
		log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
		return this;
	}

	// provide opportunity to alter form data before it is serialized
	if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
		log('ajaxSubmit: submit aborted via beforeSerialize callback');
		return this;
	}

	var n,v,a = this.formToArray(options.semantic);
	if (options.data) {
		options.extraData = options.data;
		for (n in options.data) {
			if(options.data[n] instanceof Array) {
				for (var k in options.data[n]) {
					a.push( { name: n, value: options.data[n][k] } );
				}
			}
			else {
				v = options.data[n];
				v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
				a.push( { name: n, value: v } );
			}
		}
	}

	// give pre-submit callback an opportunity to abort the submit
	if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
		log('ajaxSubmit: submit aborted via beforeSubmit callback');
		return this;
	}

	// fire vetoable 'validate' event
	this.trigger('form-submit-validate', [a, this, options, veto]);
	if (veto.veto) {
		log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
		return this;
	}

	var q = $.param(a);

	if (options.type.toUpperCase() == 'GET') {
		options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
		options.data = null;  // data is null for 'get'
	}
	else {
		options.data = q; // data is the query string for 'post'
	}

	var $form = this, callbacks = [];
	if (options.resetForm) {
		callbacks.push(function() { $form.resetForm(); });
	}
	if (options.clearForm) {
		callbacks.push(function() { $form.clearForm(); });
	}

	// perform a load on the target only if dataType is not provided
	if (!options.dataType && options.target) {
		var oldSuccess = options.success || function(){};
		callbacks.push(function(data) {
			var fn = options.replaceTarget ? 'replaceWith' : 'html';
			$(options.target)[fn](data).each(oldSuccess, arguments);
		});
	}
	else if (options.success) {
		callbacks.push(options.success);
	}

	options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
		var context = options.context || options;   // jQuery 1.4+ supports scope context 
		for (var i=0, max=callbacks.length; i < max; i++) {
			callbacks[i].apply(context, [data, status, xhr || $form, $form]);
		}
	};

	// are there files to upload?
	var fileInputs = $('input:file', this).length > 0;
	var mp = 'multipart/form-data';
	var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);

	// options.iframe allows user to force iframe mode
	// 06-NOV-09: now defaulting to iframe mode if file input is detected
   if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
	   // hack to fix Safari hang (thanks to Tim Molendijk for this)
	   // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
	   if (options.closeKeepAlive) {
		   $.get(options.closeKeepAlive, function() { fileUpload(a); });
		}
	   else {
		   fileUpload(a);
		}
   }
   else {
		$.ajax(options);
   }

	// fire 'notify' event
	this.trigger('form-submit-notify', [this, options]);
	return this;


	// private function for handling file uploads (hat tip to YAHOO!)
	function fileUpload(a) {
		var form = $form[0], i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;

        if (a) {
        	// ensure that every serialized input is still enabled
          	for (i=0; i < a.length; i++) {
            	$(form[a[i].name]).attr('disabled', false);
          	}
        }

		if ($(':input[name=submit],:input[id=submit]', form).length) {
			// if there is an input with a name or id of 'submit' then we won't be
			// able to invoke the submit fn on the form (at least not x-browser)
			alert('Error: Form elements must not have name or id of "submit".');
			return;
		}
		
		s = $.extend(true, {}, $.ajaxSettings, options);
		s.context = s.context || s;
		id = 'jqFormIO' + (new Date().getTime());
		if (s.iframeTarget) {
			$io = $(s.iframeTarget);
			n = $io.attr('name');
			if (n == null)
			 	$io.attr('name', id);
			else
				id = n;
		}
		else {
			$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
			$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
		}
		io = $io[0];


		xhr = { // mock object
			aborted: 0,
			responseText: null,
			responseXML: null,
			status: 0,
			statusText: 'n/a',
			getAllResponseHeaders: function() {},
			getResponseHeader: function() {},
			setRequestHeader: function() {},
			abort: function(status) {
				var e = (status === 'timeout' ? 'timeout' : 'aborted');
				log('aborting upload... ' + e);
				this.aborted = 1;
				$io.attr('src', s.iframeSrc); // abort op in progress
				xhr.error = e;
				s.error && s.error.call(s.context, xhr, e, e);
				g && $.event.trigger("ajaxError", [xhr, s, e]);
				s.complete && s.complete.call(s.context, xhr, e);
			}
		};

		g = s.global;
		// trigger ajax global events so that activity/block indicators work like normal
		if (g && ! $.active++) {
			$.event.trigger("ajaxStart");
		}
		if (g) {
			$.event.trigger("ajaxSend", [xhr, s]);
		}

		if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
			if (s.global) {
				$.active--;
			}
			return;
		}
		if (xhr.aborted) {
			return;
		}

		// add submitting element to data if we know it
		sub = form.clk;
		if (sub) {
			n = sub.name;
			if (n && !sub.disabled) {
				s.extraData = s.extraData || {};
				s.extraData[n] = sub.value;
				if (sub.type == "image") {
					s.extraData[n+'.x'] = form.clk_x;
					s.extraData[n+'.y'] = form.clk_y;
				}
			}
		}

		// take a breath so that pending repaints get some cpu time before the upload starts
		function doSubmit() {
			// make sure form attrs are set
			var t = $form.attr('target'), a = $form.attr('action');

			// update form attrs in IE friendly way
			form.setAttribute('target',id);
			if (form.getAttribute('method') != 'POST') {
				form.setAttribute('method', 'POST');
			}
			if (form.getAttribute('action') != s.url) {
				form.setAttribute('action', s.url);
			}

			// ie borks in some cases when setting encoding
			if (! s.skipEncodingOverride) {
				$form.attr({
					encoding: 'multipart/form-data',
					enctype:  'multipart/form-data'
				});
			}

			// support timout
			if (s.timeout) {
				timeoutHandle = setTimeout(function() { timedOut = true; cb(true); }, s.timeout);
			}

			// add "extra" data to form if provided in options
			var extraInputs = [];
			try {
				if (s.extraData) {
					for (var n in s.extraData) {
						extraInputs.push(
							$('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')
								.appendTo(form)[0]);
					}
				}

				if (!s.iframeTarget) {
					// add iframe to doc and submit the form
					$io.appendTo('body');
	                io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
				}
				form.submit();
			}
			finally {
				// reset attrs and remove "extra" input elements
				form.setAttribute('action',a);
				if(t) {
					form.setAttribute('target', t);
				} else {
					$form.removeAttr('target');
				}
				$(extraInputs).remove();
			}
		}

		if (s.forceSync) {
			doSubmit();
		}
		else {
			setTimeout(doSubmit, 10); // this lets dom updates render
		}

		var data, doc, domCheckCount = 50, callbackProcessed;

		function cb(e) {
			if (xhr.aborted || callbackProcessed) {
				return;
			}
			if (e === true && xhr) {
				xhr.abort('timeout');
				return;
			}

			var doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
			if (!doc || doc.location.href == s.iframeSrc) {
				// response not received yet
				if (!timedOut)
					return;
			}
            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);

			var status = 'success', errMsg;
			try {
				if (timedOut) {
					throw 'timeout';
				}

				var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
				log('isXml='+isXml);
				if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
					if (--domCheckCount) {
						// in some browsers (Opera) the iframe DOM is not always traversable when
						// the onload callback fires, so we loop a bit to accommodate
						log('requeing onLoad callback, DOM not available');
						setTimeout(cb, 250);
						return;
					}
					// let this fall through because server response could be an empty document
					//log('Could not access iframe DOM after mutiple tries.');
					//throw 'DOMException: not available';
				}

				//log('response detected');
                var docRoot = doc.body ? doc.body : doc.documentElement;
                xhr.responseText = docRoot ? docRoot.innerHTML : null;
				xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
				if (isXml)
					s.dataType = 'xml';
				xhr.getResponseHeader = function(header){
					var headers = {'content-type': s.dataType};
					return headers[header];
				};
                // support for XHR 'status' & 'statusText' emulation :
                if (docRoot) {
                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
                }

				var dt = s.dataType || '';
				var scr = /(json|script|text)/.test(dt.toLowerCase());
				if (scr || s.textarea) {
					// see if user embedded response in textarea
					var ta = doc.getElementsByTagName('textarea')[0];
					if (ta) {
						xhr.responseText = ta.value;
                        // support for XHR 'status' & 'statusText' emulation :
                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
					}
					else if (scr) {
						// account for browsers injecting pre around json response
						var pre = doc.getElementsByTagName('pre')[0];
						var b = doc.getElementsByTagName('body')[0];
						if (pre) {
							xhr.responseText = pre.textContent ? pre.textContent : pre.innerHTML;
						}
						else if (b) {
							xhr.responseText = b.innerHTML;
						}
					}
				}
				else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
					xhr.responseXML = toXml(xhr.responseText);
				}

                try {
                    data = httpData(xhr, s.dataType, s);
                }
                catch (e) {
                    status = 'parsererror';
                    xhr.error = errMsg = (e || status);
                }
			}
			catch (e) {
				log('error caught',e);
				status = 'error';
                xhr.error = errMsg = (e || status);
			}

			if (xhr.aborted) {
				log('upload aborted');
				status = null;
			}

            if (xhr.status) { // we've set xhr.status
                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
            }

			// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
			if (status === 'success') {
				s.success && s.success.call(s.context, data, 'success', xhr);
				g && $.event.trigger("ajaxSuccess", [xhr, s]);
			}
            else if (status) {
				if (errMsg == undefined)
					errMsg = xhr.statusText;
				s.error && s.error.call(s.context, xhr, status, errMsg);
				g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
            }

			g && $.event.trigger("ajaxComplete", [xhr, s]);

			if (g && ! --$.active) {
				$.event.trigger("ajaxStop");
			}

			s.complete && s.complete.call(s.context, xhr, status);

			callbackProcessed = true;
			if (s.timeout)
				clearTimeout(timeoutHandle);

			// clean up
			setTimeout(function() {
				if (!s.iframeTarget)
					$io.remove();
				xhr.responseXML = null;
			}, 100);
		}

		var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
			if (window.ActiveXObject) {
				doc = new ActiveXObject('Microsoft.XMLDOM');
				doc.async = 'false';
				doc.loadXML(s);
			}
			else {
				doc = (new DOMParser()).parseFromString(s, 'text/xml');
			}
			return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
		};
		var parseJSON = $.parseJSON || function(s) {
			return window['eval']('(' + s + ')');
		};

		var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4

			var ct = xhr.getResponseHeader('content-type') || '',
				xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
				data = xml ? xhr.responseXML : xhr.responseText;

			if (xml && data.documentElement.nodeName === 'parsererror') {
				$.error && $.error('parsererror');
			}
			if (s && s.dataFilter) {
				data = s.dataFilter(data, type);
			}
			if (typeof data === 'string') {
				if (type === 'json' || !type && ct.indexOf('json') >= 0) {
					data = parseJSON(data);
				} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
					$.globalEval(data);
				}
			}
			return data;
		};
	}
};

/**
 * ajaxForm() provides a mechanism for fully automating form submission.
 *
 * The advantages of using this method instead of ajaxSubmit() are:
 *
 * 1: This method will include coordinates for <input type="image" /> elements (if the element
 *	is used to submit the form).
 * 2. This method will include the submit element's name/value data (for the element that was
 *	used to submit the form).
 * 3. This method binds the submit() method to the form for you.
 *
 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
 * passes the options argument along after properly binding events for submit elements and
 * the form itself.
 */
$.fn.ajaxForm = function(options) {
	// in jQuery 1.3+ we can fix mistakes with the ready state
	if (this.length === 0) {
		var o = { s: this.selector, c: this.context };
		if (!$.isReady && o.s) {
			log('DOM not ready, queuing ajaxForm');
			$(function() {
				$(o.s,o.c).ajaxForm(options);
			});
			return this;
		}
		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
		return this;
	}

	return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
		if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
			e.preventDefault();
			$(this).ajaxSubmit(options);
		}
	}).bind('click.form-plugin', function(e) {
		var target = e.target;
		var $el = $(target);
		if (!($el.is(":submit,input:image"))) {
			// is this a child element of the submit el?  (ex: a span within a button)
			var t = $el.closest(':submit');
			if (t.length == 0) {
				return;
			}
			target = t[0];
		}
		var form = this;
		form.clk = target;
		if (target.type == 'image') {
			if (e.offsetX != undefined) {
				form.clk_x = e.offsetX;
				form.clk_y = e.offsetY;
			} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
				var offset = $el.offset();
				form.clk_x = e.pageX - offset.left;
				form.clk_y = e.pageY - offset.top;
			} else {
				form.clk_x = e.pageX - target.offsetLeft;
				form.clk_y = e.pageY - target.offsetTop;
			}
		}
		// clear form vars
		setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
	});
};

// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
$.fn.ajaxFormUnbind = function() {
	return this.unbind('submit.form-plugin click.form-plugin');
};

/**
 * formToArray() gathers form element data into an array of objects that can
 * be passed to any of the following ajax functions: $.get, $.post, or load.
 * Each object in the array has both a 'name' and 'value' property.  An example of
 * an array for a simple login form might be:
 *
 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
 *
 * It is this array that is passed to pre-submit callback functions provided to the
 * ajaxSubmit() and ajaxForm() methods.
 */
$.fn.formToArray = function(semantic) {
	var a = [];
	if (this.length === 0) {
		return a;
	}

	var form = this[0];
	var els = semantic ? form.getElementsByTagName('*') : form.elements;
	if (!els) {
		return a;
	}

	var i,j,n,v,el,max,jmax;
	for(i=0, max=els.length; i < max; i++) {
		el = els[i];
		n = el.name;
		if (!n) {
			continue;
		}

		if (semantic && form.clk && el.type == "image") {
			// handle image inputs on the fly when semantic == true
			if(!el.disabled && form.clk == el) {
				a.push({name: n, value: $(el).val()});
				a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
			}
			continue;
		}

		v = $.fieldValue(el, true);
		if (v && v.constructor == Array) {
			for(j=0, jmax=v.length; j < jmax; j++) {
				a.push({name: n, value: v[j]});
			}
		}
		else if (v !== null && typeof v != 'undefined') {
			a.push({name: n, value: v});
		}
	}

	if (!semantic && form.clk) {
		// input type=='image' are not found in elements array! handle it here
		var $input = $(form.clk), input = $input[0];
		n = input.name;
		if (n && !input.disabled && input.type == 'image') {
			a.push({name: n, value: $input.val()});
			a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
		}
	}
	return a;
};

/**
 * Serializes form data into a 'submittable' string. This method will return a string
 * in the format: name1=value1&amp;name2=value2
 */
$.fn.formSerialize = function(semantic) {
	//hand off to jQuery.param for proper encoding
	return $.param(this.formToArray(semantic));
};

/**
 * Serializes all field elements in the jQuery object into a query string.
 * This method will return a string in the format: name1=value1&amp;name2=value2
 */
$.fn.fieldSerialize = function(successful) {
	var a = [];
	this.each(function() {
		var n = this.name;
		if (!n) {
			return;
		}
		var v = $.fieldValue(this, successful);
		if (v && v.constructor == Array) {
			for (var i=0,max=v.length; i < max; i++) {
				a.push({name: n, value: v[i]});
			}
		}
		else if (v !== null && typeof v != 'undefined') {
			a.push({name: this.name, value: v});
		}
	});
	//hand off to jQuery.param for proper encoding
	return $.param(a);
};

/**
 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
 *
 *  <form><fieldset>
 *	  <input name="A" type="text" />
 *	  <input name="A" type="text" />
 *	  <input name="B" type="checkbox" value="B1" />
 *	  <input name="B" type="checkbox" value="B2"/>
 *	  <input name="C" type="radio" value="C1" />
 *	  <input name="C" type="radio" value="C2" />
 *  </fieldset></form>
 *
 *  var v = $(':text').fieldValue();
 *  // if no values are entered into the text inputs
 *  v == ['','']
 *  // if values entered into the text inputs are 'foo' and 'bar'
 *  v == ['foo','bar']
 *
 *  var v = $(':checkbox').fieldValue();
 *  // if neither checkbox is checked
 *  v === undefined
 *  // if both checkboxes are checked
 *  v == ['B1', 'B2']
 *
 *  var v = $(':radio').fieldValue();
 *  // if neither radio is checked
 *  v === undefined
 *  // if first radio is checked
 *  v == ['C1']
 *
 * The successful argument controls whether or not the field element must be 'successful'
 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
 * The default value of the successful argument is true.  If this value is false the value(s)
 * for each element is returned.
 *
 * Note: This method *always* returns an array.  If no valid value can be determined the
 *	   array will be empty, otherwise it will contain one or more values.
 */
$.fn.fieldValue = function(successful) {
	for (var val=[], i=0, max=this.length; i < max; i++) {
		var el = this[i];
		var v = $.fieldValue(el, successful);
		if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
			continue;
		}
		v.constructor == Array ? $.merge(val, v) : val.push(v);
	}
	return val;
};

/**
 * Returns the value of the field element.
 */
$.fieldValue = function(el, successful) {
	var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
	if (successful === undefined) {
		successful = true;
	}

	if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
		(t == 'checkbox' || t == 'radio') && !el.checked ||
		(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
		tag == 'select' && el.selectedIndex == -1)) {
			return null;
	}

	if (tag == 'select') {
		var index = el.selectedIndex;
		if (index < 0) {
			return null;
		}
		var a = [], ops = el.options;
		var one = (t == 'select-one');
		var max = (one ? index+1 : ops.length);
		for(var i=(one ? index : 0); i < max; i++) {
			var op = ops[i];
			if (op.selected) {
				var v = op.value;
				if (!v) { // extra pain for IE...
					v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
				}
				if (one) {
					return v;
				}
				a.push(v);
			}
		}
		return a;
	}
	return $(el).val();
};

/**
 * Clears the form data.  Takes the following actions on the form's input fields:
 *  - input text fields will have their 'value' property set to the empty string
 *  - select elements will have their 'selectedIndex' property set to -1
 *  - checkbox and radio inputs will have their 'checked' property set to false
 *  - inputs of type submit, button, reset, and hidden will *not* be effected
 *  - button elements will *not* be effected
 */
$.fn.clearForm = function() {
	return this.each(function() {
		$('input,select,textarea', this).clearFields();
	});
};

/**
 * Clears the selected form elements.
 */
$.fn.clearFields = $.fn.clearInputs = function() {
	return this.each(function() {
		var t = this.type, tag = this.tagName.toLowerCase();
		if (t == 'text' || t == 'password' || tag == 'textarea') {
			this.value = '';
		}
		else if (t == 'checkbox' || t == 'radio') {
			this.checked = false;
		}
		else if (tag == 'select') {
			this.selectedIndex = -1;
		}
	});
};

/**
 * Resets the form data.  Causes all form elements to be reset to their original value.
 */
$.fn.resetForm = function() {
	return this.each(function() {
		// guard against an input with the name of 'reset'
		// note that IE reports the reset function as an 'object'
		if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
			this.reset();
		}
	});
};

/**
 * Enables or disables any matching elements.
 */
$.fn.enable = function(b) {
	if (b === undefined) {
		b = true;
	}
	return this.each(function() {
		this.disabled = !b;
	});
};

/**
 * Checks/unchecks any matching checkboxes or radio buttons and
 * selects/deselects and matching option elements.
 */
$.fn.selected = function(select) {
	if (select === undefined) {
		select = true;
	}
	return this.each(function() {
		var t = this.type;
		if (t == 'checkbox' || t == 'radio') {
			this.checked = select;
		}
		else if (this.tagName.toLowerCase() == 'option') {
			var $sel = $(this).parent('select');
			if (select && $sel[0] && $sel[0].type == 'select-one') {
				// deselect all other options
				$sel.find('option').selected(false);
			}
			this.selected = select;
		}
	});
};

// helper fn for console logging
function log() {
	var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
	if (window.console && window.console.log) {
		window.console.log(msg);
	}
	else if (window.opera && window.opera.postError) {
		window.opera.postError(msg);
	}
};

})(jQuery);
;

var ImportFile = function(src, type ){
	if( type == null || type == undefined ) type = 'script';
	var fileRef=document.createElement( type );
	switch( type ) {
		default:
		case 'script':
			fileRef.setAttribute("type","text/javascript");
		 	fileRef.setAttribute("src", src);
			break;
		case 'link':
		 	fileRef.setAttribute("type","text/css");
		 	fileRef.setAttribute("rel","stylesheet");
		 	fileRef.setAttribute("href", src);
			break;
	}
 	document.getElementsByTagName("head")[0].appendChild(fileRef);
}
var ImportWawFile = function(fileName){
	ImportFile( '/Plugins/Internal/Jscripts/' + fileName, 'script' );
}
//
// Get selection
//
function getDomSelect (id){
	return $('#' + id + ' :selected').val();
}

//
// JSON object
//
var WawJson = {
	
	getObject : function(o) { 
	
		if(o != null && o.responseText.length > 0){

			try {
				var js=document.createElement("script");
				js.setAttribute('type', 'text/javascript');
				js.text = 'var TMP_JSON = ' + o.responseText + '';
				document.getElementsByTagName("head")[0].appendChild(js);
				return TMP_JSON;
			}
			catch(e){
				return null;
			}
		}
		return json;
	},
	getHtmlJson : function(){
		var jE = $('#htmlJson');
		if(jE != null) {
			try {
				var json = WawJson.getObject( { responseText : jE.innerHTML } );
				jsonElm.parentNode.removeChild(jsonElm);
				return json;
			}
			catch(e){
				return '';	
			}
		}
		return '';
	}	
};

//
// Press key object
//
var WawSystemKeys = {
		
	getPressedKeys : function(e){
	
		if (!e) {
			if (window.event) {
				e = window.event;
			} 
			else {
				return;
			}
		}
		if (typeof (e.which) == 'number') {
			e = e.which;
		}
		else if (typeof (e.keyCode) == 'number') {
			e = e.keyCode;
		} 
		else if (typeof( e.charCode) == 'number') {
			e = e.charCode;
		} 
		return e;
	},
	
	enterKeyPressed : function(e){
		if(this.getPressedKeys(e) == 13){
			return true;
		}
		else{
			
			return false;
		}
	}
};

/**
 * @description <p>Creates a XMLHTTP Request connect interface</p>
 * @class WawConnect
 * @namespace WawConnect
 */
var WawConnectClient = {

 	id : 'WawConnectClient',
 	
 	page : '/service_website.php',
 	
 	argument : null,
 	
 	doRequest : function(args, cb){
	
	  WawConnectClient.argument = cb.argument;
	  
		$.get(this.page, args, function( data, textStatus, XMLHttpRequest ){
			
			if( cb != null ) {
				
				cb.success ( { 
					responseText : data, 
					textStatus : textStatus, 
					argument : cb.argument,
					XMLHttpRequest : XMLHttpRequest 
				} );
			}
		});	
 	},

 	doPost : function(frmO, cb){
 		
 		if( cb.argument == null || cb.argument == undefined ) {
 			cb.argument = [];
 		}
 	    var options = { 
 	   		success : function (responseText, statusText, xhr, $form) {
 	    		
 	    		try {
 	    			cb.upload( { responseText : responseText, argument : cb.argument, statusText : statusText } );
 	    		}
 	    		catch(e){
 	    		}
 	    	}	
 	   	};
 	    var frm = $(frmO);
		frm.ajaxForm(options);
		frm.submit();
 	},

 	callComponent : function ( comName, action, call, success, output, extra ) {
 		
 		if(extra == null) {
 			var extra = new Array();
 		}
 		
 		var out = output || 'json';
 		var s = success || function( o ){};
 		
 		var args = { 
 			component : comName,
 			action : action,
 			call : call,
 			output : out
 		};
 		
		for(key in extra){
			args[ key ] = extra[ key ];
		}
 		
 		if(out == 'html' && success != null) {
 			s = function (o) {

 				var success =o.argument[0];
 				success ( o.responseText );
 			};
 		}
 		else if(out == 'json' && success != null) {
 			s = function (o) {

 				var success =o.argument[0];
				var json = WawJson.getObject ( o );
				success ( json );
 			};
 		}
 		
 		var cb = {
 
 			success : s,	
 			failure : function( o ){
 			},
 			argument : [ success ]
 		};
 		
 		WawConnectClient.doRequest (args, cb);
 	},
 	
 	setPage : function(page){
 		
 		this.page = page;
 	},

 	getPage : function(){
 		
 		return this.page;
 	},
 	
 	submitForm : function(id){
 		
 		$('#'+id).submit();
 	}
	
};
var WawClient = WawConnectClient;

var WawFormRegistration = {
		
		evDoneSave : function(msg) {
		
		},
		
		evDoneValidateField : function( errMsg ) {
			
		},
		
		typeForm : 'add',
		
		validate : function(id){
			
			var cb = {
				upload: WawFormRegistration._callBackJson,
				argument : [id]
			}
			var formObject = $('#regForm'+id);
			WawConnectClient.doPost(formObject, cb);
		},
		
		getValidateCol : function (id) {
			
			var success = function ( json ) {
				
				var field = $('#'+json.result.prefix + json.result.col); // HTML input field
				var errMsg = $('#errmsg_' + json.result.col); // Error message
				var className = 'text'; // Default text class
				var error = '';
				
				if( json.result.state == 1) {

					className = 'textError';
					error = json.result.msg;
				}
				
				if(field != null && errMsg != null) {

					var w = field.css('width');
					field.attr('class',className);
					field.css('width', w);
					errMsg.text(error);
				}
				
				WawFormRegistration.evDoneValidateField ( errMsg );
			};

			var comId = $('#componentid_register').val();
			var fieldValue = $('#'+id).val();
			
			if( comId != null || comId != undefined ) {
				var other = { "field" : id, "componentid" : comId, 'value' : fieldValue, typeform : WawFormRegistration.typeForm };
				WawClient.callComponent ( 'registration', 'add', 'validate_field', success, 'json', other );
			}
		},
		
		_checkInputs : function(o) {
			
			var canSave = true;
			
			try{
				
				var id = o.argument[0];
				$('#errorMessages').text( '' );
				
				var json = WawJson.getObject(o);
				
				for(var i=0; i < json.result.length; i++){
					
					var tmpInp = $('#'+json.result[i].prefix+json.result[i].col);
					
					if(json.result[i].state == 1){
						
						if(tmpInp != null) {
							
							if(tmpInp.attr('type') != 'checkbox'){
								
								var w = tmpInp.css('width');
								tmpInp.attr('class', 'textError');
								tmpInp.css('width', w);
							}
						}
						
						var inpSect = $('#errmsg_' + json.result[i].col);
						
						if(inpSect != null) {
							inpSect.text( json.result[i].msg );
						}
						else {
							var em = document.createElement('div');
							em.innerHTML = json.result[i].msg;
							$('#errorMessages').html (em);
						}
						var canSave = false;
					}
					else{
						
						if(tmpInp != null) {

							if(tmpInp.attr('type') != 'checkbox'){
								tmpInp.attr('class', 'text');
							}
							$('#errmsg_' + json.result[i].col).text('');
						}
					}
				}
			}
			catch(e){
				return false;
			}
			return canSave;
		},
		
		_callBackJson : function(o){

			try{

				var canSave = WawFormRegistration._checkInputs(o);
				
				var id = o.argument[0];
				if(canSave){
					
					$('#regFormTask'+id).attr('value', 'save_new_registration');
					WawConnectClient.doPost($('#regForm'+id), {
						upload: WawFormRegistration._callBackJsonSave,
						argument : [id]
					});
				}
				else {
					if(WawFormRegistration.evDoneSave!=null) {
						WawFormRegistration.evDoneSave('');
					}
				}
			}
			catch(e){
			}
		},
		
		_callBackJsonSave : function(o){
			try{
				var id = o.argument[0];
				var json = WawJson.getObject(o);
				if(json.result.state != '-1') window.location.href = json.result.link;
			}
			catch(e){}
		},
		
		copyFieldsVisitToWork : function(){
			
			if($('#copyCheckbox').attr('checked') == true) {

				var countyId = $('#address_work_country option:selected').val();
				$('#address_work_country option').each(function(){
					if($(this).val() == countyId) {
						$(this).attr('selected', 'selected');
					}
				});
				
				$('#address_deliver').attr('value', $('#address_work').val() );
				$('#address_deliver_no').attr('value', $('#address_work_no').val() );
				$('#address_deliver_zipcode').attr('value', $('#address_work_zipcode').val() );
				$('#address_deliver_city').attr('value', $('#address_work_city').val() );
				$('#address_deliver_no_suffix').attr('value', $('#address_work_no_suffix').val() );
			}
		},
		
		validateUpdate : function(id){
			
			var cb = {
			
				upload: function(o){
				
				var id = o.argument[0];
				var canSave = WawFormRegistration._checkInputs(o);
				
				if(canSave){
					
					$('#regFormTask'+id).attr('value', 'update_registration');
					
					var cb = {
					 upload: function(o2){
						var json = WawJson.getObject(o2);
						
						$('#errorMessages').text( json.result.msgsaved );
						
							if(WawFormRegistration.evDoneSave!=null) {
								WawFormRegistration.evDoneSave(json.result.msgsaved);
							}
							
							$('#regFormTask'+id).attr('value', 'validate_form');
							
							if(json.result.image.length > 0) {
								
								var imgElm = document.getElementById('picture-example');
								if(imgElm != null) {
									var img = document.createElement('img');
									img.src = '/service_website.php?service=website_images&task=getimagesecured&shortcode=' + json.result.image;
									img.alt = '';
									imgElm.innerHTML = '';
									imgElm.appendChild( img );
								}
							}
							
						},
						argument : [id]
					}
					WawConnectClient.doPost($('#regForm'+id), cb);
				}
				else {
					
					$('#regFormTask'+id).attr('value', 'validate_form');
					if(WawFormRegistration.evDoneSave!=null) {
						WawFormRegistration.evDoneSave('');
					}
				}
				
			},
				argument : [id]
			}
			WawConnectClient.doPost($('#regForm'+id), cb);
		}
};

var WawPublicLogin = {
	
	doLogin : function(id1, id2, id3){
		
		if(document.getElementById(id1).value.length > 0 && document.getElementById(id2).value.length > 0){
			document.getElementById(id3).submit();
		}
		else if(document.getElementById(id1).value.length == 0){
			alert('Vul een gebruikersnaam in');			
		}
		else if(document.getElementById(id2).value.length == 0){
			alert('Vul een wachtwoord in');
		}
	},
	doLogout : function() {
	    var success = function ( response ) {
	    
	    };

	    var other = { };
	    WawClient.callComponent ( 'login', 'view', 'do_logout', success, 'html', other );
	}	
};

var WawLoginInput = function(elmId, nextElmId, proxy){
	
	this.labelText = '';
	
	this.inp = $( '#'+elmId );
	
	this.proxy = $( '#'+proxy );
	
	if(this.inp != null) {
		this.labelText = this.inp.value;
	}
	
	var me = this;
	
	var cbInp = function () {
		if(me.inp.value == me.labelText) {
			me.inp.value = '';
		}
		me.inp.select();
	};
	
	$('#'+elmId).die('focus');
	$('#'+elmId).bind('focus', function(){
		
		if(me.inp.value == me.labelText) {
			me.inp.value = '';
		}
		me.inp.select();
	});

	$('#'+elmId).die('blur');
	$('#'+elmId).bind('blur', function(){
		
		if(me.inp.val().length == 0) {
			me.inp.attr('value', me.labelText);
		}
		
		if($('#' + nextElmId) != null) {
			
			me.proxy.css('display', 'none');
			$('#'+nextElmId).css('display', 'block');
			document.getElementById(nextElmId).focus();
		}
	});

};

var WawLoginPassword = function(elmId, proxy){

	this.labelText = '';
	
	this.inp = $( '#'+elmId );
	
	if(this.inp != null) {
		
		this.inp.style.display = 'none';
	}
	
	this.proxy = $( '#'+proxy );
	
	if(this.proxy != null) {
		
		this.proxy.css('display', 'block');
		this.labelText = this.proxy.value;
	}
	
	var me = this;

	$('#'+proxy).die('focus');
	$('#'+proxy).bind('focus', function(){
		
		me.proxy.css('display', 'none');
		me.inp.css('display', 'block');
	});	
	
	$('#'+elmId).die('blur');
	$('#'+elmId).bind('blur', function(){
		if(me.inp.value.length == 0) {

			me.proxy.css('display', 'block');
			me.inp.css('display', 'none');
		}
	});
};

var doPressKeyLogin = function (e,user,pass,section){
	if(WawSystemKeys.enterKeyPressed(e)){
		WawPublicLogin.doLogin(user,pass,section);
	}	
}

var WawPublicForm = {
		
	hasErrors : false,
	
	isAll : false,
	
	countForms : 0,
	
	loadForms : [],
	
	appendForm : function(formId) {
		
		WawPublicForm.loadForms.push(formId);	
	},
	
	columnName : '',
	
	selectSort : function(obj) {
		
		var link = obj[obj.selectedIndex].value;
		window.location.href = link;
	},
	
	checkForm : function(id, isAll){
		
		if(isAll == null) {
			WawPublicForm.isAll = false;
		}
		else {
			WawPublicForm.isAll = isAll;
		}
		
		var cb2 = {
		 upload: function(o){
			
			try{
				var json = WawJson.getObject(o);
				
				var hasErrors = 0;
				
				if(json.result.length > 0) {
					
					for(var i=0; i < json.result.length; i++) {
						
						if(json.result[i].state != null) {
							
							if(json.result[i].state == '1') {

								WawPublicForm.setErrorMsg( json.result[i].col, json.result[i].msg);
							}
						}
					}	
				}
				
				if(! WawPublicForm.isAll) {
					
					if(json.error == 0) {
						
						window.location.href = json.link_success;	
					}
					else {
						
						WawPublicForm.hassErrors = true;
					}
				}
				else {
					
					if(json.error == 0) {
						
						WawPublicForm.countForms = WawPublicForm.countForms + 1;
						
						if(WawPublicForm.loadForms.length == WawPublicForm.countForms) {
							
							window.location.href = json.link_success;
						}
					}
					else {
						
						WawPublicForm.hassErrors = true;
					}
				}
			}
			catch(e){
				
			}
		},
		argument : [id]
		}
		WawConnectClient.doPost($(id), cb2);
		return false;
	},
	
	setErrorMsg : function( col, msg ) {
		
		var errMsgId = 'error' + col;
		$ ( '#'+errMsgId ).text( msg );
	},
	
	setErrorInput : function(col){
		
		var colId = 'col_' + col;	
		if($ ( '#'+colId ) != null) {
			$( '#'+colId ).attr( 'class', 'errorText' );
		}
		else {
			$( '#'+colId ).attr( 'class', 'text' );
		}		
	},
	
	setStdInput : function(col){
		
		var colId = 'col_' + col;
		if($ ( '#'+colId ) != null) {
			$( '#'+colId ).attr( 'class', 'text' );
		}
	},	
	
	callBackValid : {
		
		success : function(o){
			
			try{

				var json = WawJson.getObject(o);
				
				if(json.result.error == '1'){
					
					WawPublicForm.setErrorMsg( WawPublicForm.columnName, json.result.msg);
					WawPublicForm.setErrorInput( WawPublicForm.columnName);
				}
				else {

					WawPublicForm.setErrorMsg( WawPublicForm.columnName, '');
					WawPublicForm.setStdInput( WawPublicForm.columnName);
				}
			}
			catch(e){
				
			}
		}
	},
	
	callBackDate : {
		
		success : function(o){
			
			try{
				
				var json = WawJson.getObject(o);
				
				WawPublicForm.setErrorMsg( WawPublicForm.columnName, json.result.msg);
			}
			catch(e){
				
			}
		}
	},	
	
	setShopWorkFlowFinancial : function(frmId, comId){
		
		var cb = {
			success : function(o){
				$('#'+frmId).submit();
			},
			failure : function(o){
				
			}
		}
		var args = { component : 'ideal', action : 'add', call : 'set_shop_workflow_financial', cid : comId };
		WawConnectClient.doRequest( args, cb );
	},
	
	checkOutPaymentFinancial : function(frmId, comId){
		
		var cb = {
			success : function(o){
				$('#'+frmId).submit();
			},
			failure : function(o){
				
			}
		}
		var args = { component : 'ideal', action : 'add', call : 'check_out_shop_financial', cid : comId };
		WawConnectClient.doRequest( args, cb );
	},	
	
	validateDate : function (colName) {

		return function(){

			WawPublicForm.columnName = colName;
			
			var yearId = 'col_year_' + colName;
			var monthId = 'col_month_' + colName;
			var dayId = 'col_day_' + colName;
			var year = '';
			var month = '';
			var day = '';
			var oYear = $(yearId);
			if(oYear != null) {
				year = $('#' + yearId + ' :selected').val();
			}
			if($(monthId) != null) {
				month = $('#' + monthId + ' :selected').val();
			}
			if($(dayId) != null) {
				day = $('#' + dayId + ' :selected').val();
			}
			
			var args = { service : 'website_forms', task : 'validate_date', val : colName, year : year, month : month, day : day };
			WawConnectClient.doRequest( args, WawPublicForm.callBackDate );
		}
	},
	
	validateLength : function (colName) {
		
		return WawPublicForm.validateValue (colName, WawPublicForm.callBackValid, { service : 'website_forms', task : 'validate_length', year : '', month : '', day : '' });
	},
	
	validateEmail : function (colName) {
		
		return WawPublicForm.validateValue (colName, WawPublicForm.callBackValid, { service : 'website_forms', task : 'validate_email', year : '', month : '', day : '' });
	},
	
	validateUrl : function (colName) {
		
		return WawPublicForm.validateValue (colName, WawPublicForm.callBackValid, { service : 'website_forms', task : 'validate_url', year : '', month : '', day : '' });
	},	
	
	validateValue : function(colName, callBack, opts) {
		
		return function(){

			WawPublicForm.columnName = colName;
			
			var oCol = $('#col_' + colName);
			if(oCol != null) {
				var col = oCol.val();
				var args = { service : opts.service, task : opts.task, val : col, year : opts.year, month : opts.month, day : opts.day };
				WawConnectClient.doRequest( args, callBack );
			}
		}
	},
	
	validateField : function( fieldName ) {
		
		var cb = function(o){
			
			if( parseInt(o["result"]["msg"].length) > 0 ) {
				
				var elmInp = document.getElementById(o["result"]["html_id"]);
				if( elmInp != null) {
					elmInp.className = 'textError';
				}
				
				var elmErr = document.getElementById(o["result"]["msgid"]);
				
				if( elmErr != null ) {
					$('#'+o["result"]["msgid"]).text( o["result"]["msg"] );
				}
				else {
					$('.errorMessage').html(o["result"]["msg"]);
				}
			}
			else {

				var elmInp = document.getElementById(o["result"]["html_id"]);
				if( elmInp != null) {
					elmInp.className = 'text';
				}
				$('#'+o["result"]["msgid"]).text( '' );
				$('.errorMessage').html('');
			}
			
			bindContactForm();
		};
		
		var fieldValue = $('#'+fieldName).val();
		var comId = $('#frmcomponentid').val();
		var formId = $('#formid'+comId).val();
		var other = { "field" : fieldName, "componentid" : comId, "value" : fieldValue, formid : formId };
		WawClient.callComponent ( 'form', 'add', 'validate_field', cb, 'json', other );
	},
	
	validate : function(id){
		if(id.length > 0  && id != null){
			var cb = {
			 upload: function(o){
					WawPublicForm._callBackJson(o);
				},
				argument : [id]
			}
			WawConnectClient.doPost($('#generalForm'+id), cb);
		}
	},

	_callBackJson : function(o){
		var formId = o.argument[0];

		try{
			var json = WawJson.getObject(o);

			if(json != null){
				
				if(json.result.length > 0){
					
					var oGFrm = $('#generalForm' + formId);
					oGFrm.find('input[type="text"].text').each( function(index) {
						$(this).attr('class', 'text');
					} );
					oGFrm.find('input[type="text"].textError').each( function(index) {
						$(this).attr('class', 'text');
					} );

					// Has Errors
					for(var i=0; i<json.result.length; i++) {
						
						if( json.result[i].state == 1) {
							$('#'+json.result[i].html_id).attr('class', 'textError');
							var elm = $('#'+json.result[i].msgid);
							if(elm != null) {
								elm.innerHTML = json.result[i].msg;
							}
						}
						$('body').trigger('event_form_validate', { id : json.result[i].html_id, msg : json.result[i].msg })
					}
				}
				else{
					
					// Submit form
					$('#formTask' + formId).attr( 'value', 'sent_form' );
					WawPublicForm.sent(formId);
				}
			}
		}
		catch(e){
		}
	},
	
	saveAllForms : function() {
		
		for(var i = 0; i < WawPublicForm.loadForms.length; i++) {
			WawPublicForm.checkForm( WawPublicForm.loadForms[i], true );
		}
	},
	
	sent : function(id){
		if(id.length > 0  && id != null){
			var cb = {
			 upload: 
				WawPublicForm._callBackSentJson	,
				argument : [id]
			}
			WawConnectClient.doPost($('#generalForm'+id), cb);
		}		
	},
	
	_callBackSentJson : function(o){
		var formId = o.argument[0];
		
		try{
			var json = WawJson.getObject(o);
			
			if(json.result.state == '1'){
				var nwLink = json.result.link.replace('&amp;', '&');
				window.location.href = nwLink;
			}
		}
		catch(e){
		}
	}	
};

var WawValidateType = {
		
		number : 0,
		currency : 1,
		phone : 2,
		email : 3,
		zipcode : 4,
		chars : 5,
		url : 6
		
};

var WawInputValidate = function(elmId, valType, cb) {
	
	this.elmId = elmId;
	
	var me = this;
	
	this.callServer = function(args, task, callBack, output) {
		
		WawClient.callComponent ( 'validation', 'view', task, callBack, output, args );
	}
	
	var elm = $('#'+elmId);
	elm.bind('blur', 'click', function(){
		
		var sArgs = {
				'val' : encodeURIComponent(elm.val())
		};
		
		var cbServ = function(json) {
			cb(me.elmId, json);
		}
		
		switch(valType) {
		
			default:
				cb(me.elmId, { result : { state : 0 } });
				break;
			case WawValidateType.number:
				me.callServer(sArgs, 'validate_number', cbServ);
				break;
			case WawValidateType.currency:
				me.callServer(sArgs, 'validate_currency', cbServ);
				break;
			case WawValidateType.phone:
				me.callServer(sArgs, 'validate_phone', cbServ);
				break;
			case WawValidateType.email:
				me.callServer(sArgs, 'validate_email', cbServ);
				break;
			case WawValidateType.zipcode:
				me.callServer(sArgs, 'validate_zipcode', cbServ);
				break;
			case WawValidateType.chars:
				me.callServer(sArgs, 'validate_characters_only', cbServ);
				break;
			case WawValidateType.url:
				me.callServer(sArgs, 'validate_url', cbServ);
				break;
		}
	})
}


var WawCookie = {
	 	
	createCookie :  function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	},
	createCookiePath : function(name,value,days,path) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=" + path;
	},
	readCookie : function (name) {
	try{
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
		}
		catch(e){
			
		}
		return null;
	},
	eraseCookie : function (name) {
		WawCookie.createCookie(name,"",-1);
	}
};

var bindContactForm = function(){
	
	$('body').find('form.contactform').each(function(index){
		var obj = $(this);
		obj.undelegate( 'input[type="text"].text', "blur" );
		obj.delegate('input[type="text"].text', "blur", function(){
			var me2 = this;
			WawPublicForm.validateField ( me2.name );
		});	
	});

	$('body').find('form.contactform').each(function(index){
		var obj = $(this);
		obj.undelegate( 'input[type="text"].textError', "blur" );
		obj.delegate('input[type="text"].textError', "blur", function(){
			var me2 = this;
			WawPublicForm.validateField ( me2.name );
		});	
	});
}

var bindRegForm = function(){
	
	$('body').find('form.registrationform').each(function(index){

		var obj = $(this);
		obj.undelegate( 'input[type="text"].text', "blur" );
		obj.delegate('input[type="text"].text', "blur", function(){
			var me2 = this;
			WawFormRegistration.getValidateCol ( me2.name );
		});	
	});

	$('body').find('form.registrationform').each(function(index){
		var obj = $(this);
		obj.undelegate( 'input[type="text"].text', "blur" );
		obj.delegate('input[type="text"].text', "blur", function(){
			var me2 = this;
			WawFormRegistration.getValidateCol ( me2.name );
		});	
	});
}

$(document).ready(function() {

	var lnkCapt = $('#reloadcaptcha');
	if( lnkCapt != null ) {
		
		lnkCapt.die('click');
		lnkCapt.bind('click', function(){
			var img = document.getElementById('captcha');
			if(img != null) {
				img.src = img.src + '&' + Math.random();
			}
		});
	}

	bindRegForm();
	bindContactForm();

});
;

