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('Cauta un cuvant cu cel putin 3 litere!');
aform.search.focus();
return false;
}
return true;
}
function f1rate(text,rate,star){
document.getElementById('voteazatu').innerHTML=text;
for(var i=1;i<=rate;i++){
document.getElementById('rateid'+i).src=star;
}
}
function f1ratexx(text,rate,star,idd){
document.getElementById('voteazatu'+idd).innerHTML=text;
for(var i=1;i<=rate;i++){
document.getElementById('a'+idd+'rateid'+i).src=star;
}
}
var xmlHttp
var innerstr;
var pagsunt;
var pagsunt1;
var idto;
function frate(id,nota){
if (id>0 && (nota<=5 && nota>=1)){
idto=id;
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
document.getElementById('voteazatuvotat').innerHTML='Erroare la votare' ;
return
}
var url="/index.php"
url=url+"?pp=rate&id="+id+"¬a="+nota
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function fratexx(id,nota){
if (id>0 && (nota<=5 && nota>=1)){
idto=id;
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
document.getElementById('voteazatuvotat'+id).innerHTML='Error!' ;
return
}
var url="/index.php"
url=url+"?pp=rate&id="+id+"¬a="+nota
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedxx ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function frate2(id){
if (id>0){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
return
}
var url="/index.php"
url=url+"?pp=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=='
Multumim pentru vot!'){
frate2(idto);
}
//Multumim pentru vot!
}
}
function stateChangedxx()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById('voteazatuvotat'+idto).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
}
function selectthis(obiect)
{
obiect.focus();
obiect.select();
}
function showhide(divid){
document.getElementById(divid).style.display = (document.getElementById(divid).style.display=='none')?'':'none';
}
function faddcom(id)
{
if(trim(document.getElementById('comform').subiectid.value)==''){
alert('Adauga un subiect!');
return false;
}
if(trim(document.getElementById('comform').comentariuid.value)==''){
alert('Adauga un comentariu!');
return false;
}
pagsunt='casutacom';
pagsunt1='comentarii';
if (id>0){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert('Erroare nu se poate adauga');
return false;
}
var url="/index.php"
url=url+"?pp=add&id="+id
url=url+"&subiect="+addSlashes(document.getElementById('comform').subiectid.value)
url=url+"&comentariu="+addSlashes(document.getElementById('comform').comentariuid.value)
url=url+"&sendmeemail="+(document.getElementById('comform').sendmeemailid.checked)
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedr ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function faddcom1(id)
{
if(trim(document.getElementById('comform').subiectid.value)==''){
alert('Please add your email!');
return false;
}
if(trim(document.getElementById('comform').comentariuid.value)==''){
alert('Please add a comment!');
return false;
}
pagsunt='casutacom';
pagsunt1='comentarii';
if (id>0){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert('Error!');
return false;
}
var url="/index.php"
url=url+"?pp=add&id="+id
url=url+"&subiect="+addSlashes(document.getElementById('comform').subiectid.value)
url=url+"&comentariu="+addSlashes(document.getElementById('comform').comentariuid.value)
url=url+"&sendmeemail="+(document.getElementById('comform').sendmeemailid.checked)
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedr ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function faddcom2(id,fff)
{
if(trim(document.getElementById(fff).subiectid.value)==''){
alert('Please add your email!');
return false;
}
if(trim(document.getElementById(fff).comentariuid.value)==''){
alert('Please add a comment!');
return false;
}
pagsunt='casutacom'+id;
pagsunt1='comentarii'+id;
if (id>0){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert('Error!');
return false;
}
var url="/index.php"
url=url+"?pp=add&id="+id
url=url+"&subiect="+addSlashes(document.getElementById(fff).subiectid.value)
url=url+"&comentariu="+addSlashes(document.getElementById(fff).comentariuid.value)
url=url+"&sendmeemail="+(document.getElementById(fff).sendmeemailid.checked)
url=url+"&badsubtitle="+addSlashes(document.getElementById(fff).badsubtitle.value)
url=url+"&sendmeemail="+(document.getElementById(fff).sendmeemailid.checked)
url=url+"&spamid="+(document.getElementById(fff).spamid.value)
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedr ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function faddmail(id)
{
if(trim(document.getElementById('comformail').numeid.value)==''){
alert('Adauga Numele tau!');
return false;
}
if(trim(document.getElementById('comformail').emailid.value)==''){
alert('Adauga Emailul tau!');
return false;
}
if(trim(document.getElementById('comformail').emailpid.value)==''){
alert('Adauga Email prieten!');
return false;
}
if(trim(document.getElementById('comformail').spamid.value)==''){
alert('Adauga Anti spam!');
return false;
}
if(trim(document.getElementById('comformail').mesajid.value)==''){
alert('Adauga Mesaj!');
return false;
}
pagsunt='casutamail';
pagsunt1='comentariim';
if (id>0){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert('Erroare nu se poate adauga');
return false;
}
var url="/index.php"
url=url+"?pp=trimitemadd&id="+id
url=url+"&nume="+addSlashes(document.getElementById('comformail').numeid.value)
url=url+"&email="+addSlashes(document.getElementById('comformail').emailid.value)
url=url+"&emailp="+addSlashes(document.getElementById('comformail').emailpid.value)
url=url+"&spam="+addSlashes(document.getElementById('comformail').spamid.value)
url=url+"&mesaj="+addSlashes(document.getElementById('comformail').mesajid.value)
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedr ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function faddmail1(id)
{
if(trim(document.getElementById('comformail').numeid.value)==''){
alert('Please add your name!');
return false;
}
if(trim(document.getElementById('comformail').emailid.value)==''){
alert('Please add your email!');
return false;
}
if(trim(document.getElementById('comformail').emailpid.value)==''){
alert('Friend email!');
return false;
}
if(trim(document.getElementById('comformail').spamid.value)==''){
alert('Anti spam!');
return false;
}
if(trim(document.getElementById('comformail').mesajid.value)==''){
alert('Please type message!');
return false;
}
pagsunt='casutamail';
pagsunt1='comentariim';
if (id>0){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert('Error!');
return false;
}
var url="/index.php"
url=url+"?pp=trimitemadd&id="+id
url=url+"&nume="+addSlashes(document.getElementById('comformail').numeid.value)
url=url+"&email="+addSlashes(document.getElementById('comformail').emailid.value)
url=url+"&emailp="+addSlashes(document.getElementById('comformail').emailpid.value)
url=url+"&spam="+addSlashes(document.getElementById('comformail').spamid.value)
url=url+"&mesaj="+addSlashes(document.getElementById('comformail').mesajid.value)
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedr ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function addSlashes(var1){
var re = /('|")/g;
return var1.replace(/\n/ig,' ').replace(re,"\\"+"$1");
}
function stateChangedr()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(pagsunt1).innerHTML=xmlHttp.responseText ;
showhide(pagsunt);
if (pagsunt=='casutamail' && document.getElementById(pagsunt1).innerHTML=='
Mesajul a fost trimis