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 ADVERT="http://advert.compuvest.com/advert/";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+"/"}};Elements.implement({filterByTag:function(a){return this.filter(a)},filterByClass:function(a){return this.filter("."+a)},filterById:function(a){return this.filter("#"+a)},filterByAttribute:function(b,a,c){return this.filter("["+b+(a||"")+(c||"")+"]")}});function numberFormat(e){e=""+e.toFixed(2);var a=e.split(".");var d=a[0];var b=a.length>1?"."+a[1]:"";var c=/(\d+)(\d{3})/;while(c.test(d)){d=d.replace(c,"$1,$2")}return d+b}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 isInt(a){return(a%1)==0?a:0}function checkPassword(){var a=document.id("Customer");if(a.Password.value==a.vPassword.value){return}else{alert("Your passwords do not match");a.Password.value="";a.vPassword.value="";a.Password.focus();return}}function isCreditCard(j){var a=j.value.replace(/-/g,"").replace(/ /g,"");var g=parseInt(a,10);if(!g){return""}var e=0,b=1,c=a.length;for(var d=0;d<c;d++){var f=a.substring(c-d-1,c-d);var h=parseInt(f,10)*b;(h>=10)?e+=(h%10)+1:e+=h;(b==1)?b++:b--}if(a.length!=""&&(e%10)==0){return(a)}else{alert("Check yours card number: "+a);j.focus()}return""}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"&&!isInt(a.billingZip.value)){alert("Invalid Billing Zip.");a.billingZip.focus();return false}if(a.shippingCountry.value=="US"&&!isInt(a.shippingZip.value)){alert("Invalid Shipping Zip.");a.shippingZip.focus();return false}return true}function copyBillToShipp(){var a=document.id("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 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 isEmail(a){return a.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1?true:false}function isReady(a){if(!isEmail(a.Email.value)){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}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=document.id("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 f=0,c=0,g="";if(b){var e=b.split(".",2);f=parseInt(e[0].replace(/,/g,""))}if(f>0&&f<2147483647){for(var d=0;d<4;d++){c=f%1000;f=Math.floor(f/1000);if(c>0){g=sdt(c)+" "+qIs[d]+" "+g}}}c=parseInt(e[1],10);if(c<10&&e[1].length==1){c*=10}if(c>0){g+=" and "+c+" cents"}document.id("am").set("html","<i>"+g+"</i>")}function validPromo(){var b=document.id("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.id("Basket").submit()}else{alert("Promotion code empty.")}return true}function prestart(){var a=document.id("pref");if(!a){return}var c=a.getElements("div.al");if(!c){return}for(var b=0;b<c.length;b++){fcl(c[b].getParent().get("id"))}}function fcl(d){var b=document.id(d);if(!b){return}var c=b.getPrevious("a").getFirst("img");if(b.style.display=="block"){b.setStyle("display","none");c.set("src","./img/it/pls.png")}else{var e=b.getElements("a");if(e.length>12){b.setStyles({height:"200px",overflow:"auto","border-top":"1px solid #BFB8BF","border-bottom":"1px solid #BFB8BF"})}else{b.setStyles({height:"auto","border-top":0,"border-bottom":0})}b.setStyles({width:"100%",display:"block"});c.set("src","./img/it/mns.png")}b=c=e=null}function hideErr(b){b.style.visibility="hidden"}function setSign(){var b=document.id("Payment");var c=document.id("sgnout");if(b.sgnch.checked){c.set("html",'Signature: <input name="sgn1" value="$2.00" size="10" readonly/>')}else{c.empty()}b.spb.value="";b.desb.value="";b.totb.value="";c=document.id("desview");c.empty();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}}}function isPaymentDone(d){var b=document.id("cvTabs");if(!b){alert("Not find tabs")}var c=b.getElements("a.tab");var a=c.filterByClass("active").get("href");document.id("payMethod").set("value",a);if(!d.totb.value){alert("Please choose one Shipping Methods!");return false}else{if(a=="CC"){if(!d.CNumber.value){alert("Credit card Number required!");d.CNumber.focus();return false}if(!d.CExpMonth.value){alert("Credit card Month required!");d.CExpMonth.focus();return false}if(!d.CExpYears.value){alert("Credit card Years required!");d.CExpYears.focus();return false}}}d.mode.disabled="disabled";return true}var setGroundShipping=new Class({Implements:Options,options:{data:[]},initialize:function(b){this.setOptions(b);if(!this.options.data.length){return}var a=this.options.data[0];if(a){document.id(a.shmd).set("checked",true);document.id("taxb").set("value","$"+a.tax.toFixed(2));document.id("desb").set("value",a.shdesc);document.id("desview").set("text",a.shdesc+" : ");document.id("spb").set("value","$"+a.shprc.toFixed(2));document.id("scdb").set("value",a.shmd);document.id("totb").set("value","$"+a.total.toFixed(2))}}});function reset(){return false}function sendform(b){var a=true;switch(b){case"notfound":case"quoterequest":case"volumediscount":if(checkf(b)){document.forms[b].submit()}break;case"logto":if(checklogto()){document.forms.logto.submit()}break;case"forgotm":if(checadr()){document.forms.forgotm.submit()}break;default:a=false}return a}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}}return cem(document.forms[b].elements[3].value)}function checadr(){var a=document.forms.forgotm.elements[0];if(!cem(a.value)){return false}return true}var vv="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";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}function cem(a){if(!isEmail(a)){alert("Please enter a valid email address.");return false}return true}var ItemsShow=new Class({initialize:function(c,a,b){this.itemsdiv=document.id(c);if(!this.itemsdiv){return}this.needChangeCat=1;this.catsdiv=document.id("catshow");this.catID=0;this.catName="";this.loPrice=0;this.hiPrice=0;this.pref=new Array();this.nav=document.id("navgshow");this.ctnav="";this.firstPage=b;this.pageName=a;this.pageBack=document.location.href;this.items={};this.pageNo=0;this.itemOnPage=15;this.sort=1;this.getItems()},getItems:function(){var pref="";for(var i=0;i<this.pref.length;i++){if(this.pref[i]){pref+="&p"+i+"="+this.pref[i]}}new Request({url:"getitems",onRequest:function(){this.itemsdiv.empty();this.itemsdiv.setStyle("text-align","center");this.itemsdiv.adopt(new Element("img",{src:"./img/it/wait.gif"}))}.bind(this),onSuccess:function(items){if(!items.length){alert("We have found 0 items that match");return}try{this.items=eval("("+items+")")}catch(err){alert("itemshow Error...");return}this.doIt()}.bind(this),onFailure:function(err){alert("Error... "+err)}}).send("cp="+this.getCatPage()+"&pg="+this.pageNo+"&iop="+this.itemOnPage+"&sr="+this.sort+"&cid="+this.catID+"&nc="+this.needChangeCat+"&lp="+this.loPrice+"&hp="+this.hiPrice+pref+"&nh="+Math.random())},doIt:function(){if(this.needChangeCat){if(this.nav){this.nav.empty();this.ctnav=new Element("div",{id:"ctnav"});this.ctnav.adopt(new Element("tt",{html:"&#8226;"}));this.ctnav.adopt(new Element("a",{href:cv_gl.getURL(),html:"Home"}));this.ctnav.adopt(new Element("tt",{html:"&#8226;"}));this.ctnav.adopt(new Element("a",{href:this.pageBack,html:this.pageName}));this.ctnav.adopt(new Element("tt",{html:"&#8226;"}));if(this.catName){var b=new Element("a",{href:"#",html:this.catName,events:{click:function(){this.pageNo=0;this.sort=1;this.loPrice=this.hiPrice=0;for(var a=0;a<this.pref.length;a++){if(this.pref[a]){this.pref[a]=null}}this.needChangeCat=1;this.getItems()}.bind(this)}});this.ctnav.adopt(b);this.ctnav.adopt(new Element("tt",{html:"&#8226;"}))}this.nav.adopt(this.ctnav)}if(this.catsdiv){this.catsdiv.empty();if(this.items.cts.length){this.catsdiv.adopt(this.doCats())}else{if(this.items.prf.length){this.catsdiv.adopt(this.doPref())}}}}this.itemsdiv.empty();this.pages=parseInt((this.items.cnt%this.itemOnPage==0)?this.items.cnt/this.itemOnPage:this.items.cnt/this.itemOnPage+1);this.itemsdiv.adopt(this.doTop());this.itemsdiv.adopt(new Items(this.items));this.itemsdiv.adopt(this.doBot());this.itemsdiv.adopt(this.doPager());new Tipz("img.tipzb");new DialogBox("a.drpab")},doTop:function(){var e=(this.pageNo+1)*this.itemOnPage;var d=new Element("div",{id:"ittop"});var a=new Element("tbody");var b=new Element("tr");new Element("td",{"class":"fl1",html:((this.pageNo*this.itemOnPage)+1)+" - "+e>=this.items.cnt?this.items.cnt:e+" of "+this.items.cnt+" results"}).inject(b);var c=new Element("td",{"class":"fl3"});new Element("select",{events:{change:function(f){f.stop();this.sort=parseInt(f.target.value);this.needChangeCat=0;this.pageNo=0;this.getItems()}.bind(this)},html:'<option value="1"'+(this.sort==1?"selected=selected":"")+'>Price: lowest first</option><option value="2"'+(this.sort==2?"selected=selected":"")+">Price: highest first</option>"}).inject(c);new Element("select",{style:"width:45px;",events:{change:function(f){f.stop();this.itemOnPage=parseInt(f.target.value);this.needChangeCat=0;this.pageNo=0;this.getItems()}.bind(this)},html:'<option value="15"'+(this.itemOnPage==15?" selected=selected":"")+'>15</option><option value="25"'+(this.itemOnPage==25?" selected=selected":"")+'>25</option><option value="50"'+(this.itemOnPage==50?" selected=selected":"")+">50</option>"}).inject(c);d.adopt(new Element("table",{id:"iborder"}).adopt(a.adopt(b.adopt(c))));return d},doBot:function(){return new Element("div",{id:"itbot",html:'<table id="iborder" style="line-height:18px"><tbody><tr><td class="fl1">Page: '+(this.pageNo+1)+" of "+this.pages+'</td><td class="fl3" style="font-size:9px;">'+this.items.t+"</td></tr></tbody></table>"})},doPager:function(){var g=new Element("span",{style:"line-height:26px;"});if(this.pages!=1){var c=this.pageNo+1,f=1,a=this.pages,b=false,e;if(this.pages-c>9){a=c+9;b=true}e=new Element("a",{id:0,html:"&laquo;&nbsp;"});if(c!=1){e.set({id:c-2,href:"#",events:{click:this.goPage.bindWithEvent(this)}})}g.adopt(e);if(c>10){f=c-9;new Element("a",{id:0,href:"#",html:"1 . . .",events:{click:this.goPage.bindWithEvent(this)}}).inject(g)}for(var d=f;d<=a;d++){e=new Element("a",{html:" "+d+" "});if(d==c){e.set("style","font-size:18px;color:#800000;")}else{e.set({id:d-1,href:"#",events:{click:this.goPage.bindWithEvent(this)}})}g.adopt(e)}if(b){new Element("a",{id:this.pages-1,href:"#",html:". . . "+this.pages,events:{click:this.goPage.bindWithEvent(this)}}).inject(g)}e=new Element("a",{id:0,html:"&nbsp;&raquo;"});if(c!=this.pages){e.set({id:c,href:"#",events:{click:this.goPage.bindWithEvent(this)}})}g.adopt(e)}return g},goPage:function(a){a.stop();this.pageNo=parseInt(a.target.id);this.needChangeCat=0;this.getItems()},doCats:function(){var j=new Element("div",{id:"ctmenu"}),g,c,d;j.adopt(new Element("div",{"class":"top"}));var f=new Element("div",{id:"ctwm"});var h;for(var e=0;e<this.items.cts.length;e++){var b=this.items.cts[e];if(h!=b.p){h=b.p;g=new Element("ul");c=new Element("li",{id:"gct"+e,"class":"gct",html:b.nmg+"<tt>("+this.countItem(b.p)+")</tt>",events:{click:function(){var a=document.id(this.id+"0");a.setStyle("display",a.getStyle("display")=="none"?"":"none")}}});g.adopt(c);f.adopt(g);g=new Element("ul",{id:"gct"+e+"0",style:"display:none"});f.adopt(g)}c=new Element("li",{html:"&raquo;"});d=new Element("a",{id:b.id,href:"#",html:b.nm,events:{click:function(a){this.catID=parseInt(a.target.id);this.catName=a.target.innerHTML;this.needChangeCat=1;this.pageNo=0;this.getItems()}.bind(this)}});c.adopt(d);c.adopt(new Element("tt",{html:"("+b.n+")"}));g.adopt(c)}if(e<50){f.getElements("ul[id]").setStyle("display","block")}j.adopt(f);j.adopt(new Element("div",{"class":"bot"}));return j},countItem:function(b){var a=0;this.items.cts.each(function(c){if(b==c.p){a+=c.n}});return a},doPref:function(){var a=new Element("div",{id:"ctmenu"}),f,e,i,j,g,c;a.adopt(new Element("div",{"class":"top"}));var b=new Element("div",{id:"ctwm"});b.adopt(new Element("div",{"class":"hd",html:"Search by preference"}));if(this.loPrice&&this.hiPrice){f=new Element("nobr",{html:"Price Range"});new Element("a",{style:"color:red;",title:"Clean Price Range",href:"#",html:" (x)",events:{click:function(){this.needChangeCat=1;this.loPrice=this.hiPrice=0;this.getItems()}.bind(this)}}).inject(f);b.adopt(f)}else{b.adopt(new Element("nobr",{html:"Price Range"}))}b.adopt(this.makeForm());for(var h=0;h<this.items.prf.length;h++){e=this.items.prf[h];b.adopt(new Element("hr",{style:"border:1px dotted silver;margin-top:2px;"}),new Element("nobr",{html:e.nm}));i=new Element("ul");g="";e.pl.sort(this.filter);for(var d=0;d<e.pl.length;d++){f=e.pl[d];if(f.nm){j=new Element("li");if(this.pref[f.id]){j.adopt(new Element("tt",{style:"color:red;",html:'&raquo; <a href="#" style="color:gray;">'+f.nm+"</a><tt>("+f.cn+")</tt>"}));new Element("a",{id:f.id,style:"color:red;",title:"Clean "+f.nm,href:"#",html:"(x)",events:{click:this.doRemove.bindWithEvent(this)}}).inject(j);this.ctnav.adopt(new Element("a",{href:"#",style:"color:gray;",html:f.nm}));new Element("a",{id:f.id,style:"color:red;",title:"Clean "+f.nm,href:"#",html:" (x)",events:{click:this.doRemove.bindWithEvent(this)}}).inject(this.ctnav);this.ctnav.adopt(new Element("tt",{html:"&#8226;"}))}else{j.adopt(new Element("tt",{html:"&raquo; "}));new Element("a",{id:f.id,title:f.nm,href:"#",html:f.nm,events:{click:function(l){l.stop();var k=l.target;this.pref[k.id]=k.title;this.pageNo=0;this.needChangeCat=1;this.getItems()}.bind(this)}}).inject(j);j.adopt(new Element("tt",{html:"("+f.cn+")"}))}if(d==5){c=new Element("li",{id:"pb"+h,"class":"mh",html:'<tt class="hd">&darr;</tt> More ...',events:{click:function(l){l.stop();var k=l.target;var m=document.getElementById(k.id);m.setStyle("display","none");m=document.getElementById(k.id+"_h");m.setStyle("display","block")}}});i.adopt(c);b.adopt(i);i=new Element("ul",{id:"pb"+h+"_h",style:"display:none;"});g=new Element("li",{id:"b"+h,"class":"mh",html:'<tt class="hd">&uarr;</tt> Hide',events:{click:function(l){l.stop();var k=l.target;var m=document.getElementById("p"+k.id+"_h");m.setStyle("display","none");m=document.getElementById("p"+k.id);m.setStyle("display","block")}.bind(this)}})}i.adopt(j)}}if(g){i.adopt(g)}b.adopt(i)}a.adopt(b);a.adopt(new Element("div",{"class":"bot"}));return a},doRemove:function(c){c.stop();var b=c.target;this.pref[b.id]=null;this.needChangeCat=1;this.getItems()},makeForm:function(){var a=new Element("form",{html:'<tt> $</tt><input type="text" value="'+this.loPrice+'"/><tt> - $</tt><input type="text" value="'+this.hiPrice+'"/><input type="submit" value="Go"/>',events:{submit:function(c){c.stop();var b=c.target.getElements('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},getCatPage:function(){var a=document.location.href.match(/\bcp=\b(\d+)/);if(a){a=a[1]||1}return a},filter:function(d,c){return d.nm<c.nm?-1:d.nm>c.nm?1:0}});var dropmessg={before:{text:"<p>Dear CompuVest Customer!</p><br/><p>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:"<br/><p>Dear Customer!</p><br/><p>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).</p><p>Please feel free to contact us if any questions.</p><br/>"}};var DialogBox=new Class({initialize:function(a){this.tags=$$(a);if(!this.tags.length){return}this.body="";this.width=500;this.box=document.id("dropricebox");if(!this.box){this.dropBox()}this.overlay=document.id("overlay");if(!this.overlay){this.tagOverlay()}this.overlay.addEvent("click",this.hide.bind(this));for(var b=0;b<this.tags.length;b++){this.tags[b].addEvent("click",this.show.bind(this,[this.tags[b].id]))}this.fade=new Fx.Morph(this.overlay,"opacity").set(0)},dropBox:function(){this.box=new Element("div",{id:"dropricebox",style:"opacity:0;visibility:hidden;width:"+this.width+"px;"}).inject(document.body,"top")},tagOverlay:function(){this.overlay=new Element("div",{id:"overlay",style:"opacity:0;visibility:hidden;"}).inject(document.body,"top")},show:function(iid){document.addEvent("keydown",function(ev){if(ev.key=="esc"&&this.box.getStyle("visibility")=="visible"){this.hide()}}.bind(this));new Request({url:"droprice",onSuccess:function(item){this.doForm(eval("("+item+")"))}.bind(this),onFailure:function(err){alert("Error... "+err)}}).send("iid="+iid+"&act=it")},doForm:function(c){this.box.empty();var d=new Element("div",{id:"drophead"});new Element("div",{text:"Price Drop Alerts"}).inject(d);new Element("span",{title:"Close",text:"x",events:{click:this.hide.bind(this)}}).inject(d);this.box.adopt(d);this.body=new Element("div",{id:"retdrop",html:dropmessg.before.text});var b=new Element("tbody").adopt(new Element("tr").adopt(new Element("th",{width:"27%",html:"Product Code:"}),new Element("td",{width:"73%",text:c.sku})),new Element("tr").adopt(new Element("th",{text:"Product Name:"}),new Element("td",{text:c.name})),new Element("tr").adopt(new Element("th",{text:"Price:",style:"color:red;"}),new Element("td",{text:"$"+numberFormat(c.price)})),new Element("tr").adopt(new Element("th",{text:"Notify me if:",style:"color:green;"}),new Element("td",{text:"Price changes"})),new Element("tr").adopt(new Element("th",{text:"Email:"}),new Element("td",{html:'<input type="text" size="40" maxLength="128" name="email" value=""/>'})),new Element("tr").adopt(new Element("th",{text:"Name:"}),new Element("td",{html:'<input type="text" size="40" maxLength="40" name="name" value=""/>'})),new Element("tr").adopt(new Element("th",{text:"Phone:"}),new Element("td",{html:'<input type="text" size="40" maxLength="40" name="phone" value=""/>'})),new Element("tr").adopt(new Element("td",{colspan:2,text:"If you wish to be notified by phone, please enter you phone number."})));var a=new Element("input",{type:"submit",value:"Send",events:{click:this.send.bind(this,[c.id])}});b.adopt(new Element("tr",{align:"center"}).adopt(new Element("td",{colspan:2}).adopt(a)));this.body.adopt(new Element("table",{id:"drp_al"}).adopt(b));this.box.adopt(this.body);this.box.setPosition({x:(window.getSize().x/2)-(this.width/2),y:window.getScroll().y+window.getSize().y/4});this.fade.start({opacity:[0,0.7],visibility:"visible"});this.box.fade("in")},hide:function(){this.box.fade("out");this.fade.start({opacity:[0,0.7],visibility:"hidden"})},send:function(d){var e="";var b=false;var c=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;var a=this.box.getElements('input[type="text"]');a.each(function(f){if(f.name=="email"){b=c.test(f.value)}e+="&"+f.name+"="+f.value});if(b){new Request({url:"droprice",onRequest:function(){this.body.empty();this.body.setStyle("text-align","center");this.body.adopt(new Element("img",{src:"./img/it/wait.gif"}))}.bind(this),onSuccess:function(){this.sendEmail()}.bind(this),onFailure:function(f){alert("Error... "+f)}}).send("act=sd&iid="+d+e)}else{alert("Please enter a valid email address.")}},sendEmail:function(){this.body.empty();this.body.set({html:dropmessg.after.text,style:"text-align:left"})}});window.addEvent("domready",function(){new DialogBox("a.drpa")});var AdvertShow=new Class({Implements:Options,options:{id:"advshow",data:[],cols:5,count:10},initialize:function(a){this.setOptions(a);this.id=document.id(this.options.id);if(!this.id){return}this.show(this.options.data)},show:function(a){var b=new Element("tbody"),c=new Element("tr",{align:"center"});a.sort(function(){return 0.5-Math.random()}).each(function(e,d){if(this.options.count>d){c.adopt(new Element("td").adopt(new Element("div",{id:"blshow",events:{click:function(){window.location.href=cv_gl.encodeURL("Desc.jsp")+"?iid="+e.id}}}).adopt(new Element("span").adopt(new Element("img",{src:NOR_IMG+e.sku+".jpg",events:{error:function(){this.setStyle("display","none")}}})),new Element("p",{text:"$"+numberFormat(e.price)}),new Element("div",{text:e.name}))));if(!((d+1)%this.options.cols)){b.adopt(c);c=new Element("tr",{align:"center"})}}},this);this.id.adopt(new Element("table").adopt(b.adopt(c)))}});var Search=new Class({initialize:function(a){this.elm=document.id(a);if(!this.elm){return}this.args=[];this.searchParams();this.search=this.args.Search||"";this.ctitle=this.args.tl||"0";this.sfill="Search for";this.go()},go:function(){this.srchIn=new Element("input",{type:"text",name:"Search",value:this.search?this.search:this.sfill,events:{focus:function(){this.value=""},mouseenter:function(){this.setStyle("background-color","#ffffef")},mouseleave:function(){this.setStyle("background-color","#f3f3f3")},keyup:function(b){if(b.key=="enter"){this.butt.fireEvent("click",b)}}.bind(this)}});this.elm.adopt(this.srchIn);this.elm.adopt(new Element("tt",{text:" in "}));var a=new Element("select",{events:{change:this.onSelect.bindWithEvent(this)},html:'<option value="0"'+(this.ctitle=="0"?" selected=selected":"")+'>All Products</option><option value="1"'+(this.ctitle=="1"?" selected=selected":"")+">Advanced</option>"});this.elm.adopt(a);this.butt=new Element("button",{type:"submit",text:"Search",events:{click:this.onSubmit.bindWithEvent(this)}});this.elm.adopt(this.butt)},onSelect:function(a){a.stop();this.ctitle=a.target.value},onSubmit:function(a){a.stop();if(this.srchIn.value!=this.sfill){var b=this.srchIn.value.replace(/hp/g,"hpp");if(b.length<3){alert("Must be more 3 letters.");return}window.location.href=cv_gl.encodeURL("Search.jsp?Search="+escape(this.srchIn.value)+"&tl="+this.ctitle)}},searchParams:function(){var a=0,c,b=document.URL;if((a=b.indexOf("?"))>0){b=b.substring(a+1,b.length);b.split("&").each(function(d){c=d.indexOf("=");if(c!=-1){this.args[d.substring(0,c)]=unescape(d.substring(c+1))}},this)}}});window.addEvent("domready",function(){new Search("dsrch")});var Excel=new Class({initialize:function(a){this.elm=document.id(a);if(!this.elm){return}this.elm.adopt(new Element("img",{src:"../img/fp/excel.png",align:"top"}),new Element("select",{styles:{width:"120px",color:"#800000","margin-right":"9px"},events:{change:this.select.bindWithEvent(this)},html:'<option value="0">Download Now</option><option value="1">Special Pricing</option><option value="2">Inventory Just Arrived</option>'}))},select:function(a){switch(a.target.value){case"1":window.location.href=ADVERT+"excel/Wholesale Prices.xls";break;case"2":window.location.href=ADVERT+"excel/JustArrived.xls";break}}});window.addEvent("domready",function(){new Excel("dsrch")});var Slides=new Class({initialize:function(a){this.links=$$(a);if(!this.links){return}this.links.each(function(e){var f=e.getNext();if(f){var d=e.getFirst();var c=new Fx.Slide(f);e.addEvent("click",function(b){c.toggle();b.stop();d.set({html:c.open?"+":"-"})});c.hide()}})}});var Tipz=new Class({initialize:function(a){this.tips=$$(a);if(!this.tips){return}this.json="";this.wraptip=document.id("wrtip");if(!this.wraptip){this.tagTip()}this.tips.addEvents({mouseenter:this.show.bindWithEvent(this),mouseleave:this.hide.bind(this)})},tagTip:function(){this.wraptip=new Element("div",{id:"wrtip"}).inject(document.body,"top")},show:function(ev){var rel=this.wraptip.get("dir");if(!rel||rel!=ev.target.id){this.wraptip.empty();new Request({url:"../gettip",onSuccess:function(tip){try{this.json=eval("("+tip+")")}catch(err){alert("Error...");return}this.wraptip.set({styles:{width:this.json.wd,background:this.json.bg},dir:ev.target.id,html:this.json.txt})}.bind(this),onFailure:function(err){alert("Error... "+err)}}).send("id="+ev.target.id)}this.wraptip.setStyles({top:ev.page.y+18+"px",left:ev.page.x+"px",display:"block"})},hide:function(){this.wraptip.setStyle("display","none")}});window.addEvent("domready",function(){new Tipz("img.tipz, span.tipz, a.tipz")});var Bottom=new Class({initialize:function(a){this.foot=document.id(a);if(!this.foot){return}this.foot.set("html",'   <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/Returns.jsp")+'">Returns</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 - 2010 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>')}});window.addEvent("domready",function(){new Bottom("cvfoot")});var cvTabs=new Class({Implements:Options,options:{newtabs:[],loadingText:'Loading... <img src="./img/it/wait.gif"/>'},initialize:function(b,a){this.tbs=document.id(b);if(!this.tbs){return}this.setOptions(a);this.tabs=this.tbs.getElements("a.tab");this.panels=this.tbs.getElements("div.panel");if(this.options.newtabs){this.options.newtabs.each(function(c){this.addTab(c.id,c.name,c.text,c.ajax,c.etilid)},this)}this.tabs.filter(".tab")[0].addClass("active");this.panels.filter(".panel")[0].addClass("active");this.tabs.each(function(c){c.addEvents({click:this.setTab.bindWithEvent(this,[c.get("href")]),focus:function(){this.blur()}})},this)},setTab:function(ev,id){ev.stop();this.tabs.removeClass("active");this.tabs.filterByAttribute("href","=",id).addClass("active");this.panels.removeClass("active");var elm=this.panels.filterById(id).addClass("active");if(elm.retrieve("ajax")[0]=="on"&&elm.get("text")[0].indexOf("Loading...")>-1){new Request({url:"desctabs",onSuccess:function(items){if(!items.length){elm.set("html",'<h3 style="padding:10px 0;">We have found 0 items that match</h3>');return}items=eval("("+items+")");elm.set("text","");elm.adopt(new Items(items));new Tipz("img.tipzb");new DialogBox("a.drpab")}.bind(this),onFailure:function(err){alert("Error... (cvTabs) "+err)}}).send("etilid="+elm.retrieve("etilid")[0]+"&nc="+Math.random())}},addTab:function(h,b,f,e,a){var g=new Element("a",{"class":"tab",href:h,html:"<span>"+b+"</span>",events:{focus:function(){this.blur()}}});var d=new Element("li",{events:{click:this.setTab.bindWithEvent(this,[h])}}).adopt(g);this.tabs.include(g);this.tbs.getElement("ul").adopt(d);var c=new Element("div",{id:h,"class":"panel",html:e?this.options.loadingText:f});c.store("ajax",e);c.store("etilid",a);this.panels.include(c);this.tbs.getElement("div").adopt(c)}});var Warning=new Class({text:'<p style="color:red;">Warning!</p>     Computers and computer circuit boards, as well as other electronic equipment, contain lead, which is a chemical     known 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.',initialize:function(b){var a=new Element("div",{"class":"warning",html:this.text});a.inject(b,"after");new Fx.Slide(a).hide().slideIn()}});String.implement({stripHTMLTag:function(){return this.replace(/<&#91;^>&#93;*>/g,"")},xmlToHtml:function(){return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/\?/g,"").replace(/\u00A6/g,"<br/>")}});var Descr=new Class({nospecMessg:"No specifications available for this product at this time.",wait:"<img src='./img/it/wait.gif'>",initialize:function(b,a){this.tbs=document.id(b);if(!this.tbs){return}this.newtabs=[];this.tabid=this.tbs.getElement("a.tab").get("href");this.panel=this.tbs.getElement("#"+this.tabid);this.panel.set("text",this.wait);this.source=document.id(a);if(!this.source){this.panel.set("text",this.nospecMessg);return}this.doDescr();new Warning(this.tbs)},doDescr:function(){var b=this.source.getElements("#img li");var g=document.id("imgbox");if(b&&g){var h=this.getImg(b.filterById("1"));if(h.length==0){h=this.getImg(b.filterById("b"))}h+=this.getImg(b.filterById("2"));h+=this.getImg(b.filterById("3"));h+=this.getImg(b.filterById("4"));if(h.length>0){g.set("html",h)}}var e="<div class='dshead'>Marketing Information</div><div class='dsbody'>";b=this.source.getElement("#minfo");if(b){e+=b.get("text").xmlToHtml()}var d=this.source.getElement("#nameb");if(d){e+=d.get("text").xmlToHtml()}e+="</div><hr/>";b=this.source.getElements("#mspec li");if(b){var a="";b.each(function(j){var i=j.id;if(i!="Standard Warranty"){a+="<li><span>"+i+" : "+j.get("text").xmlToHtml()+"</span></li>"}},this);if(a){e+="<div class='dshead'>Main Features</div><div id='tagLI'>"+a+"</div><hr/>"}}this.panel.empty();this.panel.set("html",e);var f="";b=this.source.getElements("#espec ul");if(b){b.each(function(k){var j=k.id;if(j){if(j!="Warranty"&&j!="Software"){f+="<div class='dshead'>"+j+"</div><div id='tagLI'>";var i=k.getElements("li");i.each(function(l){var m=l.id;if(m!="Package Contents"){f+="<li><span>"+m+" : "+l.get("text").xmlToHtml()+"</span></li>"}});f+="</div><hr/>"}}})}if(f){this.newTab("tb02","Technical Specification",f)}var c="";b=this.source.getElement("#paccl");if(b){c=b.get("text");if(c){this.newTab("tb03","Options & Accessories","","on",c)}}b=this.source.getElement("#psiml");if(b){c=b.get("text");if(c){this.newTab("tb04","Similar Products","","on",c)}}},newTab:function(a,c,e,d,b){this.newtabs.include({id:a,name:c,text:e,ajax:d,etilid:b})},getNewTabs:function(){return this.newtabs},getImg:function(a){return(a.length>0)?'<span><img src="'+a.get("text")+'"/></span>':""}});var ImageGalery=new Class({options:{fxParam:{property:"left",duration:1000,transition:Fx.Transitions.Back.easeOut,wait:false},interval:5000,imgSize:300,thumSize:75},initialize:function(a){this.imgbuf=document.id(a);if(!this.imgbuf){return}this.box=this.imgbuf.getElement("#imgbox");this.images=this.box.getElements("img");this.makeThumbs();this.box.setStyle("width",this.options.imgSize*this.images.length+"px");this.currentIndex=null;this._play=null;this.wait=false;this.imgFx=new Fx.Tween(this.box,this.options.fxParam).set("0px");this.maskFx=new Fx.Tween(this.thumMask,this.options.fxParam).set("-298px");this.walk(0,true)},makeThumbs:function(){this.thumbs=new Element("div",{id:"thumbs"});this.thumMask=new Element("div",{id:"thumbs_mask",style:"left:-298px;",opacity:0.8});this.handles1=new Element("p",{id:"thumbs_handles"});var a="";this.images.each(function(d,c){a+='<div><img alt="" src="'+d.src+'"/></div>';this.handles1.adopt(new Element("span",{events:{mouseenter:this.walk.bind(this,[c,false])}}))},this);var b=new Element("div",{"class":"thumbs",html:a});this.thumbs.adopt(b,this.thumMask,this.handles1);this.thumbs.inject(this.imgbuf,"after")},next:function(a){this.walk((this.currentIndex<this.images.length-1?this.currentIndex+1:0),a)},play:function(){this._play=this["next"].periodical(this.options.interval,this,[false])},stop:function(){$clear(this._play)},walk:function(a,b){if(a!=this.currentIndex){this.currentIndex=a;this.imgFx.start(this.options.imgSize*-this.currentIndex);this.maskFx.start(this.currentIndex*75-298);if(b){this.play()}}}});var Items=new Class({initialize:function(g){this.bigimg=document.id("bigimg");if(!this.bigimg){this.bigimg=new Element("div",{id:"bigimg",style:"opacity:0;"}).inject(document.body,"top")}var a=new Element("div",{id:"accsum"}),j,h,b,f,e;var d=new Element("tbody");for(var c=0;c<g.its.length;c++){j=g.its[c];h=new Element("tr");b=new Element("td",{id:"cl1"});new Element("img",{alt:j.sku,src:SRT_IMG+j.sku+".jpg",events:{error:function(){this.setStyle("display","none")},mouseenter:this.show.bindWithEvent(this,[j.sku]),mouseleave:this.hide.bind(this)}}).inject(b);h.adopt(b);new Element("td",{id:"cl2",html:'        <a href="'+cv_gl.encodeURL("Desc.jsp")+"?iid="+j.id+'">'+j.nm+"</a>        <div><dl><dd>&#187; SKU : "+j.sku+"        </dd><dd>&#187; Condition : "+j.cnd+"        </dd><dd>&#187; Stock : "+j.qty+"        </dd></dl></div><div><dl><dd>&#187; Manufacturer : "+j.mnm+"        </dd><dd>&#187; Manufacturer P/N : "+j.mfr+"        </dd><dd>&#187; Package : "+j.pkg+"        </dd></dl></div>"}).inject(h);b=new Element("td",{id:"cl3"});f=new Element("tbody");e=new Element("tr");new Element("td",{"class":"drp",colspan:3,html:'<a id="'+j.id+'" class="drpab" href="javascript:;">Drop Price Alert</a>'}).inject(e);f.adopt(e);this.trTag(j,this.banner(j)).inject(f);if(j.it){this.trTag(j.it,"").inject(f)}b.adopt(new Element("table").adopt(f));h.adopt(b);d.adopt(h);if(c+1!=g.its.length){d.adopt(new Element("tr").adopt(new Element("td",{colspan:3}).adopt(new Element("hr"))))}}return a.adopt(new Element("table").adopt(d))},trTag:function(a,b){return new Element("tr").adopt(new Element("td").adopt(b),new Element("td",{"class":"pr",html:"$"+numberFormat(a.prc)}),new Element("td",{style:"width:90px;padding:0 0 3px 0;",html:'<a id="addbk" href="'+cv_gl.encodeURL("Basket.jsp")+"?iidd="+a.id+'"><div>Add to Cart</div></a>'}))},banner:function(c){var a=new Element("span",{style:"font-size:12px;color:teal;"});if(c.it){a.set({html:'Special price <img id="spp" class="tipzb" src="./img/it/hlp.gif"/>'})}else{if(c.bnr){var b="";if(c.bnr.sp){b="Special Price"}else{if(c.bnr.cl){b="Clearance"}else{if(c.bnr.bp){b="Best Price"}else{if(c.bnr.cs){b="Ships in: 2-5 Days"}}}}a.set({text:b})}}return a},show:function(a,b){a.stop();this.bigimg.setOpacity(1);this.bigimg.setStyles({top:a.page.y-100+"px",left:a.page.x+100+"px"});a.target.setOpacity(0.3);new Element("img",{src:BIG_IMG+b+".jpg"}).inject(this.bigimg)},hide:function(a){a.stop();a.target.setOpacity(1);this.bigimg.setOpacity(0).empty()}});var Chat=new Class({initialize:function(a){this.elm=document.id(a);if(!this.elm){return}this.elm.adopt(new Element("a",{href:"javascript:;",events:{click:function(b){b.stop();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=480,height=350");this.newWindow.focus();this.newWindow.opener=window;return false}}}).adopt(new Element("img",{alt:"Live chat",border:0,src:"https://cbi.boldchat.com/aid/7567926102590264081/bc.cbi?cbdid=2455636718262289987&amp;wdid=1179094119070430670"})))}});window.addEvent("domready",function(){new Chat("chat")});window.addEvent("domready",function(){document.getElements("a").addEvent("focus",function(){this.blur()})});