/*
 jquery_xtnd: Version 0.9.7
*/
window.G8=window.G8||{};
G8.ax_jqxtnd=function a(){function b(e,g){return $.proxy(g,e)}function c(){if(typeof console!="undefined")console.info(arguments);else{var e="";$.each(arguments,function(g,k){if($.isArray(k)||typeof k=="object")$.each(arguments,function(o,p){e+="  "+o+":"+p+"\n"});else e+=k+"\n\n"})}}function d(){if(typeof console!="undefined")console.warn(arguments);else{var e="ERROR:\n";$.each(arguments,function(g,k){e+=k+"\n\n"})}}function h(){var e=arguments[0],g=arguments[1],k=arguments[2]!=undefined?G8.ax_jqxtnd.arrayCutFirst(G8.ax_jqxtnd.arrayCutFirst(arguments)).join(""):
"",o=g.cl?' class="'+g.cl+'"':"",p=g.id?' id="'+g.id+'"':"",l=g.pos?"position:"+g.pos+";":"";g=g.hid?"display:none;":"";l=l!=""||g!=""?' style="'+l+g+'"':"";return"<"+e+p+o+l+">"+k+"</"+e+">"}function f(){var e="div",g=arguments[0],k=arguments[1]!=undefined?G8.ax_jqxtnd.arrayCutFirst(arguments).join(""):"",o=g.cl?' class="'+g.cl+'"':"",p=g.id?' id="'+g.id+'"':"",l=g.pos?"position:"+g.pos+";":"";g=g.hid?"display:none;":"";l=l!=""||g!=""?' style="'+l+g+'"':"";return"<"+e+p+o+l+">"+k+"</"+e+">"}function i(e,
g){for(var k in g)e[k]=g[k];return e}function j(e){return $("<div></div>").text(e).html()}function m(e){return $("<div></div>").html(e).text()}function n(e){return j(e).nl2br().space2Nbsp()}function r(e){return m(e.br2nl().nbsp2Space())}function q(e){e=$.makeArray(e);e.shift();return e}function s(e,g){if(e==g)return e;return e+parseInt(Math.random()*(g-e+1))}function t(e){if(e)return $("html,body").scrollTop(e);else{e=document.documentElement;var g=document.body;return e&&e.scrollTop||g&&g.scrollTop||
0}}function u(e){if(e)return $("html,body").scrollLeft(e);else{e=document.documentElement;var g=document.body;return e&&e.scrollLeft||g&&g.scrollLeft||0}}return{prxy:b,makeDom:h,makeDiv:f,dbg:c,err:d,objectExtend:i,escapeHtml:j,unescapeHtml:m,inputToHtml:n,htmlToInput:r,arrayCutFirst:q,getRange:s,windowScrollTop:t,windowScrollLeft:u}}();function $Self(a,b){return b.find(a).add(b.filter(a))}
G8.ax_jqxtnd.objectExtend(String.prototype,{stripScripts:function(){return this.replace(new RegExp("<s*script[^>]*>([\\S\\s]*?)</s*script[^>]*>","img"),"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},truncate:function(a,b){a=a||30;b=b===undefined?"...":b;return this.length>a?this.slice(0,a-b.length)+b:String(this)},nl2br:function(){return this.replace(/(\r\n)|(\n\r)|\r|\n/g,"<br />").replace(/<br \/><br \/>/g,"<br />&nbsp;<br />")},stripNl:function(){return this.replace(/(\r\n)|(\n\r)|\r|\n/g,
"")},stripCssUnit:function(){return parseInt(this)},br2nl:function(){return this.replace(/<br \/>/g,"\n").replace(/<br\/>/g,"\n").replace(/<br>/g,"\n")},space2Nbsp:function(){return this.replace(/  /g,"&nbsp;&nbsp;")},nbsp2Space:function(){return this.replace(/&nbsp;/g," ").replace(/&#160;/g," ")},hasStr:function(){for(var a=$.isArray(arguments[0])?arguments[0]:arguments,b=0;b<a.length;b++)if(this.toLowerCase().indexOf(a[b].toLowerCase())!=-1)return true;return false},hasStrExact:function(){for(var a=
$.isArray(arguments[0])?arguments[0]:arguments,b=0;b<a.length;b++)if(this==a[b].toString())return true;return false}});
jQuery.fn.extend({imgSetHi:function(){return this.switchSrc("_lo.","_hi.").switchSrc("_act.","_hi.")},imgSetLo:function(){return this.switchSrc("_hi.","_lo.").switchSrc("_act.","_lo.")},imgSetAct:function(){return this.switchSrc("_hi.","_act.").switchSrc("_lo.","_act.")},imgFilterNonAct:function(){return this.filter(function(){return $(this).attr("src").indexOf("_act.")==-1})},imgSetExp:function(){return this.switchSrc("_col","_exp")},imgSetCol:function(){return this.switchSrc("_exp","_col")},fadeInXB:function(a,
b){return $.browser.msie?this.show(0,b):this.fadeIn(a,b)},fadeOutXB:function(a,b){return $.browser.msie?this.hide(0,b):this.fadeOut(a,b)},tglFadeInXB:function(a,b){return $.browser.msie?this.show(0,b):this.tglFadeIn(a,b)},tglFadeOutXB:function(a,b){return $.browser.msie?this.hide(0,b):this.tglFadeOut(a,b)},tgl:function(a){return a?this.show():this.hide()},tglFadeIn:function(a,b){return this.stopp().hide().opacity(1).fadeIn(a,b)},tglFadeOut:function(a,b){return this.is(":visible")?this.stopp().show().opacity(1).fadeOut(a,
b):this.hide()},tglSlideDown:function(a,b,c){return this.stopp().hide().css("height",b).slideDown(a,c)},tglSlideUp:function(a,b,c){return this.stopp().show().css("height",b).slideUp(a,c)},opacity:function(a){return a||a===0?this.css({opacity:a}):this.css("opacity")},stopp:function(){return this.stop(true)},removeAni:function(a,b){var c=this;this.slideUp(a,function(){c.remove();b&&b()});return c},inpReadVal:function(){return $.trim(this.val())},tglClass:function(a,b){return b?this.addClass(a):this.removeClass(a)},
isOrIsChildOf:function(a){var b=false,c=this[0];a.each(function(){var d=this;if($.contains(d,c)||d==c){b=true;return false}});return b},parentsSelf:function(a){return this.parents(a).add(this.filter(a))},outerHtml:function(){return $($("<div></div>").html(this.clone())).html()},getIdFromClass:function(a){var b="";this.attr("class")&&$.each(this.attr("class").split(/\s+/),function(){if(this.hasStr(a))b=this.replace(a,"")});return b},bindProxy:function(a,b,c,d){a=a;var h=!$.isFunction(b)?b:false;b=
h?c:b;c=h?d:c;h?this.bind(a,h,$.proxy(b,c)):this.bind(a,$.proxy(b,c));return this},bindOnce:function(a,b,c){a=a;var d=!$.isFunction(b)?b:false;b=d?c:b;this.unbind(a,b);d?this.bind(a,d,b):this.bind(a,b);return this},bindOnceProxy:function(a,b,c,d){a=a;var h=!$.isFunction(b)?b:false;b=h?c:b;c=h?d:c;h?this.bindOnce(a,h,$.proxy(b,c)):this.bindOnce(a,$.proxy(b,c));return this},switchClassF:function(a,b){this.filter("."+a).removeClass(a).addClass(b);return this},switchSrc:function(a,b){return this.attr("src",
function(){return this.src.replace(a,b)})},srcF:function(a){return a!=undefined?this.attr("src",a):this.attr("src")},switchHref:function(a,b){if(typeof a=="string")a=new RegExp(a);return this.attr("href",function(){return this.href.replace(a,b)})},clonePos:function(a,b){b=b||{};var c=b.xOff||0,d=b.yOff||0;(b=b.windowFixed===undefined?false:b.windowFixed)?this.css({left:a.offset().left-$(window).scrollLeft()+c,top:a.offset().top-$(window).scrollTop()+d}):this.setPosTo(a,["LEFTI",c],["TOPI",d]);return this},
left:function(a){if(a==undefined)return this[0]==$("window")[0]?0:this.offset().left;else{this.css({left:a+"px"});return this}},top:function(a){if(a==undefined)return this[0]==$("window")[0]?0:this.offset().top;else{this.css({top:a+"px"});return this}},moveLeft:function(a){return this.css({left:this.left()+a})},moveTop:function(a){return this.css({top:this.top()+a})},setPosTo:function(a,b,c){var d;this.parent();var h={},f={};f.isWindow=a.get(0)==window;f.isDocument=a.get(0)==document;h.height=this.outerHeight();
h.width=this.outerWidth();h.origOpacity=this.css("opacity");h.origDisplay=this.css("display");if(h.origDisplay=="none")$.browser.msie?this.css({display:"block"}):this.css({opacity:0,display:"block"});var i=0,j=0;this.css("left")=="auto"&&this.css("left","0px");this.css("top")=="auto"&&this.css("top","0px");var m=isNaN(parseFloat(this.css("left")))?0:parseFloat(this.css("left")),n=isNaN(parseFloat(this.css("top")))?0:parseFloat(this.css("top"));m=this.left()-m;n=this.top()-n;if(h.origDisplay=="none")$.browser.msie?
this.css({display:h.origDisplay}):this.css({opacity:h.origOpacity,display:h.origDisplay});if(f.isWindow||f.isDocument){f.left=0;f.top=0;f.height=a.height();f.width=a.width();f.scrollLeft=a.scrollLeft();f.scrollTop=a.scrollTop()}else{f.left=a.left();f.top=a.top();f.height=a.outerHeight();f.width=a.outerWidth();f.scrollLeft=0;f.scrollTop=0}for(var r=c?2:1,q=1;q<=r;q++){a=q==1?b:c;if(typeof a=="object"){d=a[0];if(a.length==2)if(d=="LEFT"||d=="LEFTI"||d=="RIGHT"||d=="RIGHTI"||d=="CENTERX")i=a[1]-m+f.scrollLeft;
else if(d=="TOP"||d=="TOPI"||d=="BOTTOM"||d=="BOTTOMI"||d=="CENTERY")j=a[1]-n+f.scrollTop}else if(typeof a=="string"){d=a;i=-m+f.scrollLeft;j=-n+f.scrollTop}if(this.css("position")=="fixed")i=j=0;if(d=="CENTERX")this.left(f.left+Math.round((f.width-h.width)/2)+i);else if(d=="CENTERY")this.top(f.top+Math.round((f.height-h.height)/2)+j);else if(d=="LEFT")this.left(f.left-h.width+i);else if(d=="LEFTI")this.left(f.left+i);else if(d=="TOP")this.top(f.top-h.height+j);else if(d=="TOPI")this.top(f.top+j);
else if(d=="RIGHT")this.left(f.left+f.width+i);else if(d=="RIGHTI")this.left(f.left+f.width-h.width+i);else if(d=="BOTTOM")this.top(f.top+f.height+j);else d=="BOTTOMI"&&this.top(f.top+f.height-h.height+j)}return this},totalHeight:function(a){if(a==undefined)return this.outerHeight();else{var b=this.intPadding().y,c=this.intBorder().y;return this.height(a-b-c)}},totalWidth:function(a){if(a==undefined)return this.outerWidth();else{var b=this.intPadding().x,c=this.intBorder().x;return this.width(a-b-
c)}},intPadding:function(){var a=this.intCss("padding-left"),b=this.intCss("padding-right"),c=this.intCss("padding-top"),d=this.intCss("padding-bottom");return{x:a+b,y:c+d}},intMargin:function(){var a=this.intCss("margin-left"),b=this.intCss("margin-right"),c=this.intCss("margin-top"),d=this.intCss("margin-bottom");return{x:a+b,y:c+d}},intBorder:function(){var a=this.intCss("borderLeftWidth"),b=this.intCss("borderRightWidth"),c=this.intCss("borderTopWidth"),d=this.intCss("borderBottomWidth");return{x:a+
b,y:c+d}},intCss:function(a){return parseInt(this.css(a))},cloneWidth:function(a,b){b=b||0;return this.totalWidth(a.outerWidth()+b)},cloneHeight:function(a,b){b=b||0;return this.totalHeight(a.outerHeight()+b)},cloneDim:function(a,b){b=b||{};var c=b.offWidth||0,d=b.offHeight||0;b=b.margin||false;this.css({width:a.outerWidth(b)+c+"px",height:a.outerHeight(b)+d+"px"});return this},isInViewport:function(){var a=$(window),b=a.scrollLeft(),c=a.scrollTop(),d=a.height();a=a.width();var h=this.left(),f=h+
this.outerWidth(),i=this.top(),j=i+this.outerHeight();h=h<b?-1:h>=b+a?1:0;b=f<b?-1:f>=b+a?1:0;i=i<c?-1:i>=c+d?1:0;c=j<c?-1:j>=c+d?1:0;return{xLeft:h,xRight:b,yTop:i,yBot:c,viewportHeight:d,viewportWidth:a}}});

