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'},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)",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",RewardsStoryMsg:"Quill Rewards&reg; Points",MyInkAndToner:"What is the My Ink & Toner tool?",chatNeedHelp:"We can help!."},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.",freightAnonMsg:"If your order total is more than $45 and your shipping address is within the contiguous US, you will get free standard delivery on every order. This includes standard tailgate delivery of furniture. For orders less than $45, a flat rate of $7.95 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:"",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."},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",chatNeedHelp:"bottomleft"}};
var helper={a:"abcdefghijklmnopqrstuvwxyz",A:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",number:"1234567890",months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],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();if(btn&&btn.onclick)btn.onclick();return false;}},bindEnter:function(args){$(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();if(button.onclick)button.onclick();return false;}}},addScript:function(src,div){var append=document.createElement("script");append.type="text/javascript";append.src=src;if(div)$(div).appendChild(append);else $("Body").appendChild(append);}}
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');}
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');}}
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 TabMenuConst=function(){}
TabMenuConst.prototype={TabMenu:null,tabs:null,panels:null,id:null,init:function(TabMenu,id){this.TabMenu=TabMenu;var TabMenu=$(this.TabMenu);if(id)this.id=id;else this.id=0;var tabs=$(TabMenu,"A","tab");var panels=$(TabMenu,"DIV","tabPanel");if(tabs&&exists(tabs.length)){tabs[this.id].className="tabSelected tab";panels[this.id].style.display="block";}
else if(tabs){tabs.className="tabSelected tab";panels.style.display="block";}
initScrollbars(TabMenu);},tabClick:function(tab,scroller){var TabMenu=$(this.TabMenu);var id=null;var tabs=$(TabMenu,"A","tab");var panels=$(TabMenu,"DIV","tabPanel");if(typeof tab=="number"&&tabs[tab]!=null)id=tab;else{for(var i=0;i<tabs.length;i++){if(tabs[i]==tab){id=i;break;}}}
tabs[this.id].className="tabNotSelected tab"
panels[this.id].style.display="none";tabs[id].className="tabSelected tab";panels[id].style.display="block";this.id=id;initScrollbars(TabMenu);}}
function ie6SelectFix(div,state){div=$(div);if(div){if(div.className.match("ie6HideDropDowns")&&state==1)div.className=div.className.replace(" ie6HideDropDowns","");else if(!div.className.match("ie6HideDropDowns")&&state==0)div.className+=" ie6HideDropDowns";}}
var accordion={fx:null,closeSelected:false,headerClick:function(header,index,oncomplete,adjust){if(!this.fx)this.fx=new Anim();var AccDiv=header.parentNode.parentNode;var toOpen=header.parentNode;var toClose=$(AccDiv,"DIV","AcPanelSelected");if(toOpen==toClose&&toClose.className=="AcPanelSelected"&&this.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,oncomplete:oncomplete,parentDiv:AccDiv});if(adjust){var locus=this.AdjustWindowLocation.init(adjust);if(locus!=false)window.scroll(getScrollPos().x,locus.end);else adjust=null;}
if(index)PromoMiniSkuTrack(index);return false;},toCloseAdditional:null,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(this.toCloseAdditional&&this.toCloseAdditional.offsetHeight&&!divs.getIndexByItem(this.toCloseAdditional)&&this.toCloseAdditional!=divs[0]){divs.push(this.toCloseAdditional);}
for(var j=0;j<divs.length;j++){var content=$(divs[j],"DIV","AcContent");contents.push(content);start[j]=content.offsetHeight;if(j==0){if(this.closeSelected==true&&divs[j].className.match("AcPanelSelected")){end[j]=0;divs[j].className="AcPanel";}
else{divs[j].className="AcPanelSelected";content.style.height="auto";end[j]=content.offsetHeight;}}
else{end[j]=0;divs[j].className="AcPanel";}
content.style.height=start[j]+"px";var a=$last(divs[j],"A");if(a)a.style.display="none";}
initScrollbars(contents[0]);this.fx.init({start:start,end:end,time:.25,onLoop:function(v){for(var n=contents.length;n--;){contents[n].style.height=v[n]+"px";}},onFinish:function(){if(args.oncomplete)args.oncomplete();}});this.toCloseAdditional=null;this.closeSelected=false;},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,T:2000,tip:null,obj:null,adjustY:0,adjustX:0,fx:null,init:function(obj,msg,width){if(this.obj!=null&&this.obj==obj)return false;if(!this.fx)this.fx=new Anim();obj=$(obj);var tip=$("cooltip");tip.className="cooltip tailtop";var html=$("cooltipHTML");if(width)tip.style.width=width+"px";else tip.style.width="";var scroll=getScrollPos();tip.style.display="block";html.innerHTML=msg;var tail=$("cooltiptail");if(obj!=null){var pos=getOffset(obj);if((pos.y+tip.clientHeight+14)>=(document.documentElement.clientHeight+scroll.y)){var top=pos.y-tip.clientHeight+tooltip.adjustY;tip.className="cooltip tailbottom";}
else
top=pos.y+obj.clientHeight+tooltip.adjustY;if((pos.x+obj.clientWidth+tip.clientWidth+10)>=(document.documentElement.clientWidth+document.documentElement.scrollLeft))left=pos.x-tip.clientWidth/2+tooltip.adjustX;else left=pos.x-tip.clientWidth/2+obj.clientWidth/2+tooltip.adjustX;if(left<0)left=pos.x+document.documentElement.scrollLeft+tooltip.adjustX;var tailLeft=pos.x-left+3;if(tailLeft<0){left=pos.x+tooltip.adjustX;tailLeft=10;}
this.tip=tip;this.obj=obj;var start=new Array;start[0]=top-5;start[1]=0;var end=new Array;end[0]=top;end[1]=100;tip.style.left=left+"px";tip.style.top=top-5+"px";tip.style.opacity=0;tip.style.filter="alpha(opacity=0)";tail.style.left=tailLeft+"px";this.show(top,left,start,end)}},show:function(top,left,start,end){var tip=this.tip;this.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;tooltip.timeout=setTimeout("tooltip.hide();",tooltip.T);tooltip.T=2000;tooltip.adjustY=0;tooltip.adjustX=0;}});},hide:function(){var tip=this.tip;if(tip!=null){clearTimeout(this.timeout);var top=parseInt(tip.style.top);var start=new Array;start[0]=top;start[1]=100;var end=new Array;end[0]=top+5;end[1]=0;this.fx.init({start:start,end:end,time:.25,onLoop:function(v){if(isNaN(v[0]))tip.style.top=0+"px";else tip.style.top=v[0]+"px";tip.style.opacity=v[1]/100;tip.style.filter="alpha(opacity="+v[1]+");";},onFinish:function(){tip.style.left="-2000px";tip.style.top=null;tip.style.opacity=null;tip.style.filter=null;tooltip.obj=null;}});}}}
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="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,"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");a.innerHTML=options[index].innerHTML;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,"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="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="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[TempIndex+1].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="fieldSelected";customScroll.mode=0;customScroll.scrollToElement(scrollbar,options[i]);break;}}
return false;}}
else if(LI){options[TempIndex].className=null;LI.className="fieldSelected";id.TempIndex=parseInt(LI.getAttribute("index"));}
return;}}
function processCallBackMiniSku1(buttonId,skuIn,effortCodeIn,skuImagePathIn,promoSkuImageIn){glbMiniSKUButton=buttonId;getMiniSKU1(skuIn,effortCodeIn,skuImagePathIn,promoSkuImageIn);var onclkBehavior=$find("controlledAnimationMiniSku1").get_OnClickBehavior().get_animation();CoverMiniSku1($get(buttonId),$get('flyoutdiv'));onclkBehavior.play();}
function getMiniSKU1(sku,effortCode,skuImage,promoImage){var Arguments='getMiniSKU|'+sku+'|'+effortCode+'|'+skuImage+'|'+promoImage;var Context='server';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);var onclkBehavior=$find("controlledAnimation").get_OnClickBehavior().get_animation();onclkBehavior.play();}}
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];}

var funcEmpty=function(){};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+$/,'');},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='c='+encodeURIComponent(command)+'&p='+encodeURIComponent(params)+'&ai='+encodeURIComponent(controlID)+'&ajax_postback=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+="&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?'&':'?')+'fnr='+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','','','i\x3d'+panelID+'\x26tid\x3d'+trigger+'\x26t\x3d',panelID,null,'__Page',trigger,true,progressID?progressID:null,progressID?parseInt(panel.getAttribute('upd')):0,true,true);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=/";}
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);}
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;}}
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;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 getOffset(el){var r={};r.w=el.offsetWidth;r.h=el.offsetHeight
el=$(el);if(el.offsetParent&&el){var x=el.offsetLeft;var y=el.offsetTop;while(el.offsetParent){if(el.scrollTop)y-=el.scrollTop
el=el.offsetParent;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}}
function $(element,tagName,className){if(typeof element=="string"&&tagName==null&&className==null){return document.getElementById(element);}
if(tagName!=null&&className!=null){var arrReturnElements=new Array;var arrElements=$(element).getElementsByTagName(tagName);for(var i=0;i<arrElements.length;i++){var oElement=arrElements[i];if(oElement.className.match(className)){arrReturnElements.push(oElement);}}
if(arrReturnElements.length==0)return null;if(arrReturnElements.length==1)element=arrReturnElements[0]
else
element=arrReturnElements;}
return element;}
function $find(el){return $(el);}
function getInputCaret(oField){return getInputRange(oField).start;}
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;}}

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.onscroll=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=window.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){args.onLoop(args.end);if(args.onFinish)args.onFinish();this.clear();return;}
args.onLoop(v);},clear:function(){window.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;}

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]||{});}};
Nav={init:function(){var page=$("aspnetForm");var uls=$("page","UL","navigation");if(!exists(uls))return false;uls.length?uls=uls:list=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)}},attEvent:function(el,ul,delay){ul=$(ul);el.onmouseover=function(){Nav.mouseOver(el,ul,delay)};el.onmouseout=function(event){Nav.mouseOut(el,delay,event)};el.onmouseup=function(event){if(Nav.bypassClick){Nav.bypassClick=false;return;}
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+"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',init:function(searchBox,submitButton){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;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;if(keywords!=this.oldKeywords){this.oldKeywords=this.preDropDown=keywords;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){this.preDropDown=this.oldKeywords=this.searchBox.value;if(this.selected)SearchSuggestTrack(this.preDropDown);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;return true;}
this.searchBox.value=this.oldKeywords=newLink.getAttribute("keyword");return true;},show:function(){if(this.searchIsOpen||this.suggestContainer.style.visibility=="visible"||this.searchBox.value.length==0||this.searchBox.value=='Keyword or Item #'||!this.canShow){return true;}
this.searchIsOpen=true;var effect=new Effect.Fade(this.suggestContainer,{fadeIn:true,duration:0.2});},hide:function(){if(!this.searchIsOpen)return;this.searchIsOpen=false;this.suggestContainer.style.visibility="hidden";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(link[2]!=0){var span=document.createElement("span");span.appendChild(document.createTextNode(link[2]));nodeLink.appendChild(span);}
nodeLink.appendChild(document.createTextNode(link[0]));if(listType!=0){switch(listType){case 1:nodeLink.setAttribute("keyword",link[2]);break;case 2:case 3:nodeLink.setAttribute("keyword",link[0]);break;}
nodeLink.onmousedown=this.submitClick.bindAsEventListener(this);nodeLink.onmouseover=this.linkMouseOver.bindAsEventListener(this);}
else{nodeLink.className="header";}
frag.appendChild(nodeLink);}}
this.selectLink(null);this.suggestDiv.innerHTML="";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;this.searchBox.value=this.preDropDown=this.oldKeywords=element.getAttribute("keyword");this.searchBox.focus();submit.click();SearchSuggestTrack(this.preDropDown);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="opaque"><embed src="'+swf+'" quality="high" wmode="opaque" 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",args:{},send:{},mFx:null,qFx:null,cartFx:null,processing:0,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,locus:{x:null,y:null,adjx:null,adjy:null},fx:null}
switch(args.type){case 0:args.div=$(this.Mdiv);args.wrap=$(this.Mwrap);args.url="/ajax/PopUpScripts.aspx";break;case 1:args.div=$(this.Qdiv);args.wrap=$(this.Qwrap);args.url="/ajax/QViewScripts.aspx";break;case 2:args.div=$(this.Hdiv);args.wrap=$(this.Hwrap);args.title=$(this.Htitle);break;}
this.args=Object.extend(this.args,args);if(!this.mFx)this.mFx=new Anim();if(!this.qFx)this.qFx=new Anim();if(!this.cartFx)this.cartFx=new Anim();if(!this.hFx)this.hFx=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: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:this.send.callBack=this.checkMiniSku;break;case 7:this.send.callBack=this.checkMiniSkuUpdate;break;case 8:break;case 11: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){switch(this.args.action){case 1:if(!this.tabs)this.tabs=new TabMenuConst();break;case 2:if(!this.QIMGScroll){this.QIMGScroll=new SCSCRIPT
this.QIMGScroll.name="QIMGScroll";this.QIMGScroll.itemsPerPage=4;this.QIMGScroll.itemWidth=90;this.QIMGScroll.height=65;}
break;case 3:if(!this.QViewScroller){this.QViewScroller=new SCSCRIPT;this.QViewScroller.name="QViewScroll";this.QViewScroller.itemsPerPage=4;}
break;}
var args=this.args;args.fx=this.qFx;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="+args.inktonerOffers+"&ShowAccessoriesAfterAddToCart="+args.showAccessories+"&AccessoriesMode="+args.mode;this.getHTML();}
else if(this.args.type==2){this.args.fx=this.hFx;this.show();}},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.show();if(this.args.action==1)PromoMiniSkuTrack(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";},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});}
$("hdDl").innerHTML=$("cartDl").innerHTML;$("hdShpngMsg").innerHTML=$("cartShpngMsg").innerHTML;}
else{this.processing=0;}},checkMiniSku:function(requestObj){if(requestObj.responseText=="BASKETSTATEOK"){if(location.pathname=="/cart/cart.aspx"&&this.args.action==5){__doPostBack('ctl00$MainContent$RefreshLinkButton','');s
this.close(0);}
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{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,"INPUT","qtyInput");if(this.args.type==1){if(this.args.action==1)this.tabs.init(this.args.wrap);if(this.args.action==2)this.QIMGScroll.initFinder('QIMG');if(this.args.action==3){this.QViewScroller.initFinder('QView');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.action==4||this.args.action==5){}
if(this.args.closeMiniSku==1)this.close(0);}
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(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);}},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:wrap=$(this.Hwrap);div=$(this.Hdiv);break;case 3:wrap=$(this.miniCart);window.onscroll=null;break}
if(wrap){wrap.style.display="none";if(type!=3)wrap.style.left="-2000px";}}
else{$(this.Mwrap).style.left="-2000px";$(this.Mwrap).style.display="none";$(this.Qwrap).style.left="-2000px";$(this.Qwrap).style.display="none";$(this.Hwrap).style.left="-2000px";$(this.Hwrap).style.display="none";}
this.processing=0;},tabs:null,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="";}});}}
var QViewPopUp={ShowPopUp:function(obj,imageURL,event){var QViewInfoDiv=$("QViewInfo");if(QViewInfoDiv.style.display=="block")return false;this.glbQViewButton=obj;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=$('QView');QViewDiv.innerHTML=script;QViewInfoDiv.style.display="block";reposition(QViewInfoDiv,obj);QViewInfoDiv.style.top=(parseInt(QViewInfoDiv.style.top)+30)+"px";dragme("QViewInfo",event,null);},HidePopUp:function(){if(!$('zoomImgSmall'))return false;var QViewInfoDiv=$("QViewInfo");document.clearDrag(QViewInfoDiv,null);var QViewDiv=$("QView");QViewDiv.innerHTML="";QViewInfoDiv.style.display="none";}}
function initScrollbars(div){if(div)var arrScrollBars=$(div,"DIV","customScrollBar");else var arrScrollBars=$("page","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,"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,"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,"div","contentWrapper2");var track=$(id,"div","csTrack",id);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,mask:null,scroller:null,pageWidth:null,list:[],items:null,currentPage:0,height:170,itemWidth:180,itemsPerPage:5,pages:null,name:null,mode:null,noBorder:false,T:.5,scrollbar:false,initFinder:function(controlId){this.fx=new Anim();this.fx.name=controlId;this.ControlID=controlId;this.mask=$(this.ControlID+'scrollerMask');this.scroller=$(this.ControlID+'scrollz');if(this.scroller!=null){this.pageWidth=parseInt(this.itemWidth*this.itemsPerPage);var list=$(this.scroller.id,"div","itemb");if(!list)return false;list.length?list=list:list=new Array(list);this.list=list;if(this.list&&this.list.length>0){this.items=this.list.length;this.scroller.style.width=this.items*this.itemWidth+"px";if(this.height!="auto")this.mask.style.height=this.height+"px";else{this.mask.style.height=this.autoHeight()+"px";this.height="auto";}
if(this.noBorder==false)this.mask.style.width=this.pageWidth-1+"px";else this.mask.style.width=this.pageWidth+"px";this.pages=Math.ceil(this.items/this.itemsPerPage);this.setupHelpers();}}},initGroupFinder:function(id){var div=$("ItemGroup"+id);if(div){this.list=$(div,"div","itemb");}
else
this.list=$(this.scroller.id,"div","itemb");this.scroller.style.left=0;this.currentPage=0;this.pageWidth=parseInt(this.itemWidth*this.itemsPerPage);this.items=this.list.length;this.scroller.style.width=this.items*this.itemWidth+"px";this.mask.style.height=this.height+"px";if(this.noBorder==false)this.mask.style.width=this.pageWidth-1+"px";else this.mask.style.width=this.pageWidth+"px";this.pages=Math.ceil(this.items/this.itemsPerPage);this.setupHelpers();},setupHelpers:function(){if($(this.ControlID+"toLeft")&&$(this.ControlID+"toRight")){var c=this.currentPage;var helper=$(this.ControlID+"helper");if(this.pages>1){if(c==0)$(this.ControlID+"toLeft").className="scLeft ScrPhLeft";else $(this.ControlID+"toLeft").className="scLeft";if(c==this.pages-1)$(this.ControlID+"toRight").className="scRight ScrPhRight";else $(this.ControlID+"toRight").className="scRight";}
else{$(this.ControlID+"toLeft").className="scLeft ScrPhLeft ScrPhHide";$(this.ControlID+"toRight").className="scRight ScrPhRight ScrPhHide";}}
if(helper){if(this.mode=="pagination")helper.innerHTML="<span class=\"scPager\">[ Page "+(c+1)+" of "+this.pages+" ]</span>";else helper.innerHTML="";for(var i=0;i<this.pages;i++){if(i==c){helper.innerHTML+="<a class='selected' href='javascript:void(0);'>"+(i+1)+"</a>";}
else{helper.innerHTML+="<a href=\"javascript:"+this.name+".getOverHere("+i+");\" alt=''>"+(i+1)+"</a>";}}}},getOverHere:function(targetPage){if(this.fx.z!=null&&(targetPage=="toLeft"||targetPage=="toRight"))return false;var pages=this.pages;var c=this.currentPage;var obj=this.scroller;var endPage=this.pages-1;var startPage=0;if(targetPage=='toLeft'){if(c==0&&startPage==0)return false;targetPage=(c-1);if(targetPage<startPage)return false;}
else if(targetPage=='toRight'){if(c==pages)return false;targetPage=(c+1);if(targetPage>endPage)return false;}
this.currentPage=targetPage;this.setupHelpers();var start=parseInt(this.scroller.style.left);var end=-(targetPage)*this.pageWidth;var scrollerobject=this;this.fx.init({start:start,end:end,time:this.T,onLoop:function(v){obj.style.left=v+"px";},onFinish:function(){if(scrollerobject.scrollbar==true)initScrollbars(obj);if(scrollerobject.height=="auto")scrollerobject.mask.style.height=scrollerobject.autoHeight()+"px";}});return targetPage;},initHeight:function(){if(this.height!="auto"){this.mask.style.height=this.height+"px";}
else{this.mask.style.height=this.autoHeight()+"px";this.height="auto";}},autoHeight:function(){var height=0;for(var i=this.currentPage;i<this.currentPage+this.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){if(!this.as)this.as=a.parentNode.getElementsByTagName("A");this.as[this.aPrev].className="";this.as[index].className="Selected";this.aPrev=index;if(!this.itemGroup)this.itemGroup=$(this.scroller,"div","ItemGroup");var l=this.itemGroup.length;if(index>0){for(var i=0;i<l;i++){this.itemGroup[i].className="ItemGroup noDisplay";}
this.itemGroup[index-1].className="ItemGroup";}
else{for(var i=0;i<l;i++){this.itemGroup[i].className="ItemGroup";}}
this.initGroupFinder(id);}}
var addToCartShowing=0;var visibleAddToCart=null;function lastChild(el){var l=el.lastChild;while(l!=null&&l.nodeType!=1){l=l.previousSibling;}
return l;}
function previousSiblingByClass(el,className){var l=el.previousSibling;while(l!=null&&l.className!=className){l=l.previousSibling;}
return l;}
function showAddToCart(obj,n){if(obj.className.match("itemOver")||obj==null)return;var index=parseInt(obj.getAttribute("index"));if(!addToCartShowing){if(visibleAddToCart!=null){visibleAddToCart.className=visibleAddToCart.className.replace(" itemOver"," ");;addToCartShowing=0;visibleAddToCart.style.zIndex=201-parseInt(visibleAddToCart.getAttribute("index"));}
if(!obj.qtyErrorDiv){obj.qtyErrorDiv=lastChild(lastChild(obj));obj.quantityValue=previousSiblingByClass(obj.qtyErrorDiv,"hidden");obj.quantity=$(obj)[0],"INPUT","qtyInputScroll";obj.quantityValue=obj.quantityValue.value;}
obj.qtyErrorDiv.style.display="none";obj.quantity.value=obj.quantityValue;var D=(index+1)/n%1;obj.style.zIndex=201+index;if(D==0){obj.style.zIndex=202+index;obj.className+=" cartLeft";}
visibleAddToCart=obj;obj.className=obj.className+" itemOver";}}
function hideAddToCart(obj,event){if(obj!==0){if(event){if(trueMouseOut(obj,event)==false||addToCartShowing==1)return}
obj.className=obj.className.replace(" itemOver"," ");}}
function resetAddToCart(obj){if(visibleAddToCart!=null){var strClass=obj.className;var strnewClass=strClass.replace(" itemOver"," ");visibleAddToCart.className=strnewClass;addToCartShowing=0;}}
function addItemsToCartFromWidget(obj,EffortCode,FindNumber,Quantity,PromoCode,MultipleSellQty,MaximumSellQty){if(Quantity){if(Quantity!=""){addToCartShowing=0;hideAddToCart(obj.parentNode.parentNode);popup.init({button:obj,type:0,action:2,effort:EffortCode,findNumber:FindNumber,QTY:Quantity,promoCode:PromoCode});}}}

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;try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.loadXML(returnmessage);}
catch(e){try{var parser=new DOMParser();xmlDoc=parser.parseFromString(returnmessage,"text/xml");}
catch(e){alert(e.message);return;}}
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){$('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)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;try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.loadXML(returnmessage);}
catch(e){try{var parser=new DOMParser();xmlDoc=parser.parseFromString(returnmessage,"text/xml");}
catch(e){alert(e.message);return;}}
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:'div',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;}
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);}});}},hide:function(e){if(this.container)$replace(this.container.parentNode,'');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);}}};
