var browserName=navigator.appName; 
var browserTip='ie';
if (browserName=="Netscape")
{ 
 	browserTip='mz';
}
else 
{ 
 if (browserName=="Microsoft Internet Explorer")
 {
  	browserTip='ie';
 }

}

function c()
{
	return confirm("    Sunteti sigur ? ");
}

if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}



function do_init()
{
	init_tooltips();
}
function star_over(img_id,act,ii)
{
	if(act=='over')
	{
		
				$(img_id+"_"+ii).srcx=$(img_id+"_"+ii).src;
				$(img_id+"_"+ii).src="images/new3/star4.gif";
			
	}
	if(act=='out')
	{

			$(img_id+"_"+ii).src=$(img_id+"_"+ii).srcx;

	}
}
function show_vot(poza_id,where)
{
	var url = "op.php";
	var pars="act=show_vot&poza_id="+poza_id+"&where="+where;
	//alert(pars);
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, 
		onComplete: function (originalRequest)
		{
			$('div_'+poza_id).innerHTML = originalRequest.responseText;
		}
		
	});
}


function voteaza_poza(poza_id,nota,where,rem)
{
	var url = "op.php";
	var pars="act=voteaza&poza_id="+poza_id+"&nota="+nota;
	//alert(pars);
	var go_vot=false;
	
	//alert(rem);
	
	if(rem==1)
	{
		alert("Ati acordat deja nota "+nota+" pentru o alta poza!\nNu mai puteti vota aceasta poza cu nota "+nota+"!");
		{
			go_vot=false;
		}
	}
	else
	{
		go_vot=true;
	}
	
	
	if(go_vot)
	{
		if(confirm("Puteti acorda doar o singura data nota "+nota+".\nSunteti sigur ca doriti sa continuati?"))
		{
			//alert("Ati votat aceasta poza cu nota "+nota+"!\nPuteti acorda doar o data nota "+nota+" unei singure poze.");
			var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, 
				onComplete: function (originalRequest)
				{
					show_vot(poza_id,where);
					//$('div_'+poza_id).innerHTML = originalRequest.responseText;
					refresh_votes();
				}
				
			});
		}
	}
}
function refresh_votes()
{
	for(i=0;i<lista_poze_c;i++)
	{
		show_vot(lista_poze[i],'list');
	}
}



function init_tooltip(element,poza_id)
{
	var tooltip=new Tooltip(element, {backgroundColor: "#129FCA", borderColor: "#06385B", opacity: .98,maxWidth: 415,align : "right",
					textColor: "#FFFFFF",textShadowColor: "#FFFFFF"});
	var url = "op.php";
	var pars="act=show_tooltip&poza_id="+poza_id;
	//alert(pars);
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, 
		onComplete: function (originalRequest)
		{
			//$('div_'+poza_id).innerHTML = originalRequest.responseText;
			tooltip.content=originalRequest.responseText;
		}
		
	});
}
function init_tooltips()
{
	$$(".do_tooltip").each( function(link) {
								 
								 
								 var poza_id=link.id.replace("tip_","");
								 
								 init_tooltip(link.id,poza_id);

								  });

}

