function listSingleAdd(xform,pid){var vartest=typeof xform;if(vartest=="string"){xform=findObjCart(xform)}var qty_field_name="qty_"+pid;var qty_field=findObjCart(qty_field_name);if(qty_field){qty_field.value="1";xform.submit()}}function listRedirect(url){window.location=url}function listMultiAdd(xform){xform.submit()}function findObjCart(n,d){var p,i,x;if(!d){d=document}if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p)}if(!(x=d[n])&&d.all){x=d.all[n]}for(i=0;!x&&i<d.forms.length;i++){x=d.forms[i][n]}for(i=0;!x&&d.layers&&i<d.layers.length;i++){x=findObj(n,d.layers[i].document)}if(!x&&document.getElementById){x=document.getElementById(n)}return x}function addToCartAdvAtt(xform){var submitflag=true;var err_msg="";var att_id_list_field=findObjCart("att_id_list");var att_id_list=att_id_list_field.value.split(",");for(var x=0;x<=att_id_list.length-1;x++){var select_name="att_"+att_id_list[x];var select_field=findObjCart(select_name);if(select_field){var lbl=select_field.options[0].text;var xselected=select_field.options[select_field.selectedIndex].value;if(xselected==""||xselected==0){err_msg=err_msg+"Please "+lbl+"\n";submitflag=false}}}if(submitflag){xform.submit()}else{alert(err_msg)}}function pGetObject(obj){var theObj;if(document.all){if(typeof obj=="string"){return document.all(obj)}else{return obj.style}}if(document.getElementById){if(typeof obj=="string"){return document.getElementById(obj)}else{return obj.style}}return null}function popPhotos(news_id){URL="/cart/pf/photopop.php?n="+news_id;var pactivephoto_id=pGetObject("pactivephoto");if(pactivephoto_id){URL=URL+"#"+pactivephoto_id.value}fncCenteredChildWindow(URL,"600","800","yes","yes")}function pSwithImage(photo_id){var pactivephoto_id=pGetObject("pactivephoto");var primary_photo=pGetObject("pprimary");var active_caption=pGetObject("pcap");if(pactivephoto_id){var pthumb_old=pGetObject("pthumb_"+pactivephoto_id.value)}var pmed=pGetObject("pmed_"+photo_id);var pcap=pGetObject("pcap_"+photo_id);var psource=pGetObject("psource_"+photo_id);var pthumb_img=pGetObject("pthumb_"+photo_id);if(primary_photo){if(pmed){primary_photo.src=pmed.value}}if(pthumb_img){pthumb_img.className="thumbActive"}if(pthumb_old){pthumb_old.className="thumbPhoto"}if(active_caption){if(pcap){active_caption.innerHTML=pcap.value}}if(pactivephoto_id){pactivephoto_id.value=photo_id}}function fncPF(URL){fncCCWindow(URL,"300","800","yes","no")}function fncPrint(){window.print()}function fncCloseWindow(){window.close()}function fncCCWindow(URL,vHeight,vWidth,vScroll,vStatus){if(screen.width){var winl=(screen.width-vWidth)/2;var wint=(screen.height-vHeight)/2}else{winl=0;wint=0}if(winl<0){winl=0}if(wint<0){wint=0}var child=window.open(URL,"myWin","height="+vHeight+",width="+vWidth+",scrollbars="+vScroll+",status="+vStatus+",top="+wint+",left="+winl+",resizable=no");child.focus()}function applyCouponCode(xform){xform.action="/cart/basket.php?action=coupon";xform.submit()}function beginCheckout(xform,checkout_url){if(checkout_url==""){checkout_url="/cart/checkout.php?m=login"}document.location=checkout_url};