/**************************************** FUNCTION: fetchContent DESC: retrieves a page and inserts it in div ARGS: pg=url of file to request RETVAL: COMPATABILITY: EX: ****************************************/ function fetchContent(pg){ //use cnb_aml.js to grab content alert('Activating sub-space carrier wave to retrieve data:\n\nPage:'+pg); } /**************************************** FUNCTION: setCurrentContent(i) DESC: ARGS: i=id of current content, eg. 'Desktops', 'Notebooks', 'LCDs', 'Servers', 'Acccesories' RETVAL: COMPATABILITY: EX: ****************************************/ function setCurrentContent(i){ alert('ERROR: common.php:setCurrentContent: DEPRECATED\n\nRemove the call from the current page'); //alert('setCurrentContent:i:'+i); window.currentContent=i; setButton(i,'Active'); //var pgContent=sel('#pageContent')[0]; //if(pgContent.children.length>0){ //var PCChild=pgContent.children[0]; //var PCHT=PCChild.offsetTop+PCChild.offsetHeight; //alert(PCHT); //} //var colMid=sel('#colMid')[0]; //var colMidHT=colMid.offsetHeight; //alert('colMid.offsetHeight:'+colMid.offsetHeight); //var pgBdy=sel('#pg')[0]; //var pgBdyHT=pgBdy.offsetHeight; //alert('pgBdy.outerHTML:'+pgBdy.outerHTML); //if(colMidHT>pgBdyHT){ //var newHT=colMidHT+'px'; //pgBdy.style.height=newHT; //alert('ok...wtf'); //} //alert('pgBody.offsetHeight:'+pgBody.offsetHeight); } function callSales(e){ var pcode=""; var pname=""; var NumArgs=arguments.length; if(NumArgs>1){ pcode=arguments[1]; if(NumArgs>2){ pname=arguments[2]; } } var o=which(e); //alert('Give us a call at 1-905-501-0099'); salesBin(pcode,pname); } function toggleBin(i){ var binsel='#'+i; var o=sel(binsel); } function scrollTop(){ /* var d=DIV(); d.setAttribute("id","scrollDIV"); d.style.background="#f00"; d.style.height="100px"; d.style.width="100px"; d.style.position="fixed"; d.style.top="0"; d.style.left="-1px"; //d.style.visibility='hidden'; text(d,"scroll Bin"); document.body.appendChild(d); var o=sel('#scrollDIV')[0]; alert(o.outerHTML); var t=o.scrollTop; */ if(document.all){ var t=document.documentElement.scrollTop; }else{ var t=window.pageYOffset; } return t; } function salesBin(pcode,pname){ /* FIND WINDOW SCROLL POSITION */ //var hscroll=(document.all)?document.body.scrollLeft:window.pageXOffset; //var vscroll=(document.all)?document.body.scrollTop:window.pageYOffset; var tp=scrollTop(); tp+=80; //alert("scrollTop:"+tp); var newTop=tp+"px"; /* CONTAINER */ var bin=DIV(); //bin.id="ContactInfoDLG"; bin.setAttribute("id","ContactInfoDLG"); bin.style.background='#ffa'; bin.style.border='3px ridge #933'; bin.style.color='#000'; bin.style.font='normal 12pt arial'; bin.style.left='50%'; bin.style.margin='0 0 0 -300px'; bin.style.paddingBottom="21px"; bin.style.position='absolute'; bin.style.top=newTop; //'64px'; bin.style.width='600px'; bin.style.zIndex='99'; /* HDR DIV */ var hdr=DIV(); hdr.style.background="#933"; hdr.style.borderBottom="1px solid #000"; hdr.style.marginBottom="21px"; hdr.style.textAlign="center"; hdr.style.width="100%"; /* TITLE SPAN */ var dt=SPAN(); dt.style.font='bold 12pt arial'; dt.style.color='#fff'; dt.style.display='inline-block'; dt.style.height='27px'; dt.style.lineHeight='27px'; dt.style.textAlign='center'; dt.style.width="100%"; text(dt,'Contact Information'); hdr.appendChild(dt); /* CLOSE BTN */ var cb=SPAN(); cb.setAttribute("id","ContactInfoDLGClose"); cb.style.background="url('http://www.cnbcom.com/graphics/buttons/CloseWindow.png') 0 0 no-repeat"; cb.style.cursor="pointer"; cb.style.display='inline-block'; cb.style.height="21px"; cb.style.width="21px"; cb.style.left="100%"; cb.style.position="absolute"; cb.style.margin="0 0 0 -24px"; cb.style.top="3px"; cb.style.zIndex="99"; text(cb," "); hdr.appendChild(cb); bin.appendChild(hdr); /* BODY DIV */ var bdy=DIV(); var teleDIV=DIV(); teleDIV.style.height="36px"; teleDIV.style.lineHeight="36px"; /* TELETAG */ var teleTag=SPAN(); teleTag.style.paddingRight='5px'; teleTag.style.color='#44C'; teleTag.style.display='inline-block'; teleTag.style.font='normal 14pt arial'; teleTag.style.textAlign='left'; teleTag.style.textAlign='right'; teleTag.style.width="200px"; text(teleTag, "Telephone:"); teleDIV.appendChild(teleTag); /* TELEVAL */ var teleVal=SPAN(); teleVal.style.color='#000'; teleVal.style.font='bold 14pt arial'; text(teleVal, "1-905-501-0099"); teleDIV.appendChild(teleVal); bdy.appendChild(teleDIV); /* EMAIL DIV */ var emailDIV=DIV(); emailDIV.style.height="36px"; emailDIV.style.lineHeight="36px"; /* EMAIL TAG */ var emailTag=SPAN(); emailTag.style.paddingRight='5px'; emailTag.style.color='#44C'; emailTag.style.display='inline-block'; emailTag.style.font='normal 14pt arial'; emailTag.style.textAlign='right'; emailTag.style.width="200px"; text(emailTag, "E-mail:"); emailDIV.appendChild(emailTag); /* EMAIL LINK */ if(pcode!=""){ var subjectLine="Website Email Order: Product ("+pcode+") "+pname; var bodyLine="%0AProduct Code: "+pcode+"%0AProduct Name: "+pname; bodyLine+="%0AQuantity: "; }else{ var subjectLine="General Enquiry"; var bodyLine=""; } var emailLink=document.createElement('A'); var emailHREF="mailto:sales@cnbcomputers.com?subject="+subjectLine+"&body="+bodyLine; emailLink.setAttribute("HREF",emailHREF); emailLink.TITLE="Email CNB Computers Sales"; emailLink.style.color='#00f'; emailLink.style.font='bold 14pt arial'; emailLink.style.textAlign='right'; emailLink.style.textDecoration='underline'; emailLink.style.display="inline-block"; text(emailLink,"sales@cnbcomputers.com"); emailDIV.appendChild(emailLink); var emailIMG=document.createElement('A'); emailIMG.setAttribute("HREF",emailHREF); emailIMG.TITLE="Email CNB Computers Sales"; emailIMG.ALT="Email CNB Computers Sales at sales@cnbcomputers.com"; emailIMG.style.background="url('http://www.cnbcom.com/graphics/buttons/Email.png') 0 0 no-repeat"; emailIMG.style.border="none"; emailIMG.style.color='#000'; emailIMG.style.display="inline-block"; emailIMG.style.font='bold 14pt arial'; emailIMG.style.margin="0 0 0 11px"; emailIMG.style.textAlign='right'; emailIMG.style.textDecoration='none'; emailIMG.style.width="29px"; emailIMG.innerHTML=" "; //text(emailIMG,"hello"); emailDIV.appendChild(emailIMG); bdy.appendChild(emailDIV); if(pcode!=""){ var prodBin=DIV(); prodBin.style.width="578px"; prodBin.style.background="#7AF"; prodBin.style.border="1px solid #000"; prodBin.style.padding="5px"; prodBin.style.margin="3px"; /* PRODUCT DIV */ var pDIV=DIV(); pDIV.style.width="578px"; //pDIV.style.border="1px solid #007"; //pDIV.style.padding="5px"; pDIV.style.left="0"; pDIV.style.height="32px"; pDIV.style.lineHeight="32px"; /* Product Code */ var prodIDTag=SPAN(); //prodIDTag.style.background="#ff0"; prodIDTag.style.paddingRight='5px'; prodIDTag.style.color='#000'; prodIDTag.style.display='inline-block'; prodIDTag.style.font='normal 12pt arial'; prodIDTag.style.textAlign='right'; prodIDTag.style.width="120px"; text(prodIDTag, "Product ID:"); pDIV.appendChild(prodIDTag); var prodIDVal=SPAN(); //emailLink.setAttribute("HREF","mailto:sales@cnbcomputers.com?subject="+subjectLine+"&body="+bodyLine); //emailLink.TITLE="Email CNB Computers Sales"; prodIDVal.style.color='#000'; prodIDVal.style.font='bold 12pt arial'; prodIDVal.style.textAlign='left'; //emailLink.style.textDecoration='none'; //emailLink.style.display="inline-block"; text(prodIDVal,pcode); pDIV.appendChild(prodIDVal); prodBin.appendChild(pDIV); bdy.appendChild(prodBin); if(pname!=""){ /* PRODUCT NAME DIV */ var pnameDIV=DIV(); pnameDIV.style.width="578px"; //pnameDIV.style.border="1px solid #007"; pnameDIV.style.left="0"; pnameDIV.style.height="32px"; pnameDIV.style.lineHeight="32px"; /* Product Name */ var prodNameTag=SPAN(); prodNameTag.style.paddingRight='5px'; prodNameTag.style.color='#000'; prodNameTag.style.display='inline-block'; prodNameTag.style.font='normal 12pt arial'; prodNameTag.style.textAlign='right'; prodNameTag.style.width="120px"; text(prodNameTag, "Product Name:"); pnameDIV.appendChild(prodNameTag); var prodNameVal=SPAN(); //emailLink.setAttribute("HREF","mailto:sales@cnbcomputers.com?subject="+subjectLine+"&body="+bodyLine); //emailLink.TITLE="Email CNB Computers Sales"; prodNameVal.style.color='#000'; prodNameVal.style.font='bold 12pt arial'; prodNameVal.style.textAlign='left'; //emailLink.style.textDecoration='none'; //emailLink.style.display="inline-block"; text(prodNameVal,pname); pnameDIV.appendChild(prodNameVal); prodBin.appendChild(pnameDIV); bdy.appendChild(prodBin); } } bin.appendChild(bdy); document.body.appendChild(bin); bindEvent('#ContactInfoDLGClose','onclick',closeDLG); //bindEvent('#ContactInfoDLG','onclick',callit); } function closeDLG(e){ switch(typeof(e)){ case 'object':{ if(isEvent(e)){ var o=which(e); var dlg=o.parentNode.parentNode; }else{ var dlg=e; } break; } case 'string':{ var tmp=(left(e)=='#')?sel(e)[0]:sel('#'+e)[0]; var dlg=tmp; } } removeElement(dlg); } function orderByPhone(e,pcode,pname){ var o=which(e); var p=Parent(o); var msg="ProductCode: "+pcode; msg+="\nName: "+pname; }