var psiml="",paccl="";var _warnMessg='<p style="color:red;">Warning!</p>Computers and computer circuit boards, as well as other electronic equipment, contain lead, which is a chemicalknown to the State of California to cause cancer or cause birth defects and other reproductive harm.Please wash hands after handling circuit boards and other internal components of computers and electronic equipment,and avoid inhalation of fumes if heating the solder on the internal components or circuit boards.';var nospecMessg="No specifications available for this product at this time.";if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+/g,"").replace(/\s+$/g,"")}}if(!String.prototype.spec){String.prototype.spec=function(){return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/\u00A6/g,"<br/>")}}var Destabsc=Class.create({initialize:function(a){this.element=$(a);if(!this.element){return}$("warn").update(_warnMessg);this.menu=$A(this.element.getElementsByTagName("a"));this.show(this.getInitTab());this.menu.each(this.setupTab.bind(this))},setupTab:function(a){Event.observe(a,"click",this.activate.bindAsEventListener(this))},activate:function(a){var b=Event.findElement(a,"a");Event.stop(a);this.show(b);this.menu.without(b).each(this.hide.bind(this))},hide:function(a){$(a).removeClassName("selected");$(this.tabID(a)).removeClassName("showTab")},show:function(b){var a=this.tabID(b);b.blur();$(b).addClassName("selected");$(a).addClassName("showTab");if($(a).innerHTML.indexOf("Loading")>-1){new Ajax.Request("desctabs",{method:"post",onCreate:function(){$(a).update("<img src='./img/it/wait.gif'>")},parameters:"tab="+a+"&iid="+this.itemID(b)+"&psiml="+psiml+"&paccl="+paccl+"&noch="+Math.random(),onComplete:function(c){this.updateTabs(c,a)}.bind(this),onFailure:function(){alert("Error...")}})}$("tbdesc").setStyle({display:"block"})},tabID:function(a){return a.href.match(/#(\w.+)/)[1]},itemID:function(a){return a.href.match(/\biid=\b(\d+)/)[1]||"0"},getInitTab:function(){if(document.location.href.match(/#(\w.+)/)){var a=RegExp.$1;var b=this.menu.find(function(c){return c.href.match(/#(\w.+)/)[1]==a});return b||this.menu.first()}else{return this.menu.first()}},updateTabs:function(a,b){this.resp=a.responseText;if(!this.resp){$(b).update(nospecMessg);return}$(b).update("");new Items(b,this.resp);new Tooltip($$("span.tltip"))}});Event.observe(window,"load",function(){new Destabsc("tabsc")});var Items=Class.create({initialize:function(elm,items){this.elm=$(elm);if(!this.elm){return}try{this.items=eval(items)}catch(err){return}this.make(this.elm,this.items)},show:function(a){var e=Event.findElement(a,"div");Event.stop(a);e.setStyle("border:1px solid #db6626;");var b=e.getDimensions();var d=Event.pointerX(a)+b.width;var c=Event.pointerY(a);this.sdiv.setStyle({display:"block",top:c+"px",left:d+"px",border:"1px double gray"});this.showImg.writeAttribute({src:e.down().src})},hide:function(a){var b=Event.findElement(a,"div");b.setStyle("border:1px solid white;");this.sdiv.setStyle("display:none;")},make:function(h,l){var a=new Element("div",{id:"accsum"}),m,c,k;this.sdiv=new Element("div").setStyle("display:none;width:300px;height:300px;background-color:white;z-index:900;position:absolute;");this.showImg=new Element("img");this.sdiv.update(this.showImg);a.insert(this.sdiv);var q=new Element("table");var g=new Element("tbody");for(var o=0;o<l.length;o++){var p=l[o];m=new Element("tr");c=new Element("td",{id:"cl1"});k=new Element("div");var e=new Element("img").writeAttribute({src:"http://img.compuvest.com/b/"+p.sku+".jpg"});e.observe("error",function(r){Event.findElement(r,"div").hide()});e.observe("load",this.resImg.bind(this));k.insert(e);k.observe("mouseover",this.show.bind(this));k.observe("mouseout",this.hide.bind(this));m.insert(c.insert(k));c=document.createElement("td");c.id="cl2";c.innerHTML="<a href='"+cv_gl.encodeURL("Desc.jsp")+"?iid="+p.id+"'>"+p.name+"</a><div><ul><li>&#187; SKU : "+p.sku+"</li><li>&#187; Condition : "+p.cond+"</li><li>&#187; Stock : "+p.stock+"</li></ul></div><div><ul><li>&#187; Manufacturer : "+p.mfrName+"</li><li>&#187; Manufacturer P/N : "+p.mfrNumber+"</li><li>&#187; Package : "+p.packg+"</li></ul></div>";m.appendChild(c);c=document.createElement("td");c.id="cl3";var n=new Element("table",{style:"width:280px;margin:0 10px 0 0;"}),j,d,b;j=new Element("tbody");d=new Element("tr");b=new Element("td",{style:"text-align:right;padding:0 4px 7px 0;",colspan:3}).update("<a style='text-decoration:none;font-size:12px;color:teal;' onclick=\"$('dropricebox').toggle("+p.id+");\" href='javascript:;'>Drop Price Alert</a>");d.insert(b);j.appendChild(d);d=new Element("tr");d=this.trTag(p,this.banner(p));j.appendChild(d);if(p.additem!=""){j.insert(this.trTag(p.additem[0]),new Element("div"))}n.appendChild(j);c.appendChild(n);m.appendChild(c);g.appendChild(m);m=new Element("tr").insert(new Element("td",{colspan:3}).update("<hr/>"));g.appendChild(m)}q.appendChild(g);a.appendChild(q);h.appendChild(a)},resImg:function(a){var g=Event.findElement(a,"div");var b=g.down();if(!b){return}var d=g.getDimensions();if(d.width&&d.height){var e=b.getDimensions();if(e.width&&e.height){var c=Math.min(d.width/e.width,d.height/e.height);b.setStyle({width:Math.ceil(e.width*c)+"px",height:Math.ceil(e.height*c)+"px"})}}},trTag:function(a,d){var b=new Element("tr").insert(new Element("td").insert(d));var c=new Element("td",{style:"text-align:right;font-size:14px;font-weight:bold;padding-right:5px;color:red;"}).update("$"+a.price.toFixed(2));b.appendChild(c);c=new Element("td",{style:"width:90px;padding:0 0 3px 0;"});c.insert(new Element("a",{id:"addbk",href:cv_gl.encodeURL("Basket.jsp")+"?iidd="+a.id}).update("<div>Add to Cart</div>"));b.appendChild(c);return b},banner:function(c){var a=new Element("span");if(c.additem!=""){a=new Element("span",{id:"idspp","class":"tltip",style:"font-size:12px;"}).update("Special price <img src='./img/it/hlp.gif'/>")}else{if(c.banner!=""){a=new Element("span",{style:"font-size:12px;font-weight:bold;color:teal;"});var b="&nbsp;";if(c.banner[0].special){b="Special Price"}else{if(c.banner[0].clearance){b="Clearance"}else{if(c.banner[0].bestprice){b="Best Price"}else{if(c.banner[0].comesoon){b="Ships in: 2-5 Days"}}}}a.update(b)}}return a}});var Descr=Class.create({initialize:function(a){this.descr=$("tbdesc");if(!this.descr){return}$("tbh2","tbh3","tbh4").invoke("hide");this.elm=$(a);this.tbc1=$("tbc1");if(!this.elm&&this.tbc1.empty()){this.tbc1.update(nospecMessg);return}this.show=this.doDescr()},doDescr:function(){var g="",d="";var b=$("minfo");if(b&&!b.empty()){g+="<div class='dshead'>Marketing Information</div><div class='dsbody'>"+b.innerHTML.spec();var c=$("nameb");if(c&&!c.empty()){g+="<br/>"+c.innerHTML}g+="</div><hr/>\n"}b=$$("#mspec li[id]");if(b){var a="";b.each(function(h){if(!h.empty()){var j=h.getAttribute("id");if(j!="Standard Warranty"){a+="<li><span>"+j+" : "+h.innerHTML.spec()+"</span></li>"}}});if(a!=""){g+="<div class='dshead'>Main Features</div><div id='tagLI'>"+a+"</div><hr/>"}}b=$$("#espec ul");if(b){b.each(function(h){if(h.getAttribute("id")){var j=h.getAttribute("id");if(j!="Warranty"&&j!="Software"){d+="<div class='dshead'>"+h.getAttribute("id")+"</div><div id='tagLI'>";var k=h.childElements();k.each(function(l){var m=l.getAttribute("id");if(m!="Package Contents"){d+="<li><span>"+m+" : "+l.innerHTML.spec()+"</span></li>"}});d+="</div><hr/>"}}})}b=$$("#img li");if(b){var e="[";b.each(function(j,h){if(h>0){e+=","}e+="{id:'img"+h+"',attr:'"+j.getAttribute("id")+"',url:'"+j.innerHTML+"'}"});e+="]";new GaleryImages(e)}b=$("paccl");if(b){if(b.innerHTML){paccl=b.innerHTML;$("tbh3").setStyle({display:"inline"})}}b=$("psiml");if(b){if(b.innerHTML){psiml=b.innerHTML;$("tbh4").setStyle({display:"inline"})}}$("tbc1").update(g!=""?g:nospecMessg);if(d){$("tbc2").update(d);$("tbh2").setStyle({display:"inline"})}return}});Event.observe(window,"load",function(){new Descr("DESCRIP")});var GaleryImages=Class.create({initialize:function(jsimg){this.galery=$("imgGallery");this.divImg=$("mainImg");if(!this.galery&&!this.divImg){return}try{this.jsimg=eval(jsimg)}catch(e){alert(e)}this.mainImg=new Element("img");this.imgs=[];this.totalImg=0;this.initImg()},initImg:function(){for(var b=0;b<this.jsimg.length;b++){var d=this.jsimg[b];if(d.attr!="n"){var c=new Element("div");c.observe("mouseover",this.showImg.bind(this));c.observe("mouseout",this.hideImg.bind(this));var a=new Element("img").writeAttribute({src:d.url});a.observe("load",this.resImg.bind(this));this.imgs[this.totalImg++]=a;c.insert(a);this.galery.insert(c);if(d.attr=="b"){this.mainImg.writeAttribute({src:d.url});this.mainImg.observe("error",function(e){Event.findElement(e,"div").hide()});this.divImg.insert(this.mainImg)}}}this.totalImg-=1;this.curentImg=0;this.paused=0;this.delay=5;if(this.totalImg>0){this.rotateImg()}},resImg:function(a){var g=Event.findElement(a,"div");var b=g.down();if(!b){return}var d=b.up().getDimensions();if(d.width&&d.height){var e=b.getDimensions();if(e.width&&e.height){var c=Math.min(d.width/e.width,d.height/e.height);b.setStyle({width:Math.ceil(e.width*c)+"px",height:Math.ceil(e.height*c)+"px"})}}},showImg:function(a){this.paused=1;var b=Event.findElement(a,"div");b.setStyle({border:"1px solid #db6626"});this.mainImg.src=b.down().src},hideImg:function(a){this.paused=0;var b=Event.findElement(a,"div");b.setStyle({border:"1px solid silver"})},rotateImg:function(){this.executor=new PeriodicalExecuter(function(){this.nextImg()}.bind(this),this.delay)},nextImg:function(){if(!this.paused){this.updateImg()}},updateImg:function(){new Effect.Fade(this.mainImg,{afterFinish:function(){this.checkImg();this.mainImg.src=this.imgs[this.curentImg].src;new Effect.Appear(this.mainImg)}.bind(this)})},checkImg:function(){if(this.curentImg==this.totalImg){this.curentImg=0}else{this.curentImg++}}});var SRT_IMG="http://img.compuvest.com/s/";var NOR_IMG="http://img.compuvest.com/n/";var BIG_IMG="http://img.compuvest.com/b/";var cv_gl={init:function(c,b,d,a){this.isc=c;this.sid=b||"";this.lnk=d||"www.compuvest.com"},encodeURL:function(a){return"http://"+this.lnk+"/"+a+(this.isc?"":";jsessionid="+this.sid)},getURL:function(){return"http://"+this.lnk+"/"}};var ResizeImg=Class.create({initialize:function(a){this.imgs=a;if(!this.imgs){return}this.imgs.each(function(b){var d=b.up().getDimensions();if(d.width&&d.height){var e=b.getDimensions();if(e.width&&e.height){var c=Math.min(d.width/e.width,d.height/e.height);b.setStyle({width:Math.ceil(e.width*c)+"px",height:Math.ceil(e.height*c)+"px"})}}})}});Event.observe(window,"load",function(){new ResizeImg($$("img[id='rs']"))});var AdvertShow=Class.create({initialize:function(b,a,c){this.elm=$(c);if(!this.elm){return}if(!b){return}this.options=Object.extend({cols:5,count:10},a||{});this.show(b)},show:function(j){try{var l=this.options.cols;var h=this.options.count;var m,e,k,b,a,g,d;m=new Element("table");e=new Element("tbody");k=new Element("tr",{align:"center"});j.sort(function(){return 0.5-Math.random()}).each(function(o,n){if(h>n){b=new Element("td");a=new Element("div",{id:"blshow"});a.observe("click",function(){window.location.href=cv_gl.encodeURL("Desc.jsp")+"?iid="+o.iid});d=new Element("img").writeAttribute({src:NOR_IMG+o.accid+".jpg"});d.observe("error",function(){this.hide()});g=new Element("span").insert(d);a.insert(g);a.insert(new Element("p").update("$"+o.price.toFixed(2)));a.insert(new Element("div").update(o.name));k.insert(b.insert(a));if(((n+1)%l)==0){e.insert(k);k=new Element("tr",{align:"center"})}}});this.elm.insert(m.insert(e.insert(k)))}catch(c){throw ("advertshow "+c.message)}}});function cv_togls(d,c){if(c==1){$("b"+d+"1").hide();$("b"+d+"0").show()}else{if(c==0){$("b"+d+"1").show();$("b"+d+"0").hide()}}}var bN=navigator.appName=="Netscape"?1:0;var timeOut;var timeDelay=700;var mWidth=158;var sub;function menu(){var d=$("menu");if(!d){return}setH(d);var a=d.getElementsByTagName("li");for(var b=0;b<a.length;b++){var c=a[b].getElementsByTagName("UL");if(c.length&&!bN){a[b].onmouseover=function(){var e=this.getElementsByTagName("UL");if(e.length){e[0].style.display="block"}};a[b].onmouseout=function(){var e=this.getElementsByTagName("UL");if(e.length){e[0].style.display="none"}};a[b].onmouseleave=function(){if(window.event.x<mWidth){var e=this.getElementsByTagName("UL");if(e.length){e[0].style.display="none"}}};c[0].onmouseleave=function(){showSub(this)}}}}function showSub(b){if(window.event.x<mWidth){return}b.style.display="block";sub=b;timeOut=setTimeout("fEm()",timeDelay)}function fEm(){sub.style.display="none";clearTimeout(timeOut)}function setH(j){var l=j.offsetTop;var n=$("menublock").clientHeight;var k=j.getElementsByTagName("UL");var g=k[0].parentNode.clientHeight;for(var c=1;c<k.length;c++){var h=k[c].parentNode.offsetTop;var e=k[c].getElementsByTagName("UL");if(!h||e.length){continue}else{e=k[c].getElementsByTagName("LI");var b=parseInt(g*e.length);if(n+l<b){var m=parseInt(-1*(h+l));k[c].style.top=m;continue}var d=h+b<=n?0:n-h-b;k[c].style.top=d}}}function blr(){if(bN){myblur()}}function myblur(){var a=document.getElementsByTagName("a");if(a){for(var b=0;b<a.length;b++){a[b].onfocus=function(){this.blur()}}}}Event.observe(window,"load",function(){blr()});function hideErr(b){b.parentNode.style.visibility="hidden"}function sha(c){var b=$(c);if(!b){return}if(b.style.display=="block"){b.style.display="none"}else{b.style.display="block"}}function sw(){var c=location.href;var b="";if(c.indexOf("#")>0){b=c.substring(c.indexOf("#")+1,c.length);sha(b)}}function cb(){var a=document.forms.Search.elements[0];if(a.checked){if(a.value=="Advanced Search"||a.value==""){a.value="Quick Search"}a.checked=false}else{if(a.value=="Quick Search"||a.value==""){a.value="Advanced Search"}a.checked=true}}function cb2(){var a=document.forms.Search.elements[0];if(a.value!="Quick Search"&&a.value!="Advanced Search"){return}else{a.value=""}}function gb(){var a=document.forms.Search.elements[0];if(a.value!="Quick Search"&&a.value!="Advanced Search"&&a.value!=""){document.forms.Search.submit();return false}}function setSign(){var b=document.Payment;if(b.sng.checked){$("sgn").update("Signature: <input name='sgn1' value='$2.00' size='10' readonly/>")}else{$("sgn").update("")}b.spb.value="";b.desb.value="";b.totb.value="";$("desview").update("");if(b.ship_opt.length==undefined){b.ship_opt.checked=false}else{for(var a=0;a<b.ship_opt.length;a++){b.ship_opt[a].checked=false}}}var tool_tips={idwty:{width:"400px",background:"#d8d8f4",body:"Extended Warranty :<hr/><p>&nbsp;&nbsp;&nbsp;Thank you for your interest in Compuvest.com Extended Warranty. This extended warranty program is designed to provide you with additional coverage for manufacturer defects.<br/>&nbsp;&nbsp;&nbsp;Such service, repair or adjustment of this equipment is assured the original purchaser only. This warranty does not cover equipment which has been misused, tampered with, modified or damaged as a result of accident, liquid, grit, impact or lack of proper care as indicated in the manual of operations.</p><br/>When does the Extended Warranty Coverage start?<br/><br/><p>&nbsp;&nbsp;&nbsp;Your Extended Warranty begins the day after your manufacturer warranty (if any) ends <b>(unless different warranty period is specified in item description)</b>, ensuring you seamless extended coverage.<br/>&nbsp;&nbsp;&nbsp;To have your equipment serviced under your Extended Warranty, please be sure to include your Invoice number and/or a copy of your invoice when you send in your equipment (prior RMA approval applies same as regular RMA returns procedure).When sending product back under warranty, please follow all RMA returns procedures (provided at time of your RMA submission).</p>"},idbph:{width:"210px",background:"#d8d8f4",body:"Bank Phone :<hr/><p>Bank phone number is the customer service number located on the back of your credit card.This information is not required, designed to help our processing department contact the correct bank faster when needed.</p>"},idsgn:{width:"210px",background:"#d8d8f4",body:"Signature Required :<hr/><p>You can add extra protection for your shipment by adding signature required option. Carriers such as FedEx or UPS will NOT leave your shipment by the  door without your signature .</p>"},idspp:{width:"210px",background:"#d8d8f4",body:"Special Price :<hr/><p>&nbsp;Compuvest has special promotions going on throughout the month with various products that are listed, these products have set quantity with lower pricing.<br/>Once this promotional quantity sells out, product then canonly be purchased at regular price, no exceptions.<br/>Please feel free to contact us with any questions you might have.</p>"}};var Tooltip=Class.create({initialize:function(a){this.tips=a;if(!this.tips.length){return}this.div=new Element("div",{"class":"tooltp",style:"display:none;"});this.tips.each(this.activate.bind(this))},activate:function(a){a.observe("mouseover",this.show.bind(this));a.observe("mouseout",this.hide.bind(this))},show:function(a){var e=Event.findElement(a,"span");var d=tool_tips[e.getAttribute("id")];var c=Event.pointerX(a)+5;var b=Event.pointerY(a)+5;this.div.setStyle({display:"block",top:b+"px",left:c+"px",width:d.width,background:d.background});this.div.update(d.body);e.insert({after:this.div})},hide:function(a){this.div.hide()}});Event.observe(window,"load",function(){new Tooltip($$("span.tltip"))});var dropmessg={before:{text:"<p>Dear CompuVest Customer! Welcome to Compuvest Price Drop Alerts, where you can sign up to receive alerts for price changes on your favorite products, direct to your email. Subscribe for Instant Email Alerts.Complete the form and click the Submit button to set an Alert.</p><br/>"},after:{text:"<p>Dear Customer! Thank you for submitting your price-drop alert. If the price drops within the specified time-frame you will be notified by email (or phone). Please feel free to contact us if any questions.</p>"}};var Dialog=Class.create({initialize:function(b,a){this.dialog_box=$(b);if(!this.dialog_box){return}this.options=Object.extend({hide_on_key:Event.KEY_ESC,duration:0.2,reset_form:true,hide_select_boxes:false},a||{});this.dialog_box.show=this.show.bind(this);this.dialog_box.toggle=this.toggle.bind(this);this.dialog_box.hide=this.hide.bind(this);this.overlay=false;this.iid=0;this.oldid=1;this.create_overlay();if(this.options.hide_on_key){document.observe("keypress",function(c){if(c.keyCode==this.options.hide_on_key&&this.dialog_box.visible()){this.hide()}}.bind(this))}},create_overlay:function(){if(!this.overlay){this.overlay=new Element("div").setStyle({position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:777,backgroundColor:"#000",display:"none"});document.body.insertBefore(this.overlay,document.body.childNodes[0])}},toggle:function(){if(arguments[0]){this.iid=arguments[0]}this.dialog_box.visible()?this.hide():this.show()},show:function(){this.overlay.observe("click",this.hide.bind(this));if(this.options.hide_select_boxes){this.select_boxes("hide")}new Effect.Appear(this.overlay,{duration:this.options.duration,from:0,to:0.3});if(this.dialog_box.empty()||this.oldid!=this.iid){this.oldid=this.iid;this.dialog_box.update("");new Ajax.Request("droprice",{method:"post",parameters:"iid="+this.iid+"&act=it&nch="+Math.random(),onComplete:function(d){this.fillBox(d)}.bind(this),onFailure:function(){alert("Error...")}})}var c=this.dialog_box.getDimensions();var b=(document.viewport.getScrollOffsets().last()+document.viewport.getHeight()/4);var a=((document.viewport.getWidth()/2)-(c.width)/2);this.dialog_box.setStyle({display:"",opacity:0,top:b+"px",left:a+"px"});new Effect.Appear(this.dialog_box,{duration:this.options.duration,beforeSetup:function(d){}})},hide:function(){if(this.options.hide_select_boxes){this.select_boxes("show")}new Effect.Fade(this.overlay,{duration:this.options.duration});new Effect.Fade(this.dialog_box,{duration:this.options.duration,afterFinishInternal:function(a){a.element.setStyle({display:"none"})}});if(this.options.reset_form){this.reset_form()}},fillBox:function(resp){var box="";try{box=eval(resp.responseText)}catch(err){throw ("dialog::ajax "+err.message)}var div=this.makeHead("Price Drop Alerts");this.dialog_box.insert(div);div=new Element("div",{id:"retdrop"});div.update(dropmessg.before.text);this.dialog_box.insert(div);var table=new Element("table",{id:"drp_al"});var tbody=new Element("tbody");tbody.insert(new Element("tr").insert(new Element("th",{width:"27%"}).update("Product Code:")).insert(new Element("td",{width:"73%"}).update(box[0].sku)));tbody.insert(new Element("tr").insert(new Element("th").update("Product Name:")).insert(new Element("td").update(box[0].name)));tbody.insert(new Element("tr").insert(new Element("th").update("Price:")).insert(new Element("td",{style:"color:red;"}).update("$"+box[0].price.toFixed(2))));tbody.insert(new Element("tr").insert(new Element("th").update("Notify me if:")).insert(new Element("td",{style:"color:green;"}).update("Price changes")));tbody.insert(new Element("tr").insert(new Element("th").update("Email:")).insert(new Element("td").update('<input type="text" size="40" maxLength="128" name="email" value=""/>')));tbody.insert(new Element("tr").insert(new Element("th").update("Name:")).insert(new Element("td").update('<input type="text" size="40" maxLength="40" name="name" value=""/>')));tbody.insert(new Element("tr").insert(new Element("th").update("Phone:")).insert(new Element("td").update('<input type="text" size="40" maxLength="40" name="phone" value=""/>')));tbody.insert(new Element("tr").insert(new Element("td",{colspan:"2"}).update("If you wish to be notified by phone, please enter you phone number.")));var input=new Element("input").writeAttribute({type:"submit",value:"Send"});input.observe("click",this.send.bind(this));tbody.insert(new Element("tr",{align:"center"}).insert(new Element("td",{colspan:"2"}).insert(input)));this.dialog_box.insert(div.insert(table.insert(tbody)))},send:function(){var d="",b=false,c=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;var a=$A(this.dialog_box.select('input[type="text"]'));a.each(function(e){if(e.name=="email"){b=c.test(e.value)}d+="&"+e.name+"="+e.value});if(b){new Ajax.Request("droprice",{method:"get",onCreate:function(){$("retdrop").update("<div style='text-align:center;height:25px;'><img src='./img/it/wait.gif'></div>")},parameters:"iid="+this.iid+d+"&act=sd&nch="+Math.random(),onComplete:function(e){this.done()}.bind(this),onFailure:function(){alert("Error...")}})}else{alert("Please enter a valid email address.")}},done:function(){var a=new Element("div",{"class":"btclose"}).update("Close");a.observe("click",this.hide.bind(this));$("retdrop").update(dropmessg.after.text).insert(a)},reset_form:function(){$A(this.dialog_box.getElementsByTagName("input")).each(function(a){if(a.type!="submit"){a.value=""}})},select_boxes:function(a){$A(document.getElementsByTagName("select")).each(function(b){Element[a](b)});if(a=="hide"){$A(this.dialog_box.getElementsByTagName("select")).each(function(b){Element.show(b)})}},makeHead:function(a){var c=new Element("div",{id:"drophead"});c.insert(new Element("div").update(a));var b=new Element("span",{title:"Close"}).update("x");b.observe("click",this.hide.bind(this));c.insert(b);return c}});Event.observe(window,"load",function(){new Dialog("dropricebox")});var ini=0;var pos=0;var scr=225;var left=610;var z=0;var y=0;function cltip(d){return; if(ini==0){iinit()}var a;if(bN){a=y;if((a+scr)>document.height){a=document.height-scr}pos=a}else{var g=document.body.clientHeight;var c=document.body.scrollTop;a=event.clientY;if((a+scr)<=g){pos=a+c}else{pos=g-scr+c}}var b='style="display:block;position:absolute;z-index:100;left:'+left+";top:"+pos+';"';var e="<div "+b+'><div class="pit"><table width='+scr+" height="+scr+'><tbody align=center valign=middle><tr><td><img src="'+d+'"/></td></tr></tbody></table></div></div>';$("pix").update(e);pos=0}function iinit(){if(!(document.getElementById&&document.createElement)){alert("Old browser!");ini=0}if(bN){document.onmousemove=function(a){x=a.pageX;y=a.pageY;ini=1;return}}}function prst(){$("pix").update("")}function f(d){var b=$(d);if(!b){return}var c=b.previousSibling.previousSibling.firstChild;if(b.style.display=="block"){b.setStyle({display:"none"});c.setAttribute("src","./img/it/pls.png")}else{var e=b.getElementsByTagName("a");if(e.length>12){b.setStyle({width:"101%",height:"200px",overflow:"auto",margin:0,padding:0,borderTop:"1px solid #BFB8BF",borderBottom:"1px solid #BFB8BF"})}else{b.setStyle({width:"100%",height:"auto",margin:0,padding:0,borderTop:0,borderBottom:0})}b.setStyle({display:"block"});c.setAttribute("src","./img/it/mns.png")}b=c=e=null}function prestart(){var b=$("pref");if(!b){return}var c=b.getElementsByTagName("div");if(!c){return}for(var a=0;a<c.length;a++){if(c[a].className=="al"){f(c[a].parentNode.getAttributeNode("id").value)}}}var sIs=new Array("","one","two","three","four","five","six","seven","eight","nine");var dIs=new Array("","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen");var tIs=new Array("","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety");var qIs=new Array("","thousand","million","billion");function NtoW(){var a=$("nsu").firstChild.nodeValue.split("$");n2w(a[1])}function sdt(b){var e="",d=b%10;if(d>0){e=sIs[d]}var c=Math.floor((b%100)/10);if(c==1){e=dIs[d+1]}else{if(c>1&&c<10){e=tIs[c-1]+" "+e}}d=Math.floor(b/100);if(d>0){e=sIs[d]+" hundred "+e}return e}function n2w(b){var g=0,c=0,h="";if(b){var e=b.split(".",2);g=parseInt(e[0].replace(/,/g,""))}if(g>0&&g<2147483647){for(var d=0;d<4;d++){c=g%1000;g=Math.floor(g/1000);if(c>0){h=sdt(c)+" "+qIs[d]+" "+h}}}c=parseInt(e[1],10);if(c<10&&e[1].length==1){c*=10}if(c>0){h+=" and "+c+" cents"}$("am").innerHTML="<i>"+h+"</i>"}function validPromo(){var b=document.basket.promo.value;if(b){b=b.toUpperCase();if(b.length<7||b.charAt(0)!="C"&&b.charAt(1)!="V"){alert("We're sorry, but this promotion code is invalid.");return false}document.basket.submit()}else{alert("Promotion code empty.")}return true}function billtoshipp(){var a=document.Customer;a.shippingCompany.value=a.billingCompany.value;a.shippingFirstName.value=a.billingFirstName.value;a.shippingLastName.value=a.billingLastName.value;a.shippingAddress1.value=a.billingAddress1.value;a.shippingAddress2.value=a.billingAddress2.value;a.shippingCity.value=a.billingCity.value;a.shippingZip.value=a.billingZip.value;a.shippingZip4.value=a.billingZip4.value;a.shippingState.value=a.billingState.value;a.shippingCountry.value=a.billingCountry.value;a.shippingPhone.value=a.billingPhone.value;a.shippingCell.value=a.billingCell.value;a.shippingFax.value=a.billingFax.value}function isDone(a){if(!a.Password.value){alert("Password cannot be empty.");a.Password.focus();return false}if(a.vPassword.value!=a.Password.value){alert("Your passwords do not match.");a.vPassword.focus();return false}if(!a.billingFirstName.value){alert("Billing First Name are required.");a.billingFirstName.focus();return false}if(!a.billingLastName.value){alert("Billing Last Name are required.");a.billingLastName.focus();return false}if(!a.billingAddress1.value){alert("Billing Address1 are required.");a.billingAddress1.focus();return false}if(!a.billingCountry.value){alert("Billing Country are required.");a.billingCountry.focus();return false}if(!a.billingCity.value){alert("Billing City are required.");a.billingCity.focus();return false}if(!a.billingState.value){alert("Billing State are required.");a.billingState.focus();return false}if(!a.billingZip.value){alert("Billing Zip are required.");a.billingZip.focus();return false}if(!a.billingPhone.value){alert("Phone are required.");a.billingPhone.focus();return false}if(!a.shippingFirstName.value){alert("Shipping First Name are required.");a.shippingFirstName.focus();return false}if(!a.shippingLastName.value){alert("Shipping Last Name are required.");a.shippingLastName.focus();return false}if(!a.shippingAddress1.value){alert("Shipping Address1 are required.");a.shippingAddress1.focus();return false}if(!a.shippingCountry.value){alert("Shipping Country are required.");a.shippingCountry.focus();return false}if(!a.shippingCity.value){alert("Shipping City are required.");a.shippingCity.focus();return false}if(!a.shippingState.value){alert("Shipping State are required.");a.shippingState.focus();return false}if(!a.shippingZip.value){alert("Shipping Zip are required.");a.shippingZip.focus();return false}if(!a.shippingPhone.value){alert("Phone are required.");a.shippingPhone.focus();return false}if(a.billingCountry.value=="US"&&!isNumber(a.billingZip.value)){alert("Invalid Billing Zip.");a.billingZip.focus();return false}if(a.shippingCountry.value=="US"&&!isNumber(a.shippingZip.value)){alert("Invalid Shipping Zip.");a.shippingZip.focus();return false}return true}function resisDone(a){if(!a.Password.value){alert("Password cannot be empty.");a.Password.focus();return false}if(a.vPassword.value!=a.Password.value){alert("Your passwords do not match.");a.vPassword.focus();return false}if(!a.billingCompany.value){alert("Company name are required.");a.billingCompany.focus();return false}if(!a.resellerCode.value){alert("Reseller code are required.");a.resellerCode.focus();return false}if(!a.billingFirstName.value){alert("First Name are required.");a.billingFirstName.focus();return false}if(!a.billingLastName.value){alert("Last Name are required.");a.billingLastName.focus();return false}if(!a.billingAddress1.value){alert("Address1 are required.");a.billingAddress1.focus();return false}if(!a.billingCountry.value){alert("Country are required.");a.billingCountry.focus();return false}if(!a.billingCity.value){alert("City are required.");a.billingCity.focus();return false}if(!a.billingState.value){alert("State are required.");a.billingState.focus();return false}if(!a.billingZip.value){alert("Zip are required.");a.billingZip.focus();return false}if(!a.billingPhone.value){alert("Phone are required.");a.billingPhone.focus();return false}if(!a.billingZip.value){alert("Zip are required.");a.billingZip.focus();return false}if(!a.billingPhone.value){alert("Phone are required.");a.billingPhone.focus();return false}return true}function prefDone(a){if(!a.hip.value||a.hip.value==0||!a.lop.value||a.lop.value==0){alert("Price Range cannot be empty.");a.lop.focus();return false}return true}function isCreditCard(e){var b=parseInt(e,10);if(!b){return""}var d=0,h=1,a=e.length;for(var c=0;c<a;c++){var j=e.substring(a-c-1,a-c);var g=parseInt(j,10)*h;(g>=10)?d+=(g%10)+1:d+=g;(h==1)?h++:h--}if(e.length!=""&&(d%10)==0){return(e)}else{alert("Check yours card number: "+e);document.Payment.CNumber.focus()}return""}function checkPassword(){if(document.Customer.Password.value==document.Customer.vPassword.value){return}else{alert("Your passwords do not match");document.Customer.Password.value="";document.Customer.vPassword.value="";document.Customer.Password.focus();return}}function isNumber(c){if(c.length==0){return false}var a="0123456789";for(var b=0;b<c.length;b++){if(a.indexOf(c.charAt(b))==-1){return false}}return true}function isInt(a){return(a%1)==0?a:0}function toAlphaNumeric(c){var d="";var b="";for(var a=0;a<c.length;a++){b=c.substring(a,a+1);if(b=="'"){continue}if(b>=" "&&b<="~"){d+=b}}return d}function isReady(a){if(isEmail(a.Email.value)==false){alert("Please enter a valid email address.");a.Email.focus();return false}if(!a.Password.value){alert("Password cannot be empty.");a.Password.focus();return false}if(a.mode.value=="new"){if(a.vPassword.value!=a.Password.value){alert("Your passwords do not match.");a.vPassword.focus();return false}}return true}function isEmail(a){if(a.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1){return true}return false}var Destabpm=Class.create({initialize:function(a){this.element=$(a);if(!this.element){return}this.menu=$A(this.element.getElementsByTagName("a"));this.show(this.getInitTab());this.menu.each(this.setupTab.bind(this))},setupTab:function(a){Event.observe(a,"click",this.activate.bindAsEventListener(this))},activate:function(a){var b=Event.findElement(a,"a");Event.stop(a);this.show(b);this.menu.without(b).each(this.hide.bind(this))},hide:function(a){$(a).removeClassName("selected");$(this.tabID(a)).removeClassName("showTab")},show:function(b){var a=this.tabID(b);document.Payment.tabs.value=a;b.blur();$(b).addClassName("selected");$(a).addClassName("showTab")},tabID:function(a){return a.href.match(/#(\w.+)/)[1]},getInitTab:function(){if(document.location.href.match(/#(\w.+)/)){var a=RegExp.$1;var b=this.menu.find(function(c){return c.href.match(/#(\w.+)/)[1]==a});return b||this.menu.first()}else{return this.menu.first()}}});Event.observe(window,"load",function(){new Destabpm("tabpm")});function isPaymentDone(a){if(!a.totb.value){alert("Please choose one Shipping Methods!");return false}else{if(a.tabs.value=="CC"){if(!a.CNumber.value){alert("Credit card Number required!");a.CNumber.focus();return false}if(!a.CExpMonth.value){alert("Credit card Month required!");a.CExpMonth.focus();return false}if(!a.CExpYears.value){alert("Credit card Years required!");a.CExpYears.focus();return false}}}a.mode.disabled="disabled";return true}function sendform(a){switch(a){case"notfound":case"quoterequest":case"volumediscount":if(checkf(a)){document.forms[a].submit()}break;case"logto":if(checklogto()){document.forms.logto.submit()}break;case"forgotm":if(checadr()){document.forms.forgotm.submit()}break;default:return false}return true}function checkf(b){var d;for(var c=1;c<4;c++){d=document.forms[b].elements[c];if(!d.value){alert("You haven't filled in \""+d.name+'" !');return false}}if(cem(document.forms[b].elements[3].value)){return true}else{return false}}var vv="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";function checadr(){var a=document.forms.forgotm.elements[0];if(!cem(a.value)){return false}return true}function checklogto(){var d=document.forms.logto.elements[0];if(!cem(d.value)){return false}d=document.forms.logto.elements[1];var c=d.value;var b=1;if(c){for(var a=0;a<c.length;a++){if(vv.indexOf(c.charAt(a))==-1){b=0;break}}}if(!c||!b){alert("Your password is not valid!");return false}return true}var va="1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";var vb=/(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)|(@\-)|(-\.)/;var vc=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;function cem(g){var d=1;var c=-1;for(i=0;i<g.length;i++){if(va.indexOf(g.charAt(i))==-1){d=-1}}if((!g.match(vb))&&(g.match(vc))){c=1}if(g.length<6||d<0||c<0){alert("Your e-mail address: "+g+" is not valid!");return false}return true}var Chat=Class.create({initialize:function(d){this.elm=$(d);if(!this.elm){return}var b=new Element("a",{target:"_blank",onclick:"this.newWindow=window.open('http://livechat.boldchat.com/aid/7567926102590264081/bc.chat?cwdid=1652141698897330397&amp;wdid=1179094119070430670&amp;url='+escape(document.location.href),'Chat','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=300');this.newWindow.focus();this.newWindow.opener=window;return false;",href:"http://livechat.boldchat.com/aid/7567926102590264081/bc.chat?cwdid=1652141698897330397&amp;wdid=1179094119070430670"});var c=new Element("img",{alt:"Live chat",border:0,src:"https://cbi.boldchat.com/aid/7567926102590264081/bc.cbi?cbdid=2455636718262289987&amp;wdid=1179094119070430670"});b.insert(c);this.elm.insert(b)}});Event.observe(window,"load",function(){new Chat("chat")});var Bottom=Class.create({initialize:function(a){this.foot=$(a);if(!this.foot){return}this.foot.innerHTML='<p><a href="'+cv_gl.encodeURL("")+'">Home</a> | <a href="'+cv_gl.encodeURL("info/AboutUs.jsp")+'">About Us</a> | <a href="'+cv_gl.encodeURL("info/ContactUs.jsp")+'">Contact Us</a> | <a href="'+cv_gl.encodeURL("info/CustomerService.jsp")+'">Customer Service</a> | <a href="'+cv_gl.encodeURL("info/Resellers.jsp")+'">Resellers</a> | <a href="'+cv_gl.encodeURL("info/SiteMap.jsp")+'">Site Map</a> | <a href="'+cv_gl.encodeURL("info/Affiliate.jsp")+'">Affiliate Program</a> </p><div><div class="lft">All Rights Reserved (c) 1996 - 2009 Compuvest Corp.&trade; is operating the following sites:<a href="http://www.compuvest.com">www.compuvest.com</a> and <a href="http://www.compuvest.us">www.compuvest.us</a></div><div class="rgt">888.644.7017</div></div>'}});Event.observe(window,"load",function(){new Bottom("cvfoot")});var ItemsShow=Class.create({initialize:function(a){this.itemsdiv=$("item"+a);if(!this.itemsdiv){return}this.catsdiv=$("cat"+a);this.nav=$("navg"+a);this.ctnav="";this.pageName=this.itemsdiv.lang;this.pageBack=document.location.href;this.pageNo=0;this.catID=0;this.catName="";this.pages=0;this.loPrice=0;this.hiPrice=0;this.pref=new Array();this.sort=1;this.q="";this.search="";this.srchIn="";this.searchFill="Search within "+this.pageName;this.itemOnPage=15;this.needChangeCat=1;this.getItems()},getItems:function(){var a="";for(var b=0;b<this.pref.length;b++){if(this.pref[b]){a+="&p"+b+"="+this.pref[b]}}new Ajax.Request("getitems",{method:"post",parameters:"cp="+this.getCatPage()+"&cid="+this.catID+"&pg="+this.pageNo+"&q="+this.q+"&nc="+this.needChangeCat+"&sr="+this.sort+"&lp="+this.loPrice+"&hp="+this.hiPrice+a+"&iop="+this.itemOnPage+"&nh="+Math.random(),onComplete:function(c){this.doit(c)}.bind(this),onFailure:function(){alert("itemshow Error...")}})},doit:function(resp){if(!resp.responseText.length){alert('We have found 0 items that match:\n"'+this.search+'"');this.srchIn.value="";return}try{this.resp=eval("("+resp.responseText+")")}catch(err){alert("itemshow Error...");return}var div="",a;this.itemsdiv.innerHTML=div;if(this.needChangeCat){if(this.nav){this.nav.innerHTML="";this.ctnav=new Element("div",{id:"ctnav"});this.ctnav.appendChild(this.dot());this.ctnav.appendChild(new Element("a",{href:cv_gl.getURL()}).update("Home"));this.ctnav.appendChild(this.dot());this.ctnav.appendChild(new Element("a",{href:this.pageBack}).update(this.pageName));this.ctnav.appendChild(this.dot());if(this.q){this.ctnav.appendChild(new Element("a",{href:"#"}).update(this.search));a=new Element("a",{style:"color:red;",title:"Clean "+this.search,href:"#"}).update(" (x)");a.observe("click",function(ev){this.pageNo=0;this.sort=1;this.loPrice=this.hiPrice=0;this.q="";this.search="";this.needChangeCat=1;this.getItems()}.bind(this));this.ctnav.appendChild(a);this.ctnav.appendChild(this.dot())}if(this.catName){a=new Element("a",{href:"#"}).update(this.catName);this.ctnav.appendChild(a);a.observe("click",function(ev){this.pageNo=0;this.sort=1;this.loPrice=this.hiPrice=0;for(var i=0;i<this.pref.length;i++){if(this.pref[i]){this.pref[i]=null}}this.needChangeCat=1;this.getItems()}.bind(this));this.ctnav.appendChild(this.dot())}this.nav.appendChild(this.ctnav)}if(this.catsdiv){this.catsdiv.innerHTML="";if(this.resp.cts.length){div=this.doCats()}else{if(this.resp.prf.length){div=this.doPref()}}this.catsdiv.appendChild(div)}}if(!this.catID&&typeof ADV_ITEMS!="undefined"){new AdvertShow1(ADV_ITEMS,{cols:5,count:25},this.itemsdiv)}else{this.pages=parseInt((this.resp.cnt%this.itemOnPage==0)?this.resp.cnt/this.itemOnPage:this.resp.cnt/this.itemOnPage+1);this.itemsdiv.appendChild(this.doTop());this.itemsdiv.appendChild(this.doItems());this.itemsdiv.appendChild(this.doBot());this.itemsdiv.appendChild(this.doPager());new Tooltip($$("span.tltip"))}},dot:function(){return new Element("tt").update("&#8226;")},doCats:function(){var b=new Element("div",{id:"ctmenu"}),d,c,j,h,l,k,g=0;b.appendChild(new Element("div",{"class":"top"}));c=new Element("div",{id:"ctwm"});if(this.resp.cts){for(d=0;d<this.resp.cts.length;d++){j=this.resp.cts[d];if(g!=j.p){g=j.p;h=new Element("ul");l=new Element("li",{id:"gct"+d,"class":"gct"}).update(j.nmg+"<tt>("+this.countItem(j.p)+")</tt>");l.observe("click",function(a){var m=$(a.element().id+"0");m.getStyle("display")=="none"?m.setStyle("display:block;"):m.setStyle("display:none;")}.bind(this));h.appendChild(l);c.appendChild(h);h=new Element("ul",{id:"gct"+d+"0",style:"display:none;"});c.appendChild(h)}l=new Element("li").update("&raquo;");k=new Element("a",{id:j.id,href:"#"}).update(j.nm);k.observe("click",function(n){var m=n.element();this.catID=parseInt(m.id);this.catName=m.innerHTML;this.needChangeCat=1;this.pageNo=0;this.getItems()}.bind(this));l.appendChild(k);l.appendChild(new Element("tt").update("("+j.n+")"));h.appendChild(l)}if(d<50){var e=c.select("ul[id]");e.each(function(a){a.setStyle("display:block;")})}}b.appendChild(c);b.appendChild(new Element("div",{"class":"bot"}));return b},countItem:function(c){var b=0;for(var a=0;a<this.resp.cts.length;a++){if(c==this.resp.cts[a].p){b+=this.resp.cts[a].n}}return b},doPref:function(){var b=new Element("div",{id:"ctmenu"}),c,g,h,l,n,d,j,m;b.appendChild(new Element("div",{"class":"top"}));c=new Element("div",{id:"ctwm"});c.appendChild(new Element("div",{"class":"hd"}).update("Search by preference"));if(this.loPrice&&this.hiPrice){h=new Element("nobr").update("Price Range");m=new Element("a",{style:"color:red;",title:"Clean Price Range",href:"#"}).update(" (x)");h.appendChild(m);m.observe("click",function(a){this.needChangeCat=1;this.loPrice=this.hiPrice=0;this.getItems()}.bind(this));c.appendChild(h)}else{c.appendChild(new Element("nobr").update("Price Range"))}c.appendChild(this.makeForm());for(var k=0;k<this.resp.prf.length;k++){g=this.resp.prf[k];c.appendChild(new Element("hr",{style:"border:1px dotted silver;margin-top:2px;"}));c.appendChild(new Element("nobr").update(g.nm));l=new Element("ul");j="";g.pl.sort(this.filter);for(var e=0;e<g.pl.length;e++){h=g.pl[e];if(h.nm){n=new Element("li");if(this.pref[h.id]){n.appendChild(new Element("tt",{style:"color:red;"}).update("&raquo; "));n.appendChild(new Element("a",{href:"#",style:"color:gray;"}).update(h.nm));n.appendChild(new Element("tt").update("("+h.cn+")"));m=new Element("a",{id:h.id,style:"color:red;",title:"Clean "+h.nm,href:"#"}).update("(x)");m.observe("click",this.doRemove.bind(this));n.appendChild(m);this.ctnav.appendChild(new Element("a",{href:"#",style:"color:gray;"}).update(h.nm));m=new Element("a",{id:h.id,style:"color:red;",title:"Clean "+h.nm,href:"#"}).update(" (x)");m.observe("click",this.doRemove.bind(this));this.ctnav.appendChild(m);this.ctnav.appendChild(this.dot())}else{n.appendChild(new Element("tt").update("&raquo; "));m=new Element("a",{id:h.id,title:h.nm,href:"#"}).update(h.nm);m.observe("click",function(p){var o=p.element();this.pref[o.id]=o.title;this.pageNo=0;this.needChangeCat=1;this.getItems()}.bind(this));n.appendChild(m);n.appendChild(new Element("tt").update("("+h.cn+")"))}if(e==5){d=new Element("li",{id:"pb"+k,"class":"mh"}).update('<tt class="hd">&darr;</tt> More ...');d.observe("click",function(o){var a=o.element();$(a.id).setStyle("display:none;");$(a.id+"_h").setStyle("display:block;")}.bind(this));l.appendChild(d);c.appendChild(l);l=new Element("ul",{id:"pb"+k+"_h",style:"display:none;"});j=new Element("li",{id:"b"+k,"class":"mh"}).update('<tt class="hd">&uarr;</tt> Hide');j.observe("click",function(o){var a=o.element();$("p"+a.id+"_h").setStyle("display:none;");$("p"+a.id).setStyle("display:block;")}.bind(this))}l.appendChild(n)}}if(j){l.appendChild(j)}c.appendChild(l)}b.appendChild(c);b.appendChild(new Element("div",{"class":"bot"}));return b},doRemove:function(c){var b=c.element();this.needChangeCat=1;this.pref[b.id]=null;this.getItems()},makeForm:function(){var a=new Element("form");a.appendChild(new Element("tt").update(" $"));a.appendChild(new Element("input").writeAttribute({type:"text",value:this.loPrice}));a.appendChild(new Element("tt").update(" - $"));a.appendChild(new Element("input").writeAttribute({type:"text",value:this.hiPrice}));a.appendChild(new Element("input").writeAttribute({type:"submit",value:"Go"}));a.observe("submit",function(c){var d=c.element();c.stop();var b=d.select('input[type="text"]');this.loPrice=parseInt(b[0].value);this.hiPrice=parseInt(b[1].value);if(b.length>1&&this.loPrice&&this.hiPrice&&(this.hiPrice>this.loPrice)){this.needChangeCat=1;this.getItems()}else{alert("Price Range can't be zero or be empty.");b[0].focus();b[0].select()}}.bind(this));return a},doTop:function(){var h=new Element("div",{id:"ittop"});var c=new Element("table",{id:"iborder"});var d=new Element("tr");d.appendChild(new Element("td",{"class":"fl1"}).update(((this.pageNo*this.itemOnPage)+1)+" - "+(((this.pageNo+1)*this.itemOnPage)>=this.resp.cnt?this.resp.cnt:((this.pageNo+1)*this.itemOnPage))+" of "+this.resp.cnt+" results"));var g=new Element("td",{"class":"fl3"});this.srchIn=new Element("input",{value:this.search?this.search:this.searchFill});this.srchIn.observe("click",function(j){var k=j.element();k.value=""});this.srchIn.observe("keypress",function(k){var j=k.keyCode;if(j==Event.KEY_RETURN){this.searchSel()}}.bind(this));g.appendChild(this.srchIn);var e=new Element("button").update("Go");e.observe("click",function(j){if(this.srchIn.value!=this.searchFill){this.searchSel()}}.bind(this));g.appendChild(e);e=new Element("select");e.observe("change",function(k){var l=k.element();for(var j=0;j<l.length;j++){if(l[j].selected){this.sort=l[j].value;break}}this.needChangeCat=0;this.pageNo=0;this.getItems()}.bind(this));var b=new Element("option",{value:1}).update("Price: lowest first");if(this.sort==1){b.writeAttribute({selected:"selected"})}e.appendChild(b);b=new Element("option",{value:2}).update("Price: highest first");if(this.sort==2){b.writeAttribute({selected:"selected"})}e.appendChild(b);g.appendChild(e);e=new Element("select",{style:"width:45px;"});e.observe("change",function(k){var l=k.element();for(var j=0;j<l.length;j++){if(l[j].selected){this.itemOnPage=l[j].value;break}}this.needChangeCat=0;this.pageNo=0;this.getItems()}.bind(this));b=new Element("option",{value:15}).update("15");if(this.itemOnPage==15){b.writeAttribute({selected:"selected"})}e.appendChild(b);b=new Element("option",{value:25}).update("25");if(this.itemOnPage==25){b.writeAttribute({selected:"selected"})}e.appendChild(b);b=new Element("option",{value:50}).update("50");if(this.itemOnPage==50){b.writeAttribute({selected:"selected"})}e.appendChild(b);g.appendChild(e);d.appendChild(g);var a=new Element("tbody");a.appendChild(d);c.appendChild(a);h.appendChild(c);return h},searchSel:function(){this.q="";this.search=this.srchIn.value;var c=this.srchIn.value;c=c.replace(/hp/g,"hpp");if(c.length<3){alert("Must be more 3 letters.");return}c=c.replace(/[^a-zA-Z0-9\-\+\=\#\.]/g," ");c=c.replace(/([\-]+)|([\#]+)|([\.]+)/g,"");var b=c.split(" ");if(b.length){if(b.length==1){this.q=c+"*"}else{for(var a=0;a<b.length;a++){if(b[a].length<3||b[a].length>25){continue}this.q+=" +"+b[a]}}this.pageNo=0;this.needChangeCat=1;this.getItems()}},doItems:function(){var a=document.createElement("div"),n,g,l,c,o,k,h,m,j,e,b;a.id="accsum";this.sdiv=new Element("div",{"class":"idiv"});this.showImg=new Element("img");this.sdiv.appendChild(this.showImg);a.appendChild(this.sdiv);n=document.createElement("table");g=document.createElement("tbody");for(var d=0;d<this.resp.its.length;d++){o=this.resp.its[d];l=document.createElement("tr");c=document.createElement("td");c.id="cl1";k=new Element("div",{id:o.sku});k.observe("mouseover",this.show.bind(this));k.observe("mouseout",this.hide.bind(this));h=new Element("img").writeAttribute({src:SRT_IMG+o.sku+".jpg"});h.observe("error",function(p){Event.findElement(p,"div").hide()});k.appendChild(h);c.appendChild(k);l.appendChild(c);c=document.createElement("td");c.id="cl2";c.innerHTML="<a href='"+cv_gl.encodeURL("Desc.jsp")+"?iid="+o.id+"'>"+o.nm+"</a><div><dl><dd>&#187; SKU : "+o.sku+"</dd><dd>&#187; Condition : "+o.cnd+"</dd><dd>&#187; Stock : "+o.stk+"</dd></dl></div><div><dl><dd>&#187; Manufacturer : "+o.mfm+"</dd><dd>&#187; Manufacturer P/N : "+o.mfn+"</dd><dd>&#187; Package : "+o.pkg+"</dd></dl></div>";l.appendChild(c);c=document.createElement("td");c.id="cl3";m=new Element("table");j=new Element("tbody");e=new Element("tr");b=new Element("td",{"class":"drp",colspan:3}).update("<a onclick=\"$('dropricebox').toggle("+o.id+");\" href='javascript:;'>Drop Price Alert</a>");e.appendChild(b);j.appendChild(e);e=this.trTag(o,this.banner(o));j.appendChild(e);if(o.additem){e=this.trTag(o.additem[0],new Element("div"));j.appendChild(e)}m.appendChild(j);c.appendChild(m);l.appendChild(c);g.appendChild(l);if((d+1)!=this.resp.its.length){c=new Element("td",{colspan:3}).update(new Element("hr"));l=new Element("tr");l.appendChild(c);g.appendChild(l)}}n.appendChild(g);a.appendChild(n);return a},doBot:function(){var e=new Element("div",{id:"itbot"}),b,a,c,d;b=new Element("table",{id:"iborder",style:"line-height:18px"});a=new Element("tbody");c=new Element("tr");d=new Element("td",{"class":"fl1"}).update("Page: "+(this.pageNo+1)+" of "+this.pages);c.appendChild(d);d=new Element("td",{"class":"fl3",style:"font-size:9px;"}).update(this.resp.t);c.appendChild(d);a.appendChild(c);b.appendChild(a);e.appendChild(b);return e},doPager:function(){var h=new Element("span");if(this.pages!=1){var c=this.pageNo+1,g=1,a=this.pages,b=false,e;h.setStyle({style:"line-height:26px;"});if(this.pages-c>9){a=c+9;b=true}e=new Element("a",{id:0}).update("&laquo;&nbsp;");if(c!=1){e.writeAttribute({id:c-2,href:"#"});e.observe("click",this.goPage.bind(this))}h.appendChild(e);if(c>10){g=c-9;e=new Element("a",{id:0,href:"#"}).update("1 . . .");e.observe("click",this.goPage.bind(this));h.appendChild(e)}for(var d=g;d<=a;d++){e=new Element("a").update(" "+d+" ");if(d==c){e.writeAttribute({style:"font-size:18px;color:#800000;"})}else{e.writeAttribute({id:d-1,href:"#"});e.observe("click",this.goPage.bind(this))}h.appendChild(e)}if(b){e=new Element("a",{id:this.pages-1,href:"#"}).update(". . . "+this.pages);e.observe("click",this.goPage.bind(this));h.appendChild(e)}e=new Element("a",{id:0}).update("&nbsp;&raquo;");if(c!=this.pages){e.writeAttribute({id:c,href:"#"});e.observe("click",this.goPage.bind(this))}h.appendChild(e)}return h},goPage:function(a){var b=a.element();this.pageNo=parseInt(b.id);this.needChangeCat=0;this.getItems()},show:function(a){var e=Event.findElement(a,"div");Event.stop(a);e.setStyle("border:1px solid #db6626;");var b=e.getDimensions();var d=Event.pointerX(a)+b.width;var c=Event.pointerY(a);this.sdiv.setStyle({display:"block",top:c+"px",left:d+"px",border:"1px double gray"});this.showImg.writeAttribute({src:BIG_IMG+e.id+".jpg"})},hide:function(a){var b=Event.findElement(a,"div");Event.stop(a);b.setStyle("border:1px solid white;");this.sdiv.setStyle("display:none;");this.showImg.writeAttribute({src:"./img/it/wait.gif"})},trTag:function(a,d){var b=new Element("tr"),c=new Element("td");c.appendChild(d);b.appendChild(c);c=new Element("td",{"class":"pr"}).update("$"+a.price.toFixed(2));b.appendChild(c);c=new Element("td",{style:"width:90px;padding:0 0 3px 0;"});c.appendChild(new Element("a",{id:"addbk",href:cv_gl.encodeURL("Basket.jsp")+"?iidd="+a.id}).update("<div>Add to Cart</div>"));b.appendChild(c);return b},getCatPage:function(){if(document.location.href.match(/\bcp=\b(\d+)/)){return document.location.href.match(/\bcp=\b(\d+)/)[1]||1}return 1},banner:function(c){var a=new Element("span");if(c.additem){a.writeAttribute({id:"idspp","class":"tltip",style:"font-size:12px;"}).update("Special price <img src='./img/it/hlp.gif'/>")}else{if(c.bnr){a.setStyle("font-size:12px;font-weight:bold;color:teal;");var b="&nbsp;";if(c.bnr[0].sp){b="Special Price"}else{if(c.bnr[0].cl){b="Clearance"}else{if(c.bnr[0].bp){b="Best Price"}else{if(c.bnr[0].cs){b="Ships in: 2-5 Days"}}}}a.update(b)}}return a},filter:function(d,c){return d.nm<c.nm?-1:d.nm>c.nm?1:0}});Event.observe(window,"load",function(){new ItemsShow("show")});var AdvertShow1=Class.create({initialize:function(b,a,c){this.elm=$(c);if(!this.elm){return}if(!b){return}this.options=Object.extend({cols:5,count:10},a||{});this.show(b)},show:function(j){try{var l=this.options.cols;var h=this.options.count;var m,e,k,b,a,g,d;m=new Element("table");e=new Element("tbody");k=new Element("tr",{align:"center"});j.sort(function(){return 0.5-Math.random()}).each(function(o,n){if(h>n){b=new Element("td");a=new Element("div",{id:"blshow"});a.observe("click",function(){window.location.href=cv_gl.encodeURL("Desc.jsp")+"?iid="+o.iid});d=new Element("img").writeAttribute({src:NOR_IMG+o.accid+".jpg"});d.observe("error",function(){this.hide()});g=new Element("span").insert(d);a.appendChild(g);a.appendChild(new Element("p").update("$"+o.price.toFixed(2)));a.appendChild(new Element("div").update(o.name));b.appendChild(a);k.appendChild(b);if(((n+1)%l)==0){e.appendChild(k);k=new Element("tr",{align:"center"})}}});e.appendChild(k);m.appendChild(e);this.elm.insert(m)}catch(c){throw ("advertshow "+c.message)}}});