/* IE Clear type fix */

(function ($) {

    $.fn.customFadeIn = function (speed, callback) {

        $(this).fadeIn(speed, function () {

            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');

            if (callback != undefined) callback();

        });

    };

    $.fn.customFadeOut = function (speed, callback) {

        $(this).fadeOut(speed, function () {

            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');

            if (callback != undefined) callback();

        });

    };

    $.fn.customFadeTo = function (speed, callback) {

        $(this).fadeTo(speed, function () {

            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');

            if (callback != undefined) callback();

        });

    };

    $.fn.customToggle = function (speed, callback) {

        $(this).toggle(speed, function () {

            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');

            if (callback != undefined) callback();

        });

    };



})(jQuery);



/* Disable autocomplete */

var flag = 1;

   function disAutoComplete(obj){

        if(flag){

      	obj.setAttribute("autocomplete","off");

            flag = 0;

      }

       //window.location = "#";

        obj.focus();

   }





/*

 * jQuery Form Plugin

 * version: 2.63 (29-JAN-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(b){b.fn.ajaxSubmit=function(t){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof t=="function"){t={success:t}}var h=this.attr("action");var d=(typeof h==="string")?b.trim(h):"";if(d){d=(d.match(/^([^#]+)/)||[])[1]}d=d||window.location.href||"";t=b.extend(true,{url:d,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var u={};this.trigger("form-pre-serialize",[this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(t.beforeSerialize&&t.beforeSerialize(this,t)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f,p,m=this.formToArray(t.semantic);if(t.data){t.extraData=t.data;for(f in t.data){if(t.data[f] instanceof Array){for(var i in t.data[f]){m.push({name:f,value:t.data[f][i]})}}else{p=t.data[f];p=b.isFunction(p)?p():p;m.push({name:f,value:p})}}}if(t.beforeSubmit&&t.beforeSubmit(m,this,t)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var c=b.param(m);if(t.type.toUpperCase()=="GET"){t.url+=(t.url.indexOf("?")>=0?"&":"?")+c;t.data=null}else{t.data=c}var s=this,l=[];if(t.resetForm){l.push(function(){s.resetForm()})}if(t.clearForm){l.push(function(){s.clearForm()})}if(!t.dataType&&t.target){var r=t.success||function(){};l.push(function(n){var k=t.replaceTarget?"replaceWith":"html";b(t.target)[k](n).each(r,arguments)})}else{if(t.success){l.push(t.success)}}t.success=function(w,n,x){var v=t.context||t;for(var q=0,k=l.length;q<k;q++){l[q].apply(v,[w,n,x||s,s])}};var g=b("input:file",this).length>0;var e="multipart/form-data";var j=(s.attr("enctype")==e||s.attr("encoding")==e);if(t.iframe!==false&&(g||t.iframe||j)){if(t.closeKeepAlive){b.get(t.closeKeepAlive,o)}else{o()}}else{b.ajax(t)}this.trigger("form-submit-notify",[this,t]);return this;function o(){var v=s[0];if(b(":input[name=submit],:input[id=submit]",v).length){alert('Error: Form elements must not have name or id of "submit".');return}var B=b.extend(true,{},b.ajaxSettings,t);B.context=B.context||B;var E="jqFormIO"+(new Date().getTime()),z="_"+E;var w=b('<iframe id="'+E+'" name="'+E+'" src="'+B.iframeSrc+'" />');var A=w[0];w.css({position:"absolute",top:"-1000px",left:"-1000px"});var x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;w.attr("src",B.iframeSrc)}};var I=B.global;if(I&&!b.active++){b.event.trigger("ajaxStart")}if(I){b.event.trigger("ajaxSend",[x,B])}if(B.beforeSend&&B.beforeSend.call(B.context,x,B)===false){if(B.global){b.active--}return}if(x.aborted){return}var H=0;var y=v.clk;if(y){var F=y.name;if(F&&!y.disabled){B.extraData=B.extraData||{};B.extraData[F]=y.value;if(y.type=="image"){B.extraData[F+".x"]=v.clk_x;B.extraData[F+".y"]=v.clk_y}}}function G(){var O=s.attr("target"),M=s.attr("action");v.setAttribute("target",E);if(v.getAttribute("method")!="POST"){v.setAttribute("method","POST")}if(v.getAttribute("action")!=B.url){v.setAttribute("action",B.url)}if(!B.skipEncodingOverride){s.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(B.timeout){setTimeout(function(){H=true;D()},B.timeout)}var N=[];try{if(B.extraData){for(var P in B.extraData){N.push(b('<input type="hidden" name="'+P+'" value="'+B.extraData[P]+'" />').appendTo(v)[0])}}w.appendTo("body");A.attachEvent?A.attachEvent("onload",D):A.addEventListener("load",D,false);v.submit()}finally{v.setAttribute("action",M);if(O){v.setAttribute("target",O)}else{s.removeAttr("target")}b(N).remove()}}if(B.forceSync){G()}else{setTimeout(G,10)}var K,L,J=50;function D(){L=A.contentWindow?A.contentWindow.document:A.contentDocument?A.contentDocument:A.document;if(!L||L.location.href==B.iframeSrc){return}A.detachEvent?A.detachEvent("onload",D):A.removeEventListener("load",D,false);var N=true;try{if(H){throw"timeout"}var R=B.dataType=="xml"||L.XMLDocument||b.isXMLDoc(L);a("isXml="+R);if(!R&&window.opera&&(L.body==null||L.body.innerHTML=="")){if(--J){a("requeing onLoad callback, DOM not available");setTimeout(D,250);return}}x.responseText=L.body?L.body.innerHTML:L.documentElement?L.documentElement.innerHTML:null;x.responseXML=L.XMLDocument?L.XMLDocument:L;x.getResponseHeader=function(T){var S={"content-type":B.dataType};return S[T]};var Q=/(json|script)/.test(B.dataType);if(Q||B.textarea){var M=L.getElementsByTagName("textarea")[0];if(M){x.responseText=M.value}else{if(Q){var P=L.getElementsByTagName("pre")[0];var n=L.getElementsByTagName("body")[0];if(P){x.responseText=P.textContent}else{if(n){x.responseText=n.innerHTML}}}}}else{if(B.dataType=="xml"&&!x.responseXML&&x.responseText!=null){x.responseXML=C(x.responseText)}}K=k(x,B.dataType,B)}catch(O){a("error caught:",O);N=false;x.error=O;B.error.call(B.context,x,"error",O);I&&b.event.trigger("ajaxError",[x,B,O])}if(x.aborted){a("upload aborted");N=false}if(N){B.success.call(B.context,K,"success",x);I&&b.event.trigger("ajaxSuccess",[x,B])}I&&b.event.trigger("ajaxComplete",[x,B]);if(I&&!--b.active){b.event.trigger("ajaxStop")}B.complete&&B.complete.call(B.context,x,N?"success":"error");setTimeout(function(){w.removeData("form-plugin-onload");w.remove();x.responseXML=null},100)}var C=b.parseXML||function(n,M){if(window.ActiveXObject){M=new ActiveXObject("Microsoft.XMLDOM");M.async="false";M.loadXML(n)}else{M=(new DOMParser()).parseFromString(n,"text/xml")}return(M&&M.documentElement&&M.documentElement.nodeName!="parsererror")?M:null};var q=b.parseJSON||function(n){return window["eval"]("("+n+")")};var k=function(Q,O,N){var M=Q.getResponseHeader("content-type")||"",n=O==="xml"||!O&&M.indexOf("xml")>=0,P=n?Q.responseXML:Q.responseText;if(n&&P.documentElement.nodeName==="parsererror"){b.error&&b.error("parsererror")}if(N&&N.dataFilter){P=N.dataFilter(P,O)}if(typeof P==="string"){if(O==="json"||!O&&M.indexOf("json")>=0){P=q(P)}else{if(O==="script"||!O&&M.indexOf("javascript")>=0){b.globalEval(P)}}}return P}}};b.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!b.isReady&&d.s){a("DOM not ready, queuing ajaxForm");b(function(){b(d.s,d.c).ajaxForm(c)});return this}a("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();b(this).ajaxSubmit(c)}}).bind("click.form-plugin",function(j){var i=j.target;var g=b(i);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length==0){return}i=f[0]}var h=this;h.clk=i;if(i.type=="image"){if(j.offsetX!=undefined){h.clk_x=j.offsetX;h.clk_y=j.offsetY}else{if(typeof b.fn.offset=="function"){var k=g.offset();h.clk_x=j.pageX-k.left;h.clk_y=j.pageY-k.top}else{h.clk_x=j.pageX-i.offsetLeft;h.clk_y=j.pageY-i.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length===0){return p}var d=this[0];var g=q?d.getElementsByTagName("*"):d.elements;if(!g){return p}var k,h,f,r,e,m,c;for(k=0,m=g.length;k<m;k++){e=g[k];f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(h=0,c=r.length;h<c;h++){p.push({name:f,value:r[h]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0];f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(j===undefined){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return b(c).val()};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c===undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c===undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}}})(jQuery);



/*	

	Watermark plugin for jQuery

	Version: 3.0.4

	http://jquery-watermark.googlecode.com/



	Copyright (c) 2009-2010 Todd Northrop

	http://www.speednet.biz/

	

	January 14, 2010

*/

(function(e){var c,j="watermark",g="watermarkClass",b="watermarkFocus",h="watermarkSubmit",d="watermarkMaxLength",f="watermarkPassword",m="watermarkText",a=":data("+j+")",i=":text,:password,:search,textarea",l=["Page_ClientValidate"],k=false;e.extend(e.expr[":"],{search:function(n){return"search"===n.type},data:function(o,n,q,s){var p,r=/^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(q[3]);if(r){p=e(o).data(r[1]);if(p!==c){if(r[2]){p=""+p;switch(r[2]){case"=":return(p==r[3]);case"!=":return(p!=r[3]);case"^=":return(p.slice(0,r[3].length)==r[3]);case"$=":return(p.slice(-r[3].length)==r[3]);case"*=":return(p.indexOf(r[3])!==-1)}}return true}}return false}});e.watermark={version:"3.0.4",options:{className:"watermark",useNative:true},hide:function(n){e(n).filter(a).each(function(){e.watermark._hide(e(this))})},_hide:function(q,o){if(q.val()==q.data(m)){q.val("");if(q.data(f)){if(q.attr("type")==="text"){var p=q.data(f),n=q.parent();n[0].removeChild(q[0]);n[0].appendChild(p[0]);q=p}}if(q.data(d)){q.attr("maxLength",q.data(d));q.removeData(d)}if(o){q.attr("autocomplete","off");window.setTimeout(function(){q.select()},0)}}q.removeClass(q.data(g))},show:function(n){e(n).filter(a).each(function(){e.watermark._show(e(this))})},_show:function(t){var s=t.val(),r=t.data(m),p=t.attr("type");if(((s.length==0)||(s==r))&&(!t.data(b))){k=true;if(t.data(f)){if(p==="password"){var q=t.data(f),o=t.parent();o[0].removeChild(t[0]);o[0].appendChild(q[0]);t=q;t.attr("maxLength",r.length)}}if((p==="text")||(p==="search")){var n=t.attr("maxLength");if((n>0)&&(r.length>n)){t.data(d,n);t.attr("maxLength",r.length)}}t.addClass(t.data(g));t.val(r)}else{e.watermark._hide(t)}},hideAll:function(){if(k){e.watermark.hide(i);k=false}},showAll:function(){e.watermark.show(i)}};e.fn.watermark=function(q,n){var p=(typeof(q)==="string"),o;if(typeof(n)==="object"){o=(typeof(n.className)==="string");n=e.extend({},e.watermark.options,n)}else{if(typeof(n)==="string"){o=true;n=e.extend({},e.watermark.options,{className:n})}else{n=e.watermark.options}}if(typeof(n.useNative)!=="function"){n.useNative=n.useNative?function(){return true}:function(){return false}}return this.each(function(){var v=e(this);if(!v.is(i)){return}if(v.data(j)){if(p||o){e.watermark._hide(v);if(p){v.data(m,q)}if(o){v.data(g,n.className)}}}else{if(n.useNative.call(this,v)){if(((""+v.css("-webkit-appearance")).replace("undefined","")!=="")&&(v.attr("tagName")!=="TEXTAREA")){if(p){v.attr("placeholder",q)}return}}v.data(m,p?q:"");v.data(g,n.className);v.data(j,1);if(v.attr("type")==="password"){var r=v.wrap("").parent();var u=e(r.html().replace(/type=["']?password["']?/i,'type="text"'));u.data(m,v.data(m));u.data(g,v.data(g));u.data(j,1);u.attr("maxLength",q.length);u.focus(function(){e.watermark._hide(u,true)}).bind("dragenter",function(){e.watermark._hide(u)}).bind("dragend",function(){window.setTimeout(function(){u.blur()},1)});v.blur(function(){e.watermark._show(v)}).bind("dragleave",function(){e.watermark._show(v)});u.data(f,v);v.data(f,u)}else{v.focus(function(){v.data(b,1);e.watermark._hide(v,true)}).blur(function(){v.data(b,0);e.watermark._show(v)}).bind("dragenter",function(){e.watermark._hide(v)}).bind("dragleave",function(){e.watermark._show(v)}).bind("dragend",function(){window.setTimeout(function(){e.watermark._show(v)},1)}).bind("drop",function(w){var x=w.originalEvent.dataTransfer.getData("Text");if(v.val().replace(x,"")===v.data(m)){v.val(x)}v.focus()})}if(this.form){var t=this.form,s=e(t);if(!s.data(h)){s.submit(e.watermark.hideAll);if(t.submit){s.data(h,t.submit);t.submit=(function(x,w){return function(){var y=w.data(h);e.watermark.hideAll();if(y.apply){y.apply(x,Array.prototype.slice.call(arguments))}else{y()}}})(t,s)}else{s.data(h,1);t.submit=(function(w){return function(){e.watermark.hideAll();delete w.submit;w.submit()}})(t)}}}}e.watermark._show(v)}).end()};if(l.length){e(function(){var o,n,p;for(o=l.length-1;o>=0;o--){n=l[o];p=window[n];if(typeof(p)==="function"){window[n]=(function(q){return function(){e.watermark.hideAll();q.apply(null,Array.prototype.slice.call(arguments))}})(p)}}})}})(jQuery); 



/* Simple Checkbox and Radio button Styling plugin

* @author Abdullah Rubiyath <http://www.itsalif.info/>

*/

(function($){$.fn.ezMark=function(options){options=options||{};var defaultOpt={checkboxCls:options.checkboxCls||'ez-checkbox',radioCls:options.radioCls||'ez-radio',checkedCls:options.checkedCls||'ez-checked',selectedCls:options.selectedCls||'ez-selected',hideCls:'ez-hide'};return this.each(function(){var $this=$(this);var wrapTag=$this.attr('type')=='checkbox'?'<div class="'+defaultOpt.checkboxCls+'">':'<div class="'+defaultOpt.radioCls+'">';if($this.attr('type')=='checkbox'){$this.addClass(defaultOpt.hideCls).wrap(wrapTag).change(function(){if($(this).is(':checked')){$(this).parent().addClass(defaultOpt.checkedCls);}

else{$(this).parent().removeClass(defaultOpt.checkedCls);}});if($this.is(':checked')){$this.parent().addClass(defaultOpt.checkedCls);}}

else if($this.attr('type')=='radio'){$this.addClass(defaultOpt.hideCls).wrap(wrapTag).change(function(){$('input[name="'+$(this).attr('name')+'"]').each(function(){if($(this).is(':checked')){$(this).parent().addClass(defaultOpt.selectedCls);}else{$(this).parent().removeClass(defaultOpt.selectedCls);}});});if($this.is(':checked')){$this.parent().addClass(defaultOpt.selectedCls);}}});}})(jQuery);



/* File Input Plugin */

(function(b){b.widget("shimmy.fileinput",{options:{buttonText:"Browse",inputText:""},_create:function(){var a=this,d=a.options;a.fileFile=a.element;a.fileWrapper=b("<div></div>").addClass("fileinput-wrapper ui-widget").hover(function(){a.fileButton.addClass("ui-state-hover")},function(){a.fileButton.removeClass("ui-state-hover ui-state-active")}).bind("mousemove.fileinput",function(c){var e=c.pageX-b(this).offset().left-a.fileFile.width()/1.2;c=c.pageY-b(this).offset().top-a.fileFile.height()/2;a.fileFile.css("top",

c).css("left",e)}).bind("mousedown.fileinput",function(){a.fileButton.addClass("ui-state-active")}).bind("mouseup.fileinput",function(){a.fileButton.removeClass("ui-state-active")});a.fileFile.addClass("fileinput-file").wrap(a.fileWrapper);a.fileInput=b("<span></span>").addClass("fileinput-input ui-state-default ui-widget-content ui-corner-left").text(a._getText()).insertBefore(a.fileFile);a.fileButtonText=b("<span></span>").addClass("fileinput-button-text").text(d.buttonText);a.fileButton=b("<span></span>").addClass("fileinput-button ui-state-default ui-widget-header ui-corner-right").insertAfter(a.fileInput).html(a.fileButtonText);

a.fileFile.bind("change.fileinput mouseout.fileinput",function(){a.fileInput.text(a._getText())}).bind("focusin.fileinput",function(){a.fileButton.addClass("ui-state-hover")}).bind("focusout.fileinput",function(){a.fileButton.removeClass("ui-state-hover")})},_getText:function(){fileValue=this.getValue();inputTextValue=this.options.inputText;return fileValue==""?inputTextValue:fileValue},getValue:function(){return fileValue=this.fileFile.val().replace("C:\\fakepath\\","")},reset:function(){this.fileInput.text(this.options.inputText)},

destroy:function(){this.fileInput.remove();this.fileButton.remove();this.fileButtonText.remove();this.fileFile.removeClass("fileinput-file").unwrap(this.fileWrapper);this.fileWrapper.remove();b.Widget.prototype.destroy.call(this)},_setOption:function(a,d){b.Widget.prototype._setOption.apply(this,arguments);switch(a){case "buttonText":this.fileButtonText.text(d);break;case "inputText":this.fileInput.text(this._getText())}}})})(jQuery);