var MoarResultsPointer = 0; // for continuous on-demand browsing var TheDesigner = 0; var TheCategory = ""; var DesignerSearchOpen = false; var AdvancedSearchOpen = false; var MoreinfoButtonLeft = true; var MoreinfoButtonRight = false; var GifteeSearchRandom = 0; var ProgressGIF = ''; function GoExternal(url) { var r = confirm("This link will take you outside Uther3D. Are you sure you would like to follow this link?"); if (r) { document.location = url; } } function DoSearch() { if (AdvancedSearchOpen) { DoAdvancedSearch(); } else { var lhref = ""; // step 1a, we on a designer page? if (TheDesigner != 0) { lhref += "&designer=" + TheDesigner; } // step 1b, we on a category page? if (TheCategory.length > 0) { lhref += "&category=" + TheCategory; } // step 2, check for text in id=SearchBar var d = document.getElementById("SearchBar").value; if (d.length > 0) { // first parameter var r = CleanTextInput(d, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"); //r=r.replace(" ",","); // replace spaces with commas document.getElementById("SearchBar").value = r; lhref += "&zSearchQuery=" + r; } location.href = "/?page=27" + lhref; } } function Show3DItem(mesh, item) { window.open('https://' + homeDomain + '/fRender64/?mt=' + mesh + ':' + item, 'Viewer3DPiece_' + mesh + '_' + item, 'height=411,width=611,resizable=no'); } function Hide3DItem() { //document.getElementById('CataloguePreviewItem').innerHTML=""; //document.getElementById('CataloguePreviewItem').style.display="none"; document.body.style.overflow = "auto"; // hide scrolling } function Show3DMesh(item) { window.open('https://' + homeDomain + '/fRender36/?mt=' + item, 'Viewer3DMesh_' + item, 'height=611,width=361,resizable=no'); } function DoAdvancedSearch() { // sets location.href with parameters based upon what we've got // used for linked/repeatable searches var lhref = ""; // step 1a, we on a designer page? if (TheDesigner != 0) { lhref += "&designer=" + TheDesigner; } // step 1b, we on a category page? if (TheCategory.length > 0) { lhref += "&category=" + TheCategory; } // step 2, check for text in id=SearchBar var d = document.getElementById("SearchBar").value; if (d.length > 0) { // first parameter var r = CleanTextInput(d, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"); document.getElementById("SearchBar").value = r; lhref += "&zSearchQuery=" + r; } // step 3, Avatar Type var zAvi = ""; if (document.getElementById('zLegacy').checked) { zAvi = '0'; } if (document.getElementById('zNewStyle').checked) { if (zAvi == '0') { zAvi = "0;2"; } else { zAvi = '2'; } } if (zAvi.length > 0) { lhref += "&zAviVersion=" + zAvi; } // step 4, Gender var zGender = ""; if (document.getElementById('zGenM').checked) { zGender = 'NM'; } if (document.getElementById('zGenF').checked) { if (zGender.length > 0) { zGender += ';NF'; } else { zGender = 'NF'; } } if (document.getElementById('zGenTM').checked) { if (zGender.length > 0) { zGender += ';TM'; } else { zGender = 'TM'; } } if (document.getElementById('zGenTF').checked) { if (zGender.length > 0) { zGender += ';TF'; } else { zGender = 'TF'; } } if (zGender.length > 0) { lhref += "&zGender=" + zGender; } // step 5, price var zPrice = ""; if (document.getElementById('PriceFree').checked) { zPrice = "free"; } if (document.getElementById('PriceRange').checked) { var PriceMin = document.getElementById('PriceMin').value; PriceMin = MakePrice(PriceMin); document.getElementById('PriceMin').value = PriceMin; var PriceMax = document.getElementById('PriceMax').value; PriceMax = MakePrice(PriceMax); document.getElementById('PriceMax').value = PriceMax; zPrice = PriceMin + ";" + PriceMax; } if (zPrice.length > 0) { lhref += "&zPrice=" + zPrice; } // ending step, set href and NAVIGATE! location.href = "/?page=27" + lhref; } function MakePrice(r) { r = CleanTextInput(r, "1234567890."); var newNum = new Number(r); r = newNum.toFixed(2); return r; } function CleanTextInput(v, filter) { // quick function to scan v for characters that exist in filter, and return string // also removed beginning and ending whitespace var rv = ""; // return value // beginning whitespace removal var inWS = true; for (var x = 0; x < v.length; x++) { if (v.charAt(x) == " ") { if (!inWS) { rv += v.charAt(x); } } else { inWS = false; rv += v.charAt(x); } } v = rv; rv = ""; // filter characters for (var x = 0; x < v.length; x++) { if (filter.indexOf(v.charAt(x)) != -1) { rv += v.charAt(x); } } return rv; } function DoGifteeSearch(v, i) { if (v.length < 3) { document.getElementById('giftsearcharea').innerHTML = ""; return; } GifteeSearchRandom = Math.floor(Math.random() * 1048576); // 1 to 2^20, for actual results document.getElementById('giftsearcharea').innerHTML = ProgressGIF; var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data a = r.split("|"); // pipe to split if (a[0] != GifteeSearchRandom) { return; } // not matches the current search, discard var d = document.getElementById("giftsearcharea").innerHTML = a[1]; } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_ajax.php?gifteesearch=" + v + "&gifteeitem=" + i + "&gifteesearchrand=" + GifteeSearchRandom, true); ahr.send(null); } function DoGiftShop(i) { var mid = document.getElementById('GifteeUVID').options[document.getElementById('GifteeUVID').selectedIndex].value; DoShop(i, 2, "gift:" + mid); } function FilterReason(e, i) { // filter incoming text if (window.event) { keynum = e.keyCode } else if (e.which) { keynum = e.which } if (keynum == 13) { DoReasonShop(i); return; } var allowed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 .,/?;:[]{}-_=+)(*^%$#@!~`'"; var theKey = String.fromCharCode(keynum) if (allowed.indexOf(theKey) == -1) { return false; } else { return true; } } function DoReasonShop(i) { var mid = document.getElementById('theReason').value; if (mid.length > 6) { // minimum length for a reason DoShop(i, 2, "report:" + mid); } else { DoShop(0, 0, 'report'); } } function DoShop(i, step, as) { if ((i == 0) || (step == 0)) { PreviewBottomArea(0); return; } // failsafe to cancel buy/grab process var ahr = getAjax(); PreviewBottomArea(1); // swap to new area ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data var d = document.getElementById("PreviewImageTextBottomStatus").innerHTML = r; } } }; // spinny thingy document.getElementById('PreviewImageTextBottomStatus').innerHTML = ProgressGIF; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_ajax.php?shop=" + i + "&shopstep=" + step + "&shopas=" + as, true); ahr.send(null); } function PreviewBottomArea(i) { if (i == 0) { document.getElementById('PreviewImageTextBottomRays').style.display = 'block'; document.getElementById('PreviewImageTextBottomStatus').style.display = 'none'; } if (i == 1) { document.getElementById('PreviewImageTextBottomRays').style.display = 'none'; document.getElementById('PreviewImageTextBottomStatus').style.display = 'block'; } } function MoreinfoButtonClick(i) { if (i == 0) { // left button click, or "Description" if (MoreinfoButtonLeft) { return; } MoreinfoButtonLeft = true; MoreinfoButtonRight = false; document.getElementById('PreviewImageTextLeftButton').className = 'PreviewImageTextMiddleButton2On'; document.getElementById('PreviewImageTextRightButton').className = 'PreviewImageTextMiddleButton2Off'; document.getElementById('PreviewImageTextMiddleTextAreaMI').style.display = 'none'; document.getElementById('PreviewImageTextMiddleTextArea').style.display = 'block'; } if (i == 1) { // right button click, or "More Info" if (MoreinfoButtonRight) { return; } MoreinfoButtonLeft = false; MoreinfoButtonRight = true; document.getElementById('PreviewImageTextLeftButton').className = 'PreviewImageTextMiddleButton2Off'; document.getElementById('PreviewImageTextRightButton').className = 'PreviewImageTextMiddleButton2On'; document.getElementById('PreviewImageTextMiddleTextArea').style.display = 'none'; document.getElementById('PreviewImageTextMiddleTextAreaMI').style.display = 'block'; } } function HideAllMainCategories(categoryindex) { for (var v = 66; v < 72; v++) { if (categoryindex.length > 0) { if (categoryindex != "A" + String.fromCharCode(v)) { document.getElementById("category_A" + String.fromCharCode(v)).style.display = "none"; } } else { document.getElementById("category_A" + String.fromCharCode(v)).style.display = "none"; } } } function ClickMainCategories(categoryindex) { HideAllMainCategories(categoryindex); var v = document.getElementById("category_" + categoryindex).style.display; if (v != "block") { document.getElementById("category_" + categoryindex).style.display = "block"; } else { document.getElementById("category_" + categoryindex).style.display = "none"; } } function SelectACategory(categoryindex) { if (TheDesigner == 0) { location.href = "https://" + homeDomain + "/?page=27&category=" + categoryindex; } else { location.href = "https://" + homeDomain + "/?page=27&designer=" + TheDesigner + "&category=" + categoryindex; } } function CloseCataloguePreview() { document.getElementById('CataloguePreviewCentered').style.display = 'none'; document.body.style.overflow = "auto"; // show scrolling } function LoadCatalogueEntry(id) { MoreinfoButtonLeft = true; MoreinfoButtonRight = false; var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data // id:height:width:margin-top:margin-left var d = document.getElementById("CataloguePreviewCentered"); d.style.height = "500px"; d.style.width = "750px"; d.style.marginTop = "-250px"; d.style.marginLeft = "-375px"; d.innerHTML = r; //MagicZoom.start(); } } }; // set innerhtml spinny-thingy var d = document.getElementById("CataloguePreviewCentered"); d.style.height = "20px"; d.style.width = "20px"; d.style.marginTop = "-10px"; d.style.marginLeft = "-10px"; d.innerHTML = ProgressGIF; d.style.display = "block"; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_ajax.php?LoadA=" + id, true); ahr.send(null); } function LoadPreviewImage(isrc) { document.getElementById('PreviewImageIMG').src = isrc; // get MagicZoom filename for bigguns var f = isrc.split("="); var n = f[1].split("&"); var ifn = n[0]; var bSrc = "https://" + homeDomain + "/catimg/" + ifn.substring(0, 4) + "/" + ifn.substring(4, 8) + "/" + ifn; document.getElementById('PreviewImageIMGBig').href = bSrc; //MagicZoom.update('PreviewImageIMGBig',bSrc,isrc); } function AdvancedSearch() { if (AdvancedSearchOpen) { // is it open? close it. AdvancedSearchOpen = false; document.getElementById("SearchBarSearchResults").style.display = 'none'; document.getElementById("ButtonerSearch").className = "mainSprite27 searchdropdown20x20 NoBorder MakeBottom"; // document.getElementById("ButtonerSearch").src='/image/bt_dropdown.png'; } else { AdvancedSearchOpen = true; document.getElementById("SearchBarSearchResults").style.display = 'block'; document.getElementById("ButtonerSearch").className = "mainSprite27 searchdropup20x20 NoBorder MakeBottom"; // document.getElementById("ButtonerSearch").src='/image/bt_dropup.png'; } } function DesignerSearch(query) { var dbsr = ""; if (query.length == 0) { if (DesignerSearchOpen) { // is it open and someone clicked the button? close it DesignerSearchOpen = false; document.getElementById("DesignerBarSearchResults").style.display = 'none'; document.getElementById("ButtonerDesigner").className = "mainSprite27 searchdropdown20x20 NoBorder MakeBottom"; // document.getElementById("ButtonerDesigner").src='/image/bt_dropdown.png'; return; } for (var x = 0; x < D_Total; x++) { // 408px to work with // firstload iteration, do not show people with no shoplength and only quantity of items > 40 if ((D_Shop[x].length > 0) && (D_Qty[x] > 40)) { // start firstload dbsr += "
" + D_Name[x] + "
"; if (D_Shop[x].length == 0) { dbsr += "
 
"; } else { if (D_Shop[x].length > 30) { dbsr += "
" + D_Shop[x].substr(0, 30) + "...
"; } else { dbsr += "
" + D_Shop[x] + "
"; } } dbsr += "
" + D_Qty[x] + "
"; dbsr += "
"; } // end firstload // note, 8px left } DesignerSearchOpen = true; } if (query.length > 1) { var FoundMatch = false; var srch = ""; var r; query = query.toLowerCase(); var CntDisplayedRecords = 0; for (var x = 0; x < D_Total; x++) { s = D_Name[x].toLowerCase(); r = s.search(query); if (r > -1) { FoundMatch = true; } s = D_Shop[x].toLowerCase(); r = s.search(query); if (r > -1) { FoundMatch = true; } if (FoundMatch) { // 408px to work with dbsr += "
" + D_Name[x] + "
"; if (D_Shop[x].length == 0) { dbsr += "
 
"; } else { if (D_Shop[x].length > 30) { dbsr += "
" + D_Shop[x].substr(0, 30) + "...
"; } else { dbsr += "
" + D_Shop[x] + "
"; } } dbsr += "
" + D_Qty[x] + "
"; dbsr += "
"; // note, 8px left CntDisplayedRecords++; } FoundMatch = false; } if (CntDisplayedRecords > 0) { DesignerSearchOpen = true; } else { DesignerSearchOpen = false; } } if (DesignerSearchOpen) { document.getElementById("DesignerBarSearchResults").innerHTML = dbsr; document.getElementById("DesignerBarSearchResults").style.display = 'block'; document.getElementById("ButtonerDesigner").className = "mainSprite27 searchdropup20x20 NoBorder MakeBottom"; // document.getElementById("ButtonerDesigner").src='/image/bt_dropup.png'; } else { document.getElementById("DesignerBarSearchResults").style.display = 'none'; document.getElementById("ButtonerDesigner").className = "mainSprite27 searchdropdown20x20 NoBorder MakeBottom"; // document.getElementById("ButtonerDesigner").src='/image/bt_dropdown.png'; } } function WLSearch(i) { var query = i.toLowerCase(); if (i.length == 0) { // hide results div's document.getElementById('WLResults_Left').style.display = 'none'; document.getElementById('WLResults_Right').style.display = 'none'; document.getElementById('WLResults_Clear').style.display = 'none'; } else { // search through stored array, show results var cntResults = 0; var theOptions = ""; // list of options to build for results for (var x = 0; x < W_Total; x++) { toSearch = W_Name[x].toLowerCase(); r = toSearch.search(query); if (r > -1) { theOptions += ""; cntResults++; } } // show results area document.getElementById('WLResults_Left').style.display = 'block'; document.getElementById('WLResults_Right').style.display = 'block'; document.getElementById('WLResults_Clear').style.display = 'block'; if (cntResults == 0) { document.getElementById('WLResults_Right').innerHTML = 'No Results Found.'; } else { // we have results! theOptions = ""; theOptions += " Go >"; document.getElementById('WLResults_Right').innerHTML = theOptions; } } } function GotoWishlist() { var w = document.getElementById('WLResults').options[document.getElementById('WLResults').selectedIndex].value; if (w.length == 0) { return; } document.location = '/?page=27&wishlist=' + w; } function searchselect(l, i) { if (l == "don") { document.getElementById("d_name_" + i).style.backgroundColor = 'rgb(82,68,62)'; document.getElementById("d_shop_" + i).style.backgroundColor = 'rgb(82,68,62)'; document.getElementById("d_qty_" + i).style.backgroundColor = 'rgb(82,68,62)'; } if (l == "doff") { document.getElementById("d_name_" + i).style.backgroundColor = 'rgb(41,34,31)'; document.getElementById("d_shop_" + i).style.backgroundColor = 'rgb(41,34,31)'; document.getElementById("d_qty_" + i).style.backgroundColor = 'rgb(41,34,31)'; } } function GotoPage(p) { var MoarVariables = ""; var lHref = location.href; if (lHref.indexOf("#") > -1) { // # exists in URL lHref = lHref.split("#"); lHref = lHref[0]; // need everything before # } if (lHref.indexOf("?") > -1) { // if ? exists in URL lHref = lHref.split("?"); lHref = lHref[1]; // lhref[0]=url, lhref[1]=parameters if (lHref.indexOf("&") > -1) { lHref = lHref.split("&"); for (var x = 0; x < lHref.length; x++) { var s = lHref[x].split("="); if ((s[0] != "page") && (s[0] != "PageNav")) { MoarVariables += "&" + s[0] + "=" + s[1]; } } } } location.href = "https://" + homeDomain + "/?page=27" + MoarVariables + "&PageNav=" + p; } // Bye bye MOAR KITTEH! function ShowMoar(FromID) { var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data document.getElementById("MoarResults_" + MoarResultsPointer).innerHTML = r; } } }; MoarResultsPointer = FromID; document.getElementById("MoarResults_" + MoarResultsPointer).innerHTML = ProgressGIF; // assemble href var MoarVariables = ""; var lHref = location.href; if (lHref.indexOf("?") > -1) { lHref = lHref.split("?"); lHref = lHref[1]; if (lHref.indexOf("&") > -1) { lHref = lHref.split("&"); for (var x = 0; x < lHref.length; x++) { var s = lHref[x].split("="); if (s[0] != "page") { MoarVariables += "&" + s[0] + "=" + s[1]; } } } } ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue.php?StartFrom=" + FromID + MoarVariables, true); ahr.send(null); } function DoSearchWithEnter(e) { if (window.event) { keynum = e.keyCode } else if (e.which) { keynum = e.which } if (keynum == 13) { DoSearch(); } } function HelpyThing() { var h = document.getElementById('HelpyThing'); var q = String.fromCharCode(34); h.innerHTML = '
Information
'; h.innerHTML += "
"; h.innerHTML += ''; h.style.display = 'block'; } function OpenWindow(wWidth, wHeight, wTitle, wContent) { // width, height, title, content var w = document.getElementById('PopupWindow'); w.innerHTML = ''; w.style.display = 'none'; // set window dimensions, center it on screen var extraPadding = 3; var newWidth = 0, newHeight = 0; newWidth = (wWidth + (extraPadding * 2)); newHeight = (wHeight + 16 + 1 + (extraPadding * 3)); // window area + 16[top] + 1[border between top/bottom] + 3 pads [top,middle,bottom] w.style.width = newWidth + "px"; w.style.height = newHeight + "px"; w.style.marginTop = "-" + (newHeight / 2) + "px"; w.style.marginLeft = "-" + (newWidth / 2) + "px"; // contents var wrapper = ""; wrapper = "
" + wTitle + "
" + "
" + wContent + "
"; w.innerHTML = wrapper; w.style.display = 'block'; DoBackground(); } function OpenWindowLL(wTitle, wContent) { // width, height, title, content var w = document.getElementById('PopupWindow'); w.innerHTML = ''; w.style.display = 'none'; wWidth = 300; wHeight = 200; // set window dimensions, center it on screen var extraPadding = 3; var newWidth = 0, newHeight = 0; newWidth = (wWidth + (extraPadding * 2)); newHeight = (wHeight + 16 + 1 + (extraPadding * 3)); // window area + 16[top] + 1[border between top/bottom] + 3 pads [top,middle,bottom] w.style.width = newWidth + "px"; w.style.height = newHeight + "px"; //w.style.marginTop="-"+(newHeight/2)+"px"; w.style.marginLeft="-"+(newWidth/2)+"px"; // contents var wrapper = ""; wrapper = "
" + wTitle + "
" + "
" + wContent + "
"; w.innerHTML = wrapper; w.style.display = 'block'; //DoBackground(); } function TryBeforeBuy(id) { var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data document.getElementById("PreviewImageTextBottomStatus").innerHTML = r; } } }; PreviewBottomArea(1); // swap to new area // set innerhtml spinny-thingy document.getElementById('PreviewImageTextBottomStatus').innerHTML = ProgressGIF; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_ajax.php?shop=" + id + "&shopstep=1&shopas=tbb", true); ahr.send(null); } var TBBItem = 0, TBBTimer = 0, inTBBCancel = false, TBBClickWindow = false; var TBBRand = Math.floor((Math.random() * 89999999) + 10000000); // browser-created 8-digit random number function TBBProcessCheck() { return; // launched when the browser comes to the catalogue. var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data if ((r == "0") || (r.length == 0)) { setTimeout(function() { TBBProcessCheck() }, 3333); // set to check again in 3.3s return; } // have active TBB item passed back, set it up and rawk it TryBeforeYouBuy(r); } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_tbb.php?TBBProcessCheck=yusplz", true); ahr.send(null); } function TryBeforeYouBuy(id) { var w = 300, h = 200; if (TBBClickWindow) { CloseCataloguePreview(); } OpenWindowLL("Try before Buy!", "
Loading...
"); // set global TBBItem = id; TBBTimer = 0; inTBBCancel = false; var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result if (TBBClickWindow) { LoadCatalogueEntry(TBBItem); TBBClickWindow = false; } var r = ahr.responseText; // get web data var w = document.getElementById('PopupWindow'); if (w.style.display == 'none') { return; } var a = r.split("~"); if (a[0] != "0") { TBBTimer = setTimeout(function() { TryBeforeYouBuy_Checkup() }, a[0]); } document.getElementById("TBBArea").innerHTML = a[1]; } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_tbb.php?rand=" + TBBRand + "&item=" + id, true); ahr.send(null); } function TryBeforeYouBuy_Checkup() { TBBTimer = 0; // reset global var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data var w = document.getElementById('PopupWindow'); if (w.style.display == 'none') { return; } if (inTBBCancel) { return; } var a = r.split("~"); if (a[0] != "0") { TBBTimer = setTimeout(function() { TryBeforeYouBuy_Checkup() }, a[0]); } document.getElementById("TBBArea").innerHTML = a[1]; } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_tbb.php?rand=" + TBBRand + "&item=" + TBBItem, true); ahr.send(null); } function TryBeforeYouBuy_EarlyOut() { document.getElementById("TBBArea").innerHTML = "Working..."; if (TBBTimer != 0) { clearTimeout(TBBTimer); TBBTimer = 0; } // send a blind call for abort var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data TBBTimer = setTimeout(function() { TryBeforeYouBuy_Checkup() }, 250); } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_tbb.php?rand=" + TBBRand + "&item=" + TBBItem + "&earlyOut=yes", true); ahr.send(null); } function TryBeforeYouBuy_DoCancel() { document.getElementById("TBBArea").innerHTML = "Working..."; if (TBBTimer != 0) { clearTimeout(TBBTimer); TBBTimer = 0; } inTBBCancel = true; // send a blind call for abort var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data TBBTimer = setTimeout(function() { TryBeforeYouBuy_Checkup() }, 250); } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_tbb.php?rand=" + TBBRand + "&item=" + TBBItem + "&DoCancel=yes", true); ahr.send(null); } function TryBeforeYouBuy_Rewear() { document.getElementById("TBBArea").innerHTML = "Resending avatar..."; if (TBBTimer != 0) { clearTimeout(TBBTimer); TBBTimer = 0; } // send a blind call to retry var ahr = getAjax(); ahr.onreadystatechange = function() { if (ahr.readyState == 4) { if (ahr.status == 200) { //ok result var r = ahr.responseText; // get web data TBBTimer = setTimeout(function() { TryBeforeYouBuy_Checkup() }, 250); } } }; ahr.open("GET", "https://" + homeDomain + "/pages/include_27_catalogue_tbb.php?rand=" + TBBRand + "&item=" + TBBItem + "&RetryWear=yes", true); ahr.send(null); }