var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function gsp_echipe_v04_DoFSCommand(command, args) {
	var gsp_echipe_v04Obj = isInternetExplorer ? document.all.gsp_echipe_v04 : document.gsp_echipe_v04;
	//
	if (command == "moveUp"){
		set_profile_flash(0);
	}
	//
}
PeriodicalExecuter.prototype.registerCallback = function() {
	this.intervalID = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
}

PeriodicalExecuter.prototype.stop = function() {
	clearInterval(this.intervalID);
}

fs_original= 14;
fs_pas = 0;
fs_actual = 0;
function stop_nav_footer(a,b) {
	if($('footer_nav_'+a+'_'+b).src.indexOf('/images/footer/new/'+a+'_inact.gif')==-1) $('footer_nav_'+a+'_'+b).src = '/images/footer/new/'+a+'_act.gif';
    clearTimeout(sto);
}
function nav_footer(a,id)
{
    div_pics = $('footer_nav_'+id);
    if (a == 0) {
        return;
    } else if (a < 0) {
		if($('footer_nav_left_'+id).src.indexOf('left_act.gif')!=-1) $('footer_nav_left_'+id).src = '/images/footer/new/left_over.gif';
        if (div_pics.scrollLeft <= 0) {
			$('footer_nav_left_'+id).src = '/images/footer/new/left_inact.gif';
            return;
        }
		if($('footer_nav_right_'+id).src.indexOf('right_inact.gif')!=-1) $('footer_nav_right_'+id).src = '/images/footer/new/right_act.gif';
    } else if (a > 0) {
		if($('footer_nav_right_'+id).src.indexOf('right_act.gif')!=-1) $('footer_nav_right_'+id).src = '/images/footer/new/right_over.gif';
        if ((div_pics.scrollLeft+900) >= div_pics.scrollWidth) {
			$('footer_nav_right_'+id).src = '/images/footer/new/right_inact.gif';
            return;
        }
		if($('footer_nav_left_'+id).src.indexOf('left_inact.gif')!=-1) $('footer_nav_left_'+id).src = '/images/footer/new/left_act.gif';
    }
    div_pics.scrollLeft = div_pics.scrollLeft + a;
    sto = setTimeout("nav_footer(" + a + "," + id +")", 30);
}
var my_sto;
function my_nav(a,b) {
    my_div = document.getElementById(b);
	//alert(my_div.scrollWidth - parseInt(my_div.parentNode.style.width));
    if (a == 0) {
        return;
    } else if (a < 0) {
        if (my_div.scrollLeft <= 0) {
            return;
        }
    } else if (a > 0) {
        if (my_div.scrollLeft >= my_div.scrollWidth - parseInt(my_div.style.width)) {
            return;
        }
    }
    my_div.scrollLeft = my_div.scrollLeft + a;
    my_sto = setTimeout("my_nav(" + a + ",'" + b + "')", 10);
}
function stop_my_nav() {
    clearTimeout(my_sto);
}

function show_profile_cats()
{
	if($('profile_cats').style.display!='none') $('profile_cats').style.display = 'none';
	else $('profile_cats').style.display = '';
}
function send_profile_cats()
{
	cats = document.getElementsByName('cats_profile[]');
	j = 0;
	cats_vals = '';
	for(i=0;i<cats.length;i++)
	{
		if(cats[i].checked==false)
		{
			j++;
			if(cats_vals!='') cats_vals += '-';
			cats_vals += cats[i].value;
		}
	}
	var dt = new Date();
	ts = dt.getTime();
	sets = cats_vals;
    var url = "/?section=ajax&screen=profile_cats";
    new Ajax.Request(
		url, {
			method:"post", 
			parameters:{cat_vals:sets,user_ts:ts},
			onComplete:function(){show_profile_cats();alert('Setarile au fost salvate');}
			}
		);
}
function select_profile_cats(a)
{
	cats = document.getElementsByName('cats_profile[]');
	for(i=0;i<cats.length;i++)
	{
		if(a==0) cats[i].checked = false;
		else cats[i].checked = true;
	}
}
function set_classic_view(a)
{
	var dt = new Date();
	ts = dt.getTime();
	
    var url = "/?section=ajax&screen=classic_view&ts="+ts+"&set="+a;
    new Ajax.Request(url,{
			onComplete:function()
			{
				location.reload(true);
				
			}
		}
	);
}
function set_profile_flash(a)
{
	var dt = new Date();
	ts = dt.getTime();

	if(a==0)
		url = "/index.php?section=ajax&screen=echipe_clasament_icons&ts="+ts;
	else
		url = "/index.php?section=ajax&screen=echipe_clasament_flash&ts="+ts;
	new Ajax.Request(url,{evalScripts:true,
					 onComplete: function(resp) {
						 $('echipe_flash').update(resp.responseText);
						 var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
						// Handle all the FSCommand messages in a Flash movie.
						// Hook for Internet Explorer.
						if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
							document.write('<script language=\"VBScript\"\>\n');
							document.write('On Error Resume Next\n');
							document.write('Sub gsp_echipe_v04_FSCommand(ByVal command, ByVal args)\n');
							document.write('	Call gsp_echipe_v04_DoFSCommand(command, args)\n');
							document.write('End Sub\n');
							document.write('</script\>\n');
						}
					}});
}

function nav_img_art(a,b)
{
	$('nav_poz_'+a).style.display = 'none';
	$('nav_poz_'+b).style.display = '';
}
function pop_up_spec_events(a,b,c,d)
{
	Event.observe($(a),'mouseover',function(){
		eval(c+'=1;');
		pop_up_spec_show(a,b,c,d)
	});
	Event.observe($(b),'mouseover',function(){
		eval(c+'=1;');
		pop_up_spec_show(a,b,c,d)
	});
	Event.observe($(a),'mouseout',function(){
		eval(c+'=0;');
		pop_up_spec_show(a,b,c,d)
	});
	Event.observe($(b),'mouseout',function(){
		eval(c+'=0;');
		pop_up_spec_show(a,b,c,d)
	});	
}
function pop_up_spec_show(a,b,c,d)
{
	c = eval(c);
	if(c==0)
	{
		$(b).style.display = 'none';
		if(d==1) $(a).src = '/images/articol/share/share_plus.gif';
	}
	else
	{
		$(b).style.display = 'inline';
		if(d==1) $(a).src = '/images/articol/share/share_minus.gif';
	}	
}
function validate_email(address) {
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if(reg.test(address) == false) {
		return false;
	}
	return true;
}

function ver_fel()
{
	if($('nume_exp').value=='')
	{
		alert('Nu ati introdus numele expeditorului');
		return false;
	}
	if($('nume_dest').value=='')
	{
		alert('Nu ati introdus numele destinatarului');
		return false;
	}
	if($('email_exp').value=='')
	{
		alert('Nu ati introdus adresa email a expeditorului');
		return false;
	}
	if(!validate_email($('email_exp').value))
	{
		alert('Adresa email a expeditorului nu este valida');
		return false
	}
	if($('email_dest').value=='')
	{
		alert('Nu ati introdus adresa email a destinatarului');
		return false;
	}
	if(!validate_email($('email_dest').value))
	{
		alert('Adresa email a destinatarului nu este valida');
		return false;
	}
	if(tinyMCE.activeEditor.getContent()=='')
	{
		alert('Nu ati introdus mesajul');
		return false;
	}
	return true;
}

function plus_text() {
	fs_pas+=2;
	fs_actual = fs_original + fs_pas;
	document.getElementById("continut_articol").style.fontSize = fs_actual + "px";
}
function minus_text() {
	fs_pas-=2;
	if(-fs_pas>fs_original)
	{
		fs_pas = -fs_original;
		return;
	}
	fs_actual = fs_original + fs_pas;
	document.getElementById("continut_articol").style.fontSize = fs_actual + "px";
}
function form_comentarii()
{
	nume=document.getElementById('nume').value;
	email=document.getElementById('email').value;
	comentariu=document.getElementById('comentariu').value;
	
	if (nume.length==0) 
	{
		alert ("Introduceti numele");
		return false;
	}
	if (email.length==0) 
	{
		alert ("Introduceti adresa email");
		return false;
	}
	if (comentariu.length==0) 
	{
		alert ("Introduceti comentariul");
		return false;
	}
	return true;
}
function meci_form_comentarii(a)
{
	a = '_'+a;
	nume=$('nume'+a).value;
	email=$('email'+a).value;
	comentariu=$('comentariu'+a).value;
	meci_id=$('meci_id'+a).value;
	parere=$('parere'+a).value;
	quote=$('quote'+a).value;
	uid=$('uid'+a).value;
	
	if (nume.length==0) 
	{
		alert ("Introduceti numele");
		return false;
	}
	if (email.length==0) 
	{
		alert ("Introduceti adresa email");
		return false;
	}
	if (comentariu.length==0) 
	{
		alert ("Introduceti comentariul");
		return false;
	}

    var url = "/index.php?section=ajax&screen=live_meci_comentarii_lista&meci_id="+meci_id+"&parere="+parere+"&ajax=1";
    new Ajax.Request(
		url, {
			method:"post", 
			parameters:{meci_id:meci_id,nume:nume,email:email,comentariu:comentariu,parere:parere,quote:quote,uid:uid},
			onComplete:function(res){
				$('lista_comentarii'+a).innerHTML = res.responseText;
			}
		}
	);

	return false;
}
function meci_comentarii_pag(parere,meci_id,pag)
{
    var url = "/index.php?section=ajax&screen=live_meci_comentarii_lista&meci_id="+meci_id+"&parere="+parere+"&ajax=1&pag="+pag;
    new Ajax.Request(
		url, {
			onComplete:function(res){
				$('lista_comentarii_'+parere).innerHTML = res.responseText;
			}
		}
	);	
}
function form_comentarii_ursus()
{
	nume=document.getElementById('nume').value;
	email=document.getElementById('email').value;
	localitate=document.getElementById('localitate').value;
	varsta=document.getElementById('varsta').value;
	comentariu=document.getElementById('comentariu').value;
	
	if (nume.length==0) 
	{
		alert ("Introduceti numele");
		return false;
	}
	if (email.length==0) 
	{
		alert ("Introduceti adresa email");
		return false;
	}
	if (localitate.length==0) 
	{
		alert ("Introduceti localitatea");
		return false;
	}
	if (varsta.length==0) 
	{
		alert ("Introduceti varsta");
		return false;
	}
	if (comentariu.length==0) 
	{
		alert ("Introduceti comentariul");
		return false;
	}
	return true;
}
function form_comentarii_dezb()
{
	nume=document.getElementById('nume').value;
	email=document.getElementById('email').value;
	comentariu=document.getElementById('comentariu').value;
	if (nume.length==0) 
	{
		alert ("Introduceti numele");
		return false;
	}
	if (email.length==0) 
	{
		alert ("Introduceti adresa email");
		return false;
	}
	if (comentariu.length==0) 
	{
		alert ("Introduceti comentariul");
		return false;
	}
	parere=0;
	for(i=0;i<document.comenteaza_dezbatere.parere.length;i++)
	{
		if(document.comenteaza_dezbatere.parere[i].checked)
		{
			parere=1;
			break;
		}
	}
	if(parere==0)
	{
		alert("Nu v-ati expus parerea");
		return false;
	}
	return true;
}
function adauga_comentariu()
{
	document.getElementById("adauga_comentariu").style.display = "";
}
function open_window(url,width,height)
{
	xpoz=Math.round((screen.width-width)/2);
	ypoz=Math.round((screen.height-height)/2);
	if (xpoz<0) xpoz=10;
	if (ypoz<0) ypoz=10;
	newWindow=window.open (url ,'gsp_window','toolbar=no,scrollbars=yes,width='+width+',height='+height+', left='+xpoz+', top='+ypoz);
	newWindow.focus();
	false;
}
function form_mail()
{
	nume=document.getElementById('nume').value;
	email_to=document.getElementById('email_to').value;
	if ((email_to.length<5) || (email_to.search('@') == -1) || (email_to.search('.') == -1)) 
	{
		alert ("Email destinatar invalid");
		return false;
	}
	else if (nume.length==0) 
	{
		alert ("Introduceti numele");
		return false;
	}
	return true;
}
function show_content(curent,total,id_caseta)
{
	for(i=1;i<=total;i++)
	{
		if(i==1) document.getElementById("clapeta_"+i+"_"+id_caseta).className = "first";
		else if(i==total) document.getElementById("clapeta_"+i+"_"+id_caseta).className = "last";
		else document.getElementById("clapeta_"+i+"_"+id_caseta).className = "";
		document.getElementById("content_"+i+"_"+id_caseta).style.display = "none";
	}
	if(curent==1 && total==1) document.getElementById("clapeta_"+curent+"_"+id_caseta).className = "first last selected";
	else if(curent==1) document.getElementById("clapeta_"+curent+"_"+id_caseta).className = "first selected";
	else if(curent==total) document.getElementById("clapeta_"+curent+"_"+id_caseta).className = "last selected";
	else document.getElementById("clapeta_"+curent+"_"+id_caseta).className = "selected";
	document.getElementById("content_"+curent+"_"+id_caseta).style.display = "";
}
function show_full_stars(i,total,b)
{
	for(j=1;j<=i;j++)
	{
		curent=1;
		if(j%2==0) curent=2;
		document.getElementById(b+"_"+j).src="/images/articol/"+curent+"_half_full_star.gif";
	}
	for(j=i+1;j<=total;j++)
	{
		curent=1;
		if(j%2==0) curent=2;
		document.getElementById(b+"_"+j).src="/images/articol/"+curent+"_half_empty_star.gif";
	}
}
function hide_full_stars(total,b)
{
	for(j=1;j<=total;j++)
	{
		curent=1;
		if(j%2==0) curent=2;
		document.getElementById(b+"_"+j).src="/images/articol/"+curent+"_half_empty_star.gif";
	}
}
function vote_article(articol,vot)
{
	url = "/index.php?section=articol&screen=votare&ajax=1&id="+articol+"&voteaza="+vot;
	new Ajax.Request(url,{onLoading: function() {$('articol_noteaza').update("Se incarca ...");},onComplete: function(resp) {$('articol_noteaza').update(resp.responseText);}});
}
function pags_dezbatere(url,div)
{
	new Ajax.Request(url,{onLoading: function() {$(div).update("Se incarca ...");},onComplete: function(resp) {$(div).update(resp.responseText);}});
}
function ajax_load(url,div)
{
	new Ajax.Request(url,{onComplete: function(resp) {$(div).update(resp.responseText);}});
}
var clapete=new Array();
function schimba_clapete(clapeta,valoare,id_caseta)
{
	if (clapeta==1)
	{
		$('clapeta1['+id_caseta+']').style.backgroundColor='#ffffff';
		$('clapeta2['+id_caseta+']').style.backgroundColor='#E6EBED';
		$('clapeta3['+id_caseta+']').style.backgroundColor='#E6EBED';
	}
	else if (clapeta==2)
	{
		$('clapeta1['+id_caseta+']').style.backgroundColor='#E6EBED';
		$('clapeta2['+id_caseta+']').style.backgroundColor='#ffffff';
		$('clapeta3['+id_caseta+']').style.backgroundColor='#E6EBED';
	}
	else if (clapeta==3)
	{
		$('clapeta1['+id_caseta+']').style.backgroundColor='#E6EBED';
		$('clapeta2['+id_caseta+']').style.backgroundColor='#E6EBED';
		$('clapeta3['+id_caseta+']').style.backgroundColor='#ffffff';
	}
	//alert(clapeta+'-'+valoare+'-'+id_caseta);
	$('container_blog['+id_caseta+']').innerHTML=clapete[id_caseta][valoare];
}
function open_poza(imagine,width,height,a)
{
	if(a.parentNode.tagName=="A") return false;
	xpoz=Math.round((screen.width-width)/2);
	ypoz=Math.round((screen.height-height)/2);
	if (xpoz<0) xpoz=10;
	if (ypoz<0) ypoz=10;
	newWindow=window.open('/image.php?imagine='+imagine+'&id=<?=$articol_id?>' ,'poza_window','toolbar=no,scrollbars=no,width='+width+',height='+height+', left='+xpoz+', top='+ypoz);
	newWindow.focus();
}	
/*functia de schimbare a clapetelor in cadrul clasametului din sectiunea LIVE*/
function schimba_clasament(tip)
{
	if (tip=='deplasare')
	{
		$("cl_deplasare").className = "clapeta";
		$("cl_acasa").className = "clapeta unsel";
		$("cl_general").className = "clapeta unsel";
		
		$("cont_general").style.display="none";
		$("cont_acasa").style.display="none";
		$("cont_deplasare").style.display="inline";
		
		$('lbl_adevar').innerHTML="&nbsp;";
	}
	else if (tip=='acasa')
	{
		$("cl_deplasare").className = "clapeta unsel";
		$("cl_acasa").className = "clapeta";
		$("cl_general").className = "clapeta unsel";
		
		$("cont_general").style.display="none";
		$("cont_deplasare").style.display="none";
		$("cont_acasa").style.display="inline";
		
		$('lbl_adevar').innerHTML="&nbsp;";
	}
	else
	{
		$("cl_deplasare").className = "clapeta unsel";
		$("cl_acasa").className = "clapeta unsel";
		$("cl_general").className = "clapeta";
		
		$("cont_deplasare").style.display="none";
		$("cont_acasa").style.display="none";
		$("cont_general").style.display="inline";
		
		$('lbl_adevar').innerHTML="+/-";
	}
	return false;
	
}
function comentariu_change()
{
	max_length = 500;
	length_val = $('comentariu').value.length;
	$('comentariu_status').value = max_length-length_val;
	if(length_val>max_length)
	{
		$('comentariu').value = $('comentariu').value.substr(0,max_length);
		$('comentariu_status').value = 0;
		$('comentariu').scrollTop = $('comentariu').scrollHeight;
	}
	if($('comentariu_status').value==0) $('comentariu_status').style.color = "red";
	else $('comentariu_status').style.color = "green";
}
function meci_comentariu_change(a)
{
	a = '_'+a;
	max_length = 500;
	length_val = $('comentariu'+a).value.length;
	$('comentariu_status'+a).value = max_length-length_val;
	if(length_val>max_length)
	{
		$('comentariu'+a).value = $('comentariu'+a).value.substr(0,max_length);
		$('comentariu_status'+a).value = 0;
		$('comentariu'+a).scrollTop = $('comentariu'+a).scrollHeight;
	}
	if($('comentariu_status'+a).value==0) $('comentariu_status'+a).style.color = "red";
	else $('comentariu_status'+a).style.color = "green";
}


/* autocomplete la search */

function curata_2_spec(cnt_input)
		{
			return cnt_input;
			//alert("Curata");
			var chars = new Array();

			chars["["] = "s";
			chars["{"] = "&#0258;";
			chars["]"] = "&#0238;";
			chars["}"] = "&#0206;";
			chars["="] = "&#0226;";
			chars["+"] = "&#0194;";
			//chars['\\'] = "";
			chars["&#259"] = "&#0259;";
			chars["&#258"] = "&#0258;";
			chars["&#238"] = "&#0238;";
			chars["&#206"] = "&#0206;";
			chars["&#226"] = "&#0226;";
			chars["&#194"] = "&#0194;";
			chars["&#351"] = "&#0351;";
			chars["&#350"] = "&#0350;";
			chars["&#355"] = "&#0355;";
			chars["&#354"] = "&#0354;";
			var cnt_fin = "";
			var chr = "";
			var cnt = cnt_input;//document.getElementById("continut").value;
			for(var i=0;i<cnt.length;i++)
			{
				chr = cnt.substring(i, i+1);
				//alert(chr.charCodeAt(0));
				if(chars[("&#"+chr.charCodeAt(0))]!=undefined) cnt_fin += chars["&#"+chr.charCodeAt(0)];
				else cnt_fin += chr;
			}
			
			return cnt_fin;
}

function loaddata_search() {
	if($("inp_cauta").value.length<3)
	{
		$("inp_cauta_div").style.display="none";
		return false;
	}
	url = "/?section=ajax&screen=search_sugest&ajax=1&text=" + escape(curata_2_spec($("inp_cauta").value));
	aj = new Ajax.Request(url, {onSuccess:ajax_search});
}
function ajax_search(ob) {
	resp = ob.responseText;
	if (resp != "")
	{
		document.getElementById("inp_cauta_div").style.display = "";
	}
	else
	{
		document.getElementById("inp_cauta_div").style.display = "none";
	}
	document.getElementById("inp_cauta_div").innerHTML = resp;
}
function search_over_td(a)
{
	document.getElementById("search_td"+a).style.backgroundColor="#eef7fe";
}
function search_out_td(a)
{
	document.getElementById("search_td"+a).style.backgroundColor="#e9ecee";
}
function search_click_td(a,b)
{
	//search_add(b,a);
	$("inp_cauta").value=a;
	$("inp_cauta_div").style.display="none";
}

function alow_search(val){
	if(val.length<3) {
		alert('Cautarea trebuie sa contina cel putin 3 caractere!');
		return false;	
	}
	return true;
}

/* convertor valutar */
var valuta2=1;
function schimba (id)
{
	if (id==1)
		valuta1=document.getElementById("valuta1").value;
	else if (id==2)
		valuta2=document.getElementById("valuta2").value;
	calculeaza();
}

function checknumber()
{
	var x=document.getElementById('valoare').value;
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (anum.test(x))
		testresult=true
	else{
		testresult=false
	}
	return (testresult)
}

function calculeaza()
{
	if (checknumber())
	{
		var suma=document.getElementById('valoare').value;
		var rezultat=Math.round(10000*suma*valuta1/valuta2)/10000;
		var list1=document.getElementById('valuta1');
		var valuta1text=list1.options[list1.selectedIndex].text
		var list2=document.getElementById('valuta2');
		var valuta2text=list2.options[list2.selectedIndex].text
		document.getElementById('txt_rezultat').value=suma + ' ' + valuta1text + ' = ' + rezultat + " "+ valuta2text;
	}
}

function show_curs(){
	$('show_convertor').style.display = "block";
	$('sageata_curs').innerHTML = '<a href="javascript:hide_curs();">Convertor valutar&nbsp;<img src="/images/curs_valutar/sageata_jos.gif"></a>';
}

function hide_curs(){
	$('show_convertor').style.display = "none";
	$('sageata_curs').innerHTML = '<a href="javascript:show_curs();">Convertor valutar&nbsp;<img src="/images/curs_valutar/sageata_right.gif"></a>';
}

function swapImages(id,img){
	$(id).src = '/images/footer/'+img;
	//return false;
}

function swapImages2(id,img){
	$(id).src = '/images/poker/'+img;
	//return false;
}

/* pentru sondaj concurs*/

function voteaza_superlative(nr){
	form_name = eval("document.myform_"+nr);
	propunere = $("propunere_text_"+nr).value;
	var t_option = '';
	for(i=0;i<form_name.sondaj.length;i++)
	{
		if(form_name.sondaj[i].checked)
		{
			t_option = form_name.sondaj[i].value;
			break;
		}
	}
	if (t_option=='') {alert("Trebuie sa alegi o optiune");}
	else{
		var url="/?section=concurs&screen=voting2009&ajax=1&tip_sondaj="+nr+"&id_nume="+t_option+"&propunere="+propunere;
		new Ajax.Request(
			url,
			{
			onCreate: function() {$('sondaj_'+nr).update("<div style='width:320px; font-size:12px; font-weight:bold'>Se incarca ...</div>");},
			onSuccess: function(resp) {$('sondaj_'+nr).update(resp.responseText);}
			}
		);
	}
}
function show_comment(id)
{
	if(eval('item_com_'+id) == 0) {
		$('item_com_'+id).className = "item_com";
		$('item_com_'+id+'_top').style.display = "block";
		$('item_com_'+id+'_bottom').style.display = "block";
		$('text_com_'+id).style.display = "block";
		$('idunic_'+id).style.display = "block";
		eval('item_com_'+id+"= 1;");
	}
	else {
		$('item_com_'+id).className = "item_com_notlogged";
		$('item_com_'+id+'_top').style.display = "none";
		$('item_com_'+id+'_bottom').style.display = "none";
		$('text_com_'+id).style.display = "none";
		$('idunic_'+id).style.display = "none";
		eval('item_com_'+id+"= 0;");		
	}
}

function comentarii_abuse(id)
{
	url = "/index.php?section=ajax&screen=comentarii_abuse&ajax=1&id="+id;
	new Ajax.Request(url,{onComplete: function(resp) {alert(resp.responseText);}});
}
function change_clapeta_live(a,b,c)
{
	for(i=1;i<=b;i++)
	{
		if(i!=a)
			$(c+"_"+i).className='inact';
	}
	$(c+"_"+a).className='act';
}

/*functii AJAX casete campionate -etape */

function schimba_campionat (liga,serie,limba) {	
	var param='liga='+liga+'&serie='+serie+'&limba='+limba;
	new Ajax.Updater('caseta_campionate','/index.php?section=misc&screen=clasament',{parameters:param});
}


function schimba_etapa (liga,serie,id,limba) {	
	var param='liga='+liga+'&serie='+serie+'&caseta_id='+id+'&limba='+limba;
	new Ajax.Updater('caseta_etape_'+id,'/index.php?section=misc&screen=etapa',{parameters:param});
}

/* Cele mai */

function schimba_cele_mai (tip,limba,cat_art) {	
	var param='tip_cele='+tip+'&limba='+limba+'&cat_art='+cat_art;
	new Ajax.Updater('caseta_cele_mai','/index.php?section=misc&screen=cele_mai',{parameters:param});
}

/* functie care face scroll la imagini */
/* autor Tudor */
var sto;
function scroll_pics(a,no,img_src)
{
	div_pics = $('chenar_scroll_'+no);
	if(a==0) return;
	else if(a<0)
	{
		$('sf_next').src = "/images/"+img_src+"nav_r_act.gif";		
		if(div_pics.scrollLeft<=0) {
			$('sf_next').src = "/images/"+img_src+"nav_r_act.gif";
			$('sf_prev').src = "/images/"+img_src+"nav_l.gif";			
			return;
		}
	}
	else if(a>0)
	{
		$('sf_prev').src = "/images/"+img_src+"nav_l_act.gif";
		if(div_pics.scrollLeft>=(div_pics.scrollWidth-310)) {
			$('sf_next').src = "/images/"+img_src+"nav_r.gif";			
			return;
		}
	}
	div_pics.scrollLeft = div_pics.scrollLeft+a;
	sto=setTimeout('scroll_pics('+a+','+no+',"'+img_src+'")',30);
}

function stop_scroll_pics()
{
	clearTimeout(sto);
}
