/*
 jquery_xtnd: Version 0.9.2 01
*/
window.G8=window.G8||{};
G8.ax_jqxtnd=function a(){function b(d,f){return $.proxy(f,d)}function c(){if(typeof console!="undefined")console.info(arguments);else{var d="";$.each(arguments,function(f,h){if($.isArray(h)||typeof h=="object")$.each(arguments,function(j,m){d+="  "+j+":"+m+"\n"});else d+=h+"\n\n"})}}function e(){if(typeof console!="undefined")console.warn(arguments);else{var d="ERROR:\n";$.each(arguments,function(f,h){d+=h+"\n\n"})}}function i(){var d=arguments[0],f=arguments[1],h=arguments[2]!=undefined?G8.ax_jqxtnd.arrayCutFirst(G8.ax_jqxtnd.arrayCutFirst(arguments)).join(""):
"",j=f.cl?' class="'+f.cl+'"':"",m=f.id?' id="'+f.id+'"':"",n=f.pos?"position:"+f.pos+";":"";f=f.hid?"display:none;":"";n=n!=""||f!=""?' style="'+n+f+'"':"";return"<"+d+m+j+n+">"+h+"</"+d+">"}function g(){var d="div",f=arguments[0],h=arguments[1]!=undefined?G8.ax_jqxtnd.arrayCutFirst(arguments).join(""):"",j=f.cl?' class="'+f.cl+'"':"",m=f.id?' id="'+f.id+'"':"",n=f.pos?"position:"+f.pos+";":"";f=f.hid?"display:none;":"";n=n!=""||f!=""?' style="'+n+f+'"':"";return"<"+d+m+j+n+">"+h+"</"+d+">"}function k(d,
f){for(var h in f)d[h]=f[h];return d}function l(d){return $("<div></div>").text(d).html()}function o(d){return $("<div></div>").html(d).text()}function p(d){return l(d).nl2br().space2Nbsp()}function r(d){return o(d.br2nl().nbsp2Space())}function q(d){d=$.makeArray(d);d.shift();return d}function s(d,f){if(d==f)return d;return d+parseInt(Math.random()*(f-d+1))}function t(d){if(d)return $("html,body").scrollTop(d);else{d=document.documentElement;var f=document.body;return d&&d.scrollTop||f&&f.scrollTop||
0}}function u(d){if(d)return $("html,body").scrollLeft(d);else{d=document.documentElement;var f=document.body;return d&&d.scrollLeft||f&&f.scrollLeft||0}}function v(d){var f=window.location.search.substring(1);f=f.split("&");var h;$.each(f,function(j,m){j=m.split("=");if(j[0]==d){h=j.length>1?j[1]:"";return false}});return h}function w(d,f,h){if(typeof f!="undefined"){h=h||{};if(f===null){f="";h.expires=-1}var j="";if(h.expires&&(typeof h.expires=="number"||h.expires.toUTCString)){if(typeof h.expires==
"number"){j=new Date;j.setTime(j.getTime()+h.expires*24*60*60*1E3)}else j=h.expires;j="; expires="+j.toUTCString()}var m=h.path?"; path="+h.path:"",n=h.domain?"; domain="+h.domain:"";h=h.secure?"; secure":"";document.cookie=[d,"=",encodeURIComponent(f),j,m,n,h].join("")}else{f=null;if(document.cookie&&document.cookie!=""){h=document.cookie.split(";");for(j=0;j<h.length;j++){m=$.trim(h[j]);if(m.substring(0,d.length+1)==d+"="){f=decodeURIComponent(m.substring(d.length+1));break}}}return f}}return{prxy:b,
makeDom:i,makeDiv:g,dbg:c,err:e,objectExtend:k,escapeHtml:l,unescapeHtml:o,inputToHtml:p,htmlToInput:r,arrayCutFirst:q,getRange:s,windowScrollTop:t,windowScrollLeft:u,getQueryVal:v,cookie:w}}();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}});
jQuery.fn.extend({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)},isChildOf:function(a){var b=false,c=this[0];$(a).each(function(){if(this==c){b=true;return false}else{$(this).find("*").each(function(){if(this==c){b=true;return false}});if(b)return false}});return b},isOrIsChildOf:function(a){var b=false,c=this[0];a.each(function(){var e=this;if($.contains(e,c)||e==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()},
cloneAsForm:function(a,b){b=b||{};var c=b.wOff||0,e=b.hOff||0;b=b.color||a.css("color");c+=6;this.clonePos(a).css({border:0,fontSize:a.css("fontSize"),color:b,backgroundColor:"transparent",fontWeight:a.css("font-weight"),fontFamily:a.css("font-family"),textAlign:a.css("text-align"),lineHeight:a.css("line-height"),fontStyle:a.css("font-style"),width:a.outerWidth()+c,height:a.outerHeight()+e+(this.get(0).tagName=="TEXTAREA"?15:0)});return this},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,e){a=a;var i=!$.isFunction(b)?b:false;b=i?c:b;c=i?e:c;i?this.bind(a,i,$.proxy(b,c)):this.bind(a,$.proxy(b,c));return this},bindOnce:function(a,b,c){a=a;var e=!$.isFunction(b)?b:false;b=e?c:b;this.unbind(a,b);e?this.bind(a,e,b):this.bind(a,b);return this},bindOnceProxy:function(a,b,c,e){a=a;var i=!$.isFunction(b)?b:false;b=i?c:b;c=i?e:c;i?this.bindOnce(a,i,$.proxy(b,c)):this.bindOnce(a,
$.proxy(b,c));return this},storeDiv:function(){return this.appendTo("body").css({display:"none"})},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,e=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()+e}):this.setPosTo(a,["LEFTI",c],["TOPI",e]);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 e;this.parent();var i={},g={};g.isWindow=a.get(0)==window;g.isDocument=a.get(0)==document;i.height=this.outerHeight();i.width=this.outerWidth();i.origOpacity=this.css("opacity");i.origDisplay=this.css("display");if(i.origDisplay=="none")$.browser.msie?this.css({display:"block"}):this.css({opacity:0,display:"block"});var k=0,l=0;this.css("left")=="auto"&&this.css("left","0px");this.css("top")=="auto"&&this.css("top",
"0px");var o=isNaN(parseFloat(this.css("left")))?0:parseFloat(this.css("left")),p=isNaN(parseFloat(this.css("top")))?0:parseFloat(this.css("top"));o=this.left()-o;p=this.top()-p;if(i.origDisplay=="none")$.browser.msie?this.css({display:i.origDisplay}):this.css({opacity:i.origOpacity,display:i.origDisplay});if(g.isWindow||g.isDocument){g.left=0;g.top=0;g.height=a.height();g.width=a.width();g.scrollLeft=a.scrollLeft();g.scrollTop=a.scrollTop()}else{g.left=a.left();g.top=a.top();g.height=a.outerHeight();
g.width=a.outerWidth();g.scrollLeft=0;g.scrollTop=0}for(var r=c?2:1,q=1;q<=r;q++){a=q==1?b:c;if(typeof a=="object"){e=a[0];if(a.length==2)if(e=="LEFT"||e=="LEFTI"||e=="RIGHT"||e=="RIGHTI"||e=="CENTERX")k=a[1]-o+g.scrollLeft;else if(e=="TOP"||e=="TOPI"||e=="BOTTOM"||e=="BOTTOMI"||e=="CENTERY")l=a[1]-p+g.scrollTop}else if(typeof a=="string"){e=a;k=-o+g.scrollLeft;l=-p+g.scrollTop}if(this.css("position")=="fixed")k=l=0;if(e=="CENTERX")this.left(g.left+Math.round((g.width-i.width)/2)+k);else if(e=="CENTERY")this.top(g.top+
Math.round((g.height-i.height)/2)+l);else if(e=="LEFT")this.left(g.left-i.width+k);else if(e=="LEFTI")this.left(g.left+k);else if(e=="TOP")this.top(g.top-i.height+l);else if(e=="TOPI")this.top(g.top+l);else if(e=="RIGHT")this.left(g.left+g.width+k);else if(e=="RIGHTI")this.left(g.left+g.width-i.width+k);else if(e=="BOTTOM")this.top(g.top+g.height+l);else e=="BOTTOMI"&&this.top(g.top+g.height-i.height+l)}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"),e=this.intCss("padding-bottom");return{x:a+b,y:c+e}},intMargin:function(){var a=this.intCss("margin-left"),b=this.intCss("margin-right"),c=this.intCss("margin-top"),e=this.intCss("margin-bottom");
return{x:a+b,y:c+e}},intBorder:function(){var a=this.intCss("borderLeftWidth"),b=this.intCss("borderRightWidth"),c=this.intCss("borderTopWidth"),e=this.intCss("borderBottomWidth");return{x:a+b,y:c+e}},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,e=b.offHeight||0;b=b.margin||false;this.css({width:a.outerWidth(b)+
c+"px",height:a.outerHeight(b)+e+"px"});return this},isInViewport:function(){var a=$(window),b=a.scrollLeft(),c=a.scrollTop(),e=a.height();a=a.width();var i=this.left(),g=i+this.outerWidth(),k=this.top(),l=k+this.outerHeight();i=i<b?-1:i>=b+a?1:0;b=g<b?-1:g>=b+a?1:0;k=k<c?-1:k>=c+e?1:0;c=l<c?-1:l>=c+e?1:0;return{xLeft:i,xRight:b,yTop:k,yBot:c,viewportHeight:e,viewportWidth:a}}});

