function vote_load(item_id,nota,nota_nr) 
{
	var url = '/vote_item2.php';
	var pars = 'load_vote=load_vote&item_id='+item_id+'&nota='+nota+'&nota_nr='+nota_nr;
	$('vot_div').innerHTML ='Voteaza ...';
	//alert("ok");
	var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars, 
	onComplete: function update_reps(originalRequest)
			{
				$('vot_div').innerHTML = originalRequest.responseText;
			}
	
	}); 
}
var url_to_go='';
function random_redirect()
{
	document.location.href=url_to_go;
}
function vote_item2(item_id,nota) 
{
	//get_zona(var_rep_id,var_zona_id);
	var url = '/vote_item2.php';
	var pars = 'rate_item=rate_item&item_id='+item_id+'&nota='+nota ;
	$('vot_div').innerHTML ='Voteaza ...';
	//alert("ok");
	var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars, 
	onComplete: function update_reps(originalRequest)
			{
				$('vot_div').innerHTML = originalRequest.responseText;
				if($('rand_item_link'))
				{
					url_to_go=$('rand_item_link').value;
					setTimeout('random_redirect()',1500);
				}
			}
	
	}); 
}

function c()
{
	return confirm("    Esti sigur ? ");
}
if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}


function calcHeight()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('the_iframe').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('the_iframe').height=
      the_height+10;
	  

}

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}


function checkEmail(obj) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(obj.value)){
return (true)
}
alert("Adresa de email este invalida!\n Pentru a putea primi codul adresa trebuie sa fie corecta.")
return (false)
}
