//JS

//focus border (border jos)

<!--
function focus_mouse_over(id)
{
	div = document.getElementById(id);	
	div.style.background='url(images/element-border-mouse-over.jpg) repeat-x bottom left';
}

function focus_default(id)
{
	div = document.getElementById(id);	
	div.style.background='url(images/element-border.jpg) repeat-x bottom left';
}
//-->



//sens newsletter (abonare/dezabonare)

<!--
function submit_newsletter(sens)
{
	theForm=document.getElementById('form_newsletter');
	theField=document.getElementById('sens_newsletter');
	theField.value=sens;
	theForm.submit();
}
//-->



//show/hidden (tabs)

<!--
var ids=new Array('a','b','c','d','bcd');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
//-->



//mouseover

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->



//fade

<!--
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=90
}
//-->



//jump menu

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->



//imagine mare

<!--
function imagine_mare(img,w,h,ttl)
{
	imagine_mareURL = absPath+'imagine_mare.html' // set as location of poza_mare.html
	url = imagine_mareURL + '?' + img + (ttl ? '&'+escape(ttl) : '')
	l = (screen.width-w)/2
	t = (screen.height-h)/2
	attribs = 'width='+(w)+',height='+(h)+',left='+l+',top='+t
	open(url,'imgWin',attribs)
}
//-->



//popup window

<!--
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
	}
//-->



//confirmare stergere

<!--

function confirmare_stergere(adresa)
{
	if (confirm("Sunteti sigur(a) ca doriti stergerea?"))
		document.location=adresa;
}
//-->



//confirmare

<!--
function confirmare(adresa, text)
{
	if (confirm(""+text))
		document.location=adresa;
}
//-->



//marire/micsorare font

<!--
marime_font_default = 12;
marime_font_minim = 9;
marime_font_maxim = 15;

function mareste_font()
{
	theDiv=document.getElementById('text_articol');
	marime_font_default = marime_font_default+1;
	if (marime_font_default > marime_font_maxim) {marime_font_default = marime_font_maxim;}
	theDiv.style.marime_font=marime_font_default+"px";
}

function micsoreaza_font()
{
	theDiv=document.getElementById('text_articol');
	marime_font_default = marime_font_default-1;
	if (marime_font_default < marime_font_minim) {marime_font_default = marime_font_minim;}
	theDiv.style.marime_font=marime_font_default+"px";
}
//-->



//print friendly

<!--
var gAutoPrint = true;
function printFriendly() 
{ 
	if (document.getElementById!= null) 
	{ 
		var html = '<html>\n<head>\n'; 
		if (document.getElementsByTagName!= null) 
		{ 
			var headTags = document.getElementsByTagName("head"); 
			if (headTags.length > 0) 
				html += headTags[0].innerHTML; 
		} 
		html += '\n</he' + 'ad>\n<body style="margin:5px;">\n'; 
		var printPageElem = document.getElementById("printReady"); 
		
		/* ma asigur ca div-ul de recomandare anunt este inchis */
		document.getElementById('div_optiuni').style.display="none";
		document.getElementById('div_sub_poza').style.display="none";
		
		if (printPageElem!= null) 
		{ 
			html += printPageElem.innerHTML; 
		} 
		else 
		{ 
			alert("Nu am gasit sectiunea printabila."); 
			return; 
		} 

		html += '\n</bo' + 'dy>\n</ht' + 'ml>'; 
		
		var printWin = window.open("","printFriendly"); 
		printWin.document.open(); 
		printWin.document.write(html); 
		printWin.document.close(); 
		if (gAutoPrint) 
			printWin.print(); 
	} 
	else 
	{ 
		alert("Aceasta functie poate fi utilizata numai\nde browserele cu JavaScript activat."); 
	}
	document.getElementById('div_optiuni').style.display="block";
	document.getElementById('div_sub_poza').style.display="block";
}
//-->



//aflare tasta

<!--
function aflare_tasta(e)
{
	if (window.event)
	   return window.event.keyCode;
	else if (e)
	   return e.which;
	else
	   return null;
}
//-->



//caractere bune

<!--
function caractere_bune(e, goods)
{
	var key, keychar;
	key = getkey(e);
	if (key == null)
		return true;
	
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	goods = goods.toLowerCase();
	
	if (goods.indexOf(keychar) != -1)
		return true;
	
	if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
	   return true;
	
	return false;
}
//-->



//ascundere/afisare (toggle)

<!--
function ascundere_afisare(control)
{
	obj=document.getElementById(control);
	if (obj.style.display=="none")
		obj.style.display="block";
	else
		obj.style.display="none";
}
//-->



//inchidere divuri

<!--
function inchidere_divuri(prefix)
{
	var divuri=document.getElementsByTagName('div');
	for(i=0; i<divuri.length; i++)
	{
		if(divuri[i].id.search(prefix)!=-1)
		{
			divuri[i].style.display='none';
		}
	}
	//document.getElementById(div).style.display='block';
}
//-->



//ascundere/afisare special (toggle)

<!--
function ascundere_afisare_special(prefix, id)
{
	if(obj=document.getElementById(prefix+id))
	{
		if (obj.style.display=="none")
		{
			inchidere_divuri(prefix);
			obj.style.display="block";
		}
		else
			obj.style.display="none";
	}
}
//-->


//popup

<!--
function popup(adresa, latime, inaltime, is_scroll)
{
	if (is_scroll=="scroll")
		completare=", scrollbars=yes"
	else
		completare="";
	var newWin=window.open(adresa+"", "_blank", "width="+latime+", height="+inaltime+completare);
	
	var X=(screen.width-latime)/2;
	var Y=(screen.height-inaltime)/2;
	newWin.moveTo(X,Y)
}
//-->



//arata data

<!--
function arata_data()
{
	inputs = document.getElementsByTagName("div");
	buffer = "";
	for (i = 0; i < inputs.length; i++)
		buffer += inputs[i].id + "\n";
	
	alert(buffer);
}
//-->



//ascundere meniu

<!--
function ascundere_meniu()
{
	div_id='nimic';
	div_1=document.getElementById(div_id);
	if(div_1)
	{
		if(div_1.style.display=="block")
		{
			if(!isMouseOver(div_id))
			{
				//alert("Mouse over");
				//alert("Mouse: "+event.clientX+"/"+event.clientY+"\n"+"coords: "+div_1.offsetLeft+"-"+(div_1.offsetLeft+parseFloat(div_1.style.width))+"-"+div_1.offsetTop+"-"+(div_1.offsetTop+parseFloat(div_1.style.height)));
				div_1.style.display="none";
			}
			else
			{
				//alert("Mouse off");
				//alert("Mouse: "+event.clientX+"/"+event.clientY+"\n"+"coords: "+div_1.offsetLeft+"-"+(div_1.offsetLeft+parseFloat(div_1.style.width))+"-"+div_1.offsetTop+"-"+(div_1.offsetTop+parseFloat(div_1.style.height)));
			}
		}
		return true;
	}
	return false;
}
//-->



//ascundere meniu

<!--
function este_mouse_over(theDivX)
{
	var theDiv=document.getElementById(theDivX);
	var isOpera = (navigator.userAgent.indexOf('Opera') != -1);
	var isIE = (!isOpera && navigator.userAgent.indexOf('MSIE') != -1);
	
	if (!e) var e = window.event;
	
	var mouseXPos = 0;
	var mouseYPos = 0;
	
	if (e.pageX || e.pageY)
	{
		mouseXPos = e.pageX;
		mouseYPos = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		mouseXPos = e.clientX;
		mouseYPos = e.clientY;
		if (isIE)
		{
			mouseXPos += document.documentElement.scrollLeft;
			mouseYPos += document.documentElement.scrollTop;
		}
	}
	
	var theDivLeftPos=parseFloat(theDiv.offsetLeft);
	var theDivRightPos=theDivLeftPos+parseFloat(theDiv.style.width);
	var theDivTopPos=parseFloat(theDiv.offsetTop);
	var theDivBottomPos=theDivTopPos+parseFloat(theDiv.style.height);
	alert(mouseXPos+"/"+mouseYPos+" intre ("+theDivLeftPos+":"+theDivRightPos+") si ("+theDivTopPos+":"+theDivBottomPos+")?");
	if (theDivLeftPos<mouseXPos && mouseXPos<theDivRightPos && theDivTopPos<mouseYPos && mouseYPos<theDivBottomPos)
	{
		//alert("da");
		return true;
	}
	else
	{
		//alert("nu");
		return false;
	}
}
//-->



//ascundere meniu

<!--
function afisaj_calendar(div)
{
	var divuri=document.getElementsByTagName('div');
	var str="";
	for(i=0; i<divuri.length; i++)
	{
		if(divuri[i].id.substr(0, 4)=="anul")
			divuri[i].style.display='none';
	}
	document.getElementById(div).style.display='block';
}
//-->



//reparare flash

<!--
function reparare_flash()
{
	theObjects=document.getElementsByTagName("object");
	for (var i=0; i<theObjects.length; i++)
	{
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}
}
//-->



//generare campuri

<!--
function generare_campuri()
{
	theNr=document.getElementById('nr_optiuni');
	theDiv=document.getElementById('fieldset');
	
	numar=parseInt(theNr.value);
	codHTML="";
	for (var i=1; i<=numar; i++)
	{
		codHTML+="<b>Raspuns "+i+"</b> <input type='text' name='raspuns[]' />";
		if (i!=numar) codHTML+="<br />";
	}
	theDiv.innerHTML=codHTML;
}
//-->



//fixPNG

<!--
function fixPNG(myImage)
{	//alert(myImage.src);
    if ((document.body.filters))
    {

	   var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + myImage.width+ "px; height:" + myImage.height + "px;" + imgStyle + ";"+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   			myImage.outerHTML = strNewHTML
                 // myImage.outerHTML = myImage.src
    }
}
//-->



//fixPNGLink

<!--
function fixPNGLink(myImage)
{	//alert(myImage.src);
    if ((document.body.filters))
    {

	   var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ?
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block; cursor:pointer;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width
                  + "px; height:" + myImage.height
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   			myImage.outerHTML = strNewHTML
                 // myImage.outerHTML = myImage.src
    }
}
//-->