(function($){$.createJsonString=function(json){var argumentsCount=arguments.length;if(argumentsCount==0){throw new Error("The createJsonObject() plug-in must have at least one argument.")}else if(argumentsCount==1){var jsonString="{";for(property in json){jsonString+='"'+property+'"'+":"+'"'+json[property]+'"'+","}if(jsonString.length>1){jsonString=jsonString.substr(0,jsonString.length-1)}jsonString+="}";return jsonString}else if((argumentsCount%2)!=0){throw new Error("The createJsonString() plug-in must have an even number of arguments if creating a JSON string from multiple arguments.")}else{var pairCount=argumentsCount/2;var jsonString="{";for(var i=0;i<pairCount;i++){var index=i*2;jsonString+='"'+arguments[index]+'"'+":"+'"'+arguments[index+1]+'"'+","}if(jsonString.length>1){jsonString=jsonString.substr(0,jsonString.length-1)}jsonString+="}";return jsonString}}})(jQuery);(function($){$.createJsonObject=function(){var argumentsCount=arguments.length;if(argumentsCount==0){throw new Error("The createJsonObject() plug-in must have at least two arguments.")}else if((argumentsCount%2)!=0){throw new Error("The createJsonObject() plug-in must have an even number of arguments.")}else{var json=new Object();var pairCount=argumentsCount/2;for(var i=0;i<pairCount;i++){var index=i*2;json[arguments[index]]=arguments[index+1]}return json}return null}})(jQuery);(function($){$.getBrowser=function(){if(navigator.appName.match(/microsoft internet explorer/gi)){return"ie"}else if(navigator.userAgent.match(/firefox/gi)){return"firefox"}else if(navigator.userAgent.match(/chrome/gi)){return"chrome"}else if(navigator.userAgent.match(/gecko/gi)){return"safari"}else if(navigator.appName.match(/opera/gi)){return"opera"}}})(jQuery);(function($){$.getQueryString=function(){var urlParams={};(function(){var e,a=/\+/g,r=/([^&=]+)=?([^&]*)/g,d=function(s){return decodeURIComponent(s.replace(a," "))},q=window.location.search.substring(1);while(e=r.exec(q)){urlParams[d(e[1])]=d(e[2])}})();return urlParams}})(jQuery);(function($){$.fn.center=function(heightPercent,widthPercent){if(heightPercent==undefined){heightPercent=50}if(widthPercent==undefined){widthPercent=50}var windowHeight=$(window).height();var contentHeight=Math.floor(windowHeight*heightPercent);var top=Math.floor((windowHeight-contentHeight)*overlayTop)+$(window).scrollTop();this.css('height',contentHeight+"px");this.css('top',top+"px");var windowWidth=$(window).width();var contentWidth=Math.floor(windowWidth*widthPercent);var left=Math.floor((windowWidth-contentWidth)*overlayLeft)+$(window).scrollLeft();this.css('width',contentWidth+"px");this.css('left',left+"px");this.css('position','absolute');this.css('padding','0');this.css('margin','0');this.css('border','0 none');if($(this).parent()){$(this).parent().css('position','relative')}return this}})(jQuery);(function($){$.fn.isVisible=function(){return this[0].style.display!="hidden"&&this[0].style.display!="none"}})(jQuery);(function($){$.fn.isEmpty=function(){if(this[0]&&this[0].value&&typeof this[0].value=='String'){return this[0].value==""}return true}})(jQuery);(function($){$.fn.isChecked=function(){if($(this).is(':checkbox')&&$(this).attr('checked')){return true}return false}})(jQuery);(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings)};$scrollTo.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return elem;var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=='BackCompat'?doc.body:doc.documentElement})};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0}if(typeof settings=='function')settings={onAfter:settings};if(target=='max')target=9e9;settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this._scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0}attr[key]+=settings.offset[pos]||0;if(settings.over[pos])attr[key]+=targ[axis=='x'?'width':'height']()*settings.over[pos]}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)=='%'?parseFloat(val)/100*max:val}if(/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&settings.queue){if(old!=attr[key])animate(settings.onAfterFirst);delete attr[key]}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings)})}}).end()};$scrollTo.max=function(elem,axis){var Dim=axis=='x'?'Width':'Height',scroll='scroll'+Dim;if(!$(elem).is('html,body'))return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size])};function both(val){return typeof val=='object'?val:{top:val,left:val}}})(jQuery);
