function closeCats() { var ctr,ptr,id; for (ctr = 0; ctr < diablo_items.length; ctr++) { ptr = diablo_items[ctr]; id = document.getElementById(ptr); id.className = "subnav"; // Close it } } function showSub (row) { var id,classname; id = document.getElementById(row); classname = id.className; if (Gettok(row,1,'_') == 'd2item') closeCats(); id.className = (classname == "subnav" ? "subnavshow" : "subnav"); } function showAcctNotes (uid) { subWindow("/admin/manage_users.php?action=viewnote&id=" + uid); } function checkSubmit () { var result = true,id; for (x = 0; x < chk.length; x++) { id = document.getElementById(chk[x]); if (id.value == '') result = false; } if (!result) { alert('Please fill in all required fields.'); return false; } return true; } function Gettok (string,token,C) { var ctr,tmp; token = token-1; // Fix for arrays tmp = string.split(C); for (ctr = 0; ctr <= tmp.length; ctr++) { if (ctr == token) return tmp[ctr]; } } function subWindow (url) { window.open(url,'subWindow','top=' + parseInt(screen.availHeight / 5) + ',left=400,toolbar=no,scrollbars=yes,status=no,height=400,width=500'); } function showItemInfo (id) { subWindow('/site/viewpic.php?id='+id); } function showFAQ (id) { subWindow('/admin/manage_faq.php?action=view&id='+id); } function showOrderHelp () { subWindow('/site/misc.php?misc=orderhelp'); } function showSearchHelp () { subWindow('/site/misc.php?misc=searchhelp'); } function showFeedbackSurveyResults (id) { subWindow('/feedback/?id='+id); } function showOnline () { subWindow('/site/misc.php?misc=online'); } function sitePreload () { var ctr,img,imgs,len,x; var pload = new Array(); window.status = 'Preloading site images started ...'; imgs = sitePreload.arguments; len = imgs.length; for (ctr = 0; ctr < len; ctr++) { x = ctr+1; img = sitePreload.arguments[ctr]; window.status = 'Preloading image: #'+x+' of '+len; pload[ctr] = new Image(); pload[ctr].src = img; window.status = 'Preloading of image: #'+x+' completed.'; } window.status = 'Preloaded all '+len+' images'; } function makeHomepage () { alert('Sorry, this is currently not working.'); } function bookmarkUs () { window.external.AddFavorite('http://www.d2supplies.com','D2supplies - Cheap Diablo 2 Items'); } function doPlugin (text) { var id; id = document.getElementById('item_note'); if (text == 0) // Captions return; else if (text == 1) // Clear id.value = ''; else // Plugins id.value = text; } function doToggleItemSelections () { var id,id2; id = document.getElementById('item_selections'); id2 = document.getElementById('item_selections_required'); id.style.display = id.style.display == 'none' ? '' : 'none'; //id2.checked = id.checked ? false : true; } function ToggleElement (what) { what = document.getElementById(what); what.style.display = (what.style.display == 'none' ? '' : 'none'); } function doSelectById (box,search) { var id,ctr,opts,sbox; sbox = document.getElementById(box); opts = sbox.options; for (ctr = 0; ctr < opts.length; ctr++) { id = opts[ctr]; if (id.value == search) id.selected = true; } } function doToggleTradeable () { var id,id2; id = document.getElementById('item_tradeable'); id2 = document.getElementById('is_tradeable'); id.style.display = id.style.display == 'none' ? '' : 'none'; } function doToggleElements () { var id; for (ctr = 0; ctr < doToggleElements.arguments.length; ctr++) { id = document.getElementById(doToggleElements.arguments[ctr]); id.style.display = id.style.display == 'none' ? '' : 'none'; } } function doCartRefund (oid,tid) { subWindow('/admin/manage_orders.php?action=refund&id=' + oid + '&tid=' + tid); } function doEbayRefund (oid,tid) { subWindow('/admin/manage_ebay.php?action=refund&id=' + oid + '&tid=' + tid); } function hiddenVariable (name) { subWindow('/admin/manage_variables.php?action=discover&name=' + name); } function ignoreCheck (type,id,pid) { subWindow('/admin/manage_users.php?action=ignore&type=' + type + '&id=' + id + '&pid=' + pid); } function confirmAction (items,realm,realm_count) { if (realm_count > 1) return true; var msg,choice; msg = "You are about to order " + items + " from the " + realm + " realm.\n\nAre you sure this is your selection? (we will NOT refund wrong realm orders anymore!)"; choice = confirm(msg); return choice; } function validateCoupon () { var id,val,tok1,tok2,key; key = 'd2sup'; id = document.getElementById('code'); val = id.value; if (val == "") { alert("Please enter a coupon code!"); return false; } tok1 = Gettok(val,1,'-'); tok2 = Gettok(val,2,'-'); if (tok1 != key) { alert("Sorry, but the coupon code: \""+val+"\" does not appear valid."); return false; } return true; } function showMule (type,id) { var msg,mule_login,mule_pass,mule_notes; mule_login = my_mules[id][0]; mule_pass = my_mules[id][1]; mule_notes = my_mules[id][2]; msg = "*** MULE INFO FOR " + type + " ORDER ID #" + id + " ***\n\n"; if ((mule_login == '') || (mule_login == 'd2sup') && (mule_pass == '')) msg = msg + "User requested in game delivery"; else msg = msg + "Account:" + mule_login + "\nPassword:" + mule_pass; if (mule_notes != "") msg = msg + "\n\nStaff Notes: " + mule_notes; msg = msg + "\n\n*** THANK YOU FOR YOUR BUSINESS ***"; alert(msg); } function showRememberMeInfo () { alert('This will keep you logged in when you return to the site. Only use it if no one else will be on your PC or be accessing our site otherwise they will have full access to your entire user account.\n\nYou can still logout of your account to remove this setting at a later date.'); } function xpGeolocation () { var msg = "Geolocatioin is technology which maps an IP to a certain city/region/country/zipcode.\n\nIt's purpose is to aid in fraud prevention by giving a lot of information about where the IP came from; however, it's only super accurate in certain fields.\n\nYou should only go by the country and possibly region(state) if you get a suspicious order. Due to the way certain large isps (aol, etc) route traffic and even dialup it's often hard to pinpoint the exact city strictly based on the IP.\n\nA run down on estimated accuracy is the following:\nCity = 70%\nRegon = 75%\nCountry & ISP = 95%\n\nUsing geolocation should only aid in *already* suspicious orders, not your only judgement. ISPs like AOL, for example, route ALL traffic through Virginia so geolocation will never work on their current network; AOL/MSN dialup are a few examples of inaccuracies in the system. However, with broadband users accuracy levels are marginally higher.\n\nCurrently there are roughly 22,000 cities from 220 different countries in the database."; alert(msg); } function checkBoxes () { var args,ctr,depth,id,prefix,z; args = checkBoxes.arguments.length; prefix = checkBoxes.arguments[0]; ctr = args > 2 ? checkBoxes.arguments[2] : 0; depth = ctr + checkBoxes.arguments[1]; type = args == 4 ? checkBoxes.arguments[3] : 'swap'; while (ctr <= depth) { z = prefix + ctr; id = document.getElementById(z); if (id == null) continue; if (type == 'swap') id.checked = id.checked ? false : true; else id.checked = type == 'up' ? true : false; ctr++; } } function checkBoxes2 (prefix,depth) { var id,z; for (ctr = 1; ctr <= depth; ctr++) { z = prefix + ctr; id = document.getElementById(z); if (id == null) continue; id.checked = id.checked ? false : true; } } function select2URL (prefix,id) { window.location = prefix + id; } function itemPicSelect (base_url) { var id,dir,url; id = document.getElementById('item_pic_dir'); dir = id.value; if (dir == 0) { alert('Please select a directory!'); return; } url = base_url + '?action=selectpic&dir=' + dir; subWindow(url); } function itemPicSet (dir,img) { var id,new_img; id = document.getElementById('pic_preview'); item_img = img; new_img = '/images/inventory/' + dir + '/' + img; id.src = new_img; } function itemPicDone () { self.opener.document.getElementById('item_pic').value = item_img; self.close(); } function CopyField (which) { hidemefromtdoplz.innerText = document.getElementById(which).value; Copied = hidemefromtdoplz.createTextRange(); Copied.execCommand("Copy"); alert('Field value copied!'); } function CopyAcct (which) { hidemefromtdoplz.innerText = document.getElementById(which).value; Copied = hidemefromtdoplz.createTextRange(); Copied.execCommand("Copy"); } function doInGameWhisper (which,name) { hidemefromtdoplz.innerText = "/w " + document.getElementById(which).value + " Hi, this is " + name + " from d2supplies with your order. Do you have a normal game up for delivery?"; Copied = hidemefromtdoplz.createTextRange(); Copied.execCommand("Copy"); if(name != 'Adam') alert('In Game Delivery whisper has been copied!'); } function xpStatus () { alert("PENDING = Order has been paid, but not filled by us yet\n\nCANCELLED = Order has been cancelled\n\nCOMPLETED = Order has been paid and delivered"); } function mO (object) { object.style.cursor = object.style.cursor == 'pointer' ? '' : 'pointer'; } var d2bucks = 0; var my_mules = new Array(); var item_img = '';