// pop-up windows
function openPopUp(PageName){
    new_window = window.open(PageName, "new_window", "width=400,height=400,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50");
    if (new_window.opener == null) {
        new_window.opener = self;
    }
    new_window.focus();
}

function openSizedPopUp(PageName, Width, Height){
    new_window = window.open(PageName, "new_window", "width=" + Width + ",height=" + Height + ",location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50");
    if (new_window.opener == null) {
        new_window.opener = self;
    }
    new_window.focus();
}

// quick order form validation
function validateQuickOrder(form) {        
    if ((form.ProductNumber.value == "")|| (form.ProductNumber.value == "Enter Product #")){
        alert("Please enter an item number.");
        form.ProductNumber.focus();
        return false;
    }
    return true;
}

// used to generate random string that will be appended to AJAX requests to avoid getting cached response
function rnd() { 
    return String((new Date()).getTime()).replace(/\D/gi,'')
}

// used to retrieve the debug flag
function debugFlag() { 
    if (null != document.getElementsByName("debug")[0])
        return String('&dminsite=' + document.getElementsByName("debug")[0].value);
    else
        return '';
}

// Used on one-page multi-ship checkout to populate the shipping address from the billing address.
function UseBillingAsShippingMS(form){

    if (form.ship_to_bill_address.checked) {
        form.Email_SHIP.value = form.Email.value;
        form.ConfEmail_SHIP.value = form.ConfEmail.value;
        form.FirstName_SHIP.value = form.FirstName.value;
        form.LastName_SHIP.value = form.LastName.value;
        form.Company_SHIP.value = form.Company.value;
        form.Address1_SHIP.value = form.Address1.value;
        form.Address2_SHIP.value = form.Address2.value;
        form.City_SHIP.value = form.City.value;
        form.State_SHIP.value = form.State.value;
        form.Country_SHIP.value = form.Country.value;
        form.PostalCode_SHIP.value = form.PostalCode.value;
        form.Phone_SHIP.value = form.Phone.value;
        form.PO_SHIP.checked = form.PO.checked;
        
        populateShippingMethods();
    }
    else {
        form.Email_SHIP.value = '';
        form.ConfEmail_SHIP.value = '';
        form.FirstName_SHIP.value = '';
        form.LastName_SHIP.value = '';
        form.Company_SHIP.value = '';
        form.Address1_SHIP.value = '';
        form.Address2_SHIP.value = '';
        form.City_SHIP.value = '';
        form.State_SHIP.value = '';
        form.Country_SHIP.value = '';
        form.PostalCode_SHIP.value = '';
        form.Phone_SHIP.value = '';
        form.PO_SHIP.checked = false;
        
        populateShippingMethods();
    }
}

// Used on one-page multi-ship checkout to apply a promo code.
function applyKeyCodeCheckout()
{
    var keycode = document.getElementsByName("keycode")[0].value;
    DmiAjaxFetch('CheckoutCartItemsContent', 'DmiAjaxSecure.aspx', 'request=CheckoutCartItemsContent&keycode=' + keycode + '&extra=', rnd());

    setTimeout("setDefaultInputText()", 2000);
    setTimeout("populateShippingMethods()", 2000);

    return false;
}

// Used on one-page multi-ship checkout to update billing state or country and order total
function updateBillingInfoMS()
{
    var state_bill = document.getElementsByName("State")[0].value;
    var country_bill = document.getElementsByName("Country")[0].value;
    var zip_bill = document.getElementsByName("PostalCode")[0].value;

    if (state_bill != " - Select - " && country_bill != " - Select - ")
    {
        DmiAjaxFetch('CheckoutCartTotalContent', 'DmiAjaxSecure.aspx', 'request=CheckoutCartTotalContent&state_bill=' + state_bill + '&country_bill=' + country_bill + '&zip_bill=' + zip_bill + debugFlag() + '&extra=', rnd());
    }
}

// Used on one-page multi-ship checkout to update order total after populateShippingMethods is called.
function populateCartTotalCheckout()
{
    DmiAjaxFetch('CheckoutCartTotalContent', 'DmiAjaxSecure.aspx', 'request=CheckoutCartTotalContent' + debugFlag() + '&extra=', rnd());
}

// Used on one-page multi-ship checkout 
function populateShippingMethods(recipientId)
{
    var recipient = '';
    var recipientNamePart = '';

    if ( recipientId == '' || recipientId == null || recipientId == 'undefined' ) {
        recipient = 'Default';
    } else {
        recipient = recipientId;
    }

    // if not the default, add the name part to retrieve specific recipient form elements
    if ( recipient != 'Default' && recipient != '' ) {
        recipientNamePart = '_' + recipient;
    }

    var state_ship = document.getElementsByName("State_SHIP" + recipientNamePart)[0].value;
    var country_ship = document.getElementsByName("Country_SHIP" + recipientNamePart)[0].value;
    var zip_ship = document.getElementsByName("PostalCode_SHIP" + recipientNamePart)[0].value;

    if ( state_ship != " - Select - " && country_ship != " - Select - " ) {
        
        var ship_method;
        if( document.getElementById( "shipping_method" + recipientNamePart ) != null ) {
            //shipping_method dropdown wont exist if page portion is being refreshed by AJAX call
            ship_method = document.getElementsByName("shipping_method" + recipientNamePart)[0].value;
        } else {
            ship_method = ""; // won't get set on call, but will use existing or default
        }

        // must pass recipient or else the built section will not be able to resend the recipient
        DmiAjaxFetch( 'CheckoutShippingMethods' + recipientNamePart, 'DmiAjaxSecure.aspx', 'request=' + 'CheckoutShippingMethods' + recipientNamePart + '&state_ship=' + state_ship + '&country_ship=' + country_ship + '&zip_ship=' + zip_ship + '&shipping_method=' + ship_method + '&recipient=' + recipient + debugFlag() + '&extra=', rnd() );

        setTimeout("populateCartTotalCheckout()", 2000);
    }
}

// Celebros Auto Complete JS
if("undefined"==typeof CELEBROS)var CELEBROS={};CELEBROS.namespace=function(){var a=arguments,b=null,c,d,e;for(c=0;c<a.length;c+=1){e=a[c].split(".");b=CELEBROS;for(d="CELEBROS"==e[0]?1:0;d<e.length;d+=1)b[e[d]]=b[e[d]]||{},b=b[e[d]]}return b};CELEBROS.log=function(a,b,c){var d=CELEBROS.widget.Logger;return d&&d.log?d.log(a,b,c):!1};
CELEBROS.init=function(){this.namespace("util","widget","example");if("undefined"!=typeof CELEBROS_config){var a=CELEBROS_config.listener,b=CELEBROS.env.listeners,c=!0,d;if(a){for(d=0;d<b.length;d+=1)if(b[d]==a){c=!1;break}c&&b.push(a)}}};
CELEBROS.register=function(a,b,c){var d=CELEBROS.env.modules;d[a]||(d[a]={versions:[],builds:[]});var d=d[a],e=c.version,c=c.build,f=CELEBROS.env.listeners;d.name=a;d.version=e;d.build=c;d.versions.push(e);d.builds.push(c);d.mainClass=b;for(var g=0;g<f.length;g+=1)f[g](d);b?(b.VERSION=e,b.BUILD=c):CELEBROS.log("mainClass is undefined for module "+a,"warn")};CELEBROS.env=CELEBROS.env||{modules:[],listeners:[],getVersion:function(a){return CELEBROS.env.modules[a]||null}};
CELEBROS.lang={isArray:function(a){return a.constructor&&-1<a.constructor.toString().indexOf("Array")?!0:CELEBROS.lang.isObject(a)&&a.constructor==Array},isBoolean:function(a){return"boolean"==typeof a},isFunction:function(a){return"function"==typeof a},isNull:function(a){return null===a},isNumber:function(a){return"number"==typeof a&&isFinite(a)},isObject:function(a){return"object"==typeof a||CELEBROS.lang.isFunction(a)},isString:function(a){return"string"==typeof a},isUndefined:function(a){return"undefined"==
typeof a},hasOwnProperty:function(a,b){return Object.prototype.hasOwnProperty?a.hasOwnProperty(b):!CELEBROS.lang.isUndefined(a[b])&&a.constructor.prototype[b]!==a[b]},extend:function(a,b,c){var d=function(){};d.prototype=b.prototype;a.prototype=new d;a.prototype.constructor=a;a.superclass=b.prototype;if(b.prototype.constructor==Object.prototype.constructor)b.prototype.constructor=b;if(c)for(var e in c)a.prototype[e]=c[e]},augment:function(a,b){var c=a.prototype,d=b.prototype,e=arguments,f;if(e[2])for(f=
2;f<e.length;f+=1)c[e[f]]=d[e[f]];else for(f in d)c[f]||(c[f]=d[f])}};CELEBROS.init();CELEBROS.util.Lang=CELEBROS.lang;CELEBROS.augment=CELEBROS.lang.augment;CELEBROS.extend=CELEBROS.lang.extend;CELEBROS.register("CELEBROS",CELEBROS,{version:"2.2.0",build:"127"});
(function(){var a=CELEBROS.util,b,c,d=0,e={},f=navigator.userAgent.toLowerCase(),g=-1<f.indexOf("opera"),h=-1<f.indexOf("safari");!g&&!h&&f.indexOf("gecko");var j=!g&&-1<f.indexOf("msie"),k=/(-[a-z])/i,i=function(a){if(!k.test(a))return a;if(e[a])return e[a];for(;k.exec(a);)a=a.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());return e[a]=a};b=document.defaultView&&document.defaultView.getComputedStyle?function(a,b){var c=null,d=document.defaultView.getComputedStyle(a,"");d&&(c=d[i(b)]);return a.style[b]||
c}:document.documentElement.currentStyle&&j?function(a,b){switch(i(b)){case "opacity":var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(k){}}return c/100;default:return c=a.currentStyle?a.currentStyle[b]:null,a.style[b]||c}}:function(a,b){return a.style[b]};c=j?function(a,b,c){switch(b){case "opacity":if("string"==typeof a.style.filter&&(a.style.filter="alpha(opacity="+100*c+")",!a.currentStyle||!a.currentStyle.hasLayout))a.style.zoom=
1;break;default:a.style[b]=c}}:function(a,b,c){a.style[b]=c};CELEBROS.util.Dom={get:function(b){if(!b)return null;if("string"!=typeof b&&!(b instanceof Array))return b;if("string"==typeof b)return document.getElementById(b);for(var c=[],d=0,k=b.length;d<k;++d)c[c.length]=a.Dom.get(b[d]);return c},getStyle:function(c,d){d=i(d);return a.Dom.batch(c,function(a){return b(a,d)},a.Dom,!0)},setStyle:function(b,d,k){d=i(d);a.Dom.batch(b,function(a){c(a,d,k)},a.Dom,!0)},getXY:function(b){return a.Dom.batch(b,
function(b){if(null===b.parentNode||null===b.offsetParent||"none"==this.getStyle(b,"display"))return!1;var c=null,d=[];if(b.getBoundingClientRect){c=b.getBoundingClientRect();d=document;if(!this.inDocument(b)&&parent.document!=document&&(d=parent.document,!this.isAncestor(d.documentElement,b)))return!1;b=Math.max(d.documentElement.scrollTop,d.body.scrollTop);d=Math.max(d.documentElement.scrollLeft,d.body.scrollLeft);return[c.left+d,c.top+b]}d=[b.offsetLeft,b.offsetTop];c=b.offsetParent;if(c!=b)for(;c;)d[0]+=
c.offsetLeft,d[1]+=c.offsetTop,c=c.offsetParent;h&&"absolute"==this.getStyle(b,"position")&&(d[0]-=document.body.offsetLeft,d[1]-=document.body.offsetTop);for(c=b.parentNode?b.parentNode:null;c&&"BODY"!=c.tagName.toUpperCase()&&"HTML"!=c.tagName.toUpperCase();)"inline"!=a.Dom.getStyle(c,"display")&&(d[0]-=c.scrollLeft,d[1]-=c.scrollTop),c=c.parentNode?c.parentNode:null;return d},a.Dom,!0)},getX:function(b){return a.Dom.batch(b,function(b){return a.Dom.getXY(b)[0]},a.Dom,!0)},getY:function(b){return a.Dom.batch(b,
function(b){return a.Dom.getXY(b)[1]},a.Dom,!0)},setXY:function(b,c,d){a.Dom.batch(b,function(a){var b=this.getStyle(a,"position");"static"==b&&(this.setStyle(a,"position","relative"),b="relative");var k=this.getXY(a);if(!1===k)return!1;var i=[parseInt(this.getStyle(a,"left"),10),parseInt(this.getStyle(a,"top"),10)];isNaN(i[0])&&(i[0]="relative"==b?0:a.offsetLeft);isNaN(i[1])&&(i[1]="relative"==b?0:a.offsetTop);if(null!==c[0])a.style.left=c[0]-k[0]+i[0]+"px";if(null!==c[1])a.style.top=c[1]-k[1]+i[1]+
"px";d||(b=this.getXY(a),(null!==c[0]&&b[0]!=c[0]||null!==c[1]&&b[1]!=c[1])&&this.setXY(a,c,!0))},a.Dom,!0)},setX:function(b,c){a.Dom.setXY(b,[c,null])},setY:function(b,c){a.Dom.setXY(b,[null,c])},getRegion:function(b){return a.Dom.batch(b,function(b){return new a.Region.getRegion(b)},a.Dom,!0)},getClientWidth:function(){return a.Dom.getViewportWidth()},getClientHeight:function(){return a.Dom.getViewportHeight()},getElementsByClassName:function(b,c,d){return a.Dom.getElementsBy(function(c){return a.Dom.hasClass(c,
b)},c,d)},hasClass:function(b,c){var d=RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)");return a.Dom.batch(b,function(a){return d.test(a.className)},a.Dom,!0)},addClass:function(b,c){a.Dom.batch(b,function(a){this.hasClass(a,c)||(a.className=[a.className,c].join(" "))},a.Dom,!0)},removeClass:function(b,c){var d=RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)","g");a.Dom.batch(b,function(a){if(this.hasClass(a,c))a.className=a.className.replace(d," "),this.hasClass(a,c)&&this.removeClass(a,c)},a.Dom,!0)},replaceClass:function(b,
c,d){if(c===d)return!1;var k=RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)","g");a.Dom.batch(b,function(a){this.hasClass(a,c)?(a.className=a.className.replace(k," "+d+" "),this.hasClass(a,c)&&this.replaceClass(a,c,d)):this.addClass(a,d)},a.Dom,!0)},generateId:function(b,c){c=c||"yui-gen";b=b||{};return a.Dom.batch(b,function(b){b=b?a.Dom.get(b):{};if(!b.id)b.id=c+d++;return b.id},a.Dom,!0)},isAncestor:function(b,c){b=a.Dom.get(b);return!b||!c?!1:a.Dom.batch(c,function(a){if(b.contains&&!h)return b.contains(a);
if(b.compareDocumentPosition)return!!(b.compareDocumentPosition(a)&16);for(a=a.parentNode;a;){if(a==b)return!0;if(!a.tagName||"HTML"==a.tagName.toUpperCase())break;a=a.parentNode}return!1},a.Dom,!0)},inDocument:function(b){return a.Dom.batch(b,function(a){return this.isAncestor(document.documentElement,a)},a.Dom,!0)},getElementsBy:function(b,c,d){var c=c||"*",k=[];if(d){if(d=a.Dom.get(d),!d)return k}else d=document;var i=d.getElementsByTagName(c);if(!i.length&&"*"==c&&d.all)i=d.all;c=0;for(d=i.length;c<
d;++c)b(i[c])&&(k[k.length]=i[c]);return k},batch:function(b,c,d,k){b=a.Dom.get(b);k=k?d:window;if(!b||b.tagName||!b.length)return!b?!1:c.call(k,b,d);for(var i=[],e=0,g=b.length;e<g;++e)i[i.length]=c.call(k,b[e],d);return i},getDocumentHeight:function(){return Math.max("CSS1Compat"!=document.compatMode?document.body.scrollHeight:document.documentElement.scrollHeight,a.Dom.getViewportHeight())},getDocumentWidth:function(){return Math.max("CSS1Compat"!=document.compatMode?document.body.scrollWidth:
document.documentElement.scrollWidth,a.Dom.getViewportWidth())},getViewportHeight:function(){var a=self.innerHeight,b=document.compatMode;if((b||j)&&!g)a="CSS1Compat"==b?document.documentElement.clientHeight:document.body.clientHeight;return a},getViewportWidth:function(){var a=self.innerWidth,b=document.compatMode;if(b||j)a="CSS1Compat"==b?document.documentElement.clientWidth:document.body.clientWidth;return a}}})();
CELEBROS.util.Region=function(a,b,c,d){this.top=a;this[1]=a;this.right=b;this.bottom=c;this.left=d;this[0]=d};CELEBROS.util.Region.prototype.contains=function(a){return a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom};CELEBROS.util.Region.prototype.getArea=function(){return(this.bottom-this.top)*(this.right-this.left)};
CELEBROS.util.Region.prototype.intersect=function(a){var b=Math.max(this.top,a.top),c=Math.min(this.right,a.right),d=Math.min(this.bottom,a.bottom),a=Math.max(this.left,a.left);return d>=b&&c>=a?new CELEBROS.util.Region(b,c,d,a):null};CELEBROS.util.Region.prototype.union=function(a){var b=Math.min(this.top,a.top),c=Math.max(this.right,a.right),d=Math.max(this.bottom,a.bottom),a=Math.min(this.left,a.left);return new CELEBROS.util.Region(b,c,d,a)};
CELEBROS.util.Region.prototype.toString=function(){return"Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}"};CELEBROS.util.Region.getRegion=function(a){var b=CELEBROS.util.Dom.getXY(a);return new CELEBROS.util.Region(b[1],b[0]+a.offsetWidth,b[1]+a.offsetHeight,b[0])};CELEBROS.util.Point=function(a,b){a instanceof Array&&(b=a[1],a=a[0]);this.x=this.right=this.left=this[0]=a;this.y=this.top=this.bottom=this[1]=b};CELEBROS.util.Point.prototype=new CELEBROS.util.Region;
CELEBROS.register("dom",CELEBROS.util.Dom,{version:"2.2.0",build:"127"});
if(!CELEBROS.util.Event)CELEBROS.util.Event=function(){var a=!1,b=[],c=[],d=[],e=[],f=0,g=[],h=[],j=0;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:/KHTML/gi.test(navigator.userAgent),webkit:function(){var a=navigator.userAgent.match(/AppleWebKit\/([^ ]*)/);return a&&a[1]?a[1]:null}(),isIE:!this.webkit&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi),_interval:null,startInterval:function(){if(!this._interval){var a=this;this._interval=
setInterval(function(){a._tryPreloadAttach()},this.POLL_INTERVAL)}},onAvailable:function(a,b,c,d){g.push({id:a,fn:b,obj:c,override:d,checkReady:!1});f=this.POLL_RETRYS;this.startInterval()},onContentReady:function(a,b,c,d){g.push({id:a,fn:b,obj:c,override:d,checkReady:!0});f=this.POLL_RETRYS;this.startInterval()},addListener:function(a,i,g,f,o){if(!g||!g.call)return!1;if(this._isValidCollection(a)){for(var m=!0,j=0,q=a.length;j<q;++j)m=this.on(a[j],i,g,f,o)&&m;return m}if("string"==typeof a)if(m=
this.getEl(a))a=m;else return this.onAvailable(a,function(){CELEBROS.util.Event.on(a,i,g,f,o)}),!0;if(!a)return!1;if("unload"==i&&f!==this)return c[c.length]=[a,i,g,f,o],!0;var n=a;o&&(n=!0===o?f:o);m=function(a){return g.call(n,CELEBROS.util.Event.getEvent(a),f)};j=[a,i,g,m,n];b[b.length]=j;if(this.useLegacyEvent(a,i)){var s=this.getLegacyIndex(a,i);if(-1==s||a!=d[s][0])s=d.length,h[a.id+i]=s,d[s]=[a,i,a["on"+i]],e[s]=[],a["on"+i]=function(a){CELEBROS.util.Event.fireLegacyEvent(CELEBROS.util.Event.getEvent(a),
s)};e[s].push(j)}else try{this._simpleAdd(a,i,m,!1)}catch(t){return this.lastError=t,this.removeListener(a,i,g),!1}return!0},fireLegacyEvent:function(a,b){var c=!0,g,f,h;g=e[b];for(var j=0,q=g.length;j<q;++j)if((f=g[j])&&f[this.WFN])h=f[this.ADJ_SCOPE],f=f[this.WFN].call(h,a),c=c&&f;if((g=d[b])&&g[2])g[2](a);return c},getLegacyIndex:function(a,b){var c=this.generateId(a)+b;return"undefined"==typeof h[c]?-1:h[c]},useLegacyEvent:function(a,b){if(this.webkit&&("click"==b||"dblclick"==b)){var c=parseInt(this.webkit,
10);if(!isNaN(c)&&418>c)return!0}return!1},removeListener:function(a,d,g,f){var h,j;if("string"==typeof a)a=this.getEl(a);else if(this._isValidCollection(a)){f=!0;for(h=0,j=a.length;h<j;++h)f=this.removeListener(a[h],d,g)&&f;return f}if(!g||!g.call)return this.purgeElement(a,!1,d);if("unload"==d){for(h=0,j=c.length;h<j;h++){var r=c[h];if(r&&r[0]==a&&r[1]==d&&r[2]==g)return c.splice(h,1),!0}return!1}h=null;"undefined"==typeof f&&(f=this._getCacheIndex(a,d,g));0<=f&&(h=b[f]);if(!a||!h)return!1;if(this.useLegacyEvent(a,
d)){h=this.getLegacyIndex(a,d);var q=e[h];if(q)for(h=0,j=q.length;h<j;++h)if((r=q[h])&&r[this.EL]==a&&r[this.TYPE]==d&&r[this.FN]==g){q.splice(h,1);break}}else try{this._simpleRemove(a,d,h[this.WFN],!1)}catch(n){return this.lastError=n,!1}delete b[f][this.WFN];delete b[f][this.FN];b.splice(f,1);return!0},getTarget:function(a){return this.resolveTextNode(a.target||a.srcElement)},resolveTextNode:function(a){return a&&3==a.nodeType?a.parentNode:a},getPageX:function(a){var b=a.pageX;!b&&0!==b&&(b=a.clientX||
0,this.isIE&&(b+=this._getScrollLeft()));return b},getPageY:function(a){var b=a.pageY;!b&&0!==b&&(b=a.clientY||0,this.isIE&&(b+=this._getScrollTop()));return b},getXY:function(a){return[this.getPageX(a),this.getPageY(a)]},getRelatedTarget:function(a){var b=a.relatedTarget;if(!b)if("mouseout"==a.type)b=a.toElement;else if("mouseover"==a.type)b=a.fromElement;return this.resolveTextNode(b)},getTime:function(a){if(!a.time){var b=(new Date).getTime();try{a.time=b}catch(c){return this.lastError=c,b}}return a.time},
stopEvent:function(a){this.stopPropagation(a);this.preventDefault(a)},stopPropagation:function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},getEvent:function(a){a=a||window.event;if(!a)for(var b=this.getEvent.caller;b&&!((a=b.arguments[0])&&Event==a.constructor);)b=b.caller;return a},getCharCode:function(a){return a.charCode||a.keyCode||0},_getCacheIndex:function(a,c,d){for(var e=0,g=b.length;e<g;++e){var f=
b[e];if(f&&f[this.FN]==d&&f[this.EL]==a&&f[this.TYPE]==c)return e}return-1},generateId:function(a){var b=a.id;if(!b)b="yuievtautoid-"+j,++j,a.id=b;return b},_isValidCollection:function(a){return a&&a.length&&"string"!=typeof a&&!a.tagName&&!a.alert&&"undefined"!=typeof a[0]},elCache:{},getEl:function(a){return document.getElementById(a)},clearCache:function(){},_load:function(){a=!0;var b=CELEBROS.util.Event;this.isIE&&b._simpleRemove(window,"load",b._load)},_tryPreloadAttach:function(){if(this.locked)return!1;
this.locked=!0;var b=!a;b||(b=0<f);for(var c=[],d=0,e=g.length;d<e;++d){var h=g[d];if(h){var j=this.getEl(h.id);if(j){if(!h.checkReady||a||j.nextSibling||document&&document.body)h.override&&(j=!0===h.override?h.obj:h.override),h.fn.call(j,h.obj),g[d]=null}else c.push(h)}}f=0===c.length?0:f-1;b?this.startInterval():(clearInterval(this._interval),this._interval=null);this.locked=!1;return!0},purgeElement:function(a,b,c){var d=this.getListeners(a,c);if(d)for(var e=0,f=d.length;e<f;++e){var g=d[e];this.removeListener(a,
g.type,g.fn)}if(b&&a&&a.childNodes)for(e=0,f=a.childNodes.length;e<f;++e)this.purgeElement(a.childNodes[e],b,c)},getListeners:function(a,d){var e=[],f;f=d?"unload"==d?[c]:[b]:[b,c];for(var g=0;g<f.length;++g){var h=f[g];if(h&&0<h.length)for(var j=0,q=h.length;j<q;++j){var n=h[j];n&&n[this.EL]===a&&(!d||d===n[this.TYPE])&&e.push({type:n[this.TYPE],fn:n[this.FN],obj:n[this.OBJ],adjust:n[this.ADJ_SCOPE],index:j})}}return e.length?e:null},_unload:function(a){var e=CELEBROS.util.Event,f,g,h;for(f=0,h=
c.length;f<h;++f)if(g=c[f]){var j=window;g[e.ADJ_SCOPE]&&(j=!0===g[e.ADJ_SCOPE]?g[e.OBJ]:g[e.ADJ_SCOPE]);g[e.FN].call(j,e.getEvent(a),g[e.OBJ]);c[f]=null}c=null;if(b&&0<b.length){for(a=b.length;a;)f=a-1,(g=b[f])&&e.removeListener(g[e.EL],g[e.TYPE],g[e.FN],f),a-=1;e.clearCache()}for(f=0,h=d.length;f<h;++f)d[f][0]=null,d[f]=null;d=null;e._simpleRemove(window,"unload",e._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var a=
document.documentElement,b=document.body;return a&&(a.scrollTop||a.scrollLeft)?[a.scrollTop,a.scrollLeft]:b?[b.scrollTop,b.scrollLeft]:[0,0]},regCE:function(){},_simpleAdd:function(){return window.addEventListener?function(a,b,c,d){a.addEventListener(b,c,d)}:window.attachEvent?function(a,b,c){a.attachEvent("on"+b,c)}:function(){}}(),_simpleRemove:function(){return window.removeEventListener?function(a,b,c,d){a.removeEventListener(b,c,d)}:window.detachEvent?function(a,b,c){a.detachEvent("on"+b,c)}:
function(){}}()}}(),function(){var a=CELEBROS.util.Event;a.on=a.addListener;document&&document.body?a._load():a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach()}();CELEBROS.util.CustomEvent=function(a,b,c,d){this.type=a;this.scope=b||window;this.silent=c;this.signature=d||CELEBROS.util.CustomEvent.LIST;this.subscribers=[];if("_YUICEOnSubscribe"!==a)this.subscribeEvent=new CELEBROS.util.CustomEvent("_YUICEOnSubscribe",this,!0)};
CELEBROS.util.CustomEvent.LIST=0;CELEBROS.util.CustomEvent.FLAT=1;
CELEBROS.util.CustomEvent.prototype={subscribe:function(a,b,c){this.subscribeEvent&&this.subscribeEvent.fire(a,b,c);this.subscribers.push(new CELEBROS.util.Subscriber(a,b,c))},unsubscribe:function(a,b){if(!a)return this.unsubscribeAll();for(var c=!1,d=0,e=this.subscribers.length;d<e;++d){var f=this.subscribers[d];f&&f.contains(a,b)&&(this._delete(d),c=!0)}return c},fire:function(){var a=this.subscribers.length;if(!a&&this.silent)return!0;var b=[],c=!0,d;for(d=0;d<arguments.length;++d)b.push(arguments[d]);
for(d=0;d<a;++d)if(c=this.subscribers[d]){var e=c.getScope(this.scope);if(this.signature==CELEBROS.util.CustomEvent.FLAT){var f=null;0<b.length&&(f=b[0]);c=c.fn.call(e,f,c.obj)}else c=c.fn.call(e,this.type,b,c.obj);if(!1===c)return!1}return!0},unsubscribeAll:function(){for(var a=0,b=this.subscribers.length;a<b;++a)this._delete(b-1-a);return a},_delete:function(a){var b=this.subscribers[a];b&&(delete b.fn,delete b.obj);this.subscribers.splice(a,1)},toString:function(){return"CustomEvent: '"+this.type+
"', scope: "+this.scope}};CELEBROS.util.Subscriber=function(a,b,c){this.fn=a;this.obj=b||null;this.override=c};CELEBROS.util.Subscriber.prototype.getScope=function(a){return this.override?!0===this.override?this.obj:this.override:a};CELEBROS.util.Subscriber.prototype.contains=function(a,b){return b?this.fn==a&&this.obj==b:this.fn==a};CELEBROS.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }"};
CELEBROS.util.EventProvider=function(){};
CELEBROS.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,b,c,d){this.__yui_events=this.__yui_events||{};var e=this.__yui_events[a];e?e.subscribe(b,c,d):(e=this.__yui_subscribers=this.__yui_subscribers||{},e[a]||(e[a]=[]),e[a].push({fn:b,obj:c,override:d}))},unsubscribe:function(a,b,c){this.__yui_events=this.__yui_events||{};return(a=this.__yui_events[a])?a.unsubscribe(b,c):!1},unsubscribeAll:function(a){return this.unsubscribe(a)},createEvent:function(a,
b){this.__yui_events=this.__yui_events||{};var c=b||{},d=this.__yui_events;if(!d[a]){var e=new CELEBROS.util.CustomEvent(a,c.scope||this,c.silent||null,CELEBROS.util.CustomEvent.FLAT);d[a]=e;c.onSubscribeCallback&&e.subscribeEvent.subscribe(c.onSubscribeCallback);this.__yui_subscribers=this.__yui_subscribers||{};if(c=this.__yui_subscribers[a])for(var f=0;f<c.length;++f)e.subscribe(c[f].fn,c[f].obj,c[f].override)}return d[a]},fireEvent:function(a,b,c,d){this.__yui_events=this.__yui_events||{};var e=
this.__yui_events[a];if(e){for(var f=[],g=1;g<arguments.length;++g)f.push(arguments[g]);return e.fire.apply(e,f)}return null},hasEvent:function(a){return this.__yui_events&&this.__yui_events[a]?!0:!1}};
CELEBROS.util.KeyListener=function(a,b,c,d){function e(a){if(!b.shift)b.shift=!1;if(!b.alt)b.alt=!1;if(!b.ctrl)b.ctrl=!1;if(a.shiftKey==b.shift&&a.altKey==b.alt&&a.ctrlKey==b.ctrl){var c;if(b.keys instanceof Array)for(var d=0;d<b.keys.length;d++)if(c=b.keys[d],c==a.charCode){f.fire(a.charCode,a);break}else{if(c==a.keyCode){f.fire(a.keyCode,a);break}}else c=b.keys,c==a.charCode?f.fire(a.charCode,a):c==a.keyCode&&f.fire(a.keyCode,a)}}if(!d)d=CELEBROS.util.KeyListener.KEYDOWN;var f=new CELEBROS.util.CustomEvent("keyPressed");
this.enabledEvent=new CELEBROS.util.CustomEvent("enabled");this.disabledEvent=new CELEBROS.util.CustomEvent("disabled");"string"==typeof a&&(a=document.getElementById(a));"function"==typeof c?f.subscribe(c):f.subscribe(c.fn,c.scope,c.correctScope);this.enable=function(){this.enabled||(CELEBROS.util.Event.addListener(a,d,e),this.enabledEvent.fire(b));this.enabled=!0};this.disable=function(){this.enabled&&(CELEBROS.util.Event.removeListener(a,d,e),this.disabledEvent.fire(b));this.enabled=!1};this.toString=
function(){return"KeyListener ["+b.keys+"] "+a.tagName+(a.id?"["+a.id+"]":"")}};CELEBROS.util.KeyListener.KEYDOWN="keydown";CELEBROS.util.KeyListener.KEYUP="keyup";CELEBROS.register("event",CELEBROS.util.Event,{version:"2.2.0",build:"127"});var bLoaded=!0,initialized=!1;function JSLoaded(){bLoaded=!0}function isArray(a){if(a){var b=CELEBROS.lang;return b.isNumber(a.length)&&b.isFunction(a.splice)&&!b.hasOwnProperty(a.length)}return!1}var sSeperator;
function IsSpecialSuggestion(a){return 1<a.length?a.charAt(0)==sSeperator&&a.charAt(a.length-1)==sSeperator?!0:!1:!1}"http:"==window.location.protocol?sProtocol="http:":"https:"==window.location.protocol&&(sProtocol="https:");var sDisableParemeter="autocomplete=no",sProtocol,sServiceLocation,sSiteKey,sSearchBox,oSearchBox,oResultFunction;
function ItemSelected(a,b){oAc=b[0];oItem=b[1];oItemData=b[2];var c="",d="",e="",f="";if(void 0!=oAc._typedQuery)d=oAc._typedQuery;f=[];if(null==oItemData)c=document.getElementById(sSearchBox).value,c=c.replace(/</g,""),c=c.replace(/>/g,""),c=c.replace(/'/g,"");else for(var c=oItemData[0],e=oItemData[1],g=0;g<oAc._aListItems.length;g++)oAc._aListItems[g]._oResultData&&(IsSpecialSuggestion(oAc._aListItems[g]._oResultData[0],"#")||(""!=oAc._aListItems[g]._oResultData[5]?f.push(oAc._aListItems[g]._oResultData[5]):
f.push(oAc._aListItems[g]._oResultData[0])));if(oResultFunction)g=[],g.SelectedQuery=c,g.EnteredQuery=d,g.SelectedURL=e,g.Suggestions=f,g.IsAutoComplete=null!=oItemData,document.getElementById(sSearchBox).value=c,oResultFunction(g)}
CELEBROS.util.Connect={_msxml_progid:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],_http_headers:{},_has_http_headers:!1,_use_default_post_header:!0,_default_post_header:"application/x-www-form-urlencoded",_use_default_xhr_header:!0,_default_xhr_header:"XMLHttpRequest",_has_default_headers:!0,_default_headers:{},_isFormSubmit:!1,_isFileUpload:!1,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(a){this._msxml_progid.unshift(a)},
setDefaultPostHeader:function(a){this._use_default_post_header=a},setDefaultXhrHeader:function(a){this._use_default_xhr_header=a},setPollingInterval:function(a){if("number"==typeof a&&isFinite(a))this._polling_interval=a},createXhrObject:function(a){var b,c;try{c=new XMLHttpRequest,b={conn:c,tId:a}}catch(d){for(var e=0;e<this._msxml_progid.length;++e)try{c=new ActiveXObject(this._msxml_progid[e]);b={conn:c,tId:a};break}catch(f){}}finally{return b}},getConnectionObject:function(){var a,b=this._transaction_id;
try{(a=this.createXhrObject(b))&&this._transaction_id++}catch(c){}finally{return a}},asyncRequest:function(a,b,c,d){var e=this.getConnectionObject();if(e){if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(e.tId,c,b,d);this.releaseObject(e);return}"GET"==a.toUpperCase()?b=0!=this._sFormData.length?b+((-1==b.indexOf("?")?"?":"&")+this._sFormData):b+("?"+this._sFormData):"POST"==a.toUpperCase()&&(d=d?this._sFormData+"&"+d:this._sFormData)}e.conn.open(a,b,!0);this._use_default_xhr_header&&
(this._default_headers["X-Requested-With"]||this.initHeader("X-Requested-With",this._default_xhr_header,!0));if(this._isFormSubmit||d&&this._use_default_post_header)this.initHeader("Content-Type",this._default_post_header),this._isFormSubmit&&this.resetFormState();(this._has_default_headers||this._has_http_headers)&&this.setHeader(e);this.handleReadyState(e,c);e.conn.send(d||null);return e}return null},handleReadyState:function(a,b){var c=this;b&&b.timeout&&(this._timeOut[a.tId]=window.setTimeout(function(){c.abort(a,
b,!0)},b.timeout));this._poll[a.tId]=window.setInterval(function(){a.conn&&4==a.conn.readyState&&(window.clearInterval(c._poll[a.tId]),delete c._poll[a.tId],b&&b.timeout&&delete c._timeOut[a.tId],c.handleTransactionResponse(a,b))},this._polling_interval)},handleTransactionResponse:function(a,b,c){if(b){var d;try{d=void 0!==a.conn.status&&0!=a.conn.status?a.conn.status:13030}catch(e){d=13030}if(200<=d&&300>d)c=this.createResponseObject(a,b.argument),b.success&&(b.scope?b.success.apply(b.scope,[c]):
b.success(c));else switch(d){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:c=this.createExceptionObject(a.tId,b.argument,c?c:!1);b.failure&&(b.scope?b.failure.apply(b.scope,[c]):b.failure(c));break;default:c=this.createResponseObject(a,b.argument),b.failure&&(b.scope?b.failure.apply(b.scope,[c]):b.failure(c))}}this.releaseObject(a)},createResponseObject:function(a,b){var c={},d={};try{for(var e=a.conn.getAllResponseHeaders(),f=e.split("\n"),g=0;g<f.length;g++){var h=f[g].indexOf(":");
-1!=h&&(d[f[g].substring(0,h)]=f[g].substring(h+2))}}catch(j){}c.tId=a.tId;c.status=a.conn.status;c.statusText=a.conn.statusText;c.getResponseHeader=d;c.getAllResponseHeaders=e;c.responseText=a.conn.responseText;c.responseXML=a.conn.responseXML;if(void 0!==typeof b)c.argument=b;return c},createExceptionObject:function(a,b,c){var d={};d.tId=a;c?(d.status=-1,d.statusText="transaction aborted"):(d.status=0,d.statusText="communication failure");if(b)d.argument=b;return d},initHeader:function(a,b,c){var d=
c?this._default_headers:this._http_headers;d[a]=void 0===d[a]?b:b+","+d[a];c?this._has_default_headers=!0:this._has_http_headers=!0},setHeader:function(a){if(this._has_default_headers)for(var b in this._default_headers)CELEBROS.lang.hasOwnProperty(this._default_headers,b)&&a.conn.setRequestHeader(b,this._default_headers[b]);if(this._has_http_headers){for(b in this._http_headers)CELEBROS.lang.hasOwnProperty(this._http_headers,b)&&a.conn.setRequestHeader(b,this._http_headers[b]);delete this._http_headers;
this._http_headers={};this._has_http_headers=!1}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=!1},setForm:function(a,b,c){this.resetFormState();if("string"==typeof a)a=document.getElementById(a)||document.forms[a];else if("object"!=typeof a)return;if(b)this.createFrame(c?c:null),this._isFileUpload=this._isFormSubmit=!0,this._formNode=a;else{for(var d,e,f=!1,g=0;g<a.elements.length;g++)if(b=a.elements[g],e=a.elements[g].disabled,c=
a.elements[g].name,d=a.elements[g].value,!e&&c)switch(b.type){case "select-one":case "select-multiple":for(d=0;d<b.options.length;d++)if(b.options[d].selected)this._sFormData=window.ActiveXObject?this._sFormData+(encodeURIComponent(c)+"="+encodeURIComponent(b.options[d].attributes.value.specified?b.options[d].value:b.options[d].text)+"&"):this._sFormData+(encodeURIComponent(c)+"="+encodeURIComponent(b.options[d].hasAttribute("value")?b.options[d].value:b.options[d].text)+"&");break;case "radio":case "checkbox":b.checked&&
(this._sFormData+=encodeURIComponent(c)+"="+encodeURIComponent(d)+"&");break;case "file":case void 0:case "reset":case "button":break;case "submit":!1==f&&(this._sFormData+=encodeURIComponent(c)+"="+encodeURIComponent(d)+"&",f=!0);break;default:this._sFormData+=encodeURIComponent(c)+"="+encodeURIComponent(d)+"&"}this._isFormSubmit=!0;return this._sFormData=this._sFormData.substr(0,this._sFormData.length-1)}},resetFormState:function(){this._isFileUpload=this._isFormSubmit=!1;this._formNode=null;this._sFormData=
""},createFrame:function(a){var b="yuiIO"+this._transaction_id;if(window.ActiveXObject){var c=document.createElement('<iframe id="'+b+'" name="'+b+'" />');if("boolean"==typeof a)c.src="javascript:false";else if("string"==typeof secureURI)c.src=a}else c=document.createElement("iframe"),c.id=b,c.name=b;c.style.position="absolute";c.style.top="-1000px";c.style.left="-1000px";document.body.appendChild(c)},appendPostData:function(a){for(var b=[],a=a.split("&"),c=0;c<a.length;c++){var d=a[c].indexOf("=");
if(-1!=d)b[c]=document.createElement("input"),b[c].type="hidden",b[c].name=a[c].substring(0,d),b[c].value=a[c].substring(d+1),this._formNode.appendChild(b[c])}return b},uploadFile:function(a,b,c,d){var e="yuiIO"+a,f=document.getElementById(e);this._formNode.action=c;this._formNode.method="POST";this._formNode.target=e;this._formNode.encoding?this._formNode.encoding="multipart/form-data":this._formNode.enctype="multipart/form-data";if(d)var g=this.appendPostData(d);this._formNode.submit();if(g&&0<
g.length)for(c=0;c<g.length;c++)this._formNode.removeChild(g[c]);this.resetFormState();var h=function(){var c={};c.tId=a;c.argument=b.argument;try{c.responseText=f.contentWindow.document.body?f.contentWindow.document.body.innerHTML:null,c.responseXML=f.contentWindow.document.XMLDocument?f.contentWindow.document.XMLDocument:f.contentWindow.document}catch(d){}b&&b.upload&&(b.scope?b.upload.apply(b.scope,[c]):b.upload(c));CELEBROS.util.Event?CELEBROS.util.Event.removeListener(f,"load",h):window.detachEvent?
f.detachEvent("onload",h):f.removeEventListener("load",h,!1);setTimeout(function(){document.body.removeChild(f)},100)};CELEBROS.util.Event?CELEBROS.util.Event.addListener(f,"load",h):window.attachEvent?f.attachEvent("onload",h):f.addEventListener("load",h,!1)},abort:function(a,b,c){return this.isCallInProgress(a)?(a.conn.abort(),window.clearInterval(this._poll[a.tId]),delete this._poll[a.tId],c&&delete this._timeOut[a.tId],this.handleTransactionResponse(a,b,!0),!0):!1},isCallInProgress:function(a){return a.conn?
4!=a.conn.readyState&&0!=a.conn.readyState:!1},releaseObject:function(a){a.conn=null}};CELEBROS.register("connection",CELEBROS.widget.Module,{version:"2.2.0",build:"127"});
newXMLDocument=function(a,b){a||(a="");b||(b="");if(document.implementation&&document.implementation.createDocument)return document.implementation.createDocument(b,a,null);var c=new ActiveXObject("MSXML2.DOMDocument");if(a){var d="",e=a,f=a.indexOf(":");-1!=f&&(d=a.substring(0,f),e=a.substring(f+1));b?d||(d="a0"):d="";c.loadXML("<"+(d?d+":":"")+e+(b?" xmlns:"+d+'="'+b+'"':"")+"/>")}return c};
parseXML=function(a){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(a,"application/xml");if("undefined"!=typeof ActiveXObject){var b=newXMLDocument();b.loadXML(a);return b}a="data:text/xml;charset=utf-8,"+encodeURIComponent(a);b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseXML};
CELEBROS.widget.AutoComplete=function(a,b,c,d){if(a&&b&&c&&c&&c instanceof CELEBROS.widget.DataSource&&(this.dataSource=c,CELEBROS.util.Dom.inDocument(a)&&("string"==typeof a?(this._sName="instance"+CELEBROS.widget.AutoComplete._nIndex+" "+a,this._oTextbox=document.getElementById(a)):(this._sName=a.id?"instance"+CELEBROS.widget.AutoComplete._nIndex+" "+a.id:"instance"+CELEBROS.widget.AutoComplete._nIndex,this._oTextbox=a),CELEBROS.util.Dom.inDocument(b)))){this._oContainer="string"==typeof b?document.getElementById(b):
b;if("object"==typeof d)for(var e in d)e&&(this[e]=d[e]);this._initContainer();this._initProps();this._initList();this._initContainerHelpers();a=this._oTextbox;b=this._oContainer._oContent;CELEBROS.util.Event.addListener(a,"keyup",this._onTextboxKeyUp,this);CELEBROS.util.Event.addListener(a,"keydown",this._onTextboxKeyDown,this);CELEBROS.util.Event.addListener(a,"focus",this._onTextboxFocus,this);CELEBROS.util.Event.addListener(a,"blur",this._onTextboxBlur,this);CELEBROS.util.Event.addListener(b,
"mouseover",this._onContainerMouseover,this);CELEBROS.util.Event.addListener(b,"mouseout",this._onContainerMouseout,this);CELEBROS.util.Event.addListener(b,"scroll",this._onContainerScroll,this);CELEBROS.util.Event.addListener(b,"resize",this._onContainerResize,this);a.form&&CELEBROS.util.Event.addListener(a.form,"submit",this._onFormSubmit,this);CELEBROS.util.Event.addListener(a,"keypress",this._onTextboxKeyPress,this);this.textboxFocusEvent=new CELEBROS.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=
new CELEBROS.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new CELEBROS.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new CELEBROS.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new CELEBROS.util.CustomEvent("dataError",this);this.containerExpandEvent=new CELEBROS.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new CELEBROS.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new CELEBROS.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=
new CELEBROS.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new CELEBROS.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new CELEBROS.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new CELEBROS.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new CELEBROS.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new CELEBROS.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new CELEBROS.util.CustomEvent("containerCollapse",
this);this.textboxBlurEvent=new CELEBROS.util.CustomEvent("textboxBlur",this);c=c.scriptURI;script=document.createElement("script");script.type="text/javascript";script.src=c;script.id="jsSuggestions";document.getElementsByTagName("head")[0].appendChild(script);a.setAttribute("autocomplete","off");CELEBROS.widget.AutoComplete._nIndex++}};CELEBROS.widget.AutoComplete.prototype.dataSource=null;CELEBROS.widget.AutoComplete.prototype.minQueryLength=1;
CELEBROS.widget.AutoComplete.prototype.maxResultsDisplayed=10;CELEBROS.widget.AutoComplete.prototype.queryDelay=0.2;CELEBROS.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";CELEBROS.widget.AutoComplete.prototype.prehighlightClassName=null;CELEBROS.widget.AutoComplete.prototype.delimChar=null;CELEBROS.widget.AutoComplete.prototype.autoHighlight=!0;CELEBROS.widget.AutoComplete.prototype.typeAhead=!1;CELEBROS.widget.AutoComplete.prototype.animHoriz=!1;
CELEBROS.widget.AutoComplete.prototype.animVert=!0;CELEBROS.widget.AutoComplete.prototype.animSpeed=0.3;CELEBROS.widget.AutoComplete.prototype.forceSelection=!1;CELEBROS.widget.AutoComplete.prototype.allowBrowserAutocomplete=!0;CELEBROS.widget.AutoComplete.prototype.alwaysShowContainer=!1;CELEBROS.widget.AutoComplete.prototype.useIFrame=!1;CELEBROS.widget.AutoComplete.prototype.useShadow=!1;CELEBROS.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName};
CELEBROS.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen};CELEBROS.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems};CELEBROS.widget.AutoComplete.prototype.getListItemData=function(a){return a._oResultData?a._oResultData:!1};
CELEBROS.widget.AutoComplete.prototype.setHeader=function(a){if(a){if(this._oContainer._oContent._oHeader)this._oContainer._oContent._oHeader.innerHTML=a,this._oContainer._oContent._oHeader.style.display="block"}else this._oContainer._oContent._oHeader.innerHTML="",this._oContainer._oContent._oHeader.style.display="none"};
CELEBROS.widget.AutoComplete.prototype.setFooter=function(a){if(a){if(this._oContainer._oContent._oFooter)this._oContainer._oContent._oFooter.innerHTML=a,this._oContainer._oContent._oFooter.style.display="block"}else this._oContainer._oContent._oFooter.innerHTML="",this._oContainer._oContent._oFooter.style.display="none"};
CELEBROS.widget.AutoComplete.prototype.setBody=function(a){if(a){if(this._oContainer._oContent._oBody)this._oContainer._oContent._oBody.innerHTML=a,this._oContainer._oContent._oBody.style.display="block",this._oContainer._oContent.style.display="block"}else this._oContainer._oContent._oBody.innerHTML="",this._oContainer._oContent.style.display="none";this._maxResultsDisplayed=0};CELEBROS.widget.AutoComplete.prototype.formatResult=function(a){return(a=a[0])?a:""};
CELEBROS.widget.AutoComplete.prototype.doBeforeExpandContainer=function(){return!0};CELEBROS.widget.AutoComplete.prototype.sendQuery=function(a){this._sendQuery(a)};CELEBROS.widget.AutoComplete.prototype.textboxFocusEvent=null;CELEBROS.widget.AutoComplete.prototype.textboxKeyEvent=null;CELEBROS.widget.AutoComplete.prototype.dataRequestEvent=null;CELEBROS.widget.AutoComplete.prototype.dataReturnEvent=null;CELEBROS.widget.AutoComplete.prototype.dataErrorEvent=null;
CELEBROS.widget.AutoComplete.prototype.containerExpandEvent=null;CELEBROS.widget.AutoComplete.prototype.typeAheadEvent=null;CELEBROS.widget.AutoComplete.prototype.itemMouseOverEvent=null;CELEBROS.widget.AutoComplete.prototype.itemMouseOutEvent=null;CELEBROS.widget.AutoComplete.prototype.itemArrowToEvent=null;CELEBROS.widget.AutoComplete.prototype.itemArrowFromEvent=null;CELEBROS.widget.AutoComplete.prototype.itemSelectEvent=null;CELEBROS.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;
CELEBROS.widget.AutoComplete.prototype.selectionEnforceEvent=null;CELEBROS.widget.AutoComplete.prototype.containerCollapseEvent=null;CELEBROS.widget.AutoComplete.prototype.textboxBlurEvent=null;CELEBROS.widget.AutoComplete._nIndex=0;CELEBROS.widget.AutoComplete.prototype._sName=null;CELEBROS.widget.AutoComplete.prototype._oTextbox=null;CELEBROS.widget.AutoComplete.prototype._bFocused=!0;CELEBROS.widget.AutoComplete.prototype._oAnim=null;CELEBROS.widget.AutoComplete.prototype._oContainer=null;
CELEBROS.widget.AutoComplete.prototype._bContainerOpen=!1;CELEBROS.widget.AutoComplete.prototype._bOverContainer=!1;CELEBROS.widget.AutoComplete.prototype._aListItems=null;CELEBROS.widget.AutoComplete.prototype._nDisplayedItems=0;CELEBROS.widget.AutoComplete.prototype._maxResultsDisplayed=0;CELEBROS.widget.AutoComplete.prototype._sCurQuery=null;CELEBROS.widget.AutoComplete.prototype._sSavedQuery=null;CELEBROS.widget.AutoComplete.prototype._oCurItem=null;
CELEBROS.widget.AutoComplete.prototype._bItemSelected=!1;CELEBROS.widget.AutoComplete.prototype._nKeyCode=null;CELEBROS.widget.AutoComplete.prototype._nDelayID=-1;CELEBROS.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";CELEBROS.widget.AutoComplete.prototype._queryInterval=null;CELEBROS.widget.AutoComplete.prototype._sLastTextboxValue=null;
CELEBROS.widget.AutoComplete.prototype._initProps=function(){isNaN(this.minQueryLength);if(isNaN(this.maxResultsDisplayed)||1>this.maxResultsDisplayed)this.maxResultsDisplayed=10;if(isNaN(this.queryDelay)||0>this.queryDelay)this.queryDelay=0.5;var a=this.delimChar?this.delimChar:null;if(a)if("string"==typeof a)this.delimChar=[a];else if(a.constructor!=Array)this.delimChar=null;a=this.animSpeed;if((this.animHoriz||this.animVert)&&CELEBROS.util.Anim){if(isNaN(a)||0>a)a=0.3;this._oAnim?this._oAnim.duration=
a:this._oAnim=oAnim=new CELEBROS.util.Anim(this._oContainer._oContent,{},this.animSpeed)}};
CELEBROS.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var a=document.createElement("div");a.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(a)}if(this.useIFrame&&!this._oContainer._oIFrame)a=document.createElement("iframe"),a.src=this._iFrameSrc,a.frameBorder=0,a.scrolling="no",a.style.position="absolute",a.style.width="100%",a.style.height="100%",a.tabIndex=-1,this._oContainer._oIFrame=this._oContainer.appendChild(a)};
CELEBROS.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var a=document.createElement("div");a.className="yui-ac-content";a.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(a);a=document.createElement("div");a.className="yui-ac-hd";a.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(a);a=document.createElement("div");a.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(a);
a=document.createElement("div");a.className="yui-ac-ft";a.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(a)}};
CELEBROS.widget.AutoComplete.prototype._initList=function(){for(this._aListItems=[];this._oContainer._oContent._oBody.hasChildNodes();){var a=this.getListItems();if(a)for(var b=a.length-1;0<=b;c--)a[b]=null;this._oContainer._oContent._oBody.innerHTML=""}for(var a=document.createElement("ul"),a=this._oContainer._oContent._oBody.appendChild(a),c=0;c<this.maxResultsDisplayed;c++)b=document.createElement("li"),b=a.appendChild(b),this._aListItems[c]=b,this._initListItem(b,c);this._maxResultsDisplayed=
this.maxResultsDisplayed};CELEBROS.widget.AutoComplete.prototype._initListItem=function(a,b){a.style.display="none";a._nItemIndex=b;a.mouseover=a.mouseout=a.onclick=null;CELEBROS.util.Event.addListener(a,"mouseover",this._onItemMouseover,this);CELEBROS.util.Event.addListener(a,"mouseout",this._onItemMouseout,this);CELEBROS.util.Event.addListener(a,"click",this._onItemMouseclick,this)};CELEBROS.widget.AutoComplete.prototype._onIMEDetected=function(a){a._enableIntervalDetection()};
CELEBROS.widget.AutoComplete.prototype._enableIntervalDetection=function(){var a=this._oTextbox.value;if(a!=this._sLastTextboxValue)this._sLastTextboxValue=a,this._sendQuery(a)};CELEBROS.widget.AutoComplete.prototype._cancelIntervalDetection=function(a){a._queryInterval&&clearInterval(a._queryInterval)};CELEBROS.widget.AutoComplete.prototype._isIgnoreKey=function(a){return 9==a||13==a||16==a||17==a||18<=a&&20>=a||27==a||33<=a&&34>=a||36<=a&&38>=a||40==a||44<=a&&45>=a?!0:!1};
CELEBROS.widget.AutoComplete.prototype._sendQuery=function(a){-1==this.minQueryLength?this._toggleContainer(!1):a&&a.length<this.minQueryLength||!a&&0<this.minQueryLength?(-1!=this._nDelayID&&clearTimeout(this._nDelayID),this._toggleContainer(!1)):(a=a.replace(/</g,""),a=a.replace(/>/g,""),this._typedQuery=a=a.replace(/'/g,""),a=encodeURIComponent(a),this._nDelayID=-1,this.dataRequestEvent.fire(this,a),this.dataSource.getResults(this._populateList,a,this))};
CELEBROS.widget.AutoComplete.prototype._populateList=function(a,b,c){c._toggleContainer(!1);null===b&&c.dataErrorEvent.fire(c,a);if(c._bFocused&&b){var d=-1!=navigator.userAgent.toLowerCase().indexOf("opera"),e=c._oContainer._oContent.style;e.width=!d?null:"";e.height=!d?null:"";var f=decodeURIComponent(a);c._sCurQuery=f;c._bItemSelected=!1;c._maxResultsDisplayed!=c.maxResultsDisplayed&&c._initList();d=Math.min(b.length,c.maxResultsDisplayed);c._nDisplayedItems=d;if(0<d){c._initContainerHelpers();
for(var e=c._aListItems,g=d-1;0<=g;g--){var h=e[g],j=b[g];h.innerHTML=c.formatResult(h,j,f);h.style.display="list-item";h._sResultKey=j[0];h._oResultData=j}for(f=e.length-1;f>=d;f--)g=e[f],g.innerHTML=null,g.style.display="none",g._sResultKey=null,g._oResultData=null;c.autoHighlight?(d=e[0],c._toggleHighlight(d,"to"),c.itemArrowToEvent.fire(c,d),c._typeAhead(d,a)):c._oCurItem=null;d=c.doBeforeExpandContainer(c._oTextbox,c._oContainer,a,b);c._toggleContainer(d)}else c._toggleContainer(!1);c.dataReturnEvent.fire(c,
a,b)}};CELEBROS.widget.AutoComplete.prototype._clearSelection=function(){var a=this._oTextbox.value,b=this.delimChar?this.delimChar[0]:null,b=b?a.lastIndexOf(b,a.length-2):-1;this._oTextbox.value=-1<b?a.substring(0,b):"";this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this)};
CELEBROS.widget.AutoComplete.prototype._textMatchesOption=function(){for(var a=!1,b=this._nDisplayedItems-1;0<=b;b--)if(this._aListItems[b]._sResultKey.toLowerCase()==this._sCurQuery.toLowerCase()){a=!0;break}return a};
CELEBROS.widget.AutoComplete.prototype._typeAhead=function(a,b){if(this.typeAhead&&8!=this._nKeyCode){var c=this._oTextbox;if(c.setSelectionRange||c.createTextRange){var d=a._sResultKey.toLowerCase().indexOf(this._typedQuery.toLowerCase()),d=0==d?this._typedQuery.length:0;this._updateValue(a);var e=c.value.length;this._selectText(c,d,e);c=c.value.substr(d,e);this.typeAheadEvent.fire(this,b,c)}}};
CELEBROS.widget.AutoComplete.prototype._selectText=function(a,b,c){if(a.setSelectionRange)a.setSelectionRange(b,c);else if(a.createTextRange){var d=a.createTextRange();d.moveStart("character",b);d.moveEnd("character",c-a.value.length);d.select()}else a.select()};
CELEBROS.widget.AutoComplete.prototype._toggleContainerHelpers=function(a){var b=this._oContainer._oContent.offsetWidth+"px",c=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame)a?(this._oContainer._oIFrame.style.width=b,this._oContainer._oIFrame.style.height=c):(this._oContainer._oIFrame.style.width=0,this._oContainer._oIFrame.style.height=0);if(this.useShadow&&this._oContainer._oShadow)a?(this._oContainer._oShadow.style.width=b,this._oContainer._oShadow.style.height=
c):(this._oContainer._oShadow.style.width=0,this._oContainer._oShadow.style.height=0)};
CELEBROS.widget.AutoComplete.prototype._toggleContainer=function(a){var b=this._oContainer;if(!this.alwaysShowContainer||!this._bContainerOpen){if(!a){this._oContainer._oContent.scrollTop=0;var c=this._aListItems;if(c&&0<c.length)for(var d=c.length-1;0<=d;d--)c[d].style.display="none";this._oCurItem&&this._toggleHighlight(this._oCurItem,"from");this._oCurItem=this._oTextboxItem=null;this._nDisplayedItems=0;this._sCurQuery=null}if(!a&&!this._bContainerOpen)b._oContent.style.display="none";else{var e=
this._oAnim;if(e&&e.getEl()&&(this.animHoriz||this.animVert)){a||this._toggleContainerHelpers(a);e.isAnimated()&&e.stop();c=b._oContent.cloneNode(!0);b.appendChild(c);c.style.top="-9000px";c.style.display="block";var d=c.offsetWidth,f=c.offsetHeight,g=this.animHoriz?0:d,h=this.animVert?0:f;e.attributes=a?{width:{to:d},height:{to:f}}:{width:{to:g},height:{to:h}};a&&!this._bContainerOpen?(b._oContent.style.width=g+"px",b._oContent.style.height=h+"px"):(b._oContent.style.width=d+"px",b._oContent.style.height=
f+"px");b.removeChild(c);var c=null,j=this;b._oContent.style.display="block";e.onComplete.subscribe(function(){e.onComplete.unsubscribeAll();a?j.containerExpandEvent.fire(j):(b._oContent.style.display="none",j.containerCollapseEvent.fire(j));j._toggleContainerHelpers(a)});e.animate()}else a?(b._oContent.style.display="block",this.containerExpandEvent.fire(this)):(b._oContent.style.display="none",this.containerCollapseEvent.fire(this)),this._toggleContainerHelpers(a);this._bContainerOpen=a}}};
CELEBROS.widget.AutoComplete.prototype._toggleHighlight=function(a,b){var c=this.highlightClassName;this._oCurItem&&CELEBROS.util.Dom.removeClass(this._oCurItem,c);if("to"==b&&c)this.SeperatorFunction(a._oResultData[0])||CELEBROS.util.Dom.addClass(a,c),this._oCurItem=a};CELEBROS.widget.AutoComplete.prototype._togglePrehighlight=function(a,b){if(a!=this._oCurItem){var c=this.prehighlightClassName;"mouseover"==b&&c?CELEBROS.util.Dom.addClass(a,c):CELEBROS.util.Dom.removeClass(a,c)}};
CELEBROS.widget.AutoComplete.prototype._updateValue=function(a){var b=this._oTextbox,c=this.delimChar?this.delimChar[0]||this.delimChar:null,d=this._sSavedQuery,e=a._sResultKey;b.focus();b.value="";if(c){if(d)b.value=d;b.value+=e+c;" "!=c&&(b.value+=" ")}else b.value=e;if("textarea"==b.type)b.scrollTop=b.scrollHeight;c=b.value.length;this._selectText(b,c,c);this._oTextboxItem=this._oCurItem=a};
CELEBROS.widget.AutoComplete.prototype._selectItem=function(a){this._bItemSelected=!0;this._updateValue(a);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,a,a._oResultData);this._toggleContainer(!1)};CELEBROS.widget.AutoComplete.prototype._jumpSelection=function(){this.typeAhead&&this._toggleContainer(!1)};
CELEBROS.widget.AutoComplete.prototype._moveSelection=function(a){if(this._bContainerOpen){var b=this._oCurItem,c=-1;if(b)c=b._nItemIndex;var d=40==a?c+1:c-1;if(!(-2>d||d>=this._nDisplayedItems))if(b&&(this._toggleHighlight(b,"from"),this.itemArrowFromEvent.fire(this,b)),-2==d)this._toggleContainer(!1);else{for(;this._aListItems[d]&&this.SeperatorFunction(this._aListItems[d]._oResultData[0]);)d=40==a?d+1:d-1,d>=this._nDisplayedItems&&(d=c);if(-1==d)this._oTextbox.value=this.delimChar&&this._sSavedQuery?
this._textMatchesOption()?this._sSavedQuery+this._sCurQuery:this._sSavedQuery:this._sCurQuery,this._oTextboxItem=this._oCurItem=null;else{b=this._aListItems[d];c=this._oContainer._oContent;if(("auto"==CELEBROS.util.Dom.getStyle(c,"overflow")||"auto"==CELEBROS.util.Dom.getStyle(c,"overflowY"))&&-1<d&&d<this._nDisplayedItems)if(40==a)if(b.offsetTop+b.offsetHeight>c.scrollTop+c.offsetHeight)c.scrollTop=b.offsetTop+b.offsetHeight-c.offsetHeight;else{if(b.offsetTop+b.offsetHeight<c.scrollTop)c.scrollTop=
b.offsetTop}else if(b.offsetTop<c.scrollTop)this._oContainer._oContent.scrollTop=b.offsetTop;else if(b.offsetTop>c.scrollTop+c.offsetHeight)this._oContainer._oContent.scrollTop=b.offsetTop+b.offsetHeight-c.offsetHeight;this._toggleHighlight(b,"to");this.itemArrowToEvent.fire(this,b);this.typeAhead&&this._typeAhead(b,this._sCurQuery)}}}};
CELEBROS.widget.AutoComplete.prototype._onItemMouseover=function(a,b){b.prehighlightClassName?b._togglePrehighlight(this,"mouseover"):b._toggleHighlight(this,"to");b.itemMouseOverEvent.fire(b,this)};CELEBROS.widget.AutoComplete.prototype._onItemMouseout=function(a,b){b.prehighlightClassName?b._togglePrehighlight(this,"mouseout"):b._toggleHighlight(this,"from");b.itemMouseOutEvent.fire(b,this)};
CELEBROS.widget.AutoComplete.prototype._onItemMouseclick=function(a,b){b.SeperatorFunction(this._oResultData[0])?(b._oTextbox.focus(),b.typeAhead&&void 0!=b._oTextboxItem?b._typeAhead(b._oTextboxItem,b._sCurQuery):b._selectText(b._oTextbox,b._oTextbox.value.length,b._oTextbox.value.length)):(b._toggleHighlight(this,"to"),b._selectItem(this))};CELEBROS.widget.AutoComplete.prototype._onContainerMouseover=function(a,b){b._bOverContainer=!0};
CELEBROS.widget.AutoComplete.prototype._onContainerMouseout=function(a,b){b._bOverContainer=!1;b._oCurItem&&b._toggleHighlight(b._oCurItem,"to")};CELEBROS.widget.AutoComplete.prototype._onContainerScroll=function(a,b){b._oTextbox.focus()};CELEBROS.widget.AutoComplete.prototype._onContainerResize=function(a,b){b._toggleContainerHelpers(b._bContainerOpen)};
CELEBROS.widget.AutoComplete.prototype._onTextboxKeyDown=function(a,b){var c=a.keyCode;switch(c){case 9:b.delimChar&&b._nKeyCode!=c&&b._bContainerOpen&&CELEBROS.util.Event.stopEvent(a);b._oCurItem?b.SeperatorFunction(b._oCurItem._oResultData[0])?b._bContainerOpen&&CELEBROS.util.Event.stopEvent(a):b._selectItem(b._oCurItem):b._toggleContainer(!1);break;case 13:b._nKeyCode!=c&&b._bContainerOpen&&CELEBROS.util.Event.stopEvent(a);b._oCurItem?b.SeperatorFunction(b._oCurItem._oResultData[0])?b._bContainerOpen&&
CELEBROS.util.Event.stopEvent(a):b._selectItem(b._oCurItem):(b.itemSelectEvent.fire(b),b._toggleContainer(!1));break;case 27:b._toggleContainer(!1);break;case 35:case 39:b._oCurItem&&!b.SeperatorFunction(b._oCurItem._oResultData[0])&&b._jumpSelection();break;case 38:CELEBROS.util.Event.stopEvent(a);b._moveSelection(c);break;case 40:CELEBROS.util.Event.stopEvent(a),b._moveSelection(c)}};
CELEBROS.widget.AutoComplete.prototype._onTextboxKeyPress=function(a,b){var c=a.keyCode;if(-1!=navigator.userAgent.toLowerCase().indexOf("mac"))switch(c){case 9:b.delimChar&&b._nKeyCode!=c&&b._bContainerOpen&&CELEBROS.util.Event.stopEvent(a);break;case 13:b._nKeyCode!=c&&b._bContainerOpen&&CELEBROS.util.Event.stopEvent(a);break;case 38:case 40:CELEBROS.util.Event.stopEvent(a)}else if(229==c)b._queryInterval=setInterval(function(){b._onIMEDetected(b)},500)};
CELEBROS.widget.AutoComplete.prototype._onTextboxKeyUp=function(a,b){b._initProps();var c=a.keyCode;b._nKeyCode=c;var d=this.value;if(!(b._isIgnoreKey(c)||d.toLowerCase()==b._sCurQuery))b.textboxKeyEvent.fire(b,c),0<b.queryDelay?(c=setTimeout(function(){b._sendQuery(d)},1E3*b.queryDelay),-1!=b._nDelayID&&clearTimeout(b._nDelayID),b._nDelayID=c):b._sendQuery(d)};CELEBROS.widget.AutoComplete.prototype._onTextboxFocus=function(a,b){b._oTextbox.setAttribute("autocomplete","off");b._bFocused=!0;b.textboxFocusEvent.fire(b)};
CELEBROS.widget.AutoComplete.prototype._onTextboxBlur=function(a,b){if(!b._bOverContainer||9==b._nKeyCode){if(!b._bItemSelected&&(!b._bContainerOpen||b._bContainerOpen&&!b._textMatchesOption()))b.forceSelection?b._clearSelection():b.unmatchedItemSelectEvent.fire(b,b._sCurQuery);b._bContainerOpen&&b._toggleContainer(!1);b._cancelIntervalDetection(b);b._bFocused=!1;b.textboxBlurEvent.fire(b)}};
CELEBROS.widget.AutoComplete.prototype._onFormSubmit=function(a,b){b.allowBrowserAutocomplete?b._oTextbox.setAttribute("autocomplete","on"):b._oTextbox.setAttribute("autocomplete","off")};CELEBROS.widget.DataSource=function(){};CELEBROS.widget.DataSource.ERROR_DATANULL="Response data was null";CELEBROS.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";CELEBROS.widget.DataSource.prototype.maxCacheEntries=15;CELEBROS.widget.DataSource.prototype.queryMatchContains=!1;
CELEBROS.widget.DataSource.prototype.queryMatchSubset=!1;CELEBROS.widget.DataSource.prototype.queryMatchCase=!1;CELEBROS.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName};CELEBROS.widget.DataSource.prototype.getResults=function(a,b,c){this.queryEvent.fire(this,c,b);this.doJSQuery(a,b,c)};CELEBROS.widget.DataSource.prototype.doQuery=function(){};
CELEBROS.widget.DataSource.prototype.flushCache=function(){if(this._aCache)this._aCache=[];if(this._aCacheHelper)this._aCacheHelper=[];this.cacheFlushEvent.fire(this)};CELEBROS.widget.DataSource.prototype.queryEvent=null;CELEBROS.widget.DataSource.prototype.cacheQueryEvent=null;CELEBROS.widget.DataSource.prototype.getResultsEvent=null;CELEBROS.widget.DataSource.prototype.getCachedResultsEvent=null;CELEBROS.widget.DataSource.prototype.dataErrorEvent=null;
CELEBROS.widget.DataSource.prototype.cacheFlushEvent=null;CELEBROS.widget.DataSource._nIndex=0;CELEBROS.widget.DataSource.prototype._sName=null;CELEBROS.widget.DataSource.prototype._aCache=null;
CELEBROS.widget.DataSource.prototype._init=function(){var a=this.maxCacheEntries;if(isNaN(a)||0>a)a=0;if(0<a&&!this._aCache)this._aCache=[];this._sName="instance"+CELEBROS.widget.DataSource._nIndex;CELEBROS.widget.DataSource._nIndex++;this.queryEvent=new CELEBROS.util.CustomEvent("query",this);this.cacheQueryEvent=new CELEBROS.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new CELEBROS.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new CELEBROS.util.CustomEvent("getCachedResults",
this);this.dataErrorEvent=new CELEBROS.util.CustomEvent("dataError",this);this.cacheFlushEvent=new CELEBROS.util.CustomEvent("cacheFlush",this)};CELEBROS.widget.DS_XHR=function(a,b,c){if("object"==typeof c)for(var d in c)this[d]=c[d];if(b&&b.constructor==Array)this.schema=b,this.scriptURI=a,this._init()};CELEBROS.widget.DS_XHR.prototype=new CELEBROS.widget.DataSource;CELEBROS.widget.DS_XHR.TYPE_XML=1;CELEBROS.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";
CELEBROS.widget.DS_XHR.prototype.connMgr=CELEBROS.util.Connect;CELEBROS.widget.DS_XHR.prototype.connTimeout=0;CELEBROS.widget.DS_XHR.prototype.scriptURI=null;CELEBROS.widget.DS_XHR.prototype.scriptQueryParam="query";CELEBROS.widget.DS_XHR.prototype.scriptQueryAppend="";CELEBROS.widget.DS_XHR.prototype.responseType=CELEBROS.widget.DS_XHR.TYPE_XML;CELEBROS.widget.DS_XHR.prototype.responseStripAfter="\n<!-";
CELEBROS.widget.DS_XHR.prototype.doJSQuery=function(a,b,c){var d=this.scriptURI+"?"+this.scriptQueryParam+"="+b;0<this.scriptQueryAppend.length&&(d+="&"+this.scriptQueryAppend);var e=this;CELEBROS.widget.DS_XHR.prototype.responseSuccess=function(d){for(var f in d);d=parseXML(d);null===d?e.dataErrorEvent.fire(e,c,b,CELEBROS.widget.DataSource.ERROR_DATANULL):(d=e.parseResponse(b,d,c),decodeURIComponent(b),null===d?(e.dataErrorEvent.fire(e,c,b,CELEBROS.widget.DataSource.ERROR_DATAPARSE),d=[]):e.getResultsEvent.fire(e,
c,b,d),a(b,d,c))};var f=document.getElementById("jsSuggestions");f&&f.parentNode.removeChild(f);script=document.createElement("script");script.type="text/javascript";script.src=d;script.id="jsSuggestions";document.getElementsByTagName("head")[0].appendChild(script)};
CELEBROS.widget.DS_XHR.prototype.parseResponse=function(a,b){var c=this.schema,d=[],e=!1,f=""!==this.responseStripAfter&&b.indexOf?b.indexOf(this.responseStripAfter):-1;-1!=f&&(b=b.substring(0,f));switch(this.responseType){case CELEBROS.widget.DS_XHR.TYPE_XML:f=b.getElementsByTagName(c[0]);if(!f){e=!0;break}for(var g=f.length-1;0<=g;g--){for(var h=f.item(g),j=[],k=c.length-1;1<=k;k--){var i=null;if(i=h.attributes.getNamedItem(c[k]))i=i.value;else{var l=h.getElementsByTagName(c[k]);if(l&&l.item(0)&&
l.item(0).firstChild)if(1<l.length)for(var i=[],p=0;p<l.length;p++)i.push(l.item(p).firstChild.nodeValue);else i=l.item(0).firstChild.nodeValue;else i=""}j.unshift(i)}d.unshift(j)}}return e?null:d};CELEBROS.widget.DS_XHR.prototype._oConn=null;CELEBROS.widget.DS_JSFunction=function(a,b){if("object"==typeof b)for(var c in b)this[c]=b[c];if(a&&a.constructor==Function)this.dataFunction=a,this._init()};CELEBROS.widget.DS_JSFunction.prototype=new CELEBROS.widget.DataSource;
CELEBROS.widget.DS_JSFunction.prototype.dataFunction=null;CELEBROS.widget.DS_JSFunction.prototype.doQuery=function(a,b,c){var d=this.dataFunction,e=[],e=d(b);null===e?this.dataErrorEvent.fire(this,c,b,CELEBROS.widget.DataSource.ERROR_DATANULL):(decodeURIComponent(b),this.getResultsEvent.fire(this,c,b,e),a(b,e,c))};CELEBROS.widget.DS_JSArray=function(a,b){if("object"==typeof b)for(var c in b)this[c]=b[c];if(a&&a.constructor==Array)this.data=a,this._init()};CELEBROS.widget.DS_JSArray.prototype=new CELEBROS.widget.DataSource;
CELEBROS.widget.DS_JSArray.prototype.data=null;
CELEBROS.widget.DS_JSArray.prototype.doQuery=function(a,b,c){var d=this.data,e=[],f=this.queryMatchContains;if(b){this.queryMatchCase||(b=b.toLowerCase());for(var g=d.length-1;0<=g;g--){var h=[];d[g]&&(d[g].constructor==String?h[0]=d[g]:d[g].constructor==Array&&(h=d[g]));if(h[0]&&h[0].constructor==String){var j=this.queryMatchCase?encodeURIComponent(h[0]).indexOf(b):encodeURIComponent(h[0]).toLowerCase().indexOf(b);(!f&&0===j||f&&-1<j)&&e.unshift(h)}}}this.getResultsEvent.fire(this,c,b,e);a(b,e,c)};
CELEBROS.register("autocomplete",CELEBROS.widget.AutoComplete,{version:"2.2.0",build:"127"});JSLoaded();function InsertElementAfterEnd(a,b){document.body.appendChild(b)}
function CelebrosAutoComplete(a,b,c,d){if(-1==window.location.href.indexOf(sDisableParemeter)){void 0==d&&(d=a+"-acs.celebros-analytics.com");oResultFunction=c;sServiceLocation=sProtocol+"//"+d+"/AutoCompleteWebServiceV3/GetSuggestions.aspx";if(-1==b.indexOf(".")&&-1==b.indexOf("#")&&-1==b.indexOf(" "))oSearchBox=document.getElementById(b);else if(window.jQuery)oSearchBox=window.jQuery(b);else return alert("unable to find search box - "+b),!1;CELEBROS.util.Event.addListener(oSearchBox,"focus",function(){window.sSearchBox=
this.id});c=[];sSeperator="#";c.SeperatorFunction=IsSpecialSuggestion;d=document.createElement("div");void 0!=document.getElementById("divSuggestions")?d.setAttribute("id","divSuggestions"+b):d.setAttribute("id","divSuggestions");d.setAttribute("class","divSuggestions");InsertElementAfterEnd(document.getElementById(b),d);var e=new CELEBROS.widget.DS_XHR(sServiceLocation,"sug,dc,u,iu,p,l,s".split(","));e.responseType=CELEBROS.widget.DS_XHR.TYPE_XML;e.maxCacheEntries=0;e.scriptQueryParam="strPrefix";
e.scriptQueryAppend="strSiteKey="+a+"&callback=CELEBROS.widget.DS_XHR.prototype.responseSuccess";a=new CELEBROS.widget.AutoComplete(b,d,e,c);a.minQueryLength=1;a.queryDelay=0.1;a.autoHighlight=!1;a.maxResultsDisplayed=100;a.typeAhead=!0;a.useShadow=!1;a.forceSelection=!1;a.itemSelectEvent.subscribe(this.ItemSelected,this);"undefined"!=typeof _1b9&&a.containerExpandEvent.subscribe(_1b9);"undefined"!=typeof _1ba&&a.containerCollapseEvent.subscribe(_1ba);a.formatResult=function(a,b){var c=b[0],d=b[3],
e=b[4];if("#"==c.charAt(0)&&"#"==c.charAt(c.length-1))return a.className="ACHeaderItem","<b>"+c.substr(1,c.length-2)+"</b>";if(!(""==d||""==e)){var i=[],l=0,p=0;if(!1==isArray(d))l=parseInt(d),p=parseInt(e),i.push(c.substr(0,l)),i.push("<b><u>"),i.push(c.substr(l,p)),i.push("</u></b>"),i.push(c.substr(l+p,c.length));else if(d.length==e.length){for(var o=0,m=0;m<d.length;m++)l=parseInt(d[m]),p=parseInt(e[m]),i.push(c.substr(o,l-o)),i.push("<b><u>"),i.push(c.substr(l,p)),i.push("</u></b>"),o=l+p;i.push(c.substr(o,
c.length))}else i.push(c);c=i.join("")}if(""==b[1])return a.className="ACQueryItem",c;d=b[2];a.className="ACProductItem";return['<table cellpadding=0 cellspacing=0 width="100%" class="ACproduct" style="background-color:Transparent;"><tr><td><table cellpadding=0 cellspacing=0><tr><td class="ACProductImageCell"><img class="ACProductImage" align="center" src="',d,'" /></td><td  align="left" class="ACproductText"><u>',c,'</u></td></tr></table></td></tr><tr><td><div class="Seperator">&nbsp<div/></td></tr></table>'].join("")};
a.doBeforeExpandContainer=function(a,b){var c=CELEBROS.util.Dom.getXY(a);c[1]+=CELEBROS.util.Dom.get(a).offsetHeight;CELEBROS.util.Dom.setXY(b,c);return!0}}};
