// ============================================ // // Merchant Solutions Quick Merchant Script vQM3.60 // Copyright Comtech Solutions, Salt Lake City, 1997-98 ALL RIGHTS RESERVED // This script code is available under agreement only to Registered // Comtech Solutions clients. // Set Debug to "true" to verify operation with your application. // Parameters: CSD=Description, CSI=Part Number, CSP=Price, // CSSH=Shipping/Handling, CST=Tax Override. // CSSHIPNAME=shipping name, CSSHIPADDR1=Shipping Addr1, CSSHIPADDR2=Shipping Addr2, CSSHIPCITY=Shipping Zip // CSSHIPSTATE=Shipping State, CSSHIPZIP=Shipping Zip // Common Action Settings: "View", "AddList", and ? NewSearch = unescape(window.location.search.substring(1,window.location.search.length)) NewSearch = NewSearch.toUpperCase(); RefID = "" k=NewSearch.indexOf("REFID=") if (k>=0){ j=NewSearch.indexOf("&",k+6) if (j>k){ RefID = "&RefID="+NewSearch.substring(k+6,j) } else { RefID = "&RefID="+NewSearch.substring(k+6,NewSearch.length) } CRefID = "REFID="+RefID+"; path=/;" document.cookie = CRefID } RefID = getCookieData("REFID") QMMsgID = "" QMMsgID = getCookieData("MSGID") var Debug=false; var GoSecure = true var CID; var uid=0; var Action="View" var Clear=""; var ClearAndwin=""; var Redirect=""; TStamp = new Date(); document.cookie = "QCOOKIE=True; path=/;" Pth = "https://secure2.ComtechSolutions.net" if( !GoSecure ) {Pth = "http://ComtechSolutions.net"} if( !(document.cookie.indexOf("QUNIQUE") >= 0) ) {document.cookie = "QUNIQUE="+(Math.floor(Math.random()*100000000)+ Math.floor(TStamp.getTime()))+"; path=/;"} function getCookieData(label) { var labelLen = label.length var cLen = document.cookie.length var i=0 while( i < cLen ) { var j = i + labelLen if( document.cookie.substring(i,j) == label ) { var cEnd = document.cookie.indexOf(";",j) if( cEnd == -1 ) { cEnd = document.cookie.length } return unescape(document.cookie.substring(j+1,cEnd)) } i++ } return "" } function ViewOrder() { // This function is optional. location = Pth + "/QMS/quick37.asp?CID="+CID+"&Action=View&Back=" +escape(window.location.href)+"&QUNIQUE="+getCookieData("QUNIQUE")+RefID+QMMsgID } function InitClient(NCID,NAction,NDebug) { CID = NCID; Action = NAction; Debug = NDebug; } function NewPath(ClientPath) { Pth = ClientPath } function QuickAddList(frm) { // This function is optional. (working sample - refundcents.com) // All elements of the form: "CSD=aaa;CSI=bbb;CSP=ccc;CSSH=ddd;CST=eee" // The only REQUIRED values are CSP and either CSD or CSI. All CS Names must start with xOCS= var ext=""; var ext=""; var count=0; for( i=0; i 0 ) { var Found = false if( obj.name.indexOf("OCS=") ) { Found = false; aValue = "" bValue = "" cValue = "" if( obj.name.charAt(0) == "s" ) { if( !obj.options[obj.selectedIndex].defaultSelected ) { Found=true; aValue = obj.options[obj.selectedIndex].value } } else if( obj.name.charAt(0) == "t" ) { if (obj.value != null && obj.value != ""){ Found=true; aValue = obj.value } } else if (obj.name.charAt(0) == "q" ) { if (obj.value != null && obj.value != ""){ Found=true; bValue = "CSQ=" + obj.value ; NumOpt = parseInt(frm.elements[i+1].name.charAt(1)); if (NumOpt>0) { for ( j=0; j 0 && document.cookie.substring("QCOOKIE") ) { var url = Pth + "/QMS/quick37.asp?CID=" + CID + Clear + ClearAndwin + Redirect + "&Action=" + Action; url += qmGetShipping(frm) if( Debug ) {url += "&Debug=True"} var newurl = url + "&v=QM3.00&TStamp=" + TStamp.getTime() + "&Back=" +escape(window.location.href)+"&QUNIQUE="+getCookieData("QUNIQUE")+RefID+QMMsgID+"&uid="+uid frm.action = newurl frm.submit() //location = newurl } else { alert("Your system does not support cookies so your item cannot be ordered online.") } } function addfield(frm,fieldname,fieldtype,fieldvalue){ var x=document.createElement("input"); x.name=fieldname; x.type=fieldtype; x.value=fieldvalue; frm.appendChild(x); } function QuickAdd(CSD,CSI,CSP,CSSH,CST,CSQ,CTRL) { // This function is optional. ext = "&CSI=" + escape(CSI) + "&CSD=" + escape(CSD) + "&CSP=" + escape(CSP) + "&CSSH=" + escape(CSSH) + "&CST=" + escape(CST) + "&CTRL=" + CTRL if( !isNaN(CSQ) ) { ext = ext + "&Q=" + CSQ} if( document.cookie.length > 0 && document.cookie.substring("QCOOKIE") ) { var url = Pth + "/QMS/quick37.asp?CID=" + CID + "&Action=" + Action + ext; if( Debug ) {url += "&Debug=True"} location = url + "&v=QM3.00&TStamp=" + TStamp.getTime() + "&Back=" +escape(window.location.href)+"&QUNIQUE="+getCookieData("QUNIQUE")+RefID+QMMsgID } else { alert("Your system does not support cookies so your item cannot be ordered online.") } } function QuickAddCL(clName,CSD,CSI,CSP,CSSH,CST,CSQ,CTRL) { // This function is optional. (Working sample - Demo) var x = clName.options[clName.selectedIndex].value.split(";") if( x.length >= 1 ) { CSD += x[0] } if( x.length >= 2 ) { CSI += x[1] } if( x.length >= 3 ) { CSP = x[2] } if( x.length >= 4 ) { CSSH = x[3] } if( x.length >= 5 ) { CST = x[4] } if( x.length >= 6 ) { CSQ = x[5] } QuickAdd(CSD,CSI,CSP,CSSH,CST,CSQ,CTRL) } function QuickAddQ(clName,CSQ,CSD,CSI,CSP,CSSH,CST,CTRL) { // Use this function if the page uses products that have a choice list of quantities // and only one product is ordered at a time. You must pass the NAME of the choice list // as the first parameter (i.e. document.fmData.clName - where fmData is the name of the form // and clName is the name of the choice list. if( !isNaN(clName.options[clName.selectedIndex].value) ) {CSQ=clName.options[clName.selectedIndex].value} QuickAdd(CSD,CSI,CSP,CSSH,CST,CSQ,CTRL) } function QMAdd(xCSD,xCSI,xCSP,xCSSH,xCST,xCSQ,xCTRL) { // CSQ=quantity, CSQD=default quantity, CSD=description, CSI=part number, CSP=price, CSSH=shipping and handling // any number of fields may follow. CSD = xCSD; CSI=xCSI; CSP=xCSP; CSSH=xCSSH; CST=xCST; CSQ=xCSQ; CTRL=xCTRL; for( i=7; i= 1 ) { CSD += x[0] } if( x.length >= 2 ) { CSI += x[1] } if( x.length >= 3 && x[2].length > 0 ) { CSP = x[2]; } if( x.length >= 4 && x[3].length > 0 ) { CSSH = x[3] } if( x.length >= 5 && x[4].length > 0 ) { CST = x[4] } if( x.length >= 6 && x[5].length > 0 ) { CSQ = x[5] } return(true) } function qmGetShipping(frm) { var shp = ""; if( frm.ShippingName != null ) shp += "&CSSHIPNAME="+escape(frm.ShippingName.value) if( frm.ShippingAttn != null ) shp += "&CSSHIPATTN="+escape(frm.ShippingAttn.value) if( frm.ShippingACode != null ) shp += "&CSSHIPACODE="+escape(frm.ShippingACode.value) if( frm.ShippingPhone != null ) shp += "&CSSHIPPHONE="+escape(frm.ShippingPhone.value) if( frm.ShippingEmail != null ) shp += "&CSSHIPEMAIL="+escape(frm.ShippingEmail.value) if( frm.ShippingAddr1 != null ) shp += "&CSSHIPADDR1="+escape(frm.ShippingAddr1.value) if( frm.ShippingAddr2 != null ) shp += "&CSSHIPADDR2="+escape(frm.ShippingAddr2.value) if( frm.ShippingCity != null ) shp += "&CSSHIPCITY="+escape(frm.ShippingCity.value) if( frm.ShippingState != null ) shp += "&CSSHIPSTATE="+escape(frm.ShippingState.value) if( frm.ShippingZip != null ) shp += "&CSSHIPZIP="+escape(frm.ShippingZip.value) //alert("shp="+shp) return(shp) } function ClearOrder() { Clear = "&Clr=1" } function ClearAndwinOrder(id) { ClearAndwin = "&AndwinID="+id } function BounceBack() { Redirect = "&Redirect=1" } function SetUID(x) { uid=x } var showWin; function show255(shid,ImageName){ if (showWin != null){ showWin.close() showWin = null } if (ImageName == null) { TheUrl = "/Pops/popshow.asp?Txt="+escape(shid)+"&Img=" showWin = window.open(TheUrl,"Show_Product","resizable=yes,scrollbars=no,HEIGHT=250,WIDTH=400") } else { TheUrl = "/Pops/popshow.asp?Txt="+escape(shid)+"&Img="+ImageName if( ImageName.length > 0 ) { showWin = window.open(TheUrl,"Show_Product","resizable=yes,scrollbars=no,HEIGHT=400,WIDTH=500") } else { showWin = window.open(TheUrl,"Show_Product","resizable=yes,scrollbars=no,HEIGHT=250,WIDTH=400") } } }