var checkboxHeight="30";var radioHeight="30";var selectWidth="237";document.write('<style type="text/css"> select.styled {position: relative; width: '+selectWidth+"px; opacity: 0; filter: alpha(opacity=0); z-index: 5;}</style>");var Custom={init:function(){var e=document.getElementsByTagName("input"),g=Array(),c,f,h;for(a=0;a<e.length;a++){if((e[a].type=="checkbox"||e[a].type=="radio")&&e[a].className=="styled"){g[a]=document.createElement("span");g[a].className=e[a].type;if(e[a].checked==true){if(e[a].type=="checkbox"){position="0 -"+(checkboxHeight*2)+"px";g[a].style.backgroundPosition=position}else{position="0 -"+(radioHeight*2)+"px";g[a].style.backgroundPosition=position}}e[a].parentNode.insertBefore(g[a],e[a]);e[a].onchange=Custom.clear;g[a].onmousedown=Custom.pushed;g[a].onmouseup=Custom.check;document.onmouseup=Custom.clear}}e=document.getElementsByTagName("select");for(a=0;a<e.length;a++){if(e[a].className=="styled"){f=e[a].getElementsByTagName("option");h=f[0].childNodes[0].nodeValue;c=document.createTextNode(h);for(b=0;b<f.length;b++){if(f[b].selected==true){c=document.createTextNode(f[b].childNodes[0].nodeValue)}}g[a]=document.createElement("span");g[a].className="select";g[a].id="select"+e[a].name;g[a].appendChild(c);e[a].parentNode.insertBefore(g[a],e[a]);e[a].onchange=Custom.choose}}},pushed:function(){element=this.nextSibling;if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*3+"px"}else{if(element.checked==true&&element.type=="radio"){this.style.backgroundPosition="0 -"+radioHeight*3+"px"}else{if(element.checked!=true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight+"px"}else{this.style.backgroundPosition="0 -"+radioHeight+"px"}}}},check:function(){element=this.nextSibling;if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 0";element.checked=false}else{if(element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*2+"px"}else{this.style.backgroundPosition="0 -"+radioHeight*2+"px";group=this.nextSibling.name;inputs=document.getElementsByTagName("input");for(a=0;a<inputs.length;a++){if(inputs[a].name==group&&inputs[a]!=this.nextSibling){inputs[a].previousSibling.style.backgroundPosition="0 0"}}}element.checked=true}},clear:function(){inputs=document.getElementsByTagName("input");for(var c=0;c<inputs.length;c++){if(inputs[c].type=="checkbox"&&inputs[c].checked==true&&inputs[c].className=="styled"){inputs[c].previousSibling.style.backgroundPosition="0 -"+checkboxHeight*2+"px"}else{if(inputs[c].type=="checkbox"&&inputs[c].className=="styled"){inputs[c].previousSibling.style.backgroundPosition="0 0"}else{if(inputs[c].type=="radio"&&inputs[c].checked==true&&inputs[c].className=="styled"){inputs[c].previousSibling.style.backgroundPosition="0 -"+radioHeight*2+"px"}else{if(inputs[c].type=="radio"&&inputs[c].className=="styled"){inputs[c].previousSibling.style.backgroundPosition="0 0"}}}}}},choose:function(){option=this.getElementsByTagName("option");for(d=0;d<option.length;d++){if(option[d].selected==true){document.getElementById("select"+this.name).childNodes[0].nodeValue=option[d].childNodes[0].nodeValue}}}};window.onload=Custom.init;(function(f){var g=(f.browser.msie?"paste":"input")+".mask";var e=(window.orientation!=undefined);f.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};f.fn.extend({caret:function(h,c){if(this.length==0){return}if(typeof h=="number"){c=(typeof c=="number")?c:h;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(h,c)}else{if(this.createTextRange){var j=this.createTextRange();j.collapse(true);j.moveEnd("character",c);j.moveStart("character",h);j.select()}}})}else{if(this[0].setSelectionRange){h=this[0].selectionStart;c=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var i=document.selection.createRange();h=0-i.duplicate().moveStart("character",-100000);c=h+i.text.length}}return{begin:h,end:c}}},unmask:function(){return this.trigger("unmask")},mask:function(l,r){if(!l&&this.length>0){var p=f(this[0]);var o=p.data("tests");return f.map(p.data("buffer"),function(i,h){return o[h]?i:null}).join("")}r=f.extend({placeholder:"_",completed:null},r);var c=f.mask.definitions;var o=[];var q=l.length;var m=null;var n=l.length;f.each(l.split(""),function(h,i){if(i=="?"){n--;q=h}else{if(c[i]){o.push(new RegExp(c[i]));if(m==null){m=o.length-1}}else{o.push(null)}}});return this.each(function(){var h=f(this);var y=f.map(l.split(""),function(s,t){if(s!="?"){return c[s]?r.placeholder:s}});var x=false;var i=h.val();h.data("buffer",y).data("tests",o);function B(s){while(++s<=n&&!o[s]){}return s}function D(s){while(!o[s]&&--s>=0){}for(var u=s;u<n;u++){if(o[u]){y[u]=r.placeholder;var t=B(u);if(t<n&&o[u].test(y[t])){y[u]=y[t]}else{break}}}E();h.caret(Math.max(m,s))}function C(w){for(var t=w,u=r.placeholder;t<n;t++){if(o[t]){var v=B(t);var s=y[t];y[t]=u;if(v<n&&o[v].test(s)){u=s}else{break}}}}function z(u){var s=f(this).caret();var t=u.keyCode;x=(t<16||(t>16&&t<32)||(t>32&&t<41));if((s.begin-s.end)!=0&&(!x||t==8||t==46)){A(s.begin,s.end)}if(t==8||t==46||(e&&t==127)){D(s.begin+(t==46?0:-1));return false}else{if(t==27){h.val(i);h.caret(0,j());return false}}}function k(F){if(x){x=false;return(F.keyCode==8)?false:null}F=F||window.event;var v=F.charCode||F.keyCode||F.which;var u=f(this).caret();if(F.ctrlKey||F.altKey||F.metaKey){return true}else{if((v>=32&&v<=125)||v>186){var t=B(u.begin-1);if(t<n){var s=String.fromCharCode(v);if(o[t].test(s)){C(t);y[t]=s;E();var w=B(t);f(this).caret(w);if(r.completed&&w==n){r.completed.call(h)}}}}}return false}function A(s,u){for(var t=s;t<u&&t<n;t++){if(o[t]){y[t]=r.placeholder}}}function E(){return h.val(y.join("")).val()}function j(F){var v=h.val();var u=-1;for(var w=0,t=0;w<n;w++){if(o[w]){y[w]=r.placeholder;while(t++<v.length){var s=v.charAt(t-1);if(o[w].test(s)){y[w]=s;u=w;break}}if(t>v.length){break}}else{if(y[w]==v[t]&&w!=q){t++;u=w}}}if(!F&&u+1<q){h.val("");A(0,n)}else{if(F||u+1>=q){E();if(!F){h.val(h.val().substring(0,u+1))}}}return(q?w:m)}if(!h.attr("readonly")){h.one("unmask",function(){h.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){i=h.val();var s=j();E();setTimeout(function(){if(s==l.length){h.caret(0,s)}else{h.caret(s)}},0)}).bind("blur.mask",function(){j();if(h.val()!=i){h.change()}}).bind("keydown.mask",z).bind("keypress.mask",k).bind(g,function(){setTimeout(function(){h.caret(j(true))},0)})}j()})}})})(jQuery);(function(e){e.fn.ajaxSubmit=function(v){if(!this.length){c("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof v=="function"){v={success:v}}var h=e.trim(this.attr("action"));if(h){h=(h.match(/^([^#]+)/)||[])[1]}h=h||window.location.href||"";v=e.extend({url:h,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},v||{});var x={};this.trigger("form-pre-serialize",[this,v,x]);if(x.veto){c("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(v.beforeSerialize&&v.beforeSerialize(this,v)===false){c("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var r=this.formToArray(v.semantic);if(v.data){v.extraData=v.data;for(var i in v.data){if(v.data[i] instanceof Array){for(var l in v.data[i]){r.push({name:i,value:v.data[i][l]})}}else{r.push({name:i,value:v.data[i]})}}}if(v.beforeSubmit&&v.beforeSubmit(r,this,v)===false){c("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[r,this,v,x]);if(x.veto){c("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var g=e.param(r);if(v.type.toUpperCase()=="GET"){v.url+=(v.url.indexOf("?")>=0?"&":"?")+g;v.data=null}else{v.data=g}var w=this,p=[];if(v.resetForm){p.push(function(){w.resetForm()})}if(v.clearForm){p.push(function(){w.clearForm()})}if(!v.dataType&&v.target){var t=v.success||function(){};p.push(function(j){e(v.target).html(j).each(t,arguments)})}else{if(v.success){p.push(v.success)}}v.success=function(q,k){for(var n=0,j=p.length;n<j;n++){p[n].apply(v,[q,k,w])}};var f=e("input:file",this).fieldValue();var u=false;for(var o=0;o<f.length;o++){if(f[o]){u=true}}var m=false;if((f.length&&v.iframe!==false)||v.iframe||u||m){if(v.closeKeepAlive){e.get(v.closeKeepAlive,s)}else{s()}}else{e.ajax(v)}this.trigger("form-submit-notify",[this,v]);return this;function s(){var z=w[0];if(e(":input[name=submit]",z).length){alert('Error: Form elements must not be named "submit".');return}var q=e.extend({},e.ajaxSettings,v);var J=e.extend(true,{},e.extend(true,{},e.ajaxSettings),q);var y="jqFormIO"+(new Date().getTime());var F=e('<iframe id="'+y+'" name="'+y+'" src="'+q.iframeSrc+'" />');var H=F[0];F.css({position:"absolute",top:"-1000px",left:"-1000px"});var I={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;F.attr("src",q.iframeSrc)}};var G=q.global;if(G&&!e.active++){e.event.trigger("ajaxStart")}if(G){e.event.trigger("ajaxSend",[I,q])}if(J.beforeSend&&J.beforeSend(I,J)===false){J.global&&e.active--;return}if(I.aborted){return}var k=0;var C=0;var j=z.clk;if(j){var A=j.name;if(A&&!j.disabled){v.extraData=v.extraData||{};v.extraData[A]=j.value;if(j.type=="image"){v.extraData[name+".x"]=z.clk_x;v.extraData[name+".y"]=z.clk_y}}}setTimeout(function(){var M=w.attr("target"),K=w.attr("action");z.setAttribute("target",y);if(z.getAttribute("method")!="POST"){z.setAttribute("method","POST")}if(z.getAttribute("action")!=q.url){z.setAttribute("action",q.url)}if(!v.skipEncodingOverride){w.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(q.timeout){setTimeout(function(){C=true;D()},q.timeout)}var L=[];try{if(v.extraData){for(var N in v.extraData){L.push(e('<input type="hidden" name="'+N+'" value="'+v.extraData[N]+'" />').appendTo(z)[0])}}F.appendTo("body");H.attachEvent?H.attachEvent("onload",D):H.addEventListener("load",D,false);z.submit()}finally{z.setAttribute("action",K);M?z.setAttribute("target",M):w.removeAttr("target");e(L).remove()}},10);var B=50;function D(){if(k++){return}H.detachEvent?H.detachEvent("onload",D):H.removeEventListener("load",D,false);var K=true;try{if(C){throw"timeout"}var L,O;O=H.contentWindow?H.contentWindow.document:H.contentDocument?H.contentDocument:H.document;var P=q.dataType=="xml"||O.XMLDocument||e.isXMLDoc(O);c("isXml="+P);if(!P&&(O.body==null||O.body.innerHTML=="")){if(--B){k=0;setTimeout(D,100);return}c("Could not access iframe DOM after 50 tries.");return}I.responseText=O.body?O.body.innerHTML:null;I.responseXML=O.XMLDocument?O.XMLDocument:O;I.getResponseHeader=function(R){var Q={"content-type":q.dataType};return Q[R]};if(q.dataType=="json"||q.dataType=="script"){var n=O.getElementsByTagName("textarea")[0];if(n){I.responseText=n.value}else{var N=O.getElementsByTagName("pre")[0];if(N){I.responseText=N.innerHTML}}}else{if(q.dataType=="xml"&&!I.responseXML&&I.responseText!=null){I.responseXML=E(I.responseText)}}L=e.httpData(I,q.dataType)}catch(M){K=false;e.handleError(q,I,"error",M)}if(K){q.success(L,"success");if(G){e.event.trigger("ajaxSuccess",[I,q])}}if(G){e.event.trigger("ajaxComplete",[I,q])}if(G&&!--e.active){e.event.trigger("ajaxStop")}if(q.complete){q.complete(I,K?"success":"error")}setTimeout(function(){F.remove();I.responseXML=null},100)}function E(n,K){if(window.ActiveXObject){K=new ActiveXObject("Microsoft.XMLDOM");K.async="false";K.loadXML(n)}else{K=(new DOMParser()).parseFromString(n,"text/xml")}return(K&&K.documentElement&&K.documentElement.tagName!="parsererror")?K:null}}};e.fn.ajaxForm=function(f){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){e(this).ajaxSubmit(f);return false}).bind("click.form-plugin",function(k){var j=k.target;var h=e(j);if(!(h.is(":submit,input:image"))){var g=h.closest(":submit");if(g.length==0){return}j=g[0]}var i=this;i.clk=j;if(j.type=="image"){if(k.offsetX!=undefined){i.clk_x=k.offsetX;i.clk_y=k.offsetY}else{if(typeof e.fn.offset=="function"){var l=h.offset();i.clk_x=k.pageX-l.left;i.clk_y=k.pageY-l.top}else{i.clk_x=k.pageX-j.offsetLeft;i.clk_y=k.pageY-j.offsetTop}}}setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)})};e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};e.fn.formToArray=function(t){var s=[];if(this.length==0){return s}var g=this[0];var m=t?g.getElementsByTagName("*"):g.elements;if(!m){return s}for(var o=0,q=m.length;o<q;o++){var h=m[o];var k=h.name;if(!k){continue}if(t&&g.clk&&h.type=="image"){if(!h.disabled&&g.clk==h){s.push({name:k,value:e(h).val()});s.push({name:k+".x",value:g.clk_x},{name:k+".y",value:g.clk_y})}continue}var u=e.fieldValue(h,true);if(u&&u.constructor==Array){for(var l=0,f=u.length;l<f;l++){s.push({name:k,value:u[l]})}}else{if(u!==null&&typeof u!="undefined"){s.push({name:k,value:u})}}}if(!t&&g.clk){var p=e(g.clk),r=p[0],k=r.name;if(k&&!r.disabled&&r.type=="image"){s.push({name:k,value:p.val()});s.push({name:k+".x",value:g.clk_x},{name:k+".y",value:g.clk_y})}}return s};e.fn.formSerialize=function(f){return e.param(this.formToArray(f))};e.fn.fieldSerialize=function(g){var f=[];this.each(function(){var l=this.name;if(!l){return}var j=e.fieldValue(this,g);if(j&&j.constructor==Array){for(var k=0,h=j.length;k<h;k++){f.push({name:l,value:j[k]})}}else{if(j!==null&&typeof j!="undefined"){f.push({name:this.name,value:j})}}});return e.param(f)};e.fn.fieldValue=function(l){for(var k=[],h=0,f=this.length;h<f;h++){var j=this[h];var g=e.fieldValue(j,l);if(g===null||typeof g=="undefined"||(g.constructor==Array&&!g.length)){continue}g.constructor==Array?e.merge(k,g):k.push(g)}return k};e.fieldValue=function(f,m){var h=f.name,s=f.type,u=f.tagName.toLowerCase();if(typeof m=="undefined"){m=true}if(m&&(!h||f.disabled||s=="reset"||s=="button"||(s=="checkbox"||s=="radio")&&!f.checked||(s=="submit"||s=="image")&&f.form&&f.form.clk!=f||u=="select"&&f.selectedIndex==-1)){return null}if(u=="select"){var o=f.selectedIndex;if(o<0){return null}var q=[],g=f.options;var k=(s=="select-one");var p=(k?o+1:g.length);for(var j=(k?o:0);j<p;j++){var l=g[j];if(l.selected){var r=l.value;if(!r){r=(l.attributes&&l.attributes.value&&!(l.attributes.value.specified))?l.text:l.value}if(k){return r}q.push(r)}}return q}return f.value};e.fn.clearForm=function(){return this.each(function(){e("input,select,textarea",this).clearFields()})};e.fn.clearFields=e.fn.clearInputs=function(){return this.each(function(){var g=this.type,f=this.tagName.toLowerCase();if(g=="text"||g=="password"||f=="textarea"){this.value=""}else{if(g=="checkbox"||g=="radio"){this.checked=false}else{if(f=="select"){this.selectedIndex=-1}}}})};e.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};e.fn.enable=function(f){if(f==undefined){f=true}return this.each(function(){this.disabled=!f})};e.fn.selected=function(f){if(f==undefined){f=true}return this.each(function(){var g=this.type;if(g=="checkbox"||g=="radio"){this.checked=f}else{if(this.tagName.toLowerCase()=="option"){var h=e(this).parent("select");if(f&&h[0]&&h[0].type=="select-one"){h.find("option").selected(false)}this.selected=f}}})};function c(){if(e.fn.ajaxSubmit.debug&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}}})(jQuery);