//ec3
//browser detection
var ie = (document.all)? 1 : 0 ;
var ns = (document.getElementById)? 1 : 0 ;
var ns4 = (document.layers)? 1 : 0 ;
var ns6 = document.getElementById && !document.all;


function DetectBrowser(){ //Detectarea browserului folosit
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new DetectBrowser();




//f_sm
var f_sm = 0;
var f_sm2 = 0;

//set a property to a layer
function setLay(name, prop, val){
  	if(!ns4) {
   		if(ns6) obj = eval('document.getElementById("'+name+'").style');
		   else obj = eval('document.all("'+name+'").style');
		obj[prop] = val;
	}
}


var tout = null;
var tout2 = null;


function createSubmenu(nr){ //BLUE SUBMENUS
	//create submenu items
	var var_submenu_items = '';
	for(i=1;i<=submenu[nr];i++){
		clasa = 'submenuItem';
		
		//hasSubmenu
		hasSubmenu = '';
		linkul = '<span id="link_'+nr+'_'+i+'" class="'+clasa+'" '+hasSubmenu+'>'+ submenu[nr][i][0] +'</span>';
		if(submenu[nr][i][2] == 1){
			hasSubmenu = ' onMouseOver="showSubmenu(\'show\','+nr+''+i+')" onMouseOut="showSubmenu(\'hide\','+nr+''+i+')" ';
			linkul = '<table width="145" border="0" cellspacing="0" cellpadding="0"><tr align="left" valign="middle">    <td width="115">'+'<span id="link_'+nr+'_'+i+'" class="'+clasa+'" '+hasSubmenu+'>'+ submenu[nr][i][0] +'</span>'+'</td>    <td width="5" class="submenuItem">&raquo;</td>  </tr></table>';
			;
		}
		
		if(submenu[nr][i][0] == '') var_submenu_items += '<tr class="layerSubmenu"><td colspan="3" ><img src="'+LAYOUTS+'images/spacer.gif" width="143" height="1" border="0"></td></tr>';
		else var_submenu_items += '            <tr class="layerSubmenu">       <td width="97%" id="td_'+nr+'_'+i+'" onMouseOver="tdOver('+nr+','+i+')" onMouseOut="tdOut('+nr+','+i+')" class="clickable" '+hasSubmenu+' onClick=document.location="'+submenu[nr][i][1]+'" height="19" align="left" valign="middle"><table  width="138"  border="0" cellspacing="0" cellpadding="0">                <tr>          <td width="3%">&nbsp;</td>        <td width="2%" align="right" valign="top">&nbsp;</td>                  <td width="81%" align="left" valign="middle">'+linkul+'</td>         <td width="3%">&nbsp;</td>        </tr>              </table></td>           </tr>';
	}
	
	//overLayer  menu/submenu
	if(nr < nrSubmenus+1) overLay = 'onMouseOver="showMenu(\'show\','+nr+');" onMouseOut="showMenu(\'hide\','+nr+');"';
		 else overLay = ' onMouseOver="showSubmenu(\'show\','+nr+')" onMouseOut="showSubmenu(\'hide\','+nr+')" ';
	
	menW = 145;
	//create submenu layer  
	if(bw.ie6)
		//var_submenu = '<div class="lay" id="submenu'+nr+'" '+overLay+'><div style="position:absolute; left:0px; top:0px; z-index:2;"><iframe marginwidth="0" marginheight="0" scrolling="no" frameborder="0" width="'+menW+'" height="'+iframeH[nr]+'"></iframe></div>  <div style="position:absolute; left:0px; top:0px; z-index:5;"><table width="'+menW+'" border="0" cellpadding="0" cellspacing="1" bgcolor="#efe1e1">     '+ var_submenu_items +'     </table></div></div>';
		var_submenu = '<div class="lay" id="submenu'+nr+'" '+overLay+'><div style="position:absolute; left:0px; top:0px; z-index:2;"></div>  <div style="position:absolute; left:0px; top:0px; z-index:5;"><table width="'+menW+'" border="0" cellpadding="0" cellspacing="0" class="layerSubmenuBoder">     '+ var_submenu_items +'     </table></div></div>';

	else
		var_submenu = '<div class="lay" id="submenu'+nr+'" '+overLay+'><div style="position:absolute; left:0px; top:0px; z-index:2;"></div>  <div style="position:absolute; left:0px; top:0px; z-index:5;"><table width="'+menW+'" border="0" cellpadding="0" cellspacing="0" class="layerSubmenuBoder" >     '+ var_submenu_items +'     </table></div></div>';

	//print menu layer
	document.write(var_submenu);
}



function initMenus(){
	for(nr=1; nr<=nrSubmenus; nr++) createSubmenu(nr);
}


function showMenu(visibility,nr) { 
if(nr<=nrSubmenus){
  for(i=1;i<=nrSubmenus;i++) if(i!=nr) {
	  MM_showHideLayers('submenu'+i,'','hide');	
  }
  clearTimeout(tout);
  
  //get table position
  if(ns6){
	posLeft = document.getElementById('xy').offsetLeft;  
	posTop = document.getElementById('xy').offsetTop;
	//alert(posLeft);
  } else { 
	posLeft = xy.offsetLeft;  
	posTop = xy.offsetTop; 
  }
 
  ww=0; hh=0;
  ww = widhts[nr];
  hh = heights[nr];
  //place layers
  setLay('submenu'+nr,'left',posLeft + ww);
  setLay('submenu'+nr,'top',posTop + hh);
  //show layers
  MM_showHideLayers('submenu'+nr,'','show');
  if (visibility=='show') MM_showHideLayers('submenu'+nr,'','show');
  else if (visibility=='hide') {
  	if(f_sm == 0) tout = setTimeout('MM_showHideLayers("submenu'+nr+'","","hide")',400);
  }
}
}

//mouseOver Table Cell
function tdOver(nr,i){
	cell = fieldOb('td_'+nr+'_'+i);
	cell.bgColor = "#902187"; 
	linkul = fieldOb('link_'+nr+'_'+i);
	linkul.className = "submenuItemOver";
	//img = fieldOb('img_'+nr+'_'+i);
	//img.src = LAYOUTS + "images/arrow_22.gif";
}

//mouseOut Table Cell
function tdOut(nr,i){
	cell = fieldOb('td_'+nr+'_'+i);
	cell.bgColor = "#ebebeb";  
	linkul = fieldOb('link_'+nr+'_'+i);
	linkul.className = "submenuItem";
	//img = fieldOb('img_'+nr+'_'+i);
	//img.src = LAYOUTS + "images/arrow_26.gif";
}


//initializate menus
initMenus();


var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-10686441-1");
pageTracker._trackPageview();
} catch(err) {}
