// JavaScript Document
<!--
function goProcesstest(a){alert("test");if(a=="add"){if(document.getElementById("ajaxcheck").value==1){self.document.wishbuy.action="";document.getElementById("a2cb").className="hidden";document.getElementById("a2cw").className="greenbutton";q=document.getElementById("quantity").value;n=document.getElementById("newitem").value;c=document.getElementById("unclashcategory").value;p=document.getElementById("price").value;if(document.getElementById("optionid").options){o=document.getElementById("optionid").options[document.getElementById("optionid").selectedIndex].value}else{o=document.getElementById("optionid").value}iedcache=Math.random();url="/cartcontrol/cartmonitor.cfc?method=additem&newitem="+n+"&quantity="+q+"&category="+c+"&price="+p+"&optionid="+o+"&iedcache="+iedcache+"&endof";self.document.wishbuy.action="";loadXMLDoc(url);return false}else{if(document.getElementById("quantity").value!=""){if(vCurrentInventory>=document.getElementById("quantity").value){vOptions=document.getElementById("optionidpulldown");if(vOptions!=null){if(vOptions.options[vOptions.selectedIndex].text=="Must Select Option"){alert("An option from the pull down menu must be selected.")}else{self.document.wishbuy.action="/carttest2.cfm";self.document.wishbuy.submit()}}else{self.document.wishbuy.action="/carttest2.cfm";self.document.wishbuy.submit()}}else{var b="Please select quantity 0 to "+vCurrentInventory+". Selecting 0 will remove the item from your cart.";alert(b)}}else{alert("No quantity was entered.")}}return false}if(a=="Add to Wish List"){self.document.wishbuy.action="/wish.cfm";self.document.wishbuy.submit();return}if(a=="Show Next"){self.document.wishbuy.action="/jewelry_item.cfm/"+self.document.wishbuy.nextitem.value+".htm";self.document.wishbuy.submit();return}}function goProcess(a){if(a=="add"){if(0){self.document.wishbuy.action="";document.getElementById("a2cb").className="hidden";document.getElementById("a2cw").className="greenbutton";q=document.getElementById("quantity").value;n=document.getElementById("newitem").value;c=document.getElementById("unclashcategory").value;p=document.getElementById("price").value;if(document.getElementById("optionid").options){o=document.getElementById("optionid").options[document.getElementById("optionid").selectedIndex].value}else{o=document.getElementById("optionid").value}d=Math.random();e="/cartcontrol/cartmonitor.cfc?method=additem&newitem="+n+"&quantity="+q+"&category="+c+"&price="+p+"&optionid="+o+"&iedcache="+d+"&endof";self.document.wishbuy.action="/cart.cfm";loadXMLDoc(e);return false}else{if(document.getElementById("quantity").selectedIndex!=0){if(vCurrentInventory>=document.getElementById("quantity").selectedIndex-1){vOptions=document.getElementById("optionidpulldown");if(vOptions!=null){if(vOptions.options[vOptions.selectedIndex].text=="Must Select Option"){alert("An option from the pull down menu must be selected.")}else{self.document.wishbuy.action="http://www.semiprecious.com/cart.cfm";self.document.wishbuy.submit()}}else{self.document.wishbuy.action="http://www.semiprecious.com/cart.cfm";self.document.wishbuy.submit()}}else{var b="Please select quantity 0 to "+vCurrentInventory+". Selecting 0 will remove the item from your cart.";alert(b)}}else{alert("No quantity was entered.")}}return false}if(a=="Add to Wish List"){self.document.wishbuy.action="/wish.cfm";self.document.wishbuy.submit();return}if(a=="Show Next"){self.document.wishbuy.action="/jewelry_item.cfm/"+self.document.wishbuy.nextitem.value+".htm";self.document.wishbuy.submit();return}if(a=="cart summary"){var d=Math.random();var e="/cartcontrol/cartmonitor.cfc?method=cart_summary&dcache="+d;document.getElementById("cart_summary").innerHTML="<img src='/working.gif' height='16px' />";loadXMLDoc(e);return}}function rate_item(a,b){var c=Math.random();document.getElementById("star_"+a).src="/images/process-img.gif";url="/customrequest/item_handler.cfc?method=rate_item&rating="+a+"&itemid="+b+"&iedcache="+c+"&endof";loadXMLDoc(url);return false}function loadXMLDoc(a){if(window.XMLHttpRequest){req=new XMLHttpRequest;req.onreadystatechange=processReqChange;req.open("GET",a,true);req.send(null)}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");if(req){req.onreadystatechange=processReqChange;req.open("GET",a,true);req.send()}}}function ajaxcheck(){if(document.getElementById("ajaxcheck").value==-1){ajaxCheckClient();return false}}function ajaxCheckClient(){var a=Math.random();a=a*1e3;a=Math.round(a*1e3)+1;document.getElementById("ajaxcheck").value=a;var b="/ajaxCheckServer.cfm?var="+a;loadXMLDoc(b);return}function processReqChange(){if(req.readyState==4){if(req.status==200){good=0;if(window.DOMParser){parser=new DOMParser;xmlDoc=parser.parseFromString(req.responseText,"text/xml")}else{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(req.responseText)}if(xmlDoc){if(xmlDoc.documentElement){good=1}}if(good==0){alert("There was an error in processing the request. Please check your internet connection.");return}if(good==1){response=xmlDoc.documentElement;method0=response.getElementsByTagName("localmethod")[0].firstChild.data;if(method0=="rate_item"){var a=0;var b=response.getElementsByTagName("rating")[0].firstChild.data;var c=b*1+0;document.getElementById("star_1").src="/images/star_off.gif";document.getElementById("star_2").src="/images/star_off.gif";document.getElementById("star_3").src="/images/star_off.gif";document.getElementById("star_4").src="/images/star_off.gif";document.getElementById("star_5").src="/images/star_off.gif";for(aj=1;aj<=c;aj++){a="star_"+aj;document.getElementById(a).src="/images/star_on.gif"}return}if(method0=="Cart_summary"){try{document.getElementById("cart_summary").innerHTML=(new XMLSerializer).serializeToString(response)}catch(d){document.getElementById("cart_summary").innerHTML=response.xml;return}return}b=response.getElementsByTagName("qtyadded")[0].firstChild.data;if(b){method1=response.getElementsByTagName("optionid")[0].firstChild.data;method2=response.getElementsByTagName("qtyinstock")[0].firstChild.data;method3=response.getElementsByTagName("grandtotal")[0].firstChild.data;method4=response.getElementsByTagName("totalqty")[0].firstChild.data;method2=method2*1+0;b=b*1+0;method3=method3*1;document.getElementById("a2cw").className="hidden";document.getElementById("a2cb").className="greenbutton";var e="";document.getElementById("cart_add_msg").innerHTML='<div style="background-color:white;border:gray solid 2px;width:300px;text-align:center;padding:4px;">Added to Your Cart:'+b+"<br />Your Cart total now: $ "+method3+'. <Br />Click "Back to Gallery" above this box, to continue shopping or <a href="cart.cfm">Go to Cart</a> if you would like to wrap up your shopping.</div>';return;document.getElementById("totalqty").innerHTML='<u><a href="http://<cfoutput>#cgi.server_name#</cfoutput>/cart.cfm" title="check jewelry in cart">Qty  in Cart</a></u><br /><strong><span style="background-color:white;">This Item: '+b+'</span></strong><br /><a href="/cart.cfm" title="click to go to cart">Total: '+method4+"</a>";document.getElementById("totalqty").className="rowb";if(method1>0){document.getElementById("qtyincart").innerHTML='<a href="http://<cfoutput>#cgi.server_name#</cfoutput>/cart.cfm" title="click to go to cart">Qty In Cart: '+b+' </a> <span class="optionsinline">(Option '+method1+")</span>"}else{document.getElementById("qtyincart").innerHTML=' <a href="http://<cfoutput>#cgi.server_name#</cfoutput>/cart.cfm" title="click to go to cart">Qty In Cart: '+b+" </a> "}document.getElementById("totalqty").className="itemdetailsboxgreen";document.getElementById("qtyincart").className="itemdetailsboxred";document.getElementById("erroraddingitem").className="hidden";document.getElementById("grandtotal").innerHTML="[ $"+method3+" , "+method4+" Items]";document.getElementById("grandtotal").className="error";document.getElementById("a2wl").className="hidden"}else{alert("There was an error. Make sure you have entered a numeric value in the qty")}}else{document.getElementById("a2cw").className="hidden";document.getElementById("a2cb").className="greenbutton";document.getElementById("erroraddingitem").className="error";document.getElementById("ajaxoutput").className="itemdetailsboxred";return false}}else{alert("There was an error adding the Item. Please check your network connection.")}document.getElementById("a2cw").className="hidden";document.getElementById("a2cb").className="greenbutton"}return false}function updateOptionid(){document.getElementById("optionid").value=document.getElementById("optionidlist").options[document.getElementById("optionidlist").selectedIndex].value}var req
//-->

