/* returns the first value found in an array of map objects */
jQuery.getProperty=function(d,c){var a=null;if(d!=undefined&&d!=null){if(c!=undefined&&c!=null&&c.length>0){for(var b=0;b<c.length;b++){if(c[b]!=undefined){if(c[b][d]!=undefined){a=c[b][d];break}}}}}return a};
/* return boolean indicating if the browser is IE 6 */
jQuery.browserIsIE6=function(){var a=window.navigator.userAgent.toLowerCase();return/msie/.test(a)&&(a.match(/.+msie (\d+)/))[1]==6}
/* props {
*     extraY: null, additional vertical scroll amount
*     speed: null, jQuery speed,
*     easing: null, jQuery easing
*   }
*/
;jQuery.scrollBodyTo=function(f,h,k){var j=window.navigator.userAgent.toLowerCase();var g=this("html,body");var d=0;var e={extraY:0,speed:"slow",easing:null};if(/applewebkit/.test(j)){d=document.body.scrollTop}else{if(/opera/.test(j)){d=0}else{d=document.documentElement.scrollTop}}var l=g.find(f).offset().top;var i=l-d;var c=jQuery(document).height();var a=jQuery(window).height();if(l+a>c){i-=(a-(c-l))}i+=parseInt(jQuery.getProperty("extraY",[h,e]));g.animate({scrollTop:"+="+i+"px"},jQuery.getProperty("speed",[h,e]),jQuery.getProperty("easing",[h,e]),k)};
/* props {
*     extraY: null, additional vertical scroll amount
*     speed: null, jQuery speed,
*     easing: null, jQuery easing
*   }
*/
jQuery.scrollIntoView=function(a,h,k){var j=window.navigator.userAgent.toLowerCase();var g=jQuery("html,body");var d=0;var f={extraY:0,speed:"slow",easing:null};if(/applewebkit/.test(j)){d=document.body.scrollTop}else{if(/opera/.test(j)){d=0}else{d=document.documentElement.scrollTop}}var l=$(a).offset().top;var e=$(a).height();var c=jQuery(window).height();var i=null;if(l+e>c+d){i=l+e-c-d}else{if(l<d){i=l-d}}if(i!=null){i+=parseInt(jQuery.getProperty("extraY",[h,f]));g.animate({scrollTop:"+="+i+"px"},jQuery.getProperty("speed",[h,f]),jQuery.getProperty("easing",[h,f]),k)}};
/* objNextExpression: the selector of the next field to focus on
*/
jQuery.fn.autoTab=function(a){jQuery(this).bind("keydown",function(){this.autoTabLength=jQuery(this).attr("value").length});jQuery(this).bind("keyup",function(){if(jQuery(this).attr("value").length!=this.autoTabLength){this.autoTabLength=jQuery(this).attr("value").length;if(this.autoTabLength==jQuery(this).attr("maxlength")){jQuery(a).focus()}}});return this}
/* Allows only integers in an input */
;jQuery.fn.integerInput=function(){var a=jQuery(this);a.bind("keyup",function(){if(!(/^\d*$/.test(a.val()))){a.val(a.val().replace(/\D/g,""))}});return this}
/* Replaces the inner HTML of an object with an image
*   attributesMap: attribute/value pairs to add to the image
*/
;jQuery.fn.imageHeader=function(c){var b;if(jQuery.browserIsIE6()&&c.src!=undefined&&c.src.toLowerCase().indexOf(".png")!=-1){var a=new Image();a.src=c.src;b='<span title="'+this.text()+'" style="display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+a.src+"',sizingMethod='image');width:"+a.width+"px;height:"+a.height+"px;";if(c.style!=undefined){b+=c.style}b+='"';for(var d in c){if(d.toLowerCase()!="style"){b+=(d+'="'+c[d]+'" ')}}b+="></span>"}else{b='<img alt="'+this.text()+'" title="'+this.text()+'" ';for(var d in c){b+=(d+'="'+c[d]+'" ')}b+="/>"}this.html(b);return this}
/* jQuery image preloading.
preloadedImageCache[] - not for use, holds img objects
preloadImage(src) - loads a single image
preloadImages() - accepts any number of arguments including and an array of paths
*/
;jQuery.preloadedImageCache=[];jQuery.preloadImage=function(b){var a=document.createElement("img");a.src=b;jQuery.preloadedImageCache.push(a)};jQuery.preloadImages=function(){var c=arguments.length;for(var b=c;b--;){if(typeof(arguments[b])=="string"){jQuery.preloadImage(arguments[b])}else{if(arguments[b] instanceof Array){for(var a=0;a<arguments[b].length;a++){jQuery.preloadImage(arguments[b][a])}}}}};
