var i=0
var txt = new Array()
txt[0]= "<FONT size='2' color='#C03B47'><a href='anunturi.php'>Spitalul Militar de Urgenta \"Dr.Constantin Papilian\" Cluj-Napoca cauta medic specialist, medic primar specialitatea boli infectioase pentru colaborare pe termen limitat...</a></FONT>"
//txt[0]= "<CENTER><FONT size='2' color='#C03B47'><a href='#'>SIMPOZIONUL ANUAL AL SPITALULUI MILITAR DE URGENTA \"Dr.CONSTANTIN PAPILIAN\" CLUJ-NAPOCA<br>28, 29, 30 OCTOMBRIE 2010</a></FONT></CENTER>"
//txt[0]= "<CENTER><FONT size='2' color='#C03B47'>Zilele <BR>Spitalului Militar de Urgenta <BR>'Dr. Constantin Papilian'<BR>Cluj-Napoca<br>90 de ani de la infiintare</FONT></CENTER>"
//txt[1]= "<CENTER><FONT size='2' color='#C03B47'>La 90 de ani viata unui  om se apropie de sfarsit sau s-a sfarsit, dar un spital poate sa renasca</FONT></CENTER>"
//txt[2]= "<CENTER><FONT size='2' color='#C03B47'>asa cum a renascut <BR>Spitalului Militar de Urgenta <BR>'Dr. Constantin Papilian'<BR>Cluj-Napoca</FONT></CENTER>"
//txt[3]= "<CENTER><FONT size='2' color='#C03B47'>prin inceperea construirii primului pavilion medical modern din Romania.</FONT></CENTER>"
//txt[4]= "<CENTER><FONT size='2' color='#C03B47'>Unitatea colectivului, colegialitatea, spiritul de echipa, speranta de mai bine vor face ca acest spital sa fie vesnic viu.</FONT></CENTER>"

function txtshow()
{      
//trebuie activata linia de mai jos ca sa mearga mesajele
document.getElementById('MsgWin').innerHTML=txt[i]
//if (i<4)
//  i=i+1;
//else
//  i=0;
//setTimeout("txtshow()",6000)
}

function check_fields1()
{	
  if(document.sesizari.nume.value=='' || document.sesizari.email.value=='' || document.sesizari.mesaj.value=='')
  {
    alert("Toate cimpurile sunt obligatorii!");
    document.sesizari.nume.focus();
    return false;
  }
  else return true;
}

function check_fields2()
{	
//  alert("Intra sectie="+document.cautare.sectie_hid.value);
//  alert("Intra select1="+document.cautare.select1.value);
  if(document.cautare.select1.value=='dupa...')
  {
    alert("Alegeti un criteriu de cautare!");
    document.cautare.select1.focus();
    return false;
  }
  if(document.cautare.lab_hid.value=='' && document.cautare.select1.value=='laborator')
  {
    alert("Alegeti un laborator!");
    document.cautare.select1.focus();
    return false;
  }
  if(document.cautare.sectie_hid.value=='' && document.cautare.select1.value=='sectie')
  {
    alert("Alegeti o sectie!");
    document.cautare.select1.focus();
    return false;
  }
  if(document.cautare.medic_hid.value=='' && document.cautare.select1.value=='medic')
  {
    alert("Introduceti partial sau integral numele cautat,\nsau caracterul * pentru afisarea tuturor medicilor!");
    document.cautare.select1.focus();
    return false;
  }
  else return true;
}

function caut_dupa(criteriu)
{
//  alert("Criteriu cautare: " + criteriu);
//  document.getElementById("criteriu_cautare").innerHTML = 'cautare dupa: '+criteriu;
  
  if (criteriu == 'sectie')
  {	    
    text4sectie = "<SELECT name='select3' style='width:120px; font-family: Tahoma; font-size: 11px; color: #4A4A4A; background: #F4F4F4;' onchange='document.cautare.sectie_hid.value = this.value; document.cautare.medic_hid.value=\"\"; document.cautare.lab_hid.value=\"\"'>" 
			+"<OPTION value='' SELECTED ></OPTION>"
			+"<OPTION value='chirurgie'>chirurgie</OPTION>"                                                                          
			+"<OPTION value='oftalmologie'>oftalmologie</OPTION>"                                                                    
			+"<OPTION value='ortopedie'>ortopedie</OPTION>"                                                                          
			+"<OPTION value='orl'>orl</OPTION>"                                                                                      
			+"<OPTION value='urologie'>urologie</OPTION>"                                                                            
			+"<OPTION value='ati'>ati</OPTION>"                                                                                      
			+"<OPTION value='medicina_interna'>medicina_interna</OPTION>"                                                            
			+"<OPTION value='cardiologie'>cardiologie</OPTION>"                                                                      
			+"<OPTION value='neurologie'>neurologie</OPTION>"                                                                        
			+"<OPTION value='psihiatrie'>psihiatrie</OPTION>"                                                                        
			+"<OPTION value='pneumoftiziologie'>pneumoftiziologie</OPTION>"                                                          
			+"<OPTION value='infectioase'>infectioase</OPTION>"                                                                      
	         +"</SELECT>";                	                                                                                                     
    document.getElementById("res_id").innerHTML = text4sectie;
	 
  }
  if (criteriu == 'laborator')
  {
    text4lab = "<SELECT name='select2' style='width:120px; font-family: Tahoma; font-size: 11px; color: #4A4A4A; background: #F4F4F4;' onchange='document.cautare.sectie_hid.value = \"\"; document.cautare.medic_hid.value=\"\"; document.cautare.lab_hid.value=this.value'>"
  		+"<OPTION value='' SELECTED ></OPTION>"                                                                                 
		+"<OPTION value='radiologie'>radiologie</OPTION>"                                                                       
		+"<OPTION value='microbiologie'>microbiologie</OPTION>"                                                                 
		+"<OPTION value='biochimie'>biochimie</OPTION>"                                                                         
		+"<OPTION value='anatomie_patologica'>anatomie_patologica</OPTION>"                                                     
		+"<OPTION value='medicina_preventiva'>medicina_preventiva</OPTION>"                                                     
	      +"</SELECT>";   

    document.getElementById("res_id").innerHTML = text4lab;                                                                                                           
  }
  
  if (criteriu == 'medic')
  {
    text4medic = "<input type='text' name='medic' style='width:120px; font-family: Tahoma; font-size: 11px; color: #4A4A4A; background: #F4F4F4;' onblur='document.cautare.sectie_hid.value = \"\"; document.cautare.medic_hid.value=this.value; document.cautare.lab_hid.value=\"\"'>";    	  	
    document.getElementById("res_id").innerHTML = text4medic;
  }
  
  if (criteriu == 'dupa...' )
  {
    document.getElementById("res_id").innerHTML = '';
  } 
   
  
  
}

function check_browser()
{  
  if ((navigator.userAgent).indexOf("Opera")!=-1) 
  {
    alert("Browser recomandat Microsoft Internet Explorer 5+ !");
    //Window.close.
  }
}

function menuon(colId, menuID)
{	
	document.getElementById(colId).style.backgroundColor= '#737373';
//	document.getElementById(colId).innerHTML = '*';
	document.getElementById(menuID).style.backgroundColor= '#D4D4D4';
	
}	

function menuoff(colId, menuID)
{	
	document.getElementById(colId).style.backgroundColor= '#F4F4F4';
	document.getElementById(menuID).style.backgroundColor= '#F4F4F4';
	
}	

//for popup menu
var defaultMenuWidth="250px"

var linkset=new Array()

linkset[0]="<a href='chirurgie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Chirurgie</a>"
linkset[0]+="<a href='oftalmologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Oftalmologie</a>"
linkset[0]+="<a href='ortopedie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Ortopedie - Traumatologie</a>"
linkset[0]+="<a href='orl.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;O.R.L.</a>"
linkset[0]+="<a href='urologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Urologie</a>"
linkset[0]+="<a href='ati.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Anestezie terapie intensiva</a>"
linkset[0]+="<a href='medicina_interna.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Medicina interna</a>"
linkset[0]+="<a href='cardiologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Cardiologie</a>"
linkset[0]+="<a href='neurologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Neurologie</a>"
linkset[0]+="<a href='psihiatrie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Psihiatrie</a>"
linkset[0]+="<a href='pneumoftiziologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Pneumoftiziologie</a>"
linkset[0]+="<a href='infectioase.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Boli Infectioase</a>"

linkset[1]="<a style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"'; >[-]&nbsp;Alergologie si Imunologie clinica</a>"
linkset[1]+="<a style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Cardiologie</a>"
linkset[1]+="<a style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Chirurgie</a>"
linkset[1]+="<a style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Dermato venerologie</a>"
linkset[1]+="<a style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Diabet Zaharat, nutritie si Boli metabolice</a>"

linkset[2]="<a href='radiologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Radiologie si imagistica medicala</a>"
linkset[2]+="<a href='microbiologie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Microbiologie si Hematologie</a>"
linkset[2]+="<a href='biochimie.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Biochimie</a>"
linkset[2]+="<a href='anatomie_patologica.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Anatomie patologica</a>"
linkset[2]+="<a href='medicina_preventiva.php' style='cursor: pointer; text-decoration:none; color:#737373'; onmouseover='this.style.color=\"black\"; this.style.backgroundColor= \"D4D4D4\"'; onmouseout='this.style.color=\"#737373\"; this.style.backgroundColor= \"#EAEAEA\"';>[-]&nbsp;Medicina preventiva</a>"

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu

