if(typeof root=='undefined'){var root="/";var couponHelpContent="<ul class='spacingSmall'><li class='noBg'><strong>Instant Coupons:</strong></li>";couponHelpContent+="<li>Have a one-time redemption limit unless otherwise noted.</li>";couponHelpContent+="<li>Cannot be combined with other 'Dollars Off' or 'Percentage Off' instant coupons.</li>";couponHelpContent+="<li>Are not transferable and may not be used on sale items or other discounts, office machines, computer software and hardware, custom printed products and special order items unless noted in coupon disclaimer.</li>";couponHelpContent+="<li>Cannot be redeemed after the expiration date.</li>";couponHelpContent+="<li>Must be submitted at time of order and are void where prohibited.</li>";couponHelpContent+="<li>Do not count freight or tax toward order minimum requirement.</li></ul>";couponHelpContent+="<p><strong>"+"$COMPANY_NAME$"+".com reserves the right to reject orders that use an Instant Coupon that was obtained from a bulletin board or other Internet site. ";couponHelpContent+="$COMPANY_NAME$"+".com also reserves the right to reject orders with an Instant Coupon that was transferred from a direct mail recipient or is in violation of any coupon restriction listed above.</strong></p>";var openAccountContent="<ul class='spacingSmall'><li class='noBg'><strong>Select this option for Open Account credit terms</strong></li>";openAccountContent+="<li>"+"$COMPANY_NAME$"+" Open Account credit terms for Businesses only.</li>";openAccountContent+="<li>Subject to credit approval.</li>";openAccountContent+="<li>Once credit is approved, most orders ship same day.</li>";openAccountContent+="<li>Invoice mails separately within two days of shipment.</li>";openAccountContent+="<li>Invoice payment due Net 30 days.</li></ul>";openAccountContent+="<ul class='spacingSmall'><li class='noBg'><strong>Applying for an Open Account credit terms is simple</strong></li>";openAccountContent+="<li>Select the Invoice My Account option and complete your order.</li>";openAccountContent+="<li>We'll automatically begin processing your request.</li>";openAccountContent+="<li>If there are any questions, a friendly "+"$COMPANY_NAME$"+" representative will contact you.</li>";openAccountContent+="<li>Not all businesses will qualify for an Open Account credit terms.</li>";var checkoutNoAjaxHeader="Are you having problems checking out?";var checkoutNoAjax="<p>Some older operating systems or browser versions may not perform as well with the latest Web 2.0 technology on the new "+"$COMPANY_NAME$"+".com.</p> <p class='spacingSmall'>Please click <a class='txtBold underline' href='/Checkout/CheckoutOrder.aspx'>here</a> to access our more simplified version of checkout if you are experiencing any of the following:</p><ul class='marginLeft'><li><strong> Delays with page loading</strong></li><li><strong>Credit card validation</strong></li><li><strong>Updating your information</strong></li></ul><p> If you are still unable to check out, please click the chat icon or contact us at "+"$CONTACT_INFO$"+".</p>";}
var Resource={ajax:{controlCallback:'/ajax/ajaxcontrolcallback.aspx',searchSuggest:'/ajax/searchSuggest.aspx',popUpScripts:'/ajax/PopUpScripts.aspx',postbackError:'/ajax/StorePostbackError.aspx',inkTonerSearchSuggest:'/ajax/inkTonerSearchSuggest.aspx',QView:'/ajax/QViewScripts.aspx',Finder:'/ajax/Finder.aspx',InkAndToner:'/ajax/InkTonerFinder.aspx',InkTonerQuickFind:'/ajax/InkTonerQuickFind.aspx',UpgradePrinter:'/ajax/UpgradePrinter.aspx',CompareSKUs:'/ajax/CompareSKUs.aspx',FooterPopUp:'/ajax/FooterPopUp.aspx'},page:{cookiesRequired:'/cookiesrequired.aspx',contentPages:'/content/iw/site/',error404:'/404.aspx',missingInfo:'Please correct the missing or invalid information.',additionalDeliveryOptions:'Please select one of the Delivery Options listed below.',invalidEmailInfo:'Email address and Verify Email address does not match.  Please re-enter.',invalidPassword:'Password and Verify Password does not match.  Please re-enter.',invalidUserName:'The below User Name is already being used. If you have registered previously and want to log in, please click on the Login link above. If you are new to $COMPANY_NAME$.com, please select another User Name.',invalidSourceCode:'The below Source code is invalid.  Please re-enter.'},checkoutErrMsg:{selectAccount:"Please select your payment method.",FreightDefaultMessage:"The following item(s) in your cart will be shipped by standard tailgate delivery. See below for an explanation of this service and our other enhanced delivery options.",fillCreditCardInfo:"Please enter your Credit card information."},checkoutTitle:{accountType:"Account Type",accountContactType:"Account Type",sourceCode:"Source Code",checkoutOrder:checkoutNoAjaxHeader,checkoutOrder1:checkoutNoAjaxHeader,checkoutOrder2:checkoutNoAjaxHeader,checkoutOrder3:checkoutNoAjaxHeader,checkoutOrder4:checkoutNoAjaxHeader,specialTruckDelivery:"Standard Tailgate Delivery",customerAssisted:"Driver-Assisted Delivery",whiteGlove:"White-Glove Delivery",securityCode:"Security Code",openAccountLink:"Invoice My Account",couponRestrictions:"Coupon Restrictions",freightSummaryMsg:"Freight (Special Truck Delivery)",ShredderHelpMsg:"Learn More",totalFSMsg:"Total (Special Truck Delivery)",totalFSMsgPunchout:"Total",freightAnonMsg:"Freight",freightSelectMsg:"Freight",taxAnonMsg:"Estimated Tax",totalAnonMsg:"Total",totalCouponMsg:"Total",taxExempt:"Tax Exempt",freightTruckFailure:"Freight",freightQtyFailure:"Freight",savingStoryMsg:"Saving Story",savingStoryMsgPCP:"",couponSummary:"Coupon Summary",multDelEst:"Delivery Estimates",subtituteMsg:"Subtitute Item",cdUpchargeMsg:"Deal Details",cdBundleUpchargeMsg:"Bundle Details",RewardsStoryMsg:"Quill Rewards&reg; Points",MyInkAndToner:"What is the My Ink & Toner tool?",PMDLink:"Important Note",chatNeedHelp:"We can help!.",usingGiftCard:"Using a Prepaid Gift Card"},checkoutContent:{accountType:"Select 'Business' if you are purchasing for use by your company or home-based business.<br><br>Select 'Personal' if you are purchasing for non-business use.",accountContactType:"Select 'Business' if you are purchasing for use by your company or home-based business.<br><br>Select 'Personal' if you are purchasing for non-business use.",sourceCode:"Please enter a Source Code if indicated on your print media or if you have one provided by a Sales Representative.",checkoutOrder:checkoutNoAjax,checkoutOrder1:checkoutNoAjax,checkoutOrder2:checkoutNoAjax,checkoutOrder3:checkoutNoAjax,checkoutOrder4:checkoutNoAjax,specialTruckDelivery:"Our most economical choice: the driver will bring your furniture to the tailgate of the truck. It is the customer's responsibility to unload and bring it into the building.<br>We recommend this choice if you have a loading dock and the staff available to take the merchandise off of the truck.",customerAssisted:"Only $25!  A step-up in service from our tailgate delivery option: the driver will assist you in carrying the merchandise to the ground floor of your building.<br>We recommend this choice if you do NOT have the staff available to take the merchandise off of the truck and inside your building. Fireproof file cabinets and safes: additional options and charges may apply.  A customer service representative will contact you with options.",whiteGlove:"Our ultimate delivery experience includes the delivery, assembly and installation of your furniture in a single visit. In addition, it is scheduled at your convenience and also includes the removal of all packaging.  Once your order is received, a furniture specialist will contact you to discuss this delivery option and provide you with a quote.",securityCode:"This is the security code on back or your card (waiting for this message)",openAccountLink:openAccountContent,couponRestrictions:couponHelpContent,freightSummaryMsg:"",totalFSMsg:"Your FINAL order total, including any discount coupons that apply, applicable freight and sales tax, will appear on your Order Confirmation email.",totalFSMsgPunchout:"Your FINAL order total, including applicable freight and sales tax, will appear on your Order Confirmation email.",freightAnonMsg:"If your order total is $FREIGHT_LIMIT$ or more and your delivery address is within the contiguous United States, you will get free delivery. This does not include many furniture items or other products that are designated as shipping additional. For any order under $FREIGHT_LIMIT$, a flat delivery charge of $FLAT_RATE$ will apply.",freightSelectMsg:"Your Freight will be calculated once you select one of the Delivery Options in the freight summary pane.",taxAnonMsg:"$COMPANY_NAME$ collects tax unless we have a tax exemption certificate on file, or you are shipping to a state that does not collect state or local sales tax. The exact amount of tax will be included in your Final Order Confirmation.<br><br>Tax Exempt?<br>Simply fax or email your tax exemption certificate to our tax department and, once we receive it, any tax charged to your account will be credited.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email:&nbsp;taxexempt@$DOMAIN$.com<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fax:&nbsp;&nbsp;&nbsp;&nbsp;$FAX_NUMBER$.<br><br>If we already have your tax exemption certificate on file, and this is your first order on $DOMAIN$.com, your Online Order Recap will show sales tax, but your Order Confirmation e-mail will reflect the correct final pricing with no tax.",totalAnonMsg:"Your Final Total will display once you enter your shipping and account information.",totalCouponMsg:"Your FINAL order total, including any discount coupons that apply, applicable freight and sales tax, will appear on your Order Confirmation email.",taxExempt:"Fax your tax exempt letter to 1-800-499-8805. Once we receive your certificate, any tax charged to your account will be credited. If it's your first time to use "+"$COMPANY_NAME$"+".com, your Online Order Recap will show sales tax, but your Order Confirmation e-mail will reflect the correct final pricing with no tax.",freightTruckFailure:"Sorry we are unable to calculate your freight charges at this time.  You will be contacted by a Customer Service Representative to review the options and charges associated with truck freight delivery.",freightQtyFailure:"Sorry we are unable to calculate your freight charges at this time. Your Order Confirmation email will include any applicable freight charges.",savingStoryMsg:"All coupons, sale pricing, and other discounts are reflected in this savings total.",savingStoryMsgPCP:"Your special pricing discount, exclusive coupons, sale pricing, and other discounts are reflected in this savings total.",multDelEst:"",subtituteMsg:"<span>To ensure your order is delivered in the fastest possible time, we occasionally will substitute your request with an item of equal or greater value.<br>You will be charged the same amount as your original request. <br>We apologize for any inconvenience.</span>",cdUpchargeMsg:"",RewardsStoryMsg:"Points are accumulated once your order has been invoiced and may take up to 2 business days to appear in your points balance.<br><br>Want to <a href='/rewards/landing.aspx'>redeem points</a> now?",ShredderHelpMsg:"",PMDLink:"By editing the quantity for this item, you now fall below the minimum spend and will not qualify for your % discount.",chatNeedHelp:"We are available Monday-Friday, 7 A.M to 9 P.M. (CT) and Saturday, 7.30 A.M. to 4 P.M. (CT) <BR><BR> Phone<BR>Call us during business hours at 800-982-3400 <BR> E-mail <BR> We'll respond in two business hours <BR> Help <BR> Find answers to our most frequently asked questions.",usingGiftCard:"<p>When using a prepaid gift card as your method of payment, enter your own name, address and zip code in the required cardholder name, address and zip code entry fields.</p><p>At this time, our online checkout process allows only 1 method of payment. If the amount of your gift card is less than your order total, and your order does not qualify for Open Account credit terms, we will contact you for an additional form of payment before we release your order.</p><p>We apologize for any inconvenience this may cause.</p>"},checkoutPosition:{accountType:"bottomleft",accountContactType:"bottomleft",sourceCode:"bottomleft",checkoutOrder:"bottomright",checkoutOrder1:"bottomright",checkoutOrder2:"bottomright",checkoutOrder3:"bottomright",checkoutOrder4:"bottomright",specialTruckDelivery:"bottomleft",customerAssisted:"bottomleft",whiteGlove:"bottomleft",securityCode:"bottomright",openAccountLink:"topleft",couponRestrictions:"topright",freightSummaryMsg:"bottomright",totalFSMsg:"bottomright",freightAnonMsg:"bottomright",freightSelectMsg:"bottomright",taxAnonMsg:"bottomright",totalAnonMsg:"bottomright",totalCouponMsg:"bottomright",taxExempt:"bottomright",freightTruckFailure:"bottomright",freightQtyFailure:"bottomright",savingStoryMsg:"bottomright",savingStoryMsgPCP:"bottomright",couponSummary:"bottomleft",multDelEst:"bottomleft",subtituteMsg:"bottomleft",cdUpchargeMsg:"bottomleft",RewardsStoryMsg:"bottomright",ShredderHelpMsg:"bottomleft",PMDLink:"bottomleft",chatNeedHelp:"bottomleft"}};
var helper={a:"abcdefghijklmnopqrstuvwxyz",A:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",number:"1234567890",currency:"$",months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],stringLit:"string",objectLit:"object",numberLit:"number",IsNumber:function(args){var input=$(args.input);var value=input.value;for(i=0;i<value.length;i++){var currentChar=value.charAt(i);if(this.number.indexOf(currentChar)<0){tooltip.init(input,'Please enter a valid number',120);input.value=input.value.replace(currentChar,"");}}
return true;},onEnter:function(event,btn){var e;event?e=event:e=window.event;var key=e.which?e.which:e.keyCode;var btn=$(btn);if(btn&&key==13){if(btn.click)btn.click();else if(btn.onclick)btn.onclick();else if(btn.href&&btn.href.indexOf("javascript:")>=0)btn.click();return false;}},formatCurrency:function(ammount){if(typeof ammount=="string")ammount=parseFloat(ammount);ammount=new String(Math.round(Math.abs(ammount)*100)/100);if(ammount==0)return"FREE";if(ammount.indexOf(".")<0)ammount+=".00";else if(ammount.indexOf(".")==ammount.length-2)ammount+="0";return this.currency+ammount;},formatString:function(str,values){if(!values.length||!str)return false;var l=values.length;for(var i=0;i<l;i++){var r="{"+i+"}";if(str.indexOf(r)>0)str=str.replace(r,values[i]);}
return str;},bindEnter:function(args){if($(args.input)){$(args.input).onkeydown=function(event){var e;event?e=event:e=window.event;var key=e.which?e.which:e.keyCode;var button=$(args.button);if(key==13&&button){if(button.click)button.click();else if(button.onclick)button.onclick();else if(button.href&&btn.href.indexOf("javascript:")>=0)button.click();return false;}}}},addScript:function(src,div){var append=document.createElement("script");append.type="text/javascript";append.src=src;if($(div))$(div).appendChild(append);else $("scriptAppend").appendChild(append);},trim:function(string){return string.replace(/^\s+|\s+$/g,"");},ltrim:function(string){return string.replace(/^\s+/,"");},rtrim:function(string){return string.replace(/\s+$/,"");},Login:{clearDefault:function(input,pwd){if(pwd){input.parentNode.removeChild(input)
pwd.style.display="block";pwd.focus();}
if(input.value.toLowerCase()=="enter user name"||input.value.toLowerCase()=="enter password"){input.value="";}},submit:function(args){if(args.name.value==""||args.name.value.toLowerCase().match("enter user name")){tooltip.init(args.button,"Please enter user name",200);return false;}
else if(args.pwd.value==""||args.pwd.value.toLowerCase().match("enter password")){tooltip.init(args.button,"Please enter password",200);return false;}
else{var form=$("formPH");$clear(form);form.method="post";form.action=args.url;var autoLoginValue=args.autoLogin.checked?"on":"off";var str="<input type='hidden' name='pl' value='1' /><input type='text' name='lipUserName' value='"+args.name.value+"' /><input type='password' name='lipPassword' value='"+args.pwd.value+"' /><input type='checkbox' name='lipAutologin' checked='"+args.autoLogin.checked+"' value='"+autoLoginValue+"' />";form.innerHTML=str;form.submit();return false;}}},stickyItem:function(el,yContainer,xContainer){var t=this;var el=$(el);yContainer=$(yContainer);xContainer=$(xContainer);if(!el||!yContainer||!xContainer)return false;var offset=getOffset(el);var scroll=getScrollPos();el.style.left=offset.x-scroll.x+"px";el.style.width=el.offsetWidth+"px";var absoluteLeft=offset.x;var fixedLeft=offset.x-scroll.x;var args={el:el,maxTop:0,yContainer:yContainer,xContainer:xContainer,absoluteLeft:absoluteLeft,fixedLeft:fixedLeft}
eventAdd(window,"scroll",function(){helper.stickyItemUpdate(args);});t.stickyItemUpdate(args,1);el.stickyItemUpdate=function(){t.stickyItemUpdate(args,1);}
el.stickyItemClear=function(){}},stickyItemUpdate:function(args,initial){var contOffest=getOffset(args.yContainer);var offset=getOffset(args.el);var maxY=contOffest.h+contOffest.y-offset.h;var minY=contOffest.y;var scroll=getScrollPos();var screenH=document.documentElement.clientHeight;var currentY=scroll.y+screenH-offset.h;if(currentY>=maxY){args.el.style.top=maxY+"px";args.el.style.left=args.absoluteLeft+"px";if(args.el.className.match("FixedItem"))args.el.className=args.el.className.replace("FixedItem"," AbsoluteItem");}
else if(currentY<=minY){args.el.style.top=minY+"px";args.el.style.left=args.absoluteLeft+"px";if(args.el.className.match("FixedItem"))args.el.className=args.el.className.replace("FixedItem"," AbsoluteItem");}
else{if(!args.el.className.match("FixedItem"))args.el.className+=" FixedItem";if(args.el.className.match(" AbsoluteItem"))args.el.className=args.el.className.replace(" AbsoluteItem","");if(ie6){args.el.style.left=args.absoluteLeft+"px";args.el.style.left=offset.x+"px";args.el.style.top=currentY+"px"}
else{args.el.style.left=args.fixedLeft+"px";args.el.style.top="auto";}}},scrollTo:function(link,div){div=$(div);if(div){var offset=getOffset(div);var fn=window.onscroll;window.onscroll=function(){return false};var scroll=getScrollPos()
var start=parseInt(scroll.y);var end=parseInt(offset.y);if(!this.fx)this.fx=new Anim();this.fx.init({start:start,end:end,time:.25,onLoop:function(v){window.scroll(scroll.x,v);}});window.onscroll=fn;}
return false;}}
function searchPageCompare(obj,SKUsToCompare){if(CheckCompare(obj,SKUsToCompare)){compareTrack();return true;}
else{return false;}}
function CheckCompare(obj,SKUsToCompare){var objSKUsToCompare=document.getElementById(SKUsToCompare);var arrSKUsToCompare=objSKUsToCompare.value.split(",");if((arrSKUsToCompare.length<2)||(arrSKUsToCompare.length>20)){var strErrorMessage,strNumOfItemsErrorMessage="";if(arrSKUsToCompare[0].length>0)strNumOfItemsErrorMessage="You have chosen <strong>"+arrSKUsToCompare.length+"</strong> item(s).<br/>";if(arrSKUsToCompare.length<2)strErrorMessage=strNumOfItemsErrorMessage+"Please choose at least <strong>2</strong> items to compare.";else strErrorMessage=strNumOfItemsErrorMessage+"You can choose choose a maximum of <strong>20</strong> items to compare.";tooltip.init(obj,strErrorMessage,300);return false;}
else{return true;}}
function processCallBackError(returnmessage,context){if(context=="server"){alert("Callback Error: "+returnmessage+", "+context);}
else{alert("Callback Error: "+returnmessage+", "+context);}}
function showWhatisthis(anchor){var helpTitle=eval("Resource.checkoutTitle."+anchor.id);var helpContent=eval("Resource.checkoutContent."+anchor.id);if($('CompanyNameHidden')){if($('CompanyNameHidden').value.toLowerCase()=="map"){helpContent=replaceAll(helpContent,'$COMPANY_NAME$','Medical Arts Press');helpContent=replaceAll(helpContent,'$CONTACT_INFO$','800-328-2179 ext 7386');helpContent=replaceAll(helpContent,'$FAX_NUMBER$','800-499-8805');helpContent=replaceAll(helpContent,'$DOMAIN$','medicalartspress');helpContent=replaceAll(helpContent,'$FREIGHT_LIMIT$',$('FreeShipAmountHidden').value);helpContent=replaceAll(helpContent,'$FLAT_RATE$','$7.95');}
else{helpContent=replaceAll(helpContent,'$COMPANY_NAME$',$('CompanyNameHidden').value);helpContent=replaceAll(helpContent,'$CONTACT_INFO$','800-982-3400 option 2');helpContent=replaceAll(helpContent,'$FAX_NUMBER$','800-499-8805');helpContent=replaceAll(helpContent,'$DOMAIN$','quill');helpContent=replaceAll(helpContent,'$FREIGHT_LIMIT$',$('FreeShipAmountHidden').value);helpContent=replaceAll(helpContent,'$FLAT_RATE$','$9.99');}}
var url=document.URL;url=url.toLowerCase();if(url.indexOf('cart.aspx')>0){helpContent=helpContent.replace('exclusive coupons,','');}
var args={type:2,Hcontent:helpContent,Htitle:helpTitle,button:anchor,locus:{}}
if(anchor.id=="openAccountLink")args.locus.adjx=100;if(anchor.id=="couponRestrictions")args.locus.adjx=150;popup.init(args);}
function showWhatisthisMsg(anchor,helpContent){var helpTitle=eval("Resource.checkoutTitle."+anchor.id);popup.init({type:2,Hcontent:helpContent,Htitle:helpTitle,button:anchor});}
function replaceAll(id,v1,v2){var i=id.indexOf(v1);while(i>-1){id=id.replace(v1,v2);i=id.indexOf(v1,i+v2.length+1);}
return id;}
function trimAll(sString){sString=sString.replace(/[^a-z A-Z 0-9]+/g,'');while(sString.substring(0,1)==' '){sString=sString.substring(1,sString.length);}
while(sString.substring(sString.length-1,sString.length)==' '){sString=sString.substring(0,sString.length-1);}
return sString;}
function ltrimrtrim(str){str=str.replace(/^\s+|\s+$/g,"");return str;}
function setFocusTo(control){Field=control;setTimeout("Field.focus();",1);}
function showErrorMessage(paneName,id,errMsg){$(paneName+'ErrorInfo').innerHTML=errMsg;$(paneName+'ErrorMessage').style.display='block';setFocusTo(id);return false;}
function processMyError(returnmessage,context){window.location="/default.aspx";}
var tabMenu={init:function(args){var tabMenu=$(args.tabMenu);var index=args.index;var tab=$(args.tab);if(!tabMenu&&tab)tabMenu=tab.parentNode.parentNode;var tabs=$(tabMenu).getByClass("a.tab");var panels=$(tabMenu).getByClass("div.tabPanel");if(tabs&&panels){tabs.length?tabs=tabs:tabs=new Array(tabs);panels.length?panels=panels:panels=new Array(panels);if(args.tab)index=tabs.getIndexByItem(tab);else if(!index||index>=tabs.length)index=0;for(var i=0;i<tabs.length;i++){var css="tabNotSelected";if(i==index){if(tabs[i].className.match(css))tabs[i].className=tabs[i].className.replace(css,"");panels[i].style.display="block";}
else{if(!tabs[i].className.match(css))tabs[i].className=tabs[i].className+=" "+css;panels[i].style.display="none";}}
initScrollbars(tabMenu);if(args.returnOptions){return{tabs:tabs,panels:panels,index:index}}}}}
var accordion={fx:null,closeSelected:false,headerClick:function(header,options){if(!this.fx)this.fx=new Anim();else this.fx.clear();var AccDiv=header.parentNode.parentNode;var toOpen=header.parentNode;var toClose;options=options||{};if(options.closeSingle)toClose=toOpen;else toClose=$(AccDiv).getByClass("div.AcPanelSelected");if(toOpen==toClose&&toClose.className=="AcPanelSelected"&&options.closeSelected==false)return false;if(toClose){toClose.length?toClose=toClose:toClose=new Array(toClose);if(this.closeSelected==false)toClose.remove(toOpen);if(toClose.length==1&&toClose[0].className.match("SkuAccThree")==false)return}
this.process({toOpen:toOpen,toClose:toClose,options:options,parentDiv:AccDiv});if(options.adjust){helper.scrollTo(null,options.adjust);}
if(options.index)PromoMiniSkuTrack(options.index);return false;},process:function(args){var start=new Array();var end=new Array();var divs=new Array();var contents=new Array();divs[0]=args.toOpen;if(args.toClose){divs=divs.concat(args.toClose);}
if(args.options.toCloseAdditional&&args.options.toCloseAdditional.offsetHeight&&!divs.getIndexByItem(args.options.toCloseAdditional)&&args.options.toCloseAdditional!=divs[0]){divs.push(args.options.toCloseAdditional);}
var l=divs.length;for(var j=0;j<l;j++){var content=$(divs[j]).getByClass("div.AcContent");contents.push(content);start[j]=content.offsetHeight;if(j==0){if(args.options.closeSelected==true&&divs[j].className.match("AcPanelSelected")){end[j]=0;divs[j].className=divs[j].className.replace("AcPanelSelected"," AcPanel");content.style.overflow="hidden";}
else{if(!divs[j].className.match("AcPanelSelected"))divs[j].className=divs[j].className.replace("AcPanel"," AcPanelSelected");content.style.height="auto";end[j]=content.offsetHeight;content.style.overflow="hidden";}}
else{end[j]=0;if(divs[j].className.match("AcPanelSelected"))divs[j].className=divs[j].className.replace("AcPanelSelected"," AcPanel");content.style.overflow="hidden";}
content.style.height=start[j]+"px";var a=$last(divs[j],"A");if(a&&a.innerHTML.match("See All Products"))a.style.display="none";}
initScrollbars(contents[0]);this.fx.init({start:start,end:end,time:.25,onLoop:function(v){var n=l;for(n;n--;){if(start[n]!=end[n])contents[n].style.height=v[n]+"px";}},onFinish:function(){if(end[0]!=0){contents[0].style.height="auto";contents[0].style.overflow="";}
if(args.options.oncomplete)args.options.oncomplete();}});},AdjustWindowLocation:{start:null,end:null,init:function(panl){var panl=$(panl);var scroll=getScrollPos();var offset=getOffset(panl);if(offset.y>scroll.y)return false;this.start=scroll.y;this.end=offset.y;return this;}}}
var tooltip={timeout:null,id:0,T:2000,stack:{below:1,top:2},orientation:{toLeft:1,toRight:2,vertical:2},skinError:"toolTipError",template:"_Close_Button_<div id=\"_CoolTip_TailId_\" class=\"coolTipTail\"></div><div class=\"coolTipCont\" id=\"_CoolTip_Content_Id\">_CoolTip_ContentHTML_</div>",init:function(obj,msg,width,options){obj=$(obj);var container=$("cooltipPh");if(!obj||!msg||!container)return false;if(obj.tooltips){var l=obj.tooltips.length;for(var i=0;i<l;i++){if(obj.msg[i]==msg){return false;}}}
var tip=document.createElement("DIV");tip.id="CoolTip"+this.id;tip.className="coolTip "+(options&&options.skin?options.skin:"");var tailId="CoolTip"+this.id+"Tail";var contentId="CoolTip"+this.id+"Content";var str=this.template.replace("_CoolTip_TailId_",tailId).replace("_CoolTip_Content_Id",contentId).replace("_CoolTip_ContentHTML_",msg);if(options&&options.hasCloseButton)str=str.replace("_Close_Button_","<img class=\"coolTipClose\" src=\"/Images/stardust.gif\" alt=\"Close\" onclick=\"tooltip.close('"+tip.id+"')\" />")
else
str=str.replace("_Close_Button_","");tip.innerHTML=str;container.appendChild(tip);tip.fx=new Anim();tip=$(tip.id);tip.tail=$(tailId);tip.anchor_obj=obj;tip.options=options;this.id++;this.getLocus(tip,width);if(!obj.tooltips)obj.tooltips=[];if(!obj.msg)obj.msg=[]
tip.index=obj.tooltips.length;obj.tooltips[tip.index]=tip;obj.msg[tip.index]=msg;obj.toolTipTop=tip.y;var start=[tip.y-5,0];var end=[tip.y,100];tip.style.left=tip.x+"px";tip.style.top=tip.y-5+"px";tip.style.opacity=0;tip.style.filter="alpha(opacity=0)";if(tip.tailX>0)tip.tail.style.left=tip.tailX+"px";if(tip.tailY>0)tip.tail.style.top=tip.tailY+"px";tip.style.width=(width?width:tip.w)+"px";if(obj.tooltips.length>1)tip.tail.style.display="none";obj.closeToolTips=function(){if(obj.tooltips){$each(obj.tooltips,function(item,key){tooltip.close(item);});}}
tip.fx.init({start:start,end:end,time:.25,onLoop:function(v){tip.style.top=v[0]+"px";tip.style.opacity=v[1]/100;tip.style.filter="alpha(opacity="+v[1]+");";},onFinish:function(){tip.style.opacity=null;tip.style.filter=null;if(!options||!options.hasCloseButton){tip.closeTimeout=setTimeout("tooltip.close('"+tip.id+"');",tooltip.T);}}});},getLocus:function(tip,_width){var obj=$(tip.anchor_obj);if(!obj)return false;var top=0;var left=0;var width=_width||0;var height=tip.offsetHeight;var tailLeft;var tailTop;var getLastToolTip=function(){var tooltips=obj.tooltips;if(tooltips){var index=tooltips.length-1;var t=tooltips[index];while(t){if(t.closing){index--;t=tooltips[index];t.fx.clear();t.onFinish();}
else{return t;}}}}
var lastToolTip=getLastToolTip();if(lastToolTip){if(tip.anchor_obj.stackDirection==tooltip.stack.below)top=lastToolTip.y+lastToolTip.h;else top=lastToolTip.y-lastToolTip.h;left=lastToolTip.x;width=_width||lastToolTip.w;tailLeft=lastToolTip.tailX;tailTop=lastToolTip.tailY;}
else{var stackDirection=tooltip.stack.below;var scroll=getScrollPos();var pos=getOffset(obj);width=_width||tip.offsetWidth;if(!tip.options||!tip.options.orientation||tip.options.orientation==tooltip.orientation.vertical){if((pos.y+pos.h+tip.offsetHeight)>=(document.documentElement.clientHeight+scroll.y)){top=pos.y-tip.offsetHeight-15;tip.className="coolTip "+(tip.options&&tip.options.skin?tip.options.skin:"");tip.tail.className="coolTipTail coolTipBottomTail";stackDirection=tooltip.stack.top;}
else{top=pos.y+pos.h;}
left=pos.x+pos.w-width/2;if(left+width+15>=document.documentElement.clientWidth+scroll.x)left=left-(left+width+15-document.documentElement.clientWidth+scroll.x);if(left+width<pos.x)left=pos.x+30-width;if(left<scroll.x)left=(scroll.x>pos.x?pos.x-15:scroll.x);tailLeft=pos.x-left;if(tailLeft<0){left=pos.x;tailLeft=10;}}
else if(tip.options&&tip.options.orientation==tooltip.orientation.toLeft){left=pos.x-width-15;top=pos.y-(height/2>35?35:height/2);tip.className="coolTip "+(tip.options.skin?tip.options.skin:stringEmpty);tip.tail.className="coolTipTail coolTipTailRight";tailTop=(pos.y+pos.h-top)/2;if(tailTop>(height-40)){tailTop-=tailTop-height+35;top+=tailTop-height+35;}}
var adjustY=0;var adjustX=0;adjustX+=(tip.options&&tip.options.adjustX?tip.options.adjustX:0);adjustY+=(tip.options&&tip.options.adjustY?tip.options.adjustY:0);left+=adjustX;top+=adjustY;tip.anchor_obj.stackDirection=stackDirection;}
tip.y=top;tip.x=left;tip.tailX=tailLeft;tip.tailY=tailTop;tip.w=width;tip.h=height;},close:function(tip){if(typeof tip=="string"&&(tip=$(tip))){tooltip.close(tip);}
else if(tip&&tip.anchor_obj){var top=tip.style.top?parseInt(tip.style.top):0;var start=[top,100]
var end=[top+5,0];if(tip.fx.z)return false;if(tip.timeout)window.clearTimeout(tip.closeTimeout);tip.closing=true;tip.fx.init({start:start,end:end,time:.25,onLoop:function(v){tip.style.top=v[0]+"px";tip.style.opacity=v[1]/100;tip.style.filter="alpha(opacity="+v[1]+");";},onFinish:function(){var a=tip.anchor_obj;var top=a.tooltips[0].y;var className=a.tooltips[0].tail.className;a.tooltips.remove(a.tooltips[tip.index]);a.msg.remove(a.msg[tip.index]);$("cooltipPh").removeChild(tip);var l=a.tooltips.length;if(l>0){for(var i=0;i<l;i++){var t=a.tooltips[i];t.index=i;t.tail.className=className;if(i==0)t.tail.style.display="block";else{t.tail.style.display="none";}
t.style.top=top+"px";if(a.stackDirection==tooltip.stack.below)top+=t.h;else top-=t.h;}}}});}
else{var div=$("cooltipPh");if(div){var index=0;var node=div.childNodes[index];while(node){if(node.tagName&&node.tagName.toLowerCase()=="div"){tooltip.close(node);}
index++;node=div.childNodes[index];}}}}}
var customUI={drop_down_max:4,getSelectedValue:function(id){var id=$(id);return id.getAttribute("selectedvalue");},getSelectedText:function(id){var id=$(id);return id.getAttribute("selectedtext");},setSelectedValue:function(id,value,options){var id=$(id);if(!options)options=id.getElementsByTagName("li");var index=this.getIndexByValue(id,value,options)
this.setSelectedIndex(id,index,options);},getSelectedIndex:function(id){var id=$(id);return parseInt(id.getAttribute("selectedindex"));},setSelectedIndex:function(id,index,options,scrollbar,func){id=$(id);var defaultIndex=parseInt(id.getAttribute("selectedindex"));if(!options)options=id.getElementsByTagName("li");if(options[index]){var SelectedValue=options[index].getAttribute("rel").toString();var SelectedText=$first(options[index],"SPAN").innerHTML;if(options[defaultIndex])options[defaultIndex].className=null;options[index].className.match("fieldSelected")?options[index].className=options[index].className.replace("fieldSelected",""):options[index].className+=" fieldSelected";id.setAttribute("selectedindex",index);id.setAttribute("selectedtext",SelectedText);id.setAttribute("selectedvalue",SelectedValue);$first(id,"A").innerHTML=options[index].innerHTML;if(func)eval(id.getAttribute("onchange"));}
return false;},getIndexByValue:function(id,string,options){id=$(id);string=string.toString();if(!options)options=id.getElementsByTagName("li");for(var i=0;i<options.length;i++){var value=options[i].getAttribute("rel");if(value==string){return i;}}
return false;},getIndexByText:function(id,string,options){id=$(id);if(!options)options=id.getElementsByTagName("li");for(var i=0;i<options.length;i++){var text=options[i].innerHTML;if(text==string){return i;}}},select_click:function(a,el){el=$(el);if(el.className.match("SelectDisable"))return false;if(el.className.match("SelectExpand")){customUI.collapse(el);document.body.onkeydown=null;return false;}
el.onmousedown=function(event){if(event==null)event=window.event;var target=event.target!=null?event.target:event.srcElement;if(target!=null&&target.parentNode!=null&&(target.tagName=="LI"||target.parentNode.tagName=="LI")){var index=target.getAttribute("index")!=null?target.getAttribute("index"):target.parentNode.getAttribute("index");customUI.setSelectedIndex(el,index,null,null,1,a);customUI.collapse(el);document.body.onkeydown=null;}}
var index=parseInt(el.getAttribute("selectedindex"));el.onmouseover=function(event){customUI.check_key(el,event,null,index,a);}
if(document.body.onmousedown)document.body.onmousedown(document.body.previousEvent);document.body.onkeydown=function(event){if(event==null)event=window.event;customUI.check_key(el,event,null,index,a);return false;}
customUI.expand(el);document.body.onmousedown=function(event){document.body.previousEvent=event;if(customUI.click_check(a,el,event)==true){customUI.collapse(el);document.body.onmousedown=null;document.body.previousEvent=null;}}},click_check:function(a,el,event){if(event==null)event=window.event;var target=event.target!=null?event.target:event.srcElement;var x=0;do{if(target==el){return false;break;}
var target=target.parentNode;x++;}while(target!=null&&target.parentNode&&x<6);return true;},expand:function(el){el=$(el);el.className+=" SelectExpand";var index=parseInt(el.getAttribute("selectedindex"));var options=el.getElementsByTagName("li");var scrollbar=$(el).getByClass("div.customScrollBar");if(scrollbar)customScroll.scrollToElement(scrollbar,options[index]);if(!el.ScrollBarIinit){el.ScrollBarIinit=1;scrollbar.contentWheel=true;customScroll.init(scrollbar);}
el.TempIndex=null;},collapse:function(el){el=$(el);var index=parseInt(el.getAttribute("selectedindex"));var options=el.getElementsByTagName("li");if(el.TempIndex!=null){options[el.TempIndex].className=null;el.TempIndex=null;}
var a=$first(el,"a");if(options[index]!=null){a.innerHTML=options[index].innerHTML;options[index].className.match("fieldSelected")?options[index].className=options[index].className.replace("fieldSelected",""):options[index].className+=" fieldSelected";}
document.body.onkeydown=null;el.className=el.className.replace(" SelectExpand","");},disable:function(id){id=$(id);if(id.className.match("SelectDisable"))return false;else id.className+=" SelectDisable";},enable:function(id){id=$(id);if(id.className.match("SelectDisable")){id.className=id.className.replace(" SelectDisable","");}},update:function(id,liHTML){id=$(id);var ul=id.getElementsByTagName("UL")[0];ul.innerHTML=liHTML;id.ScrollBarIinit=null;id.TempIndex=null;customUI.setSelectedIndex(id,0);},check_key:function(id,event,options,index,a){if(customScroll.fx.z)return false;if(event==null)event=window.event;var LI=null;if(event.type=="keydown"){var key=event.which?event.which:event.keyCode;var scrollbar=$(id).getByClass("div.customScrollBar");}
else{var target=event.target!=null?event.target:event.srcElement;if(target.tagName=="LI"){LI=target;}}
if(!options)options=id.getElementsByTagName("li");if(id.TempIndex==null)var TempIndex=index;else var TempIndex=id.TempIndex;var current=options[TempIndex];if(key==40&&TempIndex<options.length-1){options[TempIndex].className=null;TempIndex++;options[TempIndex].className.match("fieldSelected")?options[TempIndex].className=options[TempIndex].className.replace("fieldSelected",""):options[TempIndex].className+=" fieldSelected";a.innerHTML=options[TempIndex].innerHTML;customScroll.mode=0;customScroll.scrollToElement(scrollbar,options[TempIndex]);id.TempIndex=TempIndex;}
else if(key==38&&TempIndex>0){options[TempIndex].className=null;TempIndex--;options[TempIndex].className.match("fieldSelected")?options[TempIndex].className=options[TempIndex].className.replace("fieldSelected",""):options[TempIndex].className+=" fieldSelected";a.innerHTML=options[TempIndex].innerHTML;customScroll.mode=0;customScroll.scrollToElement(scrollbar,options[TempIndex]);id.TempIndex=TempIndex;}
else if(key==13&&TempIndex){this.setSelectedIndex(id,TempIndex,options,scrollbar,1);this.collapse(id);}
else if(key==27){this.collapse(id);}
else if(event.type=="keydown"){var letter=String.fromCharCode(key);var element;var TempOptionKey=options[TempIndex].getElementsByTagName("SPAN")[0].innerHTML.charAt(0);if(options[TempIndex+1])var NextTempOptionKey=options[TempIndex+1].getElementsByTagName("SPAN")[0].innerHTML.charAt(0);if(NextTempOptionKey==letter){options[TempIndex].className=null;id.TempIndex=TempIndex+1;customScroll.mode=0;customScroll.scrollToElement(scrollbar,options[TempIndex+1]);options[i].className.match("fieldSelected")?options[i].className=options[i].className.replace("fieldSelected",""):options[i].className+=" fieldSelected";}
else{for(var i=0;i<options.length;i++){var l=options[i].getElementsByTagName("SPAN")[0].innerHTML.charAt(0);if(letter==l){options[TempIndex].className=null;id.TempIndex=i;options[i].className.match("fieldSelected")?options[i].className=options[i].className.replace("fieldSelected",""):options[i].className+=" fieldSelected";customScroll.mode=0;customScroll.scrollToElement(scrollbar,options[i]);break;}}
return false;}}
else if(LI){options[TempIndex].className=options[TempIndex].className.replace("fieldSelected","");LI.className.match("fieldSelected")?LI.className=LI.className.replace("fieldSelected",""):LI.className+=" fieldSelected";id.TempIndex=parseInt(LI.getAttribute("index"));}
return;}}
function processCallBackMiniSku1(buttonId,skuIn,effortCodeIn,skuImagePathIn,promoSkuImageIn){getMiniSKU1(skuIn,effortCodeIn,skuImagePathIn,promoSkuImageIn,buttonId);}
function getMiniSKU1(sku,effortCode,skuImage,promoImage,buttonId){var Arguments='getMiniSKU|'+sku+'|'+effortCode+'|'+skuImage+'|'+promoImage;var Context='server';$("MiniSKUInfo").buttonId=buttonId;WebForm_DoCallback(glbMiniSKUCallBackID,Arguments,displayMiniSKU,Context,processCallBackError,true);}
function displayMiniSKU(returnmessage,context){if(returnmessage!=""){var miniSKUDivWrap=document.getElementById('MiniSKUInfo');var miniSKUDiv=document.getElementById('MiniSKU');miniSKUDiv.innerHTML=returnmessage.toString();reposition(miniSKUDivWrap,miniSKUDivWrap.buttonId);miniSKUDivWrap.buttonId=null;}}
function printWindow(){var bV;bV=parseInt(navigator.appVersion);if(bV>=4)window.print();}
function getQueryStringParameter(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return"";else return results[1];}
function showPriceInCart(obj,sku,effortCode,findNumber){QView.init({button:'0',action:'GetQViewHTML',sku:sku,effort:effortCode,findNumber:findNumber});}
var txtval=0;function AcessCountFocus(txtBox){txtval=txtBox.value;}
function AcessCountBlur(txtBox){if(txtBox.value==""||txtBox.value<0){txtBox.value=0;}
if((txtBox.value==0&&txtval>0)||(txtBox.value>0&&txtval==0)){var counter=$('counter').innerHTML;if(txtBox.value>0){counter++;}
else{counter--;}
if(counter<0)counter=0;$('counter').innerHTML=counter;}}
function handleEnterKey(btn,e){var key;if(window.event)key=window.event.keyCode;else key=e.which;if(key==13){btn.onclick();}}
function previewImage(findNumber,image,btn){var div=$("DivPhGlobal");div.className="SkuPrinterPreview";div.innerHTML="<img src='"+image+"' alt='' />";div.innerHTML+="<div class='iNumber'>item #"+findNumber+"</div>";reposition(div,btn);}
function hideImage(){var div=$("DivPhGlobal");div.style.display="none";div.className="";div.innerHTML="";}
var funcEmpty=function(){};var stringEmpty="";var Class={create:function(){return function(){this.initialize.apply(this,arguments);}},createOnLoad:function(){return function(){var t=this;var a=arguments;onLoad(function(){t.initialize.apply(t,a);});}}};Object.extend=function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;};Object.extend(String.prototype,{strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},removeBreaks:function(){return this.replace(/(\r\n|\n|\r)/gm,'');},startsWith:function(str){return(this.match("^"+str)==str)}});Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}};Function.prototype.bindAsEventListener=function(object){var __method=this,args=$A(arguments),object=args.shift();return function(event){var e=event||window.event;if(!e.target)e.target=e.srcElement;if(e.clientX&&!e.pageX){var s=getScrollPos();e.pageX=e.clientX-s.x;e.pageY=e.clientY-s.y;}
return __method.apply(object,[e].concat(args).concat($A(arguments)));}};var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0,length=iterable.length;i<length;i++)results.push(iterable[i]);return results;}};var Form={serialize:function(form){form=$(form);var elem,elems=form.elements;var length=elems.length;var out='';for(var i=0;i<length;i++){elem=elems[i];out+=(i>0?'&':'')+encodeURIComponent(elem.name)+'='+encodeURIComponent(elem.value);}
return out;}};function $first(parent,type){parent=$(parent);type=type.toUpperCase();var e=parent.firstChild;while(e&&e.nodeName.toUpperCase()!=type)e=e.nextSibling;return e;}
function $last(parent,type){parent=$(parent);type=type.toUpperCase();var e=parent.lastChild;while(e&&e.nodeName.toUpperCase()!=type)e=e.previousSibling;return e;}
function $next(element,loop,reverse){element=$(element);var sibling=element;do{sibling=reverse?sibling.previousSibling:sibling.nextSibling;if(sibling==null)if(loop)sibling=reverse?element.parentNode.lastChild:element.parentNode.firstChild;else return null;if(sibling.nodeName==element.nodeName)return sibling;}while(true)}
function $prev(element,loop){return $next(element,loop,1);}
var $previous=$prev;function $findUp(element,type,stop,attr){element=$(element);type=type.toUpperCase();do{if(!element||element==stop)return null;if(element.nodeName.toUpperCase()==type&&(!attr||(attr&&element.getAttribute(attr))))return element;element=element.parentNode;}while(true)}
function getElementsByClassNameInElement(strTagName,strClassName,el){el=$(el);if(el==null)return false;var arrReturnElements=new Array();var oElement;var arrElements=el.getElementsByTagName(strTagName);for(var i=0;i<arrElements.length;i++){oElement=arrElements[i];if(oElement.className.match(strClassName)){arrReturnElements.push(oElement);}}
if(arrReturnElements.length>0)return(arrReturnElements);else return false;}
function getDimensions(element,bypassTopLeft){var results={};results.top=results.left=0;if(!bypassTopLeft)for(e=$(element);e!=null;e=e.offsetParent){results.top+=e.offsetTop;results.left+=e.offsetLeft;}
var element=$(element);if(element.style.display!='none'){results.width=element.offsetWidth;results.height=element.offsetHeight;}else{var els=element.style;var origVis=els.visibility;var origPos=els.position;els.visibility='hidden';els.position='absolute';els.display='';results.width=element.clientWidth;results.height=element.clientHeight;els.display='none';els.position=origPos;els.visibility=origVis;}
results.right=results.left+results.width;results.bottom=results.top+results.height;return results;}
var Ajax={getTransport:function(){var req;try{req=new XMLHttpRequest();return req;}catch(e){}
try{req=new ActiveXObject('Msxml2.XMLHTTP');return req;}catch(e){}
try{req=new ActiveXObject('Microsoft.XMLHTTP');return req;}catch(e){}
return false;}};Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype={initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);if(url!=undefined)this.request(url);},setOptions:function(options){this.options={method:'POST',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''};Object.extend(this.options,options||{});this.options.method=this.options.method.toUpperCase();},request:function(url){var params=this.options.parameters;this.url=url;if(this.options.method=='GET'&&params.length>0)this.url+=(this.url.indexOf('?')>=0?'&':'?')+params;try{this.transport.open(this.options.method,this.url,this.options.asynchronous,this.options.username,this.options.password);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var body=this.options.method=='POST'?(this.options.postBody||params):null;this.transport.send(body);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1)this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.options.method=='POST'){headers['Content-type']=this.options.contentType+(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)headers['Connection']='close';}
for(var name in headers)this.transport.setRequestHeader(name,headers[name]);},success:function(){return(!this.transport.status||(this.transport.status>=200&&this.transport.status<300));},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState];var transport=this.transport,json=this.evalJSON();if(state=='Complete'){if((this.getHeader('Content-type')||'').strip().match(/^application\/json(;.*)?$/i))json=this.evalJSONResponse();try{(this.options['on'+(this.success()?'Success':'Failure')]||funcEmpty)(transport,json,this.options);}catch(e){this.dispatchException(e);}}
try{(this.options['on'+state]||funcEmpty)(transport,json,this.options);}catch(e){this.dispatchException(e);}
if(state=='Complete'){if((this.getHeader('Content-type')||'').strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))this.evalResponse();this.transport.onreadystatechange=funcEmpty;}},getHeader:function(name){try{return this.transport.getResponseHeader(name);}catch(e){return null}},evalJSON:function(){try{var json=this.getHeader('X-JSON');return json?eval('('+json+')'):null;}catch(e){return null}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},evalJSONResponse:function(){try{return eval('('+this.transport.responseText+')');}catch(e){return null}},dispatchException:function(exception){(this.options.onException||funcEmpty)(this,exception);}};function eventAdd(element,eType,fn){var el=$(element);if(el.addEventListener){el.addEventListener(eType,fn,false);return true;}else if(el.attachEvent){return el.attachEvent('on'+eType,fn);}else{el['on'+eType]=fn;}}
function eventStopProp(e){if(e&&e.stopPropogation)e.stopPropogation();else if(window.event)window.event.cancelBubble=true;else if(e&e.cancelBubble)e.cancelBubble=true;}
function eventStopDef(e){if(e&&e.preventDefault)e.preventDefault();else if(window.event&&window.event.returnValue)window.event.ReturnValue=false;}
function onLoad(f){eventAdd(window,'load',f);}
function $clear(node){node=$(node);if(node.hasChildNodes())while(node.childNodes.length>=1)node.removeChild(node.firstChild);}
function $replace(element,html,parseScript){element=$(element);if(element){$clear(element);element.innerHTML=html;if(parseScript&&html.search(/script/i))EvalScripts(element);}}
function EvalScripts(container){var totalItems=container.childNodes.length;for(var i=0;i<totalItems;i++){var c=container.childNodes[i];if(c){if(c.childNodes.length>0)EvalScripts(c);if(c.nodeName.toUpperCase()=="SCRIPT"&&c.innerHTML)eval(c.innerHTML);}}}
function ProcessEnter(ev,formID,escapeFunction){var key=ev.which?ev.which:ev.keyCode;if(key==13){var f=$(formID);if(f)f.submit();return false;}else if(key==27&&escapeFunction)escapeFunction();return true;}
function addBookmark(url,title){if(!title)title=document.title;if(!url)url=location.href;if(window.sidebar)window.sidebar.addPanel(title,url,"");else if(window.opera&&window.print){var elem=document.createElement('a');elem.setAttribute('href',url);elem.setAttribute('title',title);elem.setAttribute('rel','sidebar');elem.click();}
else if(document.all)window.external.AddFavorite(url,title);}
function getElementsByClassName(strTagName,strClassName){var arrElements=(strTagName=="*"&&document.all)?document.all:document.getElementsByTagName(strTagName);var arrReturnElements=new Array();strClassName=strClassName.replace(/\-/g,"\\-");var oRegExp=new RegExp("(^|\\s)"+strClassName+"(\\s|$)");var oElement;for(var i=0;i<arrElements.length;i++){oElement=arrElements[i];if(oRegExp.test(oElement.className)){arrReturnElements.push(oElement);}}
return(arrReturnElements);}
function escapeHtml(htmlText){var self=arguments.callee;if(self.escapeDiv){self.escapeText.nodeValue=htmlText;}else{self.escapeDiv=document.createElement('div');self.escapeText=document.createTextNode('');self.escapeText.nodeValue=htmlText;self.escapeDiv.appendChild(self.escapeText);}
return self.escapeDiv.innerHTML;}
var thispage=document.location.toString();if(!document.cookie&&thispage.indexOf(Resource.page.cookiesRequired)<0&&thispage.indexOf(Resource.page.contentPages)<0&&thispage.indexOf(Resource.page.error404)<0){document.cookie='testcookie=1; path=/; ';if(!document.cookie)window.location=Resource.page.cookiesRequired;}
var handlePostback={customErrorHandler:null,hooked:false,internalErrorHandler:function(sender,args){if(!args)return;var theError=args.get_error();if(theError){var theResponse=args.get_response();var errorMessage='N/A';var statusCode='N/A';var requestUrl='N/A';var requestBody='N/A';var responseBody='N/A';var responseHeaders='N/A';var docCookies='N/A';if(theError&&theResponse){try{errorMessage=theError.message;}catch(e){}
try{statusCode=theResponse.get_statusCode();}catch(e){}
try{requestUrl=theResponse.get_webRequest().getResolvedUrl();}catch(e){}
try{requestBody=theResponse.get_webRequest().get_body();if(requestBody.length>10003)requestBody=requestBody.substr(0,10000)+"...";}catch(e){}
try{responseBody=theResponse.get_responseData();if(responseBody.length>10003)responseBody=responseBody.substr(0,10000)+"...";}catch(e){}
try{responseHeaders=theResponse.getAllResponseHeaders();}catch(e){}
try{docCookies=document.cookie;}catch(e){}
var postbackReport="s="+encodeURIComponent(statusCode)+"&m="+encodeURIComponent(errorMessage)+"&ru="+encodeURIComponent(requestUrl)+"&rb="+encodeURIComponent(requestBody)+"&h="+encodeURIComponent(responseHeaders)+"&c="+encodeURIComponent(docCookies)+"&b="+encodeURIComponent(responseBody);var ajax=new Ajax.Request(Resource.ajax.postbackError,{parameters:postbackReport});}
args.set_errorHandled(true);if(handlePostback.customErrorHandler!=null)handlePostback.customErrorHandler(statusCode,errorMessage,requestBody);}},hookError:function(customHandler){if(typeof(Sys)=='undefined')return;if(customHandler)handlePostback.customErrorHandler=customHandler;if(handlePostback.hooked)return;handlePostback.hooked=true;var s=Sys;if(!s)return;s=s.WebForms;if(!s)return;s=s.PageRequestManager;if(!s)return;s=s.getInstance();if(!s)return;if(s.add_endRequest)s.add_endRequest(handlePostback.internalErrorHandler);},internalBeginHandler:function(sender,args){var r=args.get_request();if(r.get_headers()["X-MicrosoftAjax"]){var b=r.get_body();if(b==null)b="";var a="__MicrosoftAjax="+encodeURIComponent(r.get_headers()["X-MicrosoftAjax"]);if(b.length>0&&b.substr(b.length-1,1)!="&")b+="&";r.set_body(b+a);}},fixAjax:function(){if(typeof(Sys)=='undefined')return;var s=Sys;if(!s)return;s=s.WebForms;if(!s)return;s=s.PageRequestManager;if(!s)return;s=s.getInstance();if(!s)return;if(s.add_beginRqeuest)s.add_beginRequest(handlePostback.internalBeginHandler);}};function MyPageTrack(pagename){if(typeof(MyPageTrackReal)!="undefined")MyPageTrackReal(pagename);}
var AjaxTrackerCache=new Array();function AjaxControlCallback(method,command,params,customParams,ajaxPanel,callback,controlID,triggerID,allowOnlyLatestCallback,progressID,progressWait,useThisUrl,callPageLoad){var parameters='_ax_c='+encodeURIComponent(command)+'&_ax_p='+encodeURIComponent(params)+'&_ax_ai='+encodeURIComponent(controlID)+'&_ax_pb=1'+(customParams?'&'+customParams:'');var trigger=$(triggerID);if(trigger){var form=$findUp(trigger,"form");if(form){if(useThisUrl){form.__EVENTTARGET.value=triggerID.replace(/_/g,"$");}
var clen=controlID.length;parameters+="&_ax_f=1";for(i=0;i<form.elements.length;i++){var c=form.elements[i];if(useThisUrl||(!useThisUrl&&(c.id.startsWith(controlID)))){if((c.type!='radio'&&c.type!='checkbox')||c.checked)parameters+="&"+(useThisUrl||!c.id.startsWith(controlID)?c.name:c.id.substring(clen))+"="+(encodeURIComponent(c.value));}}}}
var tracker="_aolc_"+controlID+"_"+ajaxPanel;var trackerID=0;if(allowOnlyLatestCallback)trackerID=AjaxTrackerCache[tracker]=(AjaxTrackerCache[tracker]?AjaxTrackerCache[tracker]:0)+1;var progTimeout=null;if(progressID){var progress=$(progressID);if(progress){if(progressWait){if(!progress.timeout)progress.timeout=window.setTimeout(function(){progress.style.display='block';},progressWait);}else progress.style.display='block';}}
var ajax=new Ajax.Request(useThisUrl?window.location:Resource.ajax.controlCallback,{method:method,parameters:parameters,ajaxPanel:ajaxPanel,callback:callback,tracker:tracker,trackerID:trackerID,progress:progress,callPageLoad:callPageLoad,onComplete:function(request,data,options){if(request.responseText.indexOf('@')==0){var newUrl=request.responseText.substr(1);if(newUrl==window.location){newUrl+=(newUrl.indexOf('?')>0?'&':'?')+'axfnr='+Math.random();}
window.location=newUrl;return;}
if(AjaxTrackerCache[options.tracker]&&AjaxTrackerCache[options.tracker]!=options.trackerID)return;if(progress){if(progress.timeout){window.clearTimeout(progress.timeout);progress.timeout=null;}
progress.style.display="none";}
if(options.ajaxPanel.length>0){var res=request.responseText;var i1,i2;while(res&&res.length>0){i1=res.indexOf("|");i2=res.indexOf("|",i1+1);if(i1<100&&i2>2&&i2-i1<9){var name=res.substring(0,i1);var len=parseInt(res.substring(i1+1,i2));var text=res.substr(i2+1,len);if(name!="<SCRIPT>"){var panel=$(name);if(panel){if(name!="__VIEWSTATE")$replace(panel,text,true);else panel.value=text;}}else if(len>0)eval(text);res=res.substr(i2+1+len);}else res='';}}
if(options.callback)options.callback(request,data);if(typeof(pageLoad)=='function')pageLoad();}});}
function AjaxWrapDoPostback(eventObject,eventArgs){var trigger=eventObject.replace(/\$/g,"_");var panel=$findUp(trigger,"div",null,"ap");if(panel){var progressID=panel.getAttribute('up');var panelID=panel.id;AjaxControlCallback('post','','','_ax_i\x3d'+panelID+'\x26_ax_tid\x3d'+trigger+'\x26_ax_t\x3d',panelID,null,'__Page',trigger,true,progressID?progressID:null,progressID?parseInt(panel.getAttribute('upd')):0,true,true);return true;}
return false;}
Array.prototype.getIndexByItem=function(item){var l=this.length;for(var i=0;i<l;i++){if(this[i]==item){return i;break;}}
return false;}
Array.prototype.last=function(){return this[this.length-1];}
Array.prototype.remove=function(item){var index;if(typeof item=="number"){if(exists(this[item]))index=item;else return null;}
else{var _index=this.getIndexByItem(item);if(typeof _index=="number")index=_index;else return null;}
var slice=this.splice(index,1);}
var cookie={expires:365,buckets:{func:{name:"b_fn",temp:false},funcTemp:{name:"b_fn_t",temp:true},frameWork:{name:"b_fw",temp:false},frameWorkTemp:{name:"b_fw_t",temp:true}},mode:{read:1,write:2,remove:3},Set:function(args){if(!args.name)return false;args.mode=this.mode.write;if(args.bucket)return this.processFromBucket(args);else return this.process(args);},Get:function(args){if(!args.name)return false;args.mode=this.mode.read;if(args.bucket)return this.processFromBucket(args);else return this.process(args);},Remove:function(args){if(!args.name)return false;args.mode=this.mode.remove;args.value="";if(args.bucket)return this.processFromBucket(args);else return this.process(args);},processFromBucket:function(args){var buckets=document.cookie.split(';');for(var i=0;i<buckets.length;i++){if(buckets[i].indexOf(args.bucket.name)>=0){var cookies=buckets[i].replace(args.bucket.name+"=","").split("&");args.cookies=cookies;return this.process(args);break;}}
return false;},process:function(args){var cookies;if(args.cookies)cookies=args.cookies;else cookies=document.cookie.split(';');var cookieExists=false;var cookie;for(var k=0;k<cookies.length;k++){cookie=cookies[k].split("=");if(cookie[0].indexOf(args.name)>=0){if(args.mode==this.mode.read)return cookie[1];else if(args.mode==this.mode.remove&&args.bucket){cookies.remove(k);}
else if(args.mode==this.mode.write){cookie[1]=args.value;cookie=cookie.join("=");cookies[k]=cookie;}
cookieExists=true;break;}}
if(args.mode==this.mode.write||args.mode==this.mode.remove){if(args.name==this.buckets.frameWork.name||args.name==this.buckets.func.name||args.name==this.buckets.funcTemp.name||args.name==this.buckets.frameWorkTemp.name)return"Can't modify buckets";if(args.mode==this.mode.remove&&!cookieExists)return"No cookie to remove";var expires="";if((args.bucket&&!args.bucket.temp)||(args.expires&&!args.bucket)||(args.mode==this.mode.remove&&!args.bucket)){var date=new Date();var days=this.expires;if((!args.value||args.mode==this.mode.remove)&&!args.bucket){days=-1;}
date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}
if(args.bucket){if(cookieExists){document.cookie=args.bucket.name+"="+cookies.join("&")+expires+";path=/";}
else{document.cookie=args.bucket.name+"="+cookies.join("&")+"&"+args.name+"="+args.value+expires+";path=/";}}
else{if(cookieExists){document.cookie=cookie.join("=")+expires+";path=/";}
else{document.cookie=args.name+"="+args.value+expires+";path=/";}}
return true;}
return false;}}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function setCookie(name,value,days){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}
document.cookie=name+"="+value+expires+"; path=/";}
function exists(el){if(el==null||el==""||(typeof el=="number"&&isNaN(el)))return false
else
return true;}
function reposition(div,anchor){div=$(div);anchor=$(anchor);if(!div)return false;div.style.display="block";var top=0;var left=0;var scroll=getScrollPos();var posD=getOffset(div);var screenW=document.documentElement.clientWidth;var screenH=document.documentElement.clientHeight;if(anchor!=null){var posA=getOffset(anchor);if(posA.x>screenW/2)left=posA.x-posD.w;else left=posA.w+posA.x;top=posA.h+posA.y;if(left+posD.w>screenW+scroll.x){left=screenW-posD.w+scroll.x;}
if(top+posD.h>screenH+scroll.y){top=screenH-posD.h+scroll.y;}
if(top<scroll.y){top=scroll.y;}}
else{top=(screenH/2-posD.h/2)+scroll.y;left=(screenW/2-posD.w/2)+scroll.x;}
if(isNaN(top)||top<0)top=0;if(isNaN(left)||left<scroll.x)left=scroll.x;if(top<150)top=150
else if(top<scroll.y)top=scroll.y;div.style.top=top+"px";div.style.left=left+"px";}
function getMousePos(event){var x;var y;if(event==null)event=window.event;if(event.pageY)y=event.pageY;else if(event.clientY)y=event.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);else y=null;if(event.pageX)x=event.pageX;else if(event.clientX)x=event.clientY+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);else x=null;return{'x':x,'y':y};}
function getStyle(el,styleProp){var x=$(el);if(x.currentStyle)var y=x.currentStyle[styleProp];else if(window.getComputedStyle)var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);return y;}
function getOffset(el){var r={};el=$(el);r.w=el.offsetWidth;r.h=el.offsetHeight;if(el.offsetParent&&el){var x=el.offsetLeft;var y=el.offsetTop;while(el.offsetParent){if(el.scrollTop)y-=el.scrollTop;el=el.offsetParent;if(getStyle(el,"position")=="fixed"){var scroll=getScrollPos();y+=el.offsetTop+scroll.y;x+=el.offsetLeft+scroll.x;break;}
x+=el.offsetLeft;y+=el.offsetTop;}}
else{var x=el.offsetLeft;var y=el.offsetTop;}
r.x=x;r.y=y;return r;}
var LightBox={Show:function(){$("light_box_global").style.display="block";},Hide:function(){$("light_box_global").style.display="none";}};var Loading={loading:null,Page:function(){if(!this.loading)this.loading=$("Loading_box_global");this.loading.className="Loading";this.loading.style.display="block";},Cursor:function(event){if(event){if(event==null)event=window.event;if(!this.loading)this.loading=$("Loading_box_global");this.loading.className="LoadingCursor";this.loading.style.display="block";centerme(this.loading,event,null);this.loading.style.left=parseInt(this.loading.style.left)+35+"px";this.loading.style.top=parseInt(this.loading.style.top)+10+"px";dragme(this.loading,event);document.onmouseup=null;}
else
this.Hide();},Image:function(img){$(img).className="LoadingImg ico";},ImageN:function(img){$(img).className="LoadingError ico";},ImageY:function(img){$(img).className="LoadingCheck ico";},ImageReset:function(img){$(img).className="ico";},Show:function(){$("Loading_box_global").className="Loading";$("Loading_box_global").style.display="block";$("Loading_box_global").style.top=null;$("Loading_box_global").style.left=null;},Hide:function(){document.clearDrag("Loading_box_global");if($("Loading_box_global")){$("Loading_box_global").className="";$("Loading_box_global").style.display="none";}}}
function getScrollPos(){return{x:window.pageXOffset?window.pageXOffset:document.body&&document.body.scrollLeft?document.body.scrollLeft:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:0,y:window.pageYOffset?window.pageYOffset:document.body&&document.body.scrollTop?document.body.scrollTop:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:0}}
var ie6=false;function $(element){if(element){if(typeof element==helper.stringLit){element=document.getElementById(element);}
if(element){element.getById=function(string){return $.process({element:this,delimeter:"#",string:string});}
element.getByClass=function(string){return $.process({element:this,delimeter:".",string:string});}
return element;}}
return null;}
$.process=function(args){var string=args.string;var tagName;var value;var element;var l;if(string.match(args.delimeter)){string=string.split(args.delimeter);tagName=string[0];value=string[1];}
else{value=string;}
var arrReturnElements=new Array;var arrElements=args.element.getElementsByTagName(tagName);l=arrElements.length;if(args.delimeter=="#"){var i=0;for(i;i<l;i++){var oElement=arrElements[i];if(oElement.id==value){arrReturnElements.push(oElement);break;}}}
else{var i=0;for(i;i<l;i++){var oElement=arrElements[i];if(oElement.className.match(value))arrReturnElements.push(oElement);}}
l=arrReturnElements.length
if(l==0)return null;if(l==1)element=arrReturnElements[0]
else if(l>1)element=arrReturnElements;return element;}
function $find(el){return $(el);}
function getInputCaret(oField){return getInputRange(oField).start;}
function $each(obj,fn){if(obj&&obj.length&&fn&&typeof fn=="function"){var i=0;var l=obj.length;for(;i<l;){fn.call(obj[i],i,obj[i++]);}}}
function getInputRange(oField){var o={start:-1,length:0};if(/opera/i.test(navigator.userAgent))return o;if(document.selection){var oSel=document.selection.createRange();o.length=oSel.text.length;oSel.moveStart('character',-oField.value.length);o.start=oSel.text.length-o.length;}else if(oField.selectionStart||oField.selectionStart=='0'){o.start=oField.selectionStart;o.length=oField.selectionEnd-o.start;}
return o;}
function setInputCaret(oField,iCaretPos){setInputRange(oField,iCaretPos,0);}
function setInputRange(oField,iCaretPos,iLength){if(document.selection){var oSel=document.selection.createRange();oSel.moveStart('character',-oField.value.length);oSel.moveEnd('character',-oField.value.length);oSel.moveStart('character',iCaretPos);oSel.moveEnd('character',iLength);oSel.select();}
else if(oField.selectionStart||oField.selectionStart=='0'){oField.selectionStart=iCaretPos;oField.selectionEnd=iCaretPos+iLength;}}
if(typeof DOMParser=="undefined"){DOMParser=function(){}
DOMParser.prototype.parseFromString=function(str,contentType){if(typeof ActiveXObject!="undefined"){try{var d=new ActiveXObject("Msxml2.DOMDocument.6.0");d.loadXML(str);return d;}catch(e){}
try{var d=new ActiveXObject("Msxml2.DOMDocument");d.loadXML(str);return d;}catch(e){}}else if(typeof XMLHttpRequest!="undefined"){var req=new XMLHttpRequest;req.open("GET","data:"+(contentType||"application/xml")+";charset=utf-8,"+encodeURIComponent(str),false);if(req.overrideMimeType){req.overrideMimeType(contentType);}
req.send(null);return req.responseXML;}}}

Effect=Class.create();Effect.Transitions={linear:function(pos){return pos;},smooth:function(pos){return(-Math.cos(pos*Math.PI)/2)+0.5;}};Effect.SetOpacity=function(id,opacity){var object=$(id);if(!object)return;object=object.style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";};Effect.Base=function(){};Effect.Base.prototype={initialize:function(element,options){this.element=$(element);if(!this.element)return;if(this.addOptions)this.addOptions(options);else this.setOptions(options);if(this.options.delay>0)setTimeout(this.start.bind(this),this.options.delay*1000);else this.start();},setOptions:function(options){this.options={transition:Effect.Transitions.smooth,duration:1,fps:40.0,from:0.0,to:1.0,delay:0.0};Object.extend(this.options,options||{});},start:function(){if(this.setup)this.setup();this.cframe=0;this.started=new Date().getTime();this.finish=this.started+(this.options.duration*1000);this.interval=setInterval(this.loop.bind(this),25);},stop:function(){clearInterval(this.interval);this.interval=null;},loop:function(){var time=new Date().getTime();if(time>=this.finish){this.render(1.0);this.stop();var id=this.element.id;try{(this.options['onComplete']||funcEmpty)(id);}catch(e){}
return;}
var pos=(time-this.started)/(this.finish-this.started);var frame=Math.round(pos*this.options.fps*this.options.duration);if(frame>this.cframe){this.render(pos);this.cframe=frame;}},render:function(pos){pos=this.options.transition(pos);pos*=(this.options.to-this.options.from);pos+=this.options.from;if(this.update)this.update(pos);}};Effect.Timer=Class.create();Object.extend(Object.extend(Effect.Timer.prototype,Effect.Base.prototype),{update:function(pos){this.options.onUpdate(pos);}});Effect.Roll=Class.create();Object.extend(Object.extend(Effect.Roll.prototype,Effect.Base.prototype),{addOptions:function(userOptions){options={scaleX:false,scaleY:true,rollUp:false};Object.extend(options,userOptions||{});this.setOptions(options);},setup:function(){var el=this.element;this.origSize=getDimensions(el);var els=el.style;els.overflow='hidden';if(!this.options.rollUp){if(this.options.scaleY)els.height='1px';if(this.options.scaleX)els.width='1px';}
els.display='block';},update:function(pos){if(pos==this.options.to)var IsDone=true;var els=this.element.style;if(this.options.rollUp)pos=(1-pos);if(this.options.scaleY){var newHeight=Math.round(pos*this.origSize.height);if(newHeight>0)els.height=newHeight+'px';}
if(this.options.scaleX){var newWidth=Math.round(pos*this.origSize.width);if(newWidth>0)els.width=newWidth+'px';}
if((IsDone)&&(this.options.rollUp)&&(pos==0))els.display='none';}});Effect.Fade=Class.create();Object.extend(Object.extend(Effect.Fade.prototype,Effect.Base.prototype),{addOptions:function(userOptions){options={fadeIn:true};Object.extend(options,userOptions||{});this.setOptions(options);},setup:function(){if(this.options.fadeIn){var el=this.element;var els=el.style;Effect.SetOpacity(el,0);els.visibility='visible';if(els.display=='none'){this.wasNone=true;els.display='block';}}},update:function(pos){if(pos==this.options.to){if(this.options.fadeIn)Effect.SetOpacity(this.element,100);else{var el=this.element;Effect.SetOpacity(el,0);var els=el.style;els.visibility='hidden';if(this.wasNone)els.display='none';}}
else{if(this.options.fadeIn)Effect.SetOpacity(this.element,pos*100);else Effect.SetOpacity(this.element,(1-pos)*100);}}});function centerme(div,event,container){var w=div.offsetWidth;var h=div.offsetHeight;if(container){var offset=getOffset(container);var mouseX=event.clientX-offset.x-w/2;var mouseY=event.clientY-offset.y-h/2;}
else{var mouseX=event.clientX-w/2;var mouseY=event.clientY-h/2;}
div.style.left=mouseX+"px";div.style.top=mouseY+getScrollPos().y+"px";}
function dragme(div,event,mask,oncomplete){if(event==null)event=window.event
var target=event.target!=null?event.target:event.srcElement;div=$(div);var divOffset=getOffset(div);var height=div.offsetHeight;var width=div.offsetWidth;var adjustX=0;var adjustY=0;if(event.clientX){var startX=event.clientX;var startY=event.clientY+getScrollPos().y;var startx=parseInt(div.style.left);var starty=parseInt(div.style.top);}
if(mask){var mask=$(mask);var maskOffset=getOffset(mask);var Height=mask.offsetHeight;var Width=mask.offsetWidth;var rLimit=Width-width;var lLimit=0;var tLimit=0;var bLimit=Height-height;}
document.body.onmouseup=function(){document.clearDrag(div,oncomplete);;}
document.body.onmousemove=mousemove;document.body.focus();if(event.preventDefault)event.preventDefault();document.onselectstart=function(){return false;};if(target)target.ondragstart=function(){return false;};return false;function mousemove(event){if(event==null)event=window.event;var xPos=startx+event.clientX-startX;var yPos=starty+event.clientY+getScrollPos().y-startY;if(mask){if(yPos<tLimit)div.style.top=tLimit+"px";else if(yPos>bLimit)div.style.top=bLimit+"px";else div.style.top=yPos+"px";if(xPos<lLimit)div.style.left=lLimit+"px";else if(xPos>rLimit)div.style.left=rLimit+"px";else div.style.left=xPos+"px";if(event.clientX<maskOffset["x"]||event.clientX>maskOffset["x"]+Width||event.clientY<maskOffset["y"]||event.clientY>maskOffset["y"]+Height){document.clearDrag(div,oncomplete);return false;}}
else{div.style.left=xPos+"px";div.style.top=yPos+"px";}}}
document.clearDrag=function(div,oncomplete){div=$(div);if(div){div.style.cursor="";document.body.onmouseup=null;document.body.onmousemove=null;div.ondragstart=null;div=null;document.onselectstart=null;if(oncomplete)oncomplete();};}
var Anim=function(){};Anim.prototype={z:null,fps:25,init:function(args){if(this.z)this.clear();var options={};options.start=new Date().getTime();options.end=options.start+args.time*1000;var t=this;this.z=setInterval(function(){t.loop(args,options)},t.fps);},loop:function(args,options){var now=new Date().getTime();var x=(now-options.start)/(args.time*1000)*.5;if(args.linear)var y=x/.5;else var y=Math.sin(x*Math.PI);var v;if(args.start.length){v=new Array();for(var i=args.start.length;i--;){v[i]=Math.round((args.end[i]-args.start[i])*y+args.start[i])}}
else{v=Math.round((args.end-args.start)*y+args.start);}
if(now>=options.end||v==args.end){this.clear();args.onLoop(args.end);if(args.onFinish)args.onFinish();return;}
args.onLoop(v);},clear:function(){clearInterval(this.z);this.z=null;}}
function trueMouseOut(elem,event){if(!event)event=window.event;var target=event.relatedTarget||event.toElement;if(target){if(target==elem)return false;if(target.parentNode){var x=0;while(target.parentNode){target=target.parentNode;if(target==elem)return false;else if(target.tagName=="HTML"||x>10){return true;break;}
x++;}}}
return true;}
var Flip={AppendTo:function(div){div=$(div);div.Flip=this.Flip;var inner=div.getByClass("div.Flip_Inner");if(!inner)return false;div.inner=inner;div.inner.style.left="0";div.SideA=div.getByClass("div.Side_A");div.SideB=div.getByClass("div.Side_B");div.currentSide=div.SideA;div.nextSide=div.SideB;div.currentSide.style.display="block";div.SideB.style.display="none";div.Status=this.Status.Default;if(!div.overlay&&!ie6){var append=document.createElement("div");append.className="Flip_Overlay";div.inner.appendChild(append);div.overlay=div.getByClass("div.Flip_Overlay");div.overlay.style.height=div.clientHeight+"px";;}
eventAdd(div,"mouseover",function(){if(div.currentSide==div.SideA)div.Flip();});eventAdd(div,"mouseout",function(event){if(trueMouseOut(div,event)){div.Flip(true);}});div.processing=0;},Status:{Default:1,Collapsing:2,Expanding:3},Flip:function(reset){if((this.Status==Flip.Status.Collapsing||this.Status==Flip.Status.Expanding)&&!reset)return false;var t=this;var d=getOffset(t);if(!this.fx)this.fx=new Anim();if(reset){t.fx.clear();if(t.currentSide==t.SideA&&t.Status==Flip.Status.Collapsing){t.Status=Flip.Status.Expanding;}
else if(t.currentSide==t.SideB&&t.Status==Flip.Status.Expanding){t.Status=Flip.Status.Collapsing;}
else if(t.currentSide==t.SideA&&t.Status==Flip.Status.Default){if(t.overlay)t.overlay.style.display="none";return false;}
else if(t.currentSide==t.SideB&&t.Status==Flip.Status.Default){t.Status=Flip.Status.Collapsing;}}
else{t.Status=Flip.Status.Collapsing;}
flip();if(t.overlay)t.overlay.style.display="block";function flip(){var start=[];var end=[];start=[t.inner.clientWidth,parseInt(t.inner.style.left)]
if(t.Status==Flip.Status.Collapsing){end=[1,d.w/2];}
else if(t.Status==Flip.Status.Expanding){end=[d.w,0];}
t.fx.init({start:start,end:end,time:.15,onLoop:function(v){t.inner.style.width=v[0]+"px";t.inner.style.left=v[1]+"px";},onFinish:function(){if(t.Status==Flip.Status.Collapsing){t.Status=Flip.Status.Expanding
t.currentSide.style.display="none";t.nextSide.style.display="block";var tempCurrent=t.currentSide;t.currentSide=t.nextSide;t.nextSide=tempCurrent;flip();}
else{t.Status=Flip.Status.Default;if(t.overlay)t.overlay.style.display="none";}}});}}}
Effect.OpenUp=function(element){return new Effect.Roll(element,arguments[1]||{});};Effect.CloseDown=function(element){options={rollUp:true};Object.extend(options,arguments[1]||{});return new Effect.Roll(element,options);};Effect.Combo=function(element){element=$(element);if(element.style.display=='none'){return Effect.OpenUp(element,arguments[1]||{});}else{return Effect.CloseDown(element,arguments[1]||{});}};
var Nav={expandMain:function(btn){var div=$("subNavDiv");div.className.match("subNavDivSelected")?div.className=div.className.replace("subNavDivSelected",""):div.className+=" subNavDivSelected";},epxand:function(button,div){div=$(div);button=$(button);if(button&&div){button.className.match("navButtonSelected")?button.className=button.className.replace("navButtonSelected",""):button.className+=" navButtonSelected";div.className.match("navDivSelected")?div.className=div.className.replace("navDivSelected",""):div.className+=" navDivSelected";}},init:function(){var uls=$("page").getByClass("ul.navigation");if(!exists(uls))return false;uls.length?uls=uls:uls=new Array(uls);if(uls.length){for(var i=uls.length;i--;){if(uls[i].className.match("navDelay"))var delay=1;else var delay=0;checkForNestedUL(uls[i],delay);}}
else{if(uls.className.match("navDelay"))var delay=1;else var delay=0;checkForNestedUL(uls,delay);}
function checkForNestedUL(UL,delay){var li=$first(UL,"LI");do{if(li){var ul=$first(li,"ul");ul=ul?ul:$first(li,"div");if(ul){Nav.attEvent(li,ul,delay);checkForNestedUL(ul,delay)}}
else
break;var li=$next(li);}while(li)}},bindClick:function(el,ul,closeBtn){ul.onclick=function(){if(el.className.match("navOver"))el.className=el.className.replace("navOver","");else el.className+=" navOver";};if(closeBtn){closeBtn.onclick=function(){el.className=el.className.replace("navOver","");}}},attEvent:function(el,ul,delay){ul=$(ul);el.onmouseover=function(){Nav.mouseOver(el,ul,delay)};el.onmouseout=function(event){Nav.mouseOut(el,delay,event)};},mouseOver:function(el,ul,delay){var cName=el.className.match("navOver");if(delay){if(el.rel)window.clearTimeout(el.rel);if(cName)return false;el.rel=setTimeout(function(){el.className+=" navOver";if(el.id&&$(el.id+"Frame"))Nav.IframeFix(ul,$(el.id+"Frame"));},200);}
else{if(cName)return false;el.className+=" navOver";}
document.body.onmousedown=function(){if(ul.parentNode){var lis=ul.parentNode.parentNode.getElementsByTagName("LI");Nav.closeAll(lis);}}},mouseOut:function(el,delay,event){if(trueMouseOut(el,event)){if(delay){if(el.rel)window.clearTimeout(el.rel);el.rel=setTimeout(function(){el.className=el.className.replace("navOver","");},300);}
else{el.className=el.className.replace("navOver","");}}},closeAll:function(lis){for(var i=0;i<lis.length;i++){if(lis[i].className.match("navOver")){lis[i].className.replace("navOver","");}}
document.body.onmousedown=null;},IframeFix:function(el,frame){frame.style.height=el.clientHeight-5+"px";}}
onLoad(function(){Nav.init();});
var scrollspeed=3;var maxwidth=925;var iedom=document.all||document.getElementById,actualwidth='',cross_scroll,loadedyes=0,lefttime,righttime;function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
function showhidediv(what){}
function getposOffset(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function moveleft(e){motionengine(e)
if(loadedyes){if(iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth+10)){cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px";lefttime=setTimeout("moveleft(this)",10);}
else{showhidediv("right");}}}
function stopmotion(e){clearTimeout(lefttime);clearTimeout(righttime);}
function moveright(e){motionengine(e)
if(loadedyes){if(iedom&&parseInt(cross_scroll.style.left)<0){cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px";righttime=setTimeout("moveright(this)",10);}
else{showhidediv("left");}}}
function motionengine(e){if(!loadedyes){if(iedom){loadedyes=1
crossmain=document.getElementById?document.getElementById("motioncontainer"):document.all.motioncontainer;if(typeof crossmain.style.maxWidth!=='undefined')crossmain.style.maxWidth=maxwidth+'px';menuwidth=crossmain.offsetWidth;cross_scroll=document.getElementById?document.getElementById("motiongallery"):document.all['motiongallery'];cross_scroll.style.left="0px";actualwidth=document.getElementById?document.getElementById("trueContainer").offsetWidth:document.all['trueContainer'].offsetWidth;}}}

function OpenEGain(bOmni,sCharUrl){if(bOmni==1)SetOmniture();var sWinParas;var EGainWindow;sWinParas='width=300,height=300,left=100,top=100,status=1,resizable=0,scrollbars=1,location=0;menubar=0';EGainWindow=window.open(sCharUrl,'EGain_Signin_Window',sWinParas);EGainWindow.focus();}
function SetOmniture(){QuillChat();}
function SearchSuggestTrack(keywords){if(typeof(SearchSuggestTrackS)=='function')SearchSuggestTrackS(keywords);}
SearchSuggest=funcEmpty;SearchSuggest.prototype={KEYUP:38,KEYDOWN:40,KEYENTER:13,KEYTAB:9,KEYESC:27,searchIsOpen:false,oldKeywords:null,searchBox:null,suggestContainer:null,suggestDiv:null,initSearchBox:null,selected:null,canShow:false,preDropDown:null,submitID:null,containerPrefix:'searchSuggest',searchKeyandUrl:null,ajaxDisplayText:"",init:function(searchBox,submitButton,searchKeyandUrl){if(this.initSearchBox)control=$(this.initSearchBox);else{control=$(searchBox);}
if(!control){this.initSearchBox=searchBox;eventAdd(window,'load',this.init.bind(this));return;}
this.submitID=submitButton;this.searchBox=control;this.searchKeyandUrl=$(searchKeyandUrl)
if(control.value!='Keyword or Item #')this.oldKeywords=control.value;this.suggestContainer=$(this.containerPrefix+"Info");this.suggestDiv=$(this.containerPrefix+"Div");control.onblur=this.hide.bind(this);control.onkeyup=this.handleKeyUp.bindAsEventListener(this);control.onkeydown=this.handleKeyDown.bindAsEventListener(this);},handleKeyUp:function(evt){var key=evt.keyCode;if(key==this.KEYUP||key==this.KEYDOWN||key==this.KEYTAB||key==this.KEYENTER||key==this.KEYESC){return true;}
var keywords=this.searchBox.value;var searchTrackValue=escape(this.preDropDown)+"|"+escape(this.searchBox.value)+"|"+escape(this.ajaxDisplayText);cookie.Set({bucket:cookie.buckets.funcTemp,name:"searchTrack",value:searchTrackValue});if(keywords!=this.oldKeywords){this.oldKeywords=this.preDropDown=keywords;this.searchKeyandUrl.value="";if(keywords.length>2){var params='q='+encodeURIComponent(keywords)
var ajax=new Ajax.Request(Resource.ajax.searchSuggest,{method:'get',parameters:params,onComplete:this.buildList.bind(this)});}
else if(keywords.length==0){this.hide();}}
return true;},handleKeyDown:function(evt){var key=evt.keyCode;if(key==this.KEYESC){if(!this.searchIsOpen)return true;this.selectLink(null);this.hide();return true;}
else if(key==this.KEYENTER){var searchTrackValue=escape(this.preDropDown)+"|"+escape(this.searchBox.value)+"|"+escape(this.ajaxDisplayText);cookie.Set({bucket:cookie.buckets.funcTemp,name:"searchTrack",value:searchTrackValue});this.preDropDown=this.oldKeywords=this.searchBox.value;this.hide();return true;}
else if(key!=this.KEYUP&&key!=this.KEYDOWN){return true;}
if(!this.searchIsOpen){this.show();if(!this.searchIsOpen)return true;}
var newLink=this.selected;if(key==this.KEYDOWN){if(!newLink){newLink=this.suggestDiv.firstChild;if(!newLink)return true;}
else{newLink=newLink.nextSibling;}
if(newLink&&newLink.className&&newLink.className=="header")newLink=newLink.nextSibling;}
else{if(!newLink){newLink=this.suggestDiv.lastChild;if(!newLink)return true;}
else{newLink=newLink.previousSibling;}
if(newLink&&newLink.className&&newLink.className=="header")newLink=newLink.previousSibling;}
this.selectLink(newLink);if(!newLink){if(this.preDropDown){this.searchBox.value=this.preDropDown;this.searchKeyandUrl.value="";}
return true;}
this.searchBox.value=this.oldKeywords=newLink.getAttribute("keyword");this.searchKeyandUrl.value="";if(newLink.getAttribute("url")){this.searchKeyandUrl.value=newLink.getAttribute("url");}
this.ajaxDisplayText="";if(newLink.getAttribute("keywordText")){this.ajaxDisplayText=newLink.getAttribute("keywordText");}
return true;},show:function(){if(this.searchIsOpen||this.suggestContainer.style.display=="block"||this.searchBox.value.length==0||this.searchBox.value=='Keyword or Item #'||!this.canShow){return true;}
this.suggestContainer.style.display="block";this.searchIsOpen=true;},hide:function(){if(!this.searchIsOpen)return;this.searchIsOpen=false;this.suggestContainer.style.display="none";$clear(this.suggestDiv);if(this.preDropDown&&this.searchBox.value!=this.preDropDown)this.searchBox.value=this.preDropDown;if(this.searchBox.value.length<3)this.canShow=false;return true;},selectLink:function(item){if(this.selected)this.selected.className="";if(item){if(!item.getAttribute("keyword"))item=item.parentNode;item.className="keySelected";}
this.selected=item;},buildList:function(requestObject,data){var listType;var nodeLink;var link;if(data!=null&&data.length>0){var frag=document.createDocumentFragment();for(var linkIndex in data){link=data[linkIndex];if(typeof(link)=="object"){listType=link[3];nodeLink=document.createElement("a");if(listType==1&&link[2]!=0){var span=document.createElement("span");span.appendChild(document.createTextNode(link[2]));nodeLink.appendChild(span);}
nodeLink.appendChild(document.createTextNode(link[0]));nodeLink.setAttribute("keywordText",link[0]);if(listType!=0){switch(listType){case 1:nodeLink.setAttribute("keyword",link[2]);if(link[1]!=null&&link[1]!=""){nodeLink.setAttribute("url",link[1]);}
break;case 2:case 3:if(link[2]!=null&&link[2]!=""){nodeLink.setAttribute("keyword",link[2]);}
else{nodeLink.setAttribute("keyword",link[0]);}
if(link[1]!=null&&link[1]!=""){nodeLink.setAttribute("url",link[1]);}
break;}
nodeLink.onmousedown=this.submitClick.bindAsEventListener(this);nodeLink.onmouseover=this.linkMouseOver.bindAsEventListener(this);}
else{nodeLink.className="header";}
frag.appendChild(nodeLink);}}
this.selectLink(null);$clear(this.suggestDiv);this.suggestDiv.appendChild(frag);this.canShow=true;this.show();}
else{this.hide();}},linkMouseOver:function(evt){var element=evt.srcElement||evt.target;this.selectLink(element);},submitClick:function(evt){var element=evt.srcElement||evt.target;var submit=$(this.submitID);if(submit&&element){if(!element.getAttribute("keyword")){element=element.parentNode;}
searchTrachDet=this.searchBox.value;this.searchBox.value=this.preDropDown=this.oldKeywords=element.getAttribute("keyword");this.searchKeyandUrl.value="";if(element.getAttribute("url")){this.searchKeyandUrl.value=element.getAttribute("url");}
this.ajaxDisplayText="";if(element.getAttribute("keywordText")){this.ajaxDisplayText=element.getAttribute("keywordText");}
searchTrachDet=escape(searchTrachDet)+"|"+escape(this.searchBox.value)+"|"+escape(this.ajaxDisplayText);cookie.Set({bucket:cookie.buckets.funcTemp,name:"searchTrack",value:searchTrachDet});this.searchBox.focus();submit.click();this.hide();}}};
function ShowFlash(swf,w,h){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'"><param name="movie" value="'+swf+'"><param name="allowScriptAccess" value="always"><param name="quality" value="high"><param name="wmode" value="transparent"><embed src="'+swf+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" allowScriptAccess="always"></embed></object>');}
function IsFlashAvailable(){var fAvail=false,foundVer=0;var plugin=(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"])?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;if(plugin){var words=navigator.plugins["Shockwave Flash"].description.split(" ");if(words.length>2)if(words[2]>=6)fAvail=true;}
else if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(navigator.appVersion.indexOf("Win")!=-1)){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");fAvail=true;}
catch(e){}}
return fAvail;}
var popup=Class.create();popup={Qwrap:"QViewInfo",Qdiv:"QView",Mwrap:"MiniSKUInfo",Mdiv:"MiniSKU",Hwrap:"HelpBoxGlobal",Hdiv:"HelpBoxDiv",HContent:"HelpContentGlobal",Htitle:"HelpTitleGlobal",miniCart:"MiniCartInfo",CompareWrap:"DivCompareInfo",Compare:"DivCompare",adjustedPwrReviews:false,skuPage:false,args:{},send:{},mFx:null,qFx:null,cartFx:null,processing:0,dropDownToUpdate:"",GoButtonId:"",GetAllLegacyPrinters:0,inktonerOffers:"",showImagePopUpOK:true,init:function(args){if(this.processing!=0)return false;this.processing=1;this.args={type:0,action:"",div:"",wrap:"",title:"",ajax:"",button:null,sku:"",effort:"",findNumber:"",promoCode:"",qtyOverFlow:"",ovreferenceID:"",imprintConfigId:"",optionValue:"",cartItemIndex:"",showAccessories:0,addToCartFromQview:"",hasOptions:"",QTY:"",callTrackID:"",campaignID:"",MethodName:"",showOvDropDown:0,positionID:"",allselectedoptionDetails:null,send:null,htmlfilepath:"",productOrMarket:"",defaultImage:"",Htitle:"",Hcontent:"",DivisionNum:"",category:"",inktonerOffers:"",showBackButton:0,mode:"",closeMiniSku:1,closeQview:1,closeCompare:0,locus:{x:null,y:null,adjx:null,adjy:null},fx:null,UpgradeType:"",PrimarySKU:"",MachineTypeId:0,ManufacturerId:0,ModelId:0,MachineTypeDropDownId:"",ManufacturerDropDownId:"",ModelDropDownId:"",GoButtonId:"",showBackToCompareButton:0,skuForCompare:"",fromSeePriceInCart:0,OpenTab:"",BundleGroupNumber:"",PriceOverrideFlag:"",dealSku:"",imageIndex:0}
switch(args.type){case 0:args.div=$(this.Mdiv);args.wrap=$(this.Mwrap);args.url="/ajax/PopUpScripts.aspx";if(!this.mFx)this.mFx=new Anim();break;case 1:args.div=$(this.Qdiv);args.wrap=$(this.Qwrap);args.url="/ajax/QViewScripts.aspx";if(!this.qFx)this.qFx=new Anim();break;case 2:args.div=$(this.Hdiv);args.wrap=$(this.Hwrap);args.title=$(this.Htitle);if(!this.hFx)this.hFx=new Anim();break;case 4:args.wrap=$(this.CompareWrap);args.div=$(this.Compare);args.url=Resource.ajax.CompareSKUs;if(!this.compareFx)this.compareFx=new Anim();break;}
this.args=Object.extend(this.args,args);if(!this.cartFx)this.cartFx=new Anim();this.proccess();},proccess:function(){this.send={parent:this,params:null,callBack:this.showHTML}
this.send.params="action="+this.args.action;if(this.args.type==0){switch(this.args.action){case 1:this.inktonerOffers=this.args.inktonerOffers;break;case 2:if(this.args.hasOptions&&$(this.args.hasOptions)){if(this.checkOVError($(this.args.hasOptions))==false)return false;}
this.send.callBack=this.checkMiniSku;break;case 3:this.send.callBack=this.showMiniCart;return this.getHTML();break;case 4:break;case 5:if($(this.args.qtyOverFlow))this.args.qtyOverFlow=$(this.args.qtyOverFlow).value;else this.args.qtyOverFlow="";this.send.callBack=this.checkMiniSku;break;case 7:this.send.callBack=this.checkMiniSkuUpdate;break;case 8:break;case 11:if($(this.args.qtyOverFlow))this.args.qtyOverFlow=$(this.args.qtyOverFlow).value;else this.args.qtyOverFlow="";this.send.callBack=this.checkMiniSkuUpdate;break;case 13:this.args.url=Resource.ajax.InkAndToner;break;}
var args=this.args;var qty="";if(args.QTY){$(args.QTY)?qty=$(args.QTY).value:qty=parseInt(args.QTY);}
args.fx=this.mFx;this.send.params+="&sku="+this.args.sku+"&effortCode="+args.effort+"&findNumber="+args.findNumber+"&qty="+qty+"&showOv="+args.showOvDropDown+"&CampaignID="+args.campaignID+"&imprintConfigId="+args.imprintConfigId+"&CartItemIndex="+args.cartItemIndex+"&CallTrackID="+args.callTrackID+"&PositionID="+args.positionID+"&promoCode="+args.promoCode+"&qtyOverFlow="+args.qtyOverFlow+"&OVReferenceID="+args.ovreferenceID+"&ShowAccessoriesAfterAddToCart="+args.showAccessories+"&optionValue="+args.optionValue+"&MethodName="+args.MethodName;this.getHTML();}
else if(this.args.type==1){var args=this.args;args.fx=this.qFx;switch(this.args.action){case 1:this.inktonerOffers=args.inktonerOffers;break;case 3:break;case 4:break;}
this.send.params+="&sku="+this.args.sku+"&effortCode="+args.effort+"&findNumber="+args.findNumber+"&promoCode="+args.promoCode+"&htmlfilepath="+args.htmlfilepath+"&productOrMarket="+args.productOrMarket+"&defaultImage="+args.defaultImage+"&showBackButton="+args.showBackButton+"&GetInkAndTonerOffer="+this.inktonerOffers+"&ShowAccessoriesAfterAddToCart="+args.showAccessories+"&AccessoriesMode="+args.mode+"&skuForCompare="+args.skuForCompare+"&showBackToCompareButton="+args.showBackToCompareButton+"&fromSeePriceInCart="+this.args.fromSeePriceInCart+"&dealSku="+this.args.dealSku+"&imageindex="+this.args.imageIndex;this.getHTML();}
else if(this.args.type==2){this.args.fx=this.hFx;this.show();}
else if(this.args.type==4){this.args.fx=this.compareFx;switch(this.args.MethodName){case"CompareUpgrades":TrackUpgradeLinkClick(this.args.PrimarySKU);this.close();this.send.callBack=this.showComparison;this.send.params+="&PrimarySKU="+this.args.PrimarySKU+"&MethodName="+this.args.MethodName+"&UpgradeType="+this.args.UpgradeType+"&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&PromoCode="+this.args.promoCode;this.getHTML();break;case"SelectModel":TrackUpgradeLinkClick(this.args.PrimarySKU);if(this.args.GoButtonId!=""){if($(this.args.GoButtonId).className.indexOf("disabled",0)>0){this.processing=0;return false;}}
this.close();this.send.callBack=this.showComparison;this.send.params+="&PrimarySKU="+this.args.PrimarySKU+"&MethodName="+this.args.MethodName+"&UpgradeType="+this.args.UpgradeType;this.getHTML();break;case"GetUpgradesForModel":if(this.args.GoButtonId!=""){if($(this.args.GoButtonId).className.indexOf("disabled",0)>0){this.processing=0;return false;}}
this.close();this.send.callBack=this.showComparison;this.send.params+="&ModelId="+this.args.ModelId+"&PrimarySKU="+this.args.PrimarySKU+"&MethodName="+this.args.MethodName+"&UpgradeType="+this.args.UpgradeType;this.getHTML();break;case"GetBrands":this.GoButtonId=this.args.GoButtonId;customUI.setSelectedIndex(this.args.ModelDropDownId,0);customUI.disable(this.args.ModelDropDownId);this.enableSearch(0);this.dropDownToUpdate=this.args.ManufacturerDropDownId;if(this.args.MachineTypeId!=0){this.send.params+="&MethodName="+this.args.MethodName+"&PrimarySKU="+this.args.PrimarySKU+"&MachineTypeId="+this.args.MachineTypeId+"&GetAllLegacyPrinters="+this.args.GetAllLegacyPrinters;this.send.callBack=this.updateDropDown;this.getHTML();}
else{customUI.disable(this.args.ManufacturerDropDownId);}
break;case"GetModels":this.GoButtonId=this.args.GoButtonId;this.enableSearch(0);this.dropDownToUpdate=this.args.ModelDropDownId;if((this.args.MachineTypeId!=0)&&(this.args.ManufacturerId!=0)){this.send.params+="&MethodName="+this.args.MethodName+"&PrimarySKU="+this.args.PrimarySKU+"&MachineTypeId="+this.args.MachineTypeId+"&ManufacturerId="+this.args.ManufacturerId+"&GetAllLegacyPrinters="+this.args.GetAllLegacyPrinters;this.send.callBack=this.updateDropDown;this.getHTML();}
else{customUI.disable(this.args.ModelDropDownId);}
break;case"HandleSearch":this.GoButtonId=this.args.GoButtonId;if(this.args.ModelId!=0)this.enableSearch(1);else this.enableSearch(0);break;case"GetBundleSkus":this.close();this.send.callBack=this.showComparison;this.send.params+="&MethodName="+this.args.MethodName+"&BundleSku="+this.args.sku+"&EffortCode="+this.args.effort+"&BundleGroupNumber="+this.args.BundleGroupNumber+"&PriceOverrideFlag="+this.args.PriceOverrideFlag;this.getHTML();break;}}},getHTML:function(){var obj=this;var params=this.send.params+"&rnd="+Math.random();this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});},showHTML:function(requestObj){if(exists(requestObj.responseText)){this.args.div.innerHTML=requestObj.responseText;this.args.wrap.style.display="block";this.show();if(this.args.action==1)PromoMiniSkuTrack(0);}},showComparison:function(requestObj){if(exists(requestObj.responseText)){this.args.wrap.style.display="block";this.args.div.innerHTML=requestObj.responseText;compareScroll.pages=5;compareScroll.mode="";var itemsPerPage=3;if(this.args.MethodName=="GetBundleSkus")itemsPerPage=4;compareScroll.currentPage=0;compareScroll.initFinder({pageWidth:"auto",height:"auto",name:"compareScroll",control:"compareScroll_",itemsPerPage:itemsPerPage,maxHelperPages:5});LightBox.Show();this.show();}},updateDropDown:function(requestObj){if(exists(requestObj.responseText)){customUI.enable(this.dropDownToUpdate);customUI.update(this.dropDownToUpdate,requestObj.responseText);this.processing=0;}},handleScroll:function(){var div=$(popup.miniCart);if(div!=null){var top;if(div.offsetHeight>=document.documentElement.clientHeight)top=-1;else top=-1+getScrollPos().y
div.style.top=top+"px";}},showMiniCart:function(requestObj){if(requestObj.responseText){var div=$(this.miniCart);div.style.display="block";div.innerHTML=requestObj.responseText;var h=div.offsetHeight;div.style.height="0px";div.style.overflow="hidden";this.cartFx.init({start:0,end:h,time:.25,onLoop:function(v){div.style.height=v+"px";},onFinish:function(){div.style.overflow="";div.style.height="";}});window.onscroll=this.handleScroll;this.close(0);this.miniCartTimeout=setTimeout(function(){div.style.display="none";$clear(div);},this.miniCartT*1000);this.handleScroll();if(this.args.showAccessories==1){this.args.promoCode=parseInt(this.args.promoCode)+100;this.init({button:'0',type:1,action:3,sku:this.args.sku,inktonerOffers:"False",mode:"INKTONERFinder",promoCode:this.args.promoCode});}
$("hdTotal").innerHTML=$("cartTotal").innerHTML;$("hdItems").innerHTML=$("cartItems").innerHTML;$("hdShpngMsg").innerHTML=$("cartShpngMsg").innerHTML;var alleyBannerTextDiv=$('alleyBannerText');if((alleyBannerTextDiv)&&($('countDownOfferMessage').innerHTML!=""))alleyBannerTextDiv.innerHTML=$('countDownOfferMessage').innerHTML;}
else{this.processing=0;}},checkMiniSku:function(requestObj){if(requestObj.responseText=="BASKETSTATEOK"){if(location.pathname=="/cart/cart.aspx"&&(this.args.action==2||this.args.action==5)){__doPostBack('ctl00$MainContent$RefreshLinkButton','');this.close(0);this.args.action=3;this.proccess();}
else{this.args.action=3;this.proccess();}}
else{this.args.action=4;this.proccess();}},checkMiniSkuUpdate:function(requestObj){var strResponse=requestObj.responseText.toUpperCase();if(strResponse=="BASKETSTATEOK"||strResponse=="NOITEMINBASKET"){__doPostBack('ctl00$MainContent$CheckoutCart$CheckoutPageUpdateLink','');this.close(0);}
else if(strResponse=="QUANTITYERRORBUNDLE"){this.close(0);window.location="/cart/QuantityError.aspx?RedirectType=5";return true;}
else{this.args.action=8;this.proccess();}},miniCartTimeout:null,miniCartT:5,accessoriesTimeout:null,accessoriesT:4,show:function(){this.args.wrap.style.display="block";var input=$(this.args.wrap).getByClass("INPUT.qtyInput");if(this.args.type==1){if(this.args.action==1||this.args.action==7)tabMenu.init({tabMenu:this.args.wrap,tab:this.args.OpenTab});if(this.args.action==2){eval($("carousel_QIMG_Carousel__script").innerHTML);}
if(this.args.action==3){eval($("carousel_accessoriesCarousel_script").innerHTML);var div=$(this.args.div);div.onmouseover=function(){div.onmouseover=null;clearTimeout(popup.accessoriesTimeout);}
this.accessoriesTimeout=setTimeout(function(){popup.close(1);},this.accessoriesT*1000);}
if(this.args.closeMiniSku==1)this.close(0);if(this.args.action==4||this.args.action==5){}}
if(this.args.type==2){$(this.Htitle).innerHTML=this.args.Htitle;$(this.HContent).innerHTML=this.args.Hcontent;}
if(this.args.button&&this.args.button!='0')reposition(this.args.wrap,this.args.button);else if(this.args.button=='0')reposition(this.args.wrap);if(parseInt(this.args.wrap.style.top)<155)this.args.wrap.style.top=155+"px";if(this.args.button!=null)this.roll();if(this.args.type==0){if(this.args.closeQview==1)this.close(1);if(this.args.action==11)initScrollbars(this.args.div);}
if(this.args.closeCompare==1)this.close(4);if(this.args.type==4)this.showImagePopUpOK=true;else this.showImagePopUpOK=false;},close:function(type){if(type!=null){var div;var wrap;switch(type){case 0:wrap=$(this.Mwrap);div=$(this.Mdiv);break;case 1:wrap=$(this.Qwrap);div=$(this.Qdiv);break;case 2:$(this.Hwrap).style.left="-2000px";$(this.Hwrap).style.display="none";break;case 3:$(this.miniCart).style.display="none";window.onscroll=null;break
case 4:LightBox.Hide();wrap=$(this.CompareWrap);div=$(this.Compare);break}
if(wrap){wrap.style.left="-2000px";wrap.style.display="none";}}
else{$(this.Mwrap).style.left="-2000px";$(this.Mwrap).style.display="none";$clear(this.Mdiv);$(this.Qwrap).style.left="-2000px";$(this.Qwrap).style.display="none";$clear(this.Qdiv);$(this.Hwrap).style.left="-2000px";$(this.Hwrap).style.display="none";}
if(this.adjustedPwrReviews==true&&this.skuPage){}
this.processing=0;this.showImagePopUpOK=true;},checkOVError:function(objOptions){var allselectedoptionDetails="";var hasError="N";var allOptionDetailsDivIds=objOptions.value;var alloptionDivIdSplit=allOptionDetailsDivIds.split("|");for(i=0;i<alloptionDivIdSplit.length;i++){if($(alloptionDivIdSplit[i])!=null){var selectedOptionDetails=customUI.getSelectedValue(alloptionDivIdSplit[i]);if(selectedOptionDetails!="00000000000"){if(allselectedoptionDetails==""){allselectedoptionDetails=selectedOptionDetails;}
else{allselectedoptionDetails=allselectedoptionDetails+"|"+selectedOptionDetails;}}
else{hasError="Y";break;}}}
if(hasError=="Y"){$("optionError").innerHTML="Please select all options."
$("optionError").style.display='block';return false;}
this.args.optionValue=allselectedoptionDetails;return true;},roll:function(){var start;var end;var div=$(this.args.wrap);var d=$(this.args.div);var locus=getOffset(div);if(this.args.locus.x)locus.x=this.args.locus.x;if(this.args.locus.y)locus.y=this.args.locus.y;if(this.args.locus.adjx)locus.x=parseInt(this.args.wrap.style.left)+this.args.locus.adjx;if(this.args.locus.adjy)locus.y=parseInt(this.args.wrap.style.top)+this.args.locus.adjy;div.style.left=locus.x+"px";div.style.top=locus.y+"px";div.style.overflow="hidden";div.style.opacity=0;d.style.width=locus.w+"px";d.style.height=locus.h+"px";div.style.width="0px";div.style.height="0px";start=[locus.w/2,locus.h/2,0];end=[locus.w,locus.h,100];this.args.fx.init({start:start,end:end,time:.15,onLoop:function(v){div.style.width=v[0]+"px";div.style.height=v[1]+"px";div.style.opacity=v[2]/100;},onFinish:function(){popup.processing=0;div.style.width="";div.style.height="";div.style.filter="";div.style.opacity="";div.style.overflow="";d.style.width="";d.style.height="";}});},enableSearch:function(enable){if(enable!=0){$(this.GoButtonId).className="goButton L";}
else{$(this.GoButtonId).className="goButtonDisabled L";}
this.processing=0;},redirectToComparePage:function(modelId,primarySKU,getAllLegacyPrinters){if(modelId==0)return false;window.location="/Compare/CompareSKUs.aspx?ModelId="+modelId+"&PrimarySKU="+primarySKU+"&MethodName=GetUpgradesForModel"+"&GetAllLegacyPrinters="+getAllLegacyPrinters;}}

var QView=Class.create();QView={Qwrap:"QViewInfo",Qdiv:"QView",miniCart:"MiniCartInfo",adjustedPwrReviews:false,skuPageSku:null,args:{},send:{},mFx:null,qFx:null,cartFx:null,processing:0,refreshHTML:0,accordionPanelId:null,panel:null,acHeader:null,miniCartTimeout:null,miniCartT:5,addAccessoriesFromQView:0,trackQViewProdView:0,upgradeParentSKU:"",quantityError:0,init:function(args){if(this.processing!=0)return false;this.processing=1;this.args={action:"",div:"",wrap:"",title:"",ajax:"",button:null,sku:"",effort:"",findNumber:"",promoCode:"",qtyOverFlow:"",ovreferenceID:"",imprintConfigId:"",optionValue:"",cartItemIndex:"",showAccessories:0,addToCartFromQview:"",hasOptions:"",QTY:"",callTrackID:"",campaignID:"",MethodName:"",showOvDropDown:0,positionID:"",allselectedoptionDetails:null,send:null,htmlfilepath:"",productOrMarket:"",defaultImage:"",Htitle:"",Hcontent:"",DivisionNum:"",category:"",inktonerOffers:"",showBackButton:0,mode:"",closeMiniSku:1,closeQview:1,closeCompare:0,locus:{x:null,y:null,adjx:null,adjy:null},fx:null,tab:"tbOverview",mode:"",iQty:"",showMiniCart:'false',showInUpdateMode:0,cartItemIndex:0,tabToDisplay:null,seePriceInCart:0,hideBuy:0,accessoriesForSkuPage:0,addFromQuickView:0,upgradeParentSKU:"",imageIndex:0}
args.div=$(this.Qdiv);args.wrap=$(this.Qwrap);args.url="/ajax/QView.aspx";if(!this.qFx)this.qFx=new Anim();this.args=Object.extend(this.args,args);if(!this.cartFx)this.cartFx=new Anim();this.proccess();},proccess:function(){this.args.fx=this.qFx;this.send={parent:this,params:null,callBack:this.showHTML}
this.send.params="action="+this.args.action+"&rnd="+Math.random();switch(this.args.action){case"GetQViewHTML":if(typeof(s)!="undefined")this.trackQViewProdView=1;if(this.args.seePriceInCart==1){TrackSeePriceInCartLinkClick(this.args.sku);}
this.send.params+="&sku="+this.args.sku+"&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&promoCode="+this.args.promoCode+"&ShowInUpdateMode="+this.args.showInUpdateMode+"&QTY="+this.args.QTY+"&CartItemIndex="+this.args.cartItemIndex+"&tabToDisplay="+this.args.tabToDisplay+"&SeePriceInCart="+this.args.seePriceInCart+"&ShowAccessories="+this.args.showAccessories+"&showOv="+this.args.showOvDropDown+"&HideBuy="+this.args.hideBuy+"&AccessoriesForSkuPage="+this.args.accessoriesForSkuPage;this.getHTML();break;case"GetQviewImageHtml":this.trackQViewProdView=1;this.send.params+="&sku="+this.args.sku+"&imageindex="+this.args.imageIndex;this.getHTML();break;case"AddItemToCart":this.addFromQuickView=1;this.upgradeParentSKU=this.args.upgradeParentSKU;if(this.args.hasOptions&&$(this.args.hasOptions)){if(this.checkOVError($(this.args.hasOptions))==false)return false;}
if(this.args.hasOptions&&$(this.args.hasOptions)){if(this.checkOVError($(this.args.hasOptions))==false)return false;}
if(this.args.QTY=="0"||this.args.QTY==stringEmpty){tooltip.init($('txtQuantity'),'Please enter a valid number',120);this.processing=0;return false;}
this.send.params+="&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&QTY="+this.args.QTY+"&promoCode="+this.args.promoCode+"&ShowAccessories="+this.args.showAccessories+"&optionValue="+this.args.optionValue+"&AccessoriesForSkuPage="+this.args.accessoriesForSkuPage;var obj=this;var params=this.send.params;this.send.callBack=this.processAddToCart;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});break;case"UpdateCartItem":this.addFromQuickView=1;if(this.args.QTY==stringEmpty){tooltip.init($('txtQuantity'),'Please enter a valid number',120);this.processing=0;return false;}
this.send.params+="&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&QTY="+this.args.QTY+"&CartItemIndex="+this.args.cartItemIndex+"&ShowInUpdateMode="+this.args.showInUpdateMode;var obj=this;var params=this.send.params;this.send.callBack=this.processUpdateCart;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});break;case"GetCartHTML":this.send.params+="&ShowAccessories="+this.args.showAccessories+"&AccessoriesForSkuPage="+this.args.accessoriesForSkuPage;this.getHTML();break;case"GetQtyErrorHTML":this.quantityError=1;this.send.params+="&ShowInUpdateMode="+this.args.showInUpdateMode;this.getHTML();break;case"AddRecommendedItemsToCart":this.addFromQuickView=1;this.addAccessoriesFromQView=1;this.send.params+="&recommendedItems="+this.args.recommendedItems;var obj=this;var params=this.send.params;this.send.callBack=this.processAddToCart;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});break;case"AddItemToCartFromQtyError":this.addFromQuickView=1;if($(this.args.QTY))this.args.QTY=$(this.args.QTY).value;if($(this.args.qtyOverFlow))this.args.qtyOverFlow=$(this.args.qtyOverFlow).value;else this.args.qtyOverFlow="";if($(this.args.ovreferenceID))this.args.ovreferenceID=$(this.args.ovreferenceID).value;if(this.args.QTY=="0"||this.args.QTY==stringEmpty||this.args.QTY==0){this.processing=0;return false;}
this.send.callBack=this.processAddToCart;var obj=this;this.send.params+="&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&QTY="+this.args.QTY+"&qtyOverFlow="+this.args.qtyOverFlow+"&promoCode="+this.args.promoCode+"&ShowAccessories="+this.args.showAccessories+"&OVReferenceID="+this.args.ovreferenceID;var params=this.send.params;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});break;case"UpdateCartItemFromQtyError":this.addFromQuickView=1;if($(this.args.QTY))this.args.QTY=$(this.args.QTY).value;if($(this.args.qtyOverFlow))this.args.qtyOverFlow=$(this.args.qtyOverFlow).value;else this.args.qtyOverFlow="";if($(this.args.ovreferenceID))this.args.ovreferenceID=$(this.args.ovreferenceID).value;this.send.callBack=this.processUpdateCart;var obj=this;this.send.params+="&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&QTY="+this.args.QTY+"&qtyOverFlow="+this.args.qtyOverFlow+"&promoCode="+this.args.promoCode+"&OVReferenceID="+this.args.ovreferenceID;var params=this.send.params;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});break;}},getHTML:function(){var obj=this;var params=this.send.params;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:obj.send.callBack.bind(this),asynchronous:true});if(this.args.action=="GetCartHTML"){AddCartTrack(this.addFromQuickView,this.addAccessoriesFromQView,this.upgradeParentSKU);}},showHTML:function(requestObj){if(exists(requestObj.responseText)){if(this.args.showMiniCart=='true'){this.close(0);this.args.div=$(this.miniCart);}
else{this.close(1);this.args.div=$(this.Qdiv);}
this.showImagePopUpOK=false;this.args.div.innerHTML=requestObj.responseText;if(this.quantityError==1){TrackQuantityErrorFromQView($("miniQtyErrorErrorMsg").value,$("miniQtyErrorVariantID").value);}
this.quantityError=0;if(this.args.action=="GetCartHTML"){if($("cartTotal")!=null)$("hdTotal").innerHTML=$("cartTotal").value;if($("cartItems")!=null)$("hdItems").innerHTML=$("cartItems").value;if($("cartShpngMsg")!=null)$("hdShpngMsg").innerHTML=$("cartShpngMsg").innerHTML;if(this.args.showMiniCart!='true'){if($('scriptAccessoriesPopuop'))eval($('scriptAccessoriesPopuop').innerHTML);}}
if(this.args.showMiniCart=='true'){var div=this.args.div;div.style.display="block";var h=div.offsetHeight;div.style.height="0px";div.style.overflow="hidden";this.cartFx.init({start:0,end:h,time:.25,onLoop:function(v){div.style.height=v+"px";},onFinish:function(){div.style.overflow="";div.style.height="";QView.processing=0;}});window.onscroll=this.handleScroll;this.close(0);this.miniCartTimeout=setTimeout(function(){div.style.display="none";$clear(div);window.onscroll=null;},this.miniCartT*1000);this.handleScroll();}
var alleyBannerTextDiv=$('alleyBannerText');var countDownMsgDiv=$('countDownOfferMessage');if(alleyBannerTextDiv&&countDownMsgDiv&&countDownMsgDiv.innerHTML!="")alleyBannerTextDiv.innerHTML=$('countDownOfferMessage').innerHTML;var tabInitScript=$("scrQview");if(tabInitScript){if(this.trackQViewProdView==1)eval(tabInitScript.innerHTML);this.trackQViewProdView=0;}
if(this.args.showMiniCart=='false')this.show();var script=$("carousel_accessoriesCarousel2_script");if(script){eval(script.innerHTML);eventAdd(carousel_accessoriesCarousel2.toRight,"click",function(){QView.trackScrollingFromPopUp("toRight");});eventAdd(carousel_accessoriesCarousel2.toLeft,"click",function(){QView.trackScrollingFromPopUp("toLeft");});}
var panel=$(this.args.wrap).getByClass("div.AcPanel");if(panel.length)panel=panel[0];this.panel=$(panel);this.panel.loaded=1;this.panel.getById("a#tbOverview").loaded=1;if(this.args.tabToDisplay&&this.args.tabToDisplay.toLowerCase()=="reviews"){if(typeof POWERREVIEWS=="undefined")helper.addScript("/pwr/engine/js/full.js","pwrScripts");if(this.skuPageSkvu==this.args.sku){if($("pr-contents-"+this.skuPageSku))$("pr-contents-"+this.skuPageSku).setAttribute("id","pr-contents-"+this.skuPageSku+"_temp");if($("pr-review-engine-"+this.skuPageSku))$("pr-review-engine-"+this.skuPageSku).setAttribute("id","pr-review-engine-"+this.skuPageSku+"_temp");if($("pr-header-"+this.skuPageSku))$("pr-header-"+this.skuPageSku).setAttribute("id","pr-header-"+this.skuPageSku+"_temp");}}}
else{this.processing=0;}},initializeTab:function(target,tabHeader){var panel;var el=target;while(el.parentNode){el=el.parentNode;if(el.className.match("AcPanel")){panel=$(el);this.panel=el;break;}}
if(typeof tabHeader=="string")tabHeader=panel.getById(tabHeader);this.args.tab=tabHeader;},tabClick:function(target,tabHeader,method,tabName,imageIndex){if(this.processing!=0)return false;this.processing=1;var panel;var el=target;while(el.parentNode){el=el.parentNode;if(el.className.match("AcPanel")){panel=$(el);this.panel=el;break;}}
if(typeof tabHeader=="string")tabHeader=panel.getById(tabHeader);if(tabName){this.args.tabToDisplay=tabName;if(this.trackQViewProdView==1)TrackQViewTabClick(this.args.sku,tabName);}
this.args.action=method;this.args.tab=tabHeader;if(this.args.tab.loaded!=1){var panelIndex=this.panel.getAttribute("rel");this.send.params="action="+this.args.action+"&sku="+this.args.sku+"&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&iQty="+this.args.QTY+"&promoCode="+this.args.promoCode+"&panelIndex="+panelIndex+"&imageindex="+imageIndex;this.send.callBack=this.updateTabs;var params=this.send.params;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:this.send.callBack.bind(this),asynchronous:true});}
else{tabMenu.init({tabMenu:this.panel,tab:this.args.tab});this.processing=0;}},updateTabs:function(requestObj){if(requestObj.responseText){var options=tabMenu.init({tabMenu:this.panel,tab:this.args.tab,returnOptions:true});options.panels[options.index].innerHTML=requestObj.responseText;options.tabs[options.index].loaded=1;var panelIndex=this.panel.getAttribute("rel")||0;var script=$("carousel_QIMG_Carousel_"+panelIndex+"__script");if(script){eval(script.innerHTML);}
if(this.args.tabToDisplay&&this.args.tabToDisplay.toLowerCase()=="reviews"){if(typeof POWERREVIEWS=="undefined")helper.addScript("/pwr/engine/js/full.js","pwrScripts");if(this.skuPageSkvu==this.args.sku){if($("pr-contents-"+this.skuPageSku))$("pr-contents-"+this.skuPageSku).setAttribute("id","pr-contents-"+this.skuPageSku+"_temp");if($("pr-review-engine-"+this.skuPageSku))$("pr-review-engine-"+this.skuPageSku).setAttribute("id","pr-review-engine-"+this.skuPageSku+"_temp");if($("pr-header-"+this.skuPageSku))$("pr-header-"+this.skuPageSku).setAttribute("id","pr-header-"+this.skuPageSku+"_temp");}}}
this.processing=0;},show:function(){if($(this.args.tab)!=null){$(this.args.tab).loaded=1;tabMenu.init({tabPanel:this.args.wrap,tab:this.args.tab});}
this.args.wrap.style.display="block";if(this.args.action=="GetQViewHTML"){var panelIndex=this.panel.getAttribute("rel")||0;var script=$("carousel_Qview_QIMG_"+panelIndex+"_Carousel_script");if(script)eval(script.innerHTML);script=$("carousel_Qview_QIMGPromo_"+panelIndex+"_Carousel_script");if(script)eval(script.innerHTML);if(this.args.tabToDisplay&&this.args.tabToDisplay.toLowerCase()=="reviews"){if(this.skuPageSku==this.args.sku){if($("pr-contents-"+this.skuPageSku))$("pr-contents-"+this.skuPageSku).setAttribute("id","pr-contents-"+this.skuPageSku+"_temp");if($("pr-review-engine-"+this.skuPageSku))$("pr-review-engine-"+this.skuPageSku).setAttribute("id","pr-review-engine-"+this.skuPageSku+"_temp");if($("pr-header-"+this.skuPageSku))$("pr-header-"+this.skuPageSku).setAttribute("id","pr-header-"+this.skuPageSku+"_temp");}
var parent=$("ReviewContent");if(parent){var anchor=$first(parent,"a");}}}
else if(this.args.action=="GetQviewImageHtml"){var panelIndex=this.panel.getAttribute("rel")||0;var script=$("carousel_QIMG_Carousel_"+panelIndex+"__script");if(script)eval(script.innerHTML);this.panel=$("QView");}
if(this.args.button&&this.args.button!='0')reposition(this.args.wrap,this.args.button);else if(this.args.button=='0')reposition(this.args.wrap);if(parseInt(this.args.wrap.style.top)<135)this.args.wrap.style.top=135+"px";if(this.args.button!=null)this.roll();},getAccordionPanelContent:function(panel,accordionID,sku,effortCode,findNumber,promoCode,parentSKU){this.panel=$(panel.parentNode);if(this.panel.loaded!=1){this.acHeader=panel;this.args.action="GetAccordionPanelContent";this.args.sku=sku;this.args.effort=effortCode;this.args.findNumber=findNumber;this.send.params="action="+this.args.action+"&sku="+this.args.sku+"&EffortCode="+this.args.effort+"&FindNumber="+this.args.findNumber+"&promoCode="+promoCode+"&UpgradeParentSKU="+parentSKU;this.send.callBack=this.updateAccordionPanelContent;var params=this.send.params;this.args.ajax=new Ajax.Request(this.args.url,{method:'get',parameters:params,onComplete:this.send.callBack.bind(this),asynchronous:true});}
else{this.acHeader=panel;this.args.sku=sku;this.args.effort=effortCode;this.args.findNumber=findNumber;accordion.headerClick(panel);}
if(this.trackQViewProdView==1&&parentSKU)TrackQViewUpgradeOpen(sku,parentSKU);},updateAccordionPanelContent:function(requestObj){this.panel.loaded=1;var accordionContent=this.panel.getByClass("div.AcContent");accordionContent.innerHTML=requestObj.responseText;var tab=this.panel.getById("a#tbOverview");tab.loaded=1;tabMenu.init({tabMenu:this.panel,tab:tab});accordion.headerClick(this.acHeader);var panelIndex=this.panel.getAttribute("rel");var script=$("carousel_Qview_QIMG_"+panelIndex+"_Carousel_script");if(script)eval(script.innerHTML);script=$("carousel_Qview_QIMGPromo_"+panelIndex+"_Carousel_script");if(script)eval(script.innerHTML);},roll:function(){var start;var end;var div=$(this.args.wrap);var d=$(this.args.div);var locus=getOffset(div);if(this.args.locus.x)locus.x=this.args.locus.x;if(this.args.locus.y)locus.y=this.args.locus.y;if(this.args.locus.adjx)locus.x=parseInt(this.args.wrap.style.left)+this.args.locus.adjx;if(this.args.locus.adjy)locus.y=parseInt(this.args.wrap.style.top)+this.args.locus.adjy;div.style.left=locus.x+"px";div.style.top=locus.y+"px";div.style.overflow="hidden";div.style.opacity=0;d.style.width=locus.w+"px";d.style.height=locus.h+"px";div.style.width="0px";div.style.height="0px";start=[0,0,0];end=[locus.w,locus.h,100];this.args.fx.init({start:start,end:end,time:.15,onLoop:function(v){div.style.width=v[0]+"px";div.style.height=v[1]+"px";div.style.opacity=v[2]/100;},onFinish:function(){QView.processing=0;div.style.width="";div.style.height="";div.style.filter="";div.style.opacity="";div.style.overflow="";d.style.width="";d.style.height="";QView.processing=0;}});},close:function(type){if(type!=null){var div;var wrap;switch(type){case 0:wrap=$(this.Qwrap);div=$(this.Qdiv);break;case 1:$(this.miniCart).style.display="none";window.onscroll=null;break;}
if(wrap){wrap.style.left="-2000px";wrap.style.display="none";}}
else{$(this.Qwrap).style.left="-2000px";$(this.Qwrap).style.display="none";$(this.miniCart).style.display="none";}
if(this.skuPageSku==this.args.sku){if($("pr-contents-"+this.skuPageSku+"_temp"))$("pr-contents-"+this.skuPageSku+"_temp").setAttribute("id","pr-contents-"+this.skuPageSku);if($("pr-review-engine-"+this.skuPageSku+"_temp"))$("pr-review-engine-"+this.skuPageSku+"_temp").setAttribute("id","pr-review-engine-"+this.skuPageSku);if($("pr-header-"+this.skuPageSku+"_temp"))$("pr-header-"+this.skuPageSku+"_temp").setAttribute("id","pr-header-"+this.skuPageSku);}
this.processing=0;this.showImagePopUpOK=true;},processAddToCart:function(requestObj){var xmlDoc;var parser=new DOMParser();xmlDoc=parser.parseFromString(requestObj.responseText,"text/xml");var basketState=xmlDoc.getElementsByTagName("basketState")[0].childNodes[0].nodeValue;var cartType=xmlDoc.getElementsByTagName("cartType")[0].childNodes[0].nodeValue;if(basketState=="BASKETSTATEOK"){if(location.pathname=="/cart/cart.aspx"&&(this.args.action=="AddItemToCart")){__doPostBack('ctl00$MainContent$RefreshLinkButton','');this.close(0);}
else{this.close(0);var bShowMiniCart='';var iShowAccessories=0;if(cartType=="2"){bShowMiniCart='false';iShowAccessories=1;}
else{bShowMiniCart='true';iShowAccessories=0;}
this.init({button:'0',action:'GetCartHTML',showMiniCart:bShowMiniCart,showAccessories:iShowAccessories});}}
else{this.processing=0;this.quantityError=1;this.init({button:'0',action:'GetQtyErrorHTML'});}},processUpdateCart:function(requestObj){var strResponse=requestObj.responseText.toUpperCase();if(strResponse=="BASKETSTATEOK"||strResponse=="NOITEMINBASKET"){__doPostBack('ctl00$MainContent$CheckoutCart$CheckoutPageUpdateLink','');this.close(0);}
else if(strResponse=="QUANTITYERRORBUNDLE"){this.close(0);window.location="/cart/QuantityError.aspx?RedirectType=5";return true;}
else if(strResponse=="NOTINSTOCK"){this.close(0);window.location="/cart/NotInStock.aspx?FrmChkout=1";return true;}
else{this.processing=0;this.init({button:'0',action:'GetQtyErrorHTML',showInUpdateMode:1});}},addRecommendedProductsToCart:function(){this.close(0);var quantities=document.getElementsByName("qty");var skus=document.getElementsByName("hfSku");var effortCodes=document.getElementsByName("hfEffortCode");var findNUmbers=document.getElementsByName("hfFindNumber");var promoCodes=document.getElementsByName("hfPromoCode");var addToCartItems="";for(var i=0;i<quantities.length;i++){if(quantities[i].value!="0"){addToCartItems+=skus[i].value+","+effortCodes[i].value+","+findNUmbers[i].value+","+quantities[i].value+","+promoCodes[i].value+"|"}}
if(addToCartItems.length>0){addToCartItems=addToCartItems.substring(0,addToCartItems.length-1);this.init({recommendedItems:addToCartItems,action:"AddRecommendedItemsToCart"});}},handleScroll:function(){var div=$(QView.miniCart);if(div!=null){var top;if(div.offsetHeight>=document.documentElement.clientHeight)top=-1;else top=-1+getScrollPos().y
div.style.top=top+"px";}},ImageGalleryClick:function(src){this.panel.getById("img#imgSTDpopup").src=src;},showImagePopUpOK:true,showImagePopUp:function(obj,imageURL,event){if(this.showImagePopUpOK&&popup.showImagePopUpOK){var QViewInfoDiv=$(this.Qwrap);script="<div class='rb rbWhite' id='zoomImgSmall' style='padding:0px;width:200px;'><div class='rbTop'><div class='a1'></div><div class='a2'></div><div class='a3'></div><div class='a4'></div></div><div class='rbInner'>";script+="<div class='rbContent clearAfter'>";script+="<img src='"+imageURL+"' alt='' />";script+="</div></div><div class='rbBottom'><div class='a4'></div><div class='a3'></div><div class='a2'></div><div class='a1'></div></div></div>";var QViewDiv=$(this.Qdiv);QViewDiv.innerHTML=script;QViewInfoDiv.style.display="block";reposition(QViewInfoDiv,obj);QViewInfoDiv.style.top=(parseInt(QViewInfoDiv.style.top)+30)+"px";dragme("QViewInfo",event,null);}},hideImagePopUp:function(){if(this.showImagePopUpOK&&popup.showImagePopUpOK){var QViewInfoDiv=$(this.Qwrap);document.clearDrag(QViewInfoDiv,null);this.close();}},checkOVError:function(objOptions){var allselectedoptionDetails="";var hasError="N";var allOptionDetailsDivIds=objOptions.value;var alloptionDivIdSplit=allOptionDetailsDivIds.split("|");for(i=0;i<alloptionDivIdSplit.length;i++){if($(alloptionDivIdSplit[i])!=null){var selectedOptionDetails=customUI.getSelectedValue(alloptionDivIdSplit[i]);if(selectedOptionDetails!="00000000000"){if(allselectedoptionDetails==""){allselectedoptionDetails=selectedOptionDetails;}
else{allselectedoptionDetails=allselectedoptionDetails+"|"+selectedOptionDetails;}}
else{hasError="Y";break;}}}
if(hasError=="Y"){$("optionError").innerHTML="Please select all options."
$("optionError").style.display='block';this.processing=0;return false;}
this.args.optionValue=allselectedoptionDetails;this.processing=0;return true;},trackScrollingFromPopUp:function(targetPage){var carousel=$("accessoriesCarousel2").carousel;var pageNumber=carousel.settings.currentPage;if((pageNumber<0)||(pageNumber>=carousel.settings.pages))return;var startIndex=3*pageNumber;var endIndex=(3*pageNumber)+3;var parentSKU=$('accessoriesParentSKU').value
var arrSKUs=$('accessories').value.split(",");var strDisplayedSKUs="";for(i=0;i<arrSKUs.length;i++){if((i>=startIndex)&&(i<endIndex))strDisplayedSKUs+=arrSKUs[i]+",";}
strDisplayedSKUs=strDisplayedSKUs.replace(/,+$/,"");omnitureTrackSKUPopUp({events:'event38',products:';'+parentSKU,prop25:strDisplayedSKUs});}}

function initScrollbars(div){if(div)var arrScrollBars=$(div).getByClass("div.customScrollBar");else var arrScrollBars=$("page").getByClass("div.customScrollBar");if(exists(arrScrollBars)){if(exists(arrScrollBars.length)){for(i=0;i<arrScrollBars.length;i++){customScroll.init(arrScrollBars[i]);}}
else{customScroll.init(arrScrollBars);}}}
var customScroll={fx:null,settings:{topLimit:8,bottomLimit:null,mode:1,startY:null,startTop:null},init:function(div){div=$(div);if(!div)return false;var scroller=div;var height=scroller.getAttribute("sHeight")?scroller.getAttribute("sHeight"):scroller.getAttribute("sheight");height=parseInt(height);scroller.style.overflow="visible";scroller.style.height="auto";var content=$(div).getByClass("div.contentWrapper2");if(height>=div.offsetHeight){if(exists(content)){content.style.position="";scroller.style.position="";var track=$next(content);track.style.display="none";track.style.height="auto";scroller.style.overflow="visible";content.style.paddingRight="0px";}
return false;}
scroller.style.height=height+"px";scroller.style.overflow="hidden";if(!exists(content)){var contentHTML=scroller.innerHTML;scroller.innerHTML="<div class='contentWrapper2 clearAfter' style='top:0px;'>"+contentHTML+"</div><div class='csTrack'><img alt='' src='/Images/stardust.gif' /><div class='scBottom'></div></div>";var contentHTML=null;}
content=$(div).getByClass("div.contentWrapper2");content.style.paddingRight="14px";if(content==null)return false;var track=$next(content);var slider=$first(track,"img");track.style.display="block";track.style.height=height+"px";content.style.position="relative";scroller.style.position="relative";slider.style.top=this.settings.topLimit+"px";content.style.top="0px";if(scroller.contentWheel!=null)var w=scroller;else var w=track;this.settings.bottomLimit=slider.offsetHeight+this.settings.topLimit;track.onmousedown=function(event){if(scroller.disable!=null)return false;customScroll.handleClick(slider,track,event,content,height);eventStopProp(event);}
if(w.listener!=1){if(w.addEventListener)w.addEventListener('DOMMouseScroll',wheelEvent,false);w.listener=1;}
w.onmousewheel=wheelEvent;function wheelEvent(event){if(scroller.disable!=null)return false;var contentHeight=content.offsetHeight;var slHeight=slider.offsetHeight;var pos=parseInt(slider.style.top);var delta=customScroll.wheel(event);if(delta>0&&pos>0){customScroll.scrollSlideTo(slider,content,height,contentHeight,slHeight,0,1)}
else if(delta<0&&pos<(height-customScroll.settings.bottomLimit)){customScroll.scrollSlideTo(slider,content,height,contentHeight,slHeight,1,1)}
else
return false;}
return false;},handleClick:function(slider,track,event,content,height){if(event==null)event=window.event
var target=event.target!=null?event.target:event.srcElement;var offset=getOffset(track).y;this.settings.startY=this.getMouseY(event);this.settings.startTop=slider.offsetTop;slider.className="active";var contentHeight=content.offsetHeight;var slHeight=slider.offsetHeight;document.body.focus();document.body.onselectstart=function(){return false;};target.ondragstart=function(){return false;};if(target.tagName=="IMG"){document.body.onmouseup=function(){customScroll.mouseUp(slider,track,event,content)}
document.body.onmousemove=function(event){customScroll.mouseDrag(slider,track,event,content,offset,height,contentHeight,slHeight)}
return false;}
else if(target.tagName=="DIV")customScroll.scrollHandle(slider,track,event,content,offset,height,contentHeight,slHeight);},mouseDrag:function(slider,track,event,content,offset,height,contentHeight,slHeight){var mouseY=this.settings.startTop+this.getMouseY(event)-this.settings.startY;var pixelRatio=(contentHeight-height)/(height-4-slHeight);if(mouseY>=this.settings.topLimit&&mouseY<=(height-this.settings.bottomLimit)){slider.style.top=mouseY+"px";content.style.top=-(Math.round(pixelRatio*mouseY))+"px";}
else if(mouseY<=this.settings.topLimit){slider.style.top=this.settings.topLimit+"px";content.style.top=0+"px";}
else if(mouseY>=(height-this.settings.bottomLimit)){slider.style.top=(height-this.settings.bottomLimit)+"px";content.style.top=-(contentHeight-height)+"px";}},scrollHandle:function(slider,track,event,content,offset,height,contentHeight,slHeight){var mouseY=this.getMouseY(event)-offset;var pos=parseInt(slider.style.top);if(mouseY>=pos&&mouseY<=height){this.scrollSlideTo(slider,content,height,contentHeight,slHeight,1)}
else if(mouseY<=pos&&mouseY>=0){this.scrollSlideTo(slider,content,height,contentHeight,slHeight,0)}},scrollSlideTo:function(slider,content,height,contentHeight,slHeight,direction,wheel,elOffset){if(this.fx.z)return false;var pos=parseInt(slider.style.top);var contentPos=parseInt(content.style.top);var pixelRatio=(height-slHeight+10)/(contentHeight-height+10);var start=new Array;var end=new Array;var slStart=new Array;var slEnd=new Array;var offsetAmmount=height;if(wheel)offsetAmmount=height/3
if(elOffset&&direction==1)offsetAmmount=elOffset-(-contentPos+height);else if(elOffset&&direction==0)offsetAmmount=-contentPos-elOffset;start[0]=contentPos;start[1]=pos;if(direction==1){end[0]=Math.round(contentPos-offsetAmmount)
end[1]=Math.round(pos+(offsetAmmount*pixelRatio));if(end[1]>(height-this.settings.bottomLimit)){end[0]=-Math.round((contentHeight-height));end[1]=height-this.settings.bottomLimit;}}
else if(direction==0){end[0]=Math.round(contentPos+offsetAmmount);end[1]=Math.round(pos-(offsetAmmount*pixelRatio));if(end[1]<this.settings.topLimit){end[0]=0;end[1]=this.settings.topLimit;}}
if(this.settings.mode==1){this.fx.init({start:start,end:end,time:.2,onLoop:function(v){content.style.top=v[0]+"px";slider.style.top=v[1]+"px";}});}
else{content.style.top=end[0]+"px";slider.style.top=end[1]+"px";this.settings.mode=1;this.fx.z=null;}},scrollToElement:function(id,el){id=$(id);var content=id.getByClass("div.contentWrapper2");var track=id.getByClass("div.csTrack");if(content==null||track==null)return false;var slider=$first(track,"img");var height=parseInt(id.style.height);var slHeight=slider.offsetHeight;var offset=parseInt(content.style.top);var contentHeight=content.offsetHeight;var elHeight=el.offsetHeight;var elOffset=el.offsetTop;var elOffsetHeight=elOffset+elHeight;if(elOffsetHeight>(height-offset)){this.scrollSlideTo(slider,content,height,contentHeight,slHeight,1,null,elOffsetHeight)}
else if(elOffset<-offset){this.scrollSlideTo(slider,content,height,contentHeight,slHeight,0,null,elOffset)}
return false;},mouseUp:function(slider,track,event,content){slider.className="";document.body.onmousemove=null;slider.ondragstart=null;document.body.onselectstart=null;},wheel:function(event){var delta=0;if(event==null)event=window.event;if(event.wheelDelta){delta=event.wheelDelta/120;if(window.opera)delta=-delta;}
else if(event.detail)delta=-event.detail/3;if(event.preventDefault)event.preventDefault();event.returnValue=false;return delta;},getMouseY:function(event){if(event==null)event=window.event;if(event.pageY)return event.pageY;else if(event.clientY)return event.clientY+getScrollPos().y;else return null;}}
customScroll.fx=new Anim();
var SCSCRIPT=function(){};SCSCRIPT.prototype={fx:null,ControlID:null,items:null,pages:null,name:null,mode:null,list:null,toLeft:null,toRight:null,toLeftBottom:null,toRightBottom:null,mask:null,scroller:null,helperTop:null,helperBottom:null,pagerTop:null,pagerBottom:null,focusIndex:true,settings:null,initFinder:function(args){var settings={pageWidth:null,control:null,itemsPerPage:5,helpers:"numeric",maxHelperPages:null,T:.5,scrollbar:false,height:175,itemHeight:null,itemWidth:180,hideItems:true,itemClass:"itemb",currentPage:0,type:0}
this.settings=Object.extend(settings,args);if(this.settings.autoStart){this.settings.autoStart=Object.extend({init:false,T:null,maxScrolls:null,Z:null,scrolls:0,parent:null,pBtn_click:function(btn){if(this.Z)this.clear();else{this.toRight();this.start();}},getLinkHtml:function(){return"<a id='"+this.parent.settings.name+"pBtn' onclick='"+(this.parent.settings.name)+".settings.autoStart.pBtn_click()' class='pBtn "+(this.Z?"pBtnPause":"pBtnPlay")+"'>"+(this.Z?"Pause":"Start")+"</a>";},clear:function(){if(this.Z){var t=this.parent;var pBtn=$(t.settings.name+"pBtn");if(pBtn){pBtn.className="pBtn pBtnPlay";pBtn.innerHTML="Start";}
window.clearInterval(this.Z);this.init=false;this.scrolls=0;this.Z=null;}},start:function(){if(!this.Z){var T=this;var pBtn=$(this.parent.settings.name+"pBtn");if(pBtn){pBtn.className="pBtn pBtnPause";pBtn.innerHTML="Pause";}
this.Z=window.setInterval(function(){T.toRight();},T.T*1000);}},toRight:function(){var t=this.parent;if(t.settings.currentPage==t.pages-1){t.getOverHere("autoScrollFirst")}
else
t.getOverHere("autoScroll");this.scrolls++;if(this.scrolls>this.maxScrolls)this.clear();}},this.settings.autoStart);}
var controlId=args.control;this.scroller=$(controlId+"scrollz");this.fx=new Anim();this.fx.name=controlId;if(this.scroller!=null){$(controlId).carousel=this;this.helperTop=$(controlId+"helperTop");this.helperBottom=$(controlId+"helperBottom");this.pagerTop=$(controlId+"pagerTop");this.pagerBottom=$(controlId+"pagerBottom");this.scroller.style.display="block";this.toLeft=$(controlId+"toLeft");this.toRight=$(controlId+"toRight");this.toLeftBottom=$(controlId+"toLeftBottom");this.toRightBottom=$(controlId+"toRightBottom");this.mask=$(controlId+"scrollerMask");var list=$(this.scroller).getByClass("div."+this.settings.itemClass);if(list!=null){list.length?this.list=list:this.list=new Array(list);this.settings.iTotal?this.items=this.settings.iTotal:this.items=this.list.length;this.pages=Math.ceil(this.items/this.settings.itemsPerPage);if(this.settings.type==1){this.settings.pageWidth=this.settings.itemWidth;this.settings.height=this.settings.itemsPerPage*this.settings.itemHeight;this.scroller.style.width=this.settings.itemWidth+"px";this.scroller.style.top=-this.settings.currentPage*this.settings.height+"px";}
else{if(this.settings.pageWidth=="auto")this.pages>1?this.settings.pageWidth=this.settings.itemWidth*this.settings.itemsPerPage:this.settings.pageWidth=this.settings.itemWidth*this.items;else this.settings.pageWidth=this.settings.itemWidth*this.settings.itemsPerPage;this.scroller.style.width=this.items*this.settings.itemWidth+"px";this.scroller.style.left=-this.settings.currentPage*this.settings.pageWidth+"px";}
this.mask.style.width=this.settings.pageWidth+"px";this.settings.height=="auto"?this.mask.style.height=this.autoHeight()+"px":this.mask.style.height=this.settings.height+"px";if(this.settings.autoStart&&this.pages>1){this.settings.autoStart.parent=this;if(this.settings.autoStart.init)this.settings.autoStart.start();}
this.setupHelpers();if(this.settings.hideItems)this.hideItems();var o=this;if(this.toRight&&this.toLeft){this.toRight.onselectstart=function(){return false;}
this.toRight.onmousedown=function(){o.focusIndex=false;o.getOverHere("toRight");o.toRight.clicked=true;return false;}
this.toRight.onfocus=function(){if(o.toRight.clicked!=true)o.getOverHere("toRight");o.toRight.clicked=true;}
this.toLeft.onfocus=function(){if(o.toLeft.clicked!=true)o.getOverHere("toLeft");o.toLeft.clicked=true;}
this.toLeft.onselectstart=function(){return false;}
this.toLeft.onmousedown=function(){o.focusIndex=false;o.getOverHere("toLeft");o.toLeft.clicked=true;return false;}}}}},setupHelpers:function(){var pagerHTML="[ Page "+(this.settings.currentPage+1)+" of "+this.pages+" ]";var helperHTML="";var min=0;var max=this.pages;var t=this;if(this.pages==1&&this.toLeft&&this.toRight){this.toLeft.className="ScHide scLeft";this.toLeft.setAttribute("href","javascript:void(0)");this.toLeftBottom?this.toLeftBottom.className="ScHide scLeft":"";this.toRight.className="ScHide scRight";this.toRight.setAttribute("href","javascript:void(0)");this.toRightBottom?this.toRightBottom.className="ScHide scRight":"";}
else{if(this.helperTop||this.helperBottom){if(this.settings.maxHelperPages&&max>this.settings.maxHelperPages){var halfL=Math.floor(this.settings.maxHelperPages/2);var min=this.settings.currentPage-halfL;var max=this.settings.currentPage+this.settings.maxHelperPages-halfL;if(max+min<this.settings.maxHelperPages)max=this.settings.maxHelperPages;else if(max>this.pages)max=this.pages;if(min<0)min=0;}
function formatHelper(helper,index,selected,first,last){var helperCss="";helperCss+=" carouselHelper";if(first)helperCss+=" helperFirst";if(last)helperCss+=" helperLast";if(selected)helperCss+=" selected";helper.className=helperCss;helper.href="javascript:void(0)";helper.index=index;helper.onclick=function(){t.getOverHere(this.index);}}
if(this.settings.helpers=="numeric"){if(this.settings.autoStart){if(this.pages>1){var a=this.settings.autoStart.getLinkHtml();if(this.helperTop)this.helperTop.innerHTML+=a;if(this.helperBottom)this.helperBottom.innerHTML+=a;}}
if(this.helperTop)$clear(this.helperTop);if(this.helperBottom)$clear(this.helperBottom);for(var i=min;i<max;i++){var a=document.createElement("a");formatHelper(a,i,(this.settings.currentPage==i?true:false));a.innerHTML=i+1;if(this.helperTop)this.helperTop.appendChild(a);if(this.helperBottom)this.helperBottom.appendChild(a);}}
else{if(this.helperTop){var helpers=this.helperTop.getElementsByTagName("a");var l=helpers.length;$each(helpers,function(i,a){formatHelper(a,i,(t.settings.currentPage==i?true:false),(i==0?true:false),(i==l-1?true:false));});}}}
if(this.pagerTop)this.pagerTop.innerHTML=pagerHTML;if(this.pagerBottom)this.pagerBottom.innerHTML=pagerHTML;if(this.toRight&&this.toLeft){if(this.settings.currentPage==this.pages-1){this.toRight.className="ScrPhRight scRight";this.toRightBottom?this.toRightBottom.className="ScrPhRight scRight":"";this.toRight.removeAttribute("href");}
else{this.toRight.className="scRight";this.toRightBottom?this.toRightBottom.className="scRight":"";this.toRight.setAttribute("href","javascript:void(0)");}
if(this.settings.currentPage==0){this.toLeft.className="ScrPhLeft scLeft";this.toLeft.removeAttribute("href");this.toLeftBottom?this.toLeftBottom.className="ScrPhLeft scLeft":"";}
else{this.toLeft.className="scLeft";this.toLeftBottom?this.toLeftBottom.className="scLeft":"";this.toLeft.setAttribute("href","javascript:void(0)");}}}},getOverHere:function(page){var index;var t=this;if(page=="toLeft"){page=this.settings.currentPage-1;if(this.focusIndex){index=this.list[((this.settings.currentPage-1)*this.settings.itemsPerPage)+this.settings.itemsPerPage-1];if(index)index=index.getElementsByTagName("A")[0];}}
if(page=="toRight"){page=this.settings.currentPage+1;if(this.focusIndex){index=this.list[(this.settings.currentPage*this.settings.itemsPerPage)+this.settings.itemsPerPage];if(index)index=index.getElementsByTagName("A")[0];}}
if(page=="autoScroll")page=this.settings.currentPage+1;else if(page=="autoScrollFirst")page=0;else if(this.settings.autoStart)this.settings.autoStart.clear();if(page<0||page==this.settings.currentPage||page>=this.pages)return false;if(this.settings.hideItems)this.hideItems(1);var start;var end;var onLoop;if(this.settings.type==1)start=parseInt(this.scroller.style.top);else if(this.settings.type==2)start=[100,0]
else
start=parseInt(this.scroller.style.left);if(this.settings.type==1)end=-(page)*this.settings.height;else if(this.settings.type==2)end=[0,100]
else
end=-(page)*this.settings.pageWidth;var carousel=this;var obj=this.scroller;var prevPage=this.settings.currentPage;this.settings.currentPage=page;this.setupHelpers();if(this.settings.type==1){onLoop=function(v){obj.style.top=v+"px";}}
else if(this.settings.type==2){var current=t.list[prevPage];var next=t.list[page];current.style.zIndex=2;next.style.zIndex=1;onLoop=function(v){current.style.opacity=v[0]/100;next.style.opacity=v[1]/100;}}
else{onLoop=function(v){obj.style.left=v+"px";}}
this.fx.init({start:start,end:end,time:this.settings.T,onLoop:onLoop,onFinish:function(){if(carousel.settings.scrollbar==true)initScrollbars(obj);if(carousel.height=="auto")carousel.mask.style.height=carousel.autoHeight()+"px";if(carousel.settings.hideItems)carousel.hideItems();if(index)index.focus();carousel.focusIndex=true;if(carousel.toRight&&carousel.toLeft){carousel.toRight.clicked=false;carousel.toLeft.clicked=false;}}});return false;},hideItems:function(a){var l=this.list;var min=this.settings.currentPage*this.settings.itemsPerPage;var mid=min+this.settings.itemsPerPage-1;var max=this.list.length;for(var i=0;i<max;i++){if(a)l[i].style.visibility="visible";else if(i<min||i>mid)l[i].style.visibility="hidden";else l[i].style.visibility="visible";}},initHeight:function(){if(this.settings.height!="auto"){this.mask.style.height=this.settings.height+"px";}
else{this.mask.style.height=this.autoHeight()+"px";this.settings.height="auto";}},autoHeight:function(){var height=0;for(var i=this.settings.currentPage;i<this.settings.currentPage+this.settings.itemsPerPage;i++){if(this.list[i]!=null&&this.list[i].offsetHeight>height)height=this.list[i].offsetHeight;}
return height;},aPrev:0,as:null,itemGroup:null,TabClick:function(a,index,id){var tabs=a.parentNode.getElementsByTagName("A");if(tabs.length<2)return false;var css="tabNotSelected";if(!a.className.match(css))return false
for(var i=0;i<tabs.length;i++){if(!tabs[i].className.match(css))tabs[i].className+=" "+css;}
a.className=a.className.replace(css,"");var group;if(!this.itemGroup)this.itemGroup=$(this.scroller).getByClass("div.ItemGroup");var l=this.itemGroup.length;if(id=="All"){for(var i=0;i<l;i++){this.itemGroup[i].className="ItemGroup";}
group=this.scroller;}
else{for(var i=0;i<l;i++){this.itemGroup[i].className="ItemGroup noDisplay";}
group=$("ItemGroup"+id);group.className="ItemGroup";}
var list=$(group).getByClass("div.itemb");list.length?this.list=list:this.list=new Array(list);this.scroller.style.left=0;this.settings.currentPage=0;if(this.settings.pageWidth=="auto")this.pages>1?this.settings.pageWidth=this.settings.itemWidth*this.settings.itemsPerPage:this.settings.pageWidth=this.settings.itemWidth*this.items;else this.settings.pageWidth=this.settings.itemWidth*this.settings.itemsPerPage;this.items=this.list.length;this.scroller.style.width=this.items*this.settings.itemWidth+"px";this.settings.height=="auto"?this.mask.style.height=this.autoHeight()+"px":this.mask.style.height=this.settings.height+"px";this.pages=Math.ceil(this.items/this.settings.itemsPerPage);this.setupHelpers();if(this.settings.hideItems)this.hideItems();}}

QuickFindScripts=function(){};QuickFindScripts.prototype={CurrentEditIndex:null,userId:null,objAnchor:null,objMachineToEdit:null,deleteSerialNumber:null,sorting:null,nickNameAtCheckout:null,GetSaveEditHTML:function(event,bDidUserClick){if(bDidUserClick==undefined)bDidUserClick=0;if(event&&event.type=="click")Loading.Cursor(event);var redirect;if(window.location.href.indexOf("inktonerfinder.aspx")>-1)redirect="false";else redirect="true";var params="MethodName=getSaveEditHTML&Redirect="+redirect+"&UserInitiated="+bDidUserClick+"&rnd="+Math.random();var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.RenderSaveEditHTML.bind(this,bDidUserClick),asynchronous:true});},RenderSaveEditHTML:function(bDidUserClick,requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){var xmlReturnString=returnmessage;var xmlDoc;var parser=new DOMParser();xmlDoc=parser.parseFromString(returnmessage,"text/xml");var popupHTML=xmlDoc.getElementsByTagName("popupHTML")[0].childNodes[0].nodeValue;var controlHTML=xmlDoc.getElementsByTagName("controlHTML")[0].childNodes[0].nodeValue;var QuickFindDiv=$('QuickFind');QuickFindDiv.innerHTML=popupHTML;var SavedMachines=$('dvSavedMachines');SavedMachines.innerHTML=controlHTML;initScrollbars(SavedMachines);LightBox.Show();reposition(QuickFindDiv);initScrollbars(QuickFindDiv);TrackQuickFind(null,1,bDidUserClick);}
Loading.Hide();this.sorting=0;},EditMachine:function(index,btn,nickName,serialNumber,MachineTypeID,ManufacturerID,ModelID,displaySequence){if(btn.className.match("BtnDisable"))return false;this.disableLinks();$('txtNickNameEdit').value=nickName;$('hfSerialNumberEdit').value=serialNumber;customUI.setSelectedValue('csMachineTypeEdit',MachineTypeID);this.GetBrands('csManufacturerEdit','csModelEdit',MachineTypeID,$('hfMachineEdit'),ManufacturerID);this.GetModels('csModelEdit',MachineTypeID,ManufacturerID,$('hfMachineEdit'),ModelID);customUI.setSelectedValue('csMachineTypeEdit',MachineTypeID);this.CurrentEditIndex=index;var trData=$("data"+index);var trEdit=$("trEdit");trEdit.className="TR TrEdit";var offset=getOffset(trData);var offset2=getOffset("QuickFind");var top=offset['y']-offset2['y'];var left=offset['x']-offset2['x'];trEdit.style.top=top+"px";trEdit.style.left=left+"px";trEdit.style.width=trData.offsetWidth-2+"px";},disableLinks:function(){var x=0;var BtnEdit=$("BtnEdit"+x);var BtnDelete=$("BtnDelete"+x);$("quickFindSavedMachineScroll").disable=1;if(BtnEdit){do{BtnEdit.className+=" BtnDisable";BtnDelete.className+=" BtnDisable";var down=getElementsByClassNameInElement("IMG","IcoDown",BtnEdit.parentNode.parentNode)[0];var up=getElementsByClassNameInElement("IMG","IcoUp",BtnEdit.parentNode.parentNode)[0];if(up)up.className+=" BtnDisable UpDisable";if(down)down.className+=" BtnDisable DownDisable";x++;var BtnEdit=$("BtnEdit"+x);var BtnDelete=$("BtnDelete"+x);}
while(BtnEdit)}
$("BtnAdd").className="button BtnG BtnDisable floatLeft";},enableLinks:function(){var x=0;var BtnEdit=$("BtnEdit"+x);var BtnDelete=$("BtnDelete"+x);$("quickFindSavedMachineScroll").disable=null;if(BtnEdit){do{BtnEdit.className=BtnEdit.className.replace(" BtnDisable","");BtnDelete.className=BtnDelete.className.replace(" BtnDisable","");var up=getElementsByClassNameInElement("IMG","IcoDown",BtnEdit.parentNode.parentNode)[0];var down=getElementsByClassNameInElement("IMG","IcoUp",BtnEdit.parentNode.parentNode)[0];if(up)up.className="IcoUp"
if(down)down.className="IcoDown"
x++;var BtnEdit=$("BtnEdit"+x);var BtnDelete=$("BtnDelete"+x);}
while(BtnEdit)}
$("BtnAdd").className="button";},AddNewMachine:function(btn){if(btn.className.match("BtnDisable"))return false;this.disableLinks();var trNew=$("new");trNew.className="TR TrEdit";},CancelAddNew:function(){this.enableLinks();var trNew=$("new");trNew.className="TR TrEdit noDisplay";},ConfirmDelete:function(bttn,serialNumber,event){if(bttn.className.match("BtnDisable"))return false;this.disableLinks();this.deleteSerialNumber=serialNumber;reposition('dvConfirmDelete',bttn);},DeleteMachine:function(event){$('dvConfirmDelete').style.display="none";Loading.Cursor(event);var params="MethodName=deleteMachine&SerialNumber="+this.deleteSerialNumber;$("dvSavedMachines").className+=" GLOW";var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.GetSaveEditHTML.bind(this),asynchronous:true});},GetSignUpHTML:function(event,bDidUserClick){if(bDidUserClick==undefined)bDidUserClick=0;if(event==null)event=window.event;Loading.Cursor(event);var params="MethodName=getSignUpHTML&UserInitiated="+bDidUserClick+"&rnd="+Math.random();var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.RenderSignUpHTML.bind(this,bDidUserClick),asynchronous:true});},RenderSignUpHTML:function(bDidUserClick,requestObj){Loading.Hide();var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){var QuickFindDiv=$('QuickFind');QuickFindDiv.innerHTML=returnmessage;LightBox.Show();reposition(QuickFindDiv);initScrollbars(QuickFindDiv);TrackQuickFind(null,1,bDidUserClick);}},RemindLater:function(obj,bDidUserClick){var params="MethodName=remindLater&rnd="+Math.random();var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.CloseQuickFind.bind(this),asynchronous:true});TrackQuickFind(obj,0,bDidUserClick);},CommitEditMachine:function(event){var modelID=customUI.getSelectedValue($('csModelEdit'));if(modelID=="0"){tooltip.T=3000;tooltip.init($('csModelEdit'),"Please select a model");return false;}
$('dvConfirmSave').style.display="none";this.SaveModel($('txtNickNameEdit').value,$('csMachineTypeEdit'),$('csManufacturerEdit'),$('csModelEdit'),$('hfMachineEdit'),$('hfSerialNumberEdit'))
var params="MethodName=commitEditMachine&MachineAttributes="+escape($('hfMachineEdit').value);Loading.Cursor(event);var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.ProcessEditMachine.bind(this),asynchronous:true});},ProcessEditMachine:function(requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){if(returnmessage!=9999)this.GetSaveEditHTML();else{tooltip.T=3000;tooltip.init($("txtNickNameEdit"),"A machine with this nickname already exists, please enter a different nickname");Loading.Hide();}
$("dvSavedMachines").className+=" GLOW";}},CancelEdit:function(index){this.enableLinks();var trData=$("data"+index);var trEdit=$("trEdit");trEdit.className="TR TrEdit noDisplay";trEdit.style.top=null;trEdit.style.top=null;trEdit.style.width=null;},SaveMachineFromCheckout:function(nickName,modelId,element,txtNickName){var params="MethodName=saveMachineFromCheckout&NickName="+nickName+"&ModelID="+modelId;var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.ProcessSaveMachineFromCheckout.bind(this,element,txtNickName),asynchronous:true});},ChangeDisplaySequence:function(serialNumber,moveOrder,event,btn){if((btn.className.match("BtnDisable"))||(this.sorting==1))return false;this.sorting=1;var params="MethodName=changeDisplaySequence&SerialNumber="+serialNumber+"&MoveOrder="+moveOrder;Loading.Cursor(event);var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.GetSaveEditHTML.bind(this),asynchronous:true});},SaveNewMachine:function(bttn,hfMachine,event){if(bttn.className.indexOf("Disable")>=0){tooltip.T=3000;tooltip.init($('csModelNew'),"Please select a model");return false;}
Loading.Cursor(event);this.SaveModel($('txtNickNameNew').value,$('csMachineTypeNew'),$('csManufacturerNew'),$('csModelNew'),$('hfMachineNew'))
var params="MethodName=AddNewMachine&MachineAttributes="+escape(hfMachine.value);var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.ProcessSavenewMachine.bind(this),asynchronous:true});},ProcessSavenewMachine:function(requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){if(returnmessage!=9999)this.GetSaveEditHTML();else{tooltip.T=3000;tooltip.init($("txtNickNameNew"),"A machine with this nickname already exists, please enter a different nickname");Loading.Hide();}
$("dvSavedMachines").className+=" GLOW";}},ProcessSaveMachineFromCheckout:function(element,txtNickName,requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){if(returnmessage==9999){tooltip.T=3000;tooltip.init(txtNickName,"A machine with this nickname already exists, please enter a different nickname");Loading.Hide();}
else
$(element).style.display="none";}
this.nickNameAtCheckout=null;},SaveNewMachines:function(event){var serializedForm=Form.serialize($("frmNewMachines"));var params="MethodName=saveNewMachines";Loading.Cursor(event);var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'post',postBody:serializedForm,onComplete:this.ProcessSaveNewMachines.bind(this),asynchronous:true});},ProcessSaveNewMachines:function(requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){var xmlReturnString=returnmessage;var xmlDoc;var parser=new DOMParser();xmlDoc=parser.parseFromString(returnmessage,"text/xml");var responseStatusCode=xmlDoc.getElementsByTagName("status")[0].childNodes[0].nodeValue;if(responseStatusCode==9999){$("ITErrorDiv").innerHTML="Please select a model";$("ITErrorDiv").className+=" attention";Loading.Hide();}
else{this.GetSaveEditHTML();}
$("dvSavedMachines").className+=" GLOW";}},CloseQuickFind:function(){var QuickFindDiv=$('QuickFind');QuickFindDiv.innerHTML="";QuickFindDiv.style.display="none";Loading.Hide();LightBox.Hide();},GetBrands:function(manufacturerControlId,modelControlId,machineTypeId,hfmachine,ManufacturerID){customUI.setSelectedIndex(modelControlId,0);customUI.disable(modelControlId);hfmachine.value="";if($("btnUpdate"+this.CurrentEditIndex)){$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className.replace(" Disable","");$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className+" Disable";}
if($("btnSaveNew")){$("btnSaveNew").className=$("btnSaveNew").className.replace(" Disable","");$("btnSaveNew").className=$("btnSaveNew").className+" Disable";}
if(machineTypeId!=0){var params="MethodName=getBrands&RemoveIfNoCartridge=1&MachineTypeId="+machineTypeId+"&rnd="+Math.random();var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.PopulateBrands.bind(this,manufacturerControlId,modelControlId,ManufacturerID),asynchronous:true});}
else{customUI.disable(manufacturerControlId);}},PopulateBrands:function(manufacturerControlId,modelControlId,manufacturerID,requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){customUI.enable(manufacturerControlId);customUI.update(manufacturerControlId,returnmessage);if(manufacturerID!=null)customUI.setSelectedValue('csManufacturerEdit',manufacturerID);}},GetModels:function(modelControlId,machineTypeId,manufacturerId,hfmachine,ModelID){hfmachine.value="";if($("btnUpdate"+this.CurrentEditIndex)){$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className.replace(" Disable","");$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className+" Disable";}
if($("btnSaveNew")){$("btnSaveNew").className=$("btnSaveNew").className.replace(" Disable","");$("btnSaveNew").className=$("btnSaveNew").className+" Disable";}
if((machineTypeId!=0)&&(manufacturerId!=0)){var params="MethodName=getModels&RemoveIfNoCartridge=1&MachineTypeId="+machineTypeId+"&ManufacturerId="+manufacturerId+"&rnd="+Math.random();var ajax=new Ajax.Request(Resource.ajax.InkTonerQuickFind,{method:'get',parameters:params,onComplete:this.PopulateModels.bind(this,modelControlId,ModelID),asynchronous:true});}
else{customUI.disable(modelControlId);}},PopulateModels:function(modelControlId,modelID,requestObj){var returnmessage=requestObj.responseText;if(returnmessage!=null&&returnmessage!=""){var csModel=$(modelControlId);customUI.enable(csModel);customUI.update(csModel,returnmessage);if(modelID!=null){customUI.setSelectedValue('csModelEdit',modelID);customUI.enable(modelControlId);}}},SaveModel:function(nickName,csMachineType,csManufacturer,csModel,hfmachine,hfSerialNumber){var machineTypeID=customUI.getSelectedValue(csMachineType);var machineTypeName=customUI.getSelectedText(csMachineType);var manufacturerID=customUI.getSelectedValue(csManufacturer);var manufacturerName=customUI.getSelectedText(csManufacturer);var modelID=customUI.getSelectedValue(csModel);var modelName=customUI.getSelectedText(csModel);if(modelID=="0"){if($("btnUpdate"+this.CurrentEditIndex)){$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className.replace(" Disable","");$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className+" Disable";}
if($("btnSaveNew")){$("btnSaveNew").className=$("btnSaveNew").className.replace(" Disable","");$("btnSaveNew").className=$("btnSaveNew").className+" Disable";}}
else{if($("btnUpdate"+this.CurrentEditIndex))$("btnUpdate"+this.CurrentEditIndex).className=$("btnUpdate"+this.CurrentEditIndex).className.replace("Disable","");if($("btnSaveNew"))$("btnSaveNew").className=$("btnSaveNew").className.replace("Disable","");}
if(hfSerialNumber!=null)hfmachine.value=hfSerialNumber.value+"|"+nickName+"|"+machineTypeID+","+machineTypeName+"|"+manufacturerID+","+manufacturerName+"|"+modelID+","+modelName;else hfmachine.value="|"+nickName+"|"+machineTypeID+","+machineTypeName+"|"+manufacturerID+","+manufacturerName+"|"+modelID+","+modelName;}};var QuickFindPopUp=new QuickFindScripts();
var AjaxSuggest=Class.createOnLoad();AjaxSuggest.prototype={KEYUP:38,KEYDOWN:40,KEYENTER:13,KEYTAB:9,KEYESC:27,initialize:function(textBox,suggestContainer,innerContainer,onAjaxUpdate,onItemClick,submitButtonID,options){this.textBox=$(textBox);this.containerID=suggestContainer;this.innerID=innerContainer;this.ajaxUpdate=onAjaxUpdate;this.itemClick=onItemClick;this.prevValue=0;this.submitButton=$(submitButtonID);this.submitted=false;this.textBox.onkeyup=this.update.bindAsEventListener(this);this.textBox.onkeydown=this.navigate.bindAsEventListener(this);this.textBox.onblur=this.hide.bindAsEventListener(this);this.textBox.onkeypress=this.handleEnter.bindAsEventListener(this);if(this.submitButton)this.submitButton.onclick=this.onSubmit.bindAsEventListener(this);this.setOptions(options);},setOptions:function(options){this.o={suggestType:'a',selectClass:'sel'};Object.extend(this.o,options||{});},onSubmit:function(e){if(e)eventStopDef(e);this.click(this.textBox);return false;},handleEnter:function(e){if(e.keyCode==this.KEYENTER){eventStopDef(e);var el=this.selected?this.selected:this.textBox;this.click(el);this.hide();return false;}},update:function(e){if(!(e.keyCode==this.KEYTAB)&&this.textBox.value!=this.prevValue){this.submitted=false;this.prevValue=this.textBox.value;var t=this;this.ajaxUpdate(function(){t.selected=null
t.container=$(t.containerID);if(t.container){if(t.submitted){t.hide();return;}
if(t.container.innerHTML!=""){t.container.style.display="block";t.containerBox=getDimensions(t.container);t.container.onmouseover=t.navigate.bindAsEventListener(t);t.container.onmouseout=t.navigate.bindAsEventListener(t);t.container.onmousedown=t.navigate.bindAsEventListener(t);}
else{t.container.style.display="none";}}});}},hide:function(e){if(this.container){this.container.style.display="none";$clear(this.container);}
this.selected=null;},navigate:function(e){if(!this.container)return;var el=null;var forceSelect=false;var forceClick=false;if(e.type=="mouseover"){forceSelect=true;el=$findUp(e.target,this.o.suggestType,this.container);}
else if(e.type=="mouseout"){if(e.pageX<=this.containerBox.left||e.pageX>=(this.containerBox.right-40)||e.pageY<=this.containerBox.top||e.pageY>=this.containerBox.bottom)forceSelect=true;else{return;}}
else if(e.type=="mousedown"){return this.click($findUp(e.target,this.o.suggestType,this.container));}
else if(e.type=="keydown"){switch(e.keyCode){case this.KEYDOWN:el=this.selected?$next(this.selected,true):$first(this.innerID,this.o.suggestType);break;case this.KEYUP:el=this.selected?$prev(this.selected,true):$last(this.innerID,this.o.suggestType);break;case this.KEYESC:return this.hide();}}
if(el||forceSelect){if(el!=this.selected){if(this.selected)this.selected.className=this.selectedClass;if(el){this.selectedClass=el.className;el.className=this.o.selectClass;}
this.selected=el;}}},click:function(el){if(el){this.hide();this.submitted=true;if(!el.value&&el.getAttribute('value'))el.value=el.getAttribute('value');if(el.value)this.itemClick(el);}}};
var recycling={inkSubmit:null,tonerSubmit:null,init:function(){eventAdd($(recycling.inkSubmit),"click",function(){$("inkLoading").style.display="block";});eventAdd($(recycling.tonerSubmit),"click",function(){$("tonerLoading").style.display="block";});},downloadClick:function(button,msgPh,link){button.style.display="none";$(msgPh).innerHTML="Please submit again to print additional labels";window.open(link);}}
var mainPreText="ctl00_MainContent_";var labelInk,lableToner;function dsplyRecycleAdrs(ctrl,flag){ctrl=$(ctrl);if(ctrl){ctrl.style.display=flag;$('ErrorMessage').style.display='none';if(flag=='block'&&ctrl.id=="divDeliveryAdrs"){reposition(ctrl);assignAdrsToTextbox($(mainPreText+'hiddenShipAdrs').value,"oldAdrs");$('divAdrsRptr').style.display='none';}
else if(ctrl.id=="divAdrsRptr"){$("addressPickLink").className=(flag=="block"?"itr_addressPickLink itr_addressPickLinkSelected":"itr_addressPickLink");$("addressPickLink").onclick=function(){dsplyRecycleAdrs("divAdrsRptr",(flag=="block"?"none":"block"));}}}}
function assignAdrsToTextbox(shipAdress,adrsIdFlag){var controlArray=["FirstNameTextBox","LastNameTextBox","CompanyTextBox","CompnyAddressTextBox","CityTextBox","StateBillDropDownList","ZipTextBox"];var warnLabel;var missingLabel;var adrsArray=shipAdress.split('|');for(i=0;i<controlArray.length;i++){if(trimAll(controlArray[i])!=""){if(controlArray[i].indexOf('DropDownList')>0){warnLabel=controlArray[i].replace('DropDownList','Warning');missingLabel=controlArray[i].replace('DropDownList','Label');}
else{warnLabel=controlArray[i].replace('TextBox','Warning');missingLabel=controlArray[i].replace('TextBox','Label');}
$(mainPreText+controlArray[i]).value=(adrsArray[i]!=null)?adrsArray[i]:"";}}
var _rptrItemCount=$(mainPreText+'rptrItemCount').value;var _rptrClientId='ctl00_MainContent_ShippingAddressRepeater_ctl';var _index;var _oldAdrsId=(adrsIdFlag=="oldAdrs")?$(mainPreText+'hdnOrderAddressId').value:adrsIdFlag;return false;}
function ddlChange(ctrl){if(ctrl=="lblErrorMsgInk")$('imgDownloadInkLabel').style.display='none';else $('imgbtnDownloadCartrideLabel').style.display='none';if(ctrl=="lblErrorMsgInk"){if($(mainPreText+'hdnInkChangeCount').value>0)$(mainPreText+ctrl).innerHTML="Label quantity has changed, please submit again.";}
else{if($(mainPreText+'hdnTonerChangeCount').value>0)$(mainPreText+ctrl).innerHTML="Label quantity has changed, please submit again.";}}
function downloadPdf(result,context){if(context=="Ink"){$('imgDownloadInkLabel').style.display='block';$(mainPreText+'lblErrorMsgInk').innerHTML="";labelInk=result;$(mainPreText+'hdnInkChangeCount').value=1;}
else{$('imgbtnDownloadCartrideLabel').style.display='block';$(mainPreText+'lblErrorMsgToner').innerHTML="";lableToner=result;$(mainPreText+'hdnTonerChangeCount').value=1;}
$("inkLoading").style.display="none";$("tonerLoading").style.display="none";}
function validateUserInfo(){var controlArray=["CompanyTextBox","FirstNameTextBox","LastNameTextBox","CompnyAddressTextBox","CityTextBox","ZipTextBox","StateBillDropDownList"];var warnLabel;var missingLabel;var count=0;for(i=0;i<controlArray.length;i++){if(trimAll(controlArray[i])!=""){if(controlArray[i].indexOf('DropDownList')>0){warnLabel=$(controlArray[i].replace('DropDownList','Warning'));missingLabel=$(controlArray[i].replace('DropDownList','Label'));}
else{warnLabel=$(controlArray[i].replace('TextBox','Warning'));missingLabel=$(controlArray[i].replace('TextBox','Label'));}
if(trimAll($(mainPreText+controlArray[i]).value)==""&&missingLabel){warnLabel.innerHTML='!';if(!missingLabel.className.match('red'))missingLabel.className+=' red';count++;if(count==1)setFocusTo($(mainPreText+controlArray[i]));}
else{warnLabel.innerHTML='';if(missingLabel.className.match('red'))missingLabel.className=missingLabel.className.replace('red','');}}}
if(count>0){$('ErrorMessage').innerHTML="<img src=\"/Images/stardust.gif\" alt=\"\" class=\"ICO attention\" /> "+Resource.page.missingInfo;$('ErrorMessage').style.display='block';return false;}
else{$('ErrorMessage').style.display='none';return true;}
$(mainPreText+ctrl).innerHTML="Label quantity has changed, please submit again.";}


