function verifyForm() { var msg=''; if (document.form_modifica.nume_dest.value=='') { msg="You must supply a name for the recipient\n"; foc=document.form_modifica.nume_dest; }else if (document.form_modifica.email_dest.value=='') { msg="You must supply an e-mail address for the recipient\n"; foc=document.form_modifica.email_dest; }else if((document.form_modifica.email_dest.value.indexOf('@')<1)|| (document.form_modifica.email_dest.value.indexOf('@')>(document.form_modifica.email_dest.value.length - 5))|| (document.form_modifica.email_dest.value.indexOf('.')<1)){ msg='You must supply an e-mail address for the recipient'; foc=document.form_modifica.email_dest; }else if (document.form_modifica.nume_exp.value=='') { msg="You must supply your name\n"; foc=document.form_modifica.nume_exp; }else if (document.form_modifica.email_exp.value=='') { msg="You must supply your e-mail address\n"; foc=document.form_modifica.email_exp; }else if((document.form_modifica.email_exp.value.indexOf('@')<1)|| (document.form_modifica.email_exp.value.indexOf('@')>(document.form_modifica.email_exp.value.length - 5))|| (document.form_modifica.email_exp.value.indexOf('.')<1)){ msg='You must supply your e-mail address'; foc=document.form_modifica.email_exp; } if(msg!=''){ alert(msg); foc.focus(); return false; } } function smilie(text) { text = ' ' + text + ' '; if (document.form_modifica.mesaj.createTextRange && document.form_modifica.mesaj.caretPos) { var caretPos = document.form_modifica.mesaj.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; document.form_modifica.mesaj.focus(); }else{ document.form_modifica.mesaj.value += text; document.form_modifica.mesaj.focus(); } } function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return ''; } function checkformsearch(aform) { if (aform.search.value=='' || aform.search.value.length<3){ alert('Search for a word with 3 chars!'); aform.search.focus(); return false; } return true; } var xmlHttp var innerstr; var pagsunt; var idto; function f1rate(text,rate,star){ document.getElementById('voteazatu').innerHTML=text; for(var i=1;i<=rate;i++){ document.getElementById('rateid'+i).src=star; } } function frate(id,nota){ if (id>0 && (nota<=5 && nota>=1)){ idto=id; xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { document.getElementById('voteazatuvotat').innerHTML='Error' ; return } var url="rate.php" url=url+"?p=rate&id="+id+"¬a="+nota url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged ; xmlHttp.open("GET",url,true) xmlHttp.send(null) } } function frate2(id){ if (id>0){ xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { return } var url="rate.php" url=url+"?p=vot&id="+id url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChangeds ; xmlHttp.open("GET",url,true) xmlHttp.send(null) } } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById('voteazatuvotat').innerHTML=xmlHttp.responseText ; if (xmlHttp.responseText=='Thank you!'){ frate2(idto); } //Multumim pentru vot! } } function stateChangeds() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById('voturiid').innerHTML=xmlHttp.responseText ; } } function GetXmlHttpObject() { var objXMLHttp=null if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp }