function voidfunc(){}
var xmlhttp;var currentid;function display_toogle(id){xmlhttp=getxmlhttp();if(xmlhttp==null){alert("Your browser does not support AJAX!");return;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(currentid==id){document.getElementById("arttext_"+currentid).innerHTML=xmlhttp.responseText.substring(0,247)+"...";document.getElementById("details_on_"+currentid).style.display="none";document.getElementById("details_off_"+currentid).style.display="block";document.getElementById("lnk_det_"+currentid).innerHTML="<strong>+</strong> detalii";currentid=0;}
else{if(currentid){document.getElementById("arttext_"+currentid).innerHTML=xmlhttp.responseText.substring(0,247)+"...";document.getElementById("details_on_"+currentid).style.display="none";document.getElementById("details_off_"+currentid).style.display="block";document.getElementById("lnk_det_"+currentid).innerHTML="<strong>+</strong> detalii";}
document.getElementById("arttext_"+id).innerHTML=xmlhttp.responseText;document.getElementById("details_off_"+id).style.display="none";document.getElementById("lnk_det_"+id).innerHTML="<strong>-</strong> detalii";document.getElementById("details_on_"+id).style.display="block";currentid=id;}}}
xmlhttp.open("POST","lib/views.php",true);params="id="+id+"&page=main";xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",params.length);xmlhttp.setRequestHeader("Connection","close");xmlhttp.send(params);}
function getxmlhttp(){var xmlhttp=null;xmlhttp=new XMLHttpRequest();if(!xmlhttp){xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");if(!xmlhttp){alert("Your browser does not support Ajax! Please update!");}}
return xmlhttp;}
function auth(){if(!document.getElementById("au").value)document.getElementById("aa").innerHTML="Campul pentru utilizator trebuie completat";else if(!document.getElementById("ap").value)document.getElementById("aa").innerHTML="Campul pentru parola trebuie completat";else{document.login.submit();document.login.reset();}}
function gsm_toogle(id){if(currentid==id){document.getElementById("gsm_"+currentid).style.display="none";currentid=0;}
else{if(currentid){document.getElementById("gsm_"+currentid).style.display="none";}
document.getElementById("gsm_"+id).style.display="block";currentid=id;}}
var currentartid=1;function artmenu_toogle(artid){if(currentartid){document.getElementById("art_menuitem_"+currentartid).style.display="none";document.getElementById("art_menubut_"+currentartid).className="art_menuitem";}
document.getElementById("art_menubut_"+artid).className="art_menuitem_on";document.getElementById("art_menuitem_"+artid).style.display="block";currentartid=artid;}
function submitform(formname,action){document[formname].action=action;document[formname].submit();}
function check(){document.check.action="verificare_comanda.php?action=check";document.check.submit();}
function recomanda(id,rec_n,rec_e,rec_fe,rec_t){if(id&&rec_n&&rec_e&&rec_fe){xmlhttp=getxmlhttp();if(xmlhttp==null){alert("Your browser does not support AJAX!");return;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById('rec_answ').innerHTML=xmlhttp.responseText;document.getElementById('rec_n').value='';document.getElementById('rec_e').value='';document.getElementById('rec_fe').value='';document.getElementById('rec_t').value='';}}
xmlhttp.open("POST","forms.php?sec=recomanda",true);params="id="+id+"&rec_n="+rec_n+"&rec_e="+rec_e+"&rec_fe="+rec_fe+"&rec_t="+rec_t.replace('\n',' ');xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",params.length);xmlhttp.setRequestHeader("Connection","close");xmlhttp.send(params);}
else{if(!rec_n)document.getElementById('rec_answ').innerHTML='Nume tau trebuie introdus!';else if(!rec_e)document.getElementById('rec_answ').innerHTML='Email-ul tau trebuie introdus!';else if(!rec_fe)document.getElementById('rec_answ').innerHTML='Email-ul prietenului tau trebuie introdus!';}}
function alerta(prodid,user,alert_p,alert_e){if(prodid&&user&&alert_p&&alert_e){xmlhttp=getxmlhttp();if(xmlhttp==null){alert("Your browser does not support AJAX!");return;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById('alert_answ').innerHTML=xmlhttp.responseText;document.getElementById('alert_p').value='';document.getElementById('alert_e').value='';}}
xmlhttp.open("POST","forms.php?sec=alerta",true);params="prodid="+prodid+"&alert_p="+alert_p+"&alert_e="+alert_e;xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",params.length);xmlhttp.setRequestHeader("Connection","close");xmlhttp.send(params);}
else{if(!user)document.getElementById('alert_answ').innerHTML='Doar utilizatorii inregistrati beneficiaza de aceasta optiune!';else if(!alert_e)document.getElementById('alert_answ').innerHTML='Email-ul tau trebuie introdus!';else if(!alert_p)document.getElementById('alert_answ').innerHTML='Pretul trebuie introdus!';else if(!prodid)document.getElementById('alert_answ').innerHTML='O eroare critica a aparut! Te rugam sa ne trimiti un email la <strong>info [at] cerinte.ro</strong> mentionand produsul pentru care vrei sa fii alertat';}}
function setfilter(cat,subcat,filter){document.location="accesorii_gsm.php?category="+cat+"&subcategory="+subcat+"&filter="+filter;}
function img_toogle(nr,id,title){document.getElementById("art_mainimage").innerHTML='<img src="adm/images/gsm_products/mid_'+id+'_'+nr+'.jpg" width="336" height="252" alt="'+title+'" />';}
