var add=new Array(); var box=new Array(); var totaladd=0.0; function chprice(sum,sid,radio){ if(!add[sid]) add[sid]=0; if(!box[sid]) box[sid]=0; totaladd-=add[sid]; if(radio==1 || box[sid]==0){ totaladd+=sum; box[sid]=1; add[sid]=sum; } else{ add[sid]=0; box[sid]=0; } new_price=init_price+totaladd; new_price+=""; n=new_price.indexOf("."); if(n>=0) new_price=new_price.substr(0,n+3); vat_price=init_vat_price+totaladd; vat_price+=""; n1=vat_price.indexOf("."); if(n1>=0) vat_price=vat_price.substr(0,n1+3); document.prod_buy.new_price.value=new_price+' '; document.prod_buy.vat_price.value=vat_price+' '; } function check(){ eroare=''; lg=1; f=document.review_form.elements; for(var j = f.length-1; j >= 0; j--){ f[j].style.backgroundColor=elemFormDefaultBackColor; } chkel(f['review_title'],f['review_title'].value,"Review Title",2); chkel(f['review_text'],f['review_text'].value,"Review Message",2); if (f['permit'].value==0) eroare+="You must be logged in order to add a review to this product"; if (eroare != ""){ alerter (eroare); return false; } else document.review_form.submit(); }