function imageID(str, custom_prod_id, custom_image_id, custom_text, custom_font_size, new_image_id, custom_text_color, custom_font_name, custom_text_position, custom_image_size, custom_image_position_x, custom_image_position_y, custom_tags) { var xhr; try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e2) { try { xhr = new XMLHttpRequest(); } catch (e3) { xhr = false; } } } xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { var myXML = xhr.responseText; if(myXML == '') { alert('There has been an error'); } //alert(myXML); //if (document.getElementById('frontSide').checked==true) { imageName = "http://images.cafepress.com/product/" + myXML + "_240x240_Front.jpg";} //else { imageName = "http://images.cafepress.com/product/" + myXML + "_240x240_Back.jpg";}; var selected_color; if (document.frmCustomize.buymeColours) { //exists Item = document.frmCustomize.buymeColours.selectedIndex; Result = document.frmCustomize.buymeColours.options[Item].text; selected_color = "_Color-" + Result; } else { //does not exist selected_color = ""; } if (document.getElementById('frontSide').checked==true) { imageName = "http://images.cafepress.com/product/" + myXML + "_240x240_Front" + selected_color + ".jpg"; } else { imageName = "http://images.cafepress.com/product/" + myXML + "_240x240_Back" + selected_color + ".jpg"; } newImage = "url(" + imageName + ")"; document.getElementById('prodImg').style.backgroundImage = newImage; document.getElementById('ajaxLoad').src = '/images/spacer.gif' document.getElementById('buymeBtn').style.display = 'block'; document.getElementById('prod_id').value = myXML; document.getElementById('uploadDiv').style.display = 'none'; window.location.hash = "#"+myXML; //setSliderValue(slider1, 1); //setSliderValue(slider3, 1); //Modalbox.hide(); } } }; document.getElementById('ajaxLoad').src = '/images/ajaxLoad.gif'; custom_text = custom_text.replace(/[\r\n]+/g, "[break]"); var url="/t-shirts/inc/connector.asp" url=url+"?mode=text" url=url+"&prodid="+custom_prod_id url=url+"&imageid="+custom_image_id url=url+"&text="+custom_text url=url+"&sliderValue="+custom_font_size url=url+"&fontcolor="+custom_text_color url=url+"&fontname="+custom_font_name url=url+"&newimageid="+new_image_id url=url+"&textposition="+custom_text_position url=url+"&imagesize="+custom_image_size url=url+"&transformx="+custom_image_position_x url=url+"&transformy="+custom_image_position_y url=url+"&tags="+custom_tags url=url+"&side="+document.getElementById('frontSide').checked url=url+"&nocache="+Math.floor(Math.random()*9999) //alert(url); //window.location.href=url; xhr.open('GET', url, true); xhr.send(null); }