function showStatus(sMsg) { window.status = sMsg ; return true ; } function NewWindow(mypage, myname, w, h, scroll) { var win = null; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'; win = window.open(mypage, myname, settings) } function modCant(id, operatie) { var cantitate=parseInt(document.getElementById(id).value); if(isNaN(cantitate)) { alert("Cantitatea trebuie sa fie numerica!") document.getElementById(id).value=1; return; } else { if(operatie=="+") document.getElementById(id).value=cantitate+1; else { if(cantitate>=1) document.getElementById(id).value=parseInt(cantitate)-1; } } } function toggle(id) { var obiect=document.getElementById(id); if(obiect.style.display=="none") obiect.style.display="block"; else obiect.style.display="none"; } function valideazaComanda(total_comanda, comanda_minima, url, id_form, erori_cos, username) { if(parseInt(total_comanda)==0) { alert("Nu aveti nici un produs in cos!"); return false; } else if(parseInt(total_comanda)0) { alert("Pentru a finaliza comanda, trebuie sa stergeti produsele din cos care nu mai sunt pe stoc!") } else if(username=="") { alert("Pentru a finaliza comanda trebuie sa fiti logat!"); } else { document.getElementById("finalizeaza_comanda").value="1"; document.getElementById(id_form).action=url; document.getElementById(id_form).submit(); return true; } } function toggleCampuri(id, arr_ids, arr_values) { var checkbox=document.getElementById(id); if(checkbox.checked) { for(var i=0;ix - inchide'; } else { document.getElementById("toggle_cat_"+id).style.display="none"; document.getElementById("actiune_"+id).innerHTML='» mai multe afectiuni'; } } function textCounter(field, cntfield, maxlimit) { if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit); else cntfield.value = maxlimit - field.value.length; }