function prima_pagina_top(id_stire){
	s='id_stire='+id_stire;
	//alert(s);
	var myAjax = new Ajax.Updater(
	{success: "prima_pagina_top"},
	"responders/prima_pagina_top.php",
	{
		method: 'post',
		parameters: s
	}
	);
}

function email_friend(){
	var subject = 'Pagina interesanta';
	var body = 'Salut,' + '%0d%0a\n' +
		'Am gasit o pagina interesanta: ' + '%0d%0a\n' +
		window.location + '%0d%0a\n';
	window.location = 'mailto:?Subject='+subject+'&body='+body;
	return false;
} 

function oras(oras_id){
	s='oras_id='+oras_id;
	//alert(s);
	var myAjax = new Ajax.Updater(
	{success: "oras"},
	"responders/oras.php",
	{
		method: 'post',
		parameters: s
	}
	);
}

/*
function changetop(a)
{
	s='a='+a;
	
	var myAjax = new Ajax.Updater(
	{success: "changetop"},
	"responders/changetop.php",
	{
		method: 'post',
		parameters: s
	}
	);
	
}*/




function changetop(a)
{
	$('curs_valutar').style.display = 'none';
	$('bursa').style.display = 'none';
	$('meteo').style.display = 'none';
	$('curs_valutar_btn').className = '';
	$('bursa_btn').className = '';
	$('meteo_btn').className = '';
	
	$(a).style.display = '';
	$(a + '_btn').className = 'selected';
}





function indici(indice)
{
	s='indice='+indice;
	//alert(s);
	var myAjax = new Ajax.Updater(
	{success: "indici"},
	"responders/indici.php",
	{
		method: 'post',
		parameters: s
	}
	);
}

function localitate(localitate)
{	s='localitate='+localitate;
	//alert(s);
	var myAjax = new Ajax.Updater(
	{success: "localitate"},
	"responders/localitate.php",
	{
		method: 'post',
		parameters: s
	}
	);
}


function judet(judet_id,localitate_id)
{	s='judet_id='+judet_id+'&localitate_id='+localitate_id;
	//alert(s);
	var myAjax = new Ajax.Updater(
	{success: "judet"},
	"responders/judet.php",
	{
		method: 'post',
		parameters: s
	}
	);
}

// Cauta elementele care au ca si clasa de css js-hide si le ataseaza clasa .ascuns (le pune un display:none)

hideElements=function(){
	elem=document.getElementsByClassName("js-hide");
	$A(elem).each(function(el){
		Element.addClassName(el,'ascuns');
	})
}

Event.observe(window,'load',function(){
	nota_imp=document.getElementsByClassName('nota-input');
	$A(nota_imp).each(function(nota){
		Event.observe(nota,'click',function(){
			Element.removeClassName('scode-container','ascuns');
		})
	})
	
})

Event.observe(window,'load',hideElements);


function bookmarksite(){

    title = document.title;
    url = window.location.href;
    
    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 otvor(adresa, xova, yova)
{
//xova=xova+20
//yova=yova+20
var okno = window.open(adresa,"","toolbar=no,scrollbars=yes,location=no,status=no,screenX=20,screenY=20,width="+xova+",height="+yova+",resizable=0")
} 


//function count_masini_nivea(categ, id)
//{	s='c='+categ+'&id='+id;
////	alert(s);
//	var myAjax = new Ajax.Request(
//	"responders/count_art.php",
//	{
//		method: 'post',
//		parameters: s
//	}
//	);
//	return true;
//}

getViewportDimensions=function() {
	  var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return {width:pageWidth,height:pageHeight,winWidth:windowWidth, winHeight:windowHeight};
		}
		setOverLayerDim=function(){
		  dims=getViewportDimensions();
		  
		  $('overlayer').setStyle(
		    {
		      width:dims.width+'px',
		      height:dims.height+'px'
		    }
		  );
		}
		
		showFelicitareSimpla=function(){
			$('felicitareSimpla').toggle();
		}
		
		showOverlayer=function(){
			$('overlayer').toggle();
		}
		
		showFelicitare=function(){
			showOverlayer();
			$('felicitare').toggle();
			showFelicitareSimpla();
			
			
		}
		
		document.observe('dom:loaded',setOverLayerDim);