<!--

function changeImages(arg,img) {
	arg.style.background="url("+img+")";
	}
	
//functii pt rollover pe imagini, butoane
function changeImage(img){
if(document.getElementById)
ob=document.getElementById(img);
else
//ob=document[img];
ob=eval("document."+img);
if(ob){
	if(ob.src.indexOf("_on.gif")==-1){
		ob.src=ob.src.replace(".gif","_on.gif");
		}
	else if(ob.src.indexOf("_on.gif")!=-1){
		ob.src=ob.src.replace("_on.gif",".gif");
		}
	}
}

function x(){
if(document.getElementById)
	var tabel=document.getElementById("<?=$pg;?>_meniu");
else
	//var tabel=document["<?=$pg;?>_meniu"];
	var tabel=eval("document."+"<?=$pg;?>_meniu");
	
	if(tabel){
	var aReturn=tabel.getElementsByTagName("img");
		for(i=0;i<aReturn.length;i++){
			aReturn[i].style.cursor="pointer";
			
			aReturn[i].onmouseover=function(){
			changeImage(this.id);
			}
			aReturn[i].onmouseout=function(){
			changeImage(this.id);
			}
			
			/*aReturn[i].onclick=function(){
			document.location.href="main.php?fc=<?=$fc?>&pg="+this.id;
			}*/
		}
	}
}


function changeButton(){
	var aReturn=document.getElementsByTagName("input");
		for(i=0;i<aReturn.length;i++){
			if(aReturn[i].type=="button" || aReturn[i].type=="submit" || aReturn[i].type=="reset"){
				this.className="button";
				
				aReturn[i].onmouseover=function(){
				this.className="button_on";
				}
				aReturn[i].onmouseout=function(){
				this.className="button";
				}
				
				/*aReturn[i].onclick=function(){
				document.location.href="main.php?fc=<?=$fc?>&pg="+this.id;
				}*/
			}
		}
	
}

function changeText(){
	var aReturn=document.getElementsByTagName("input");
		for(i=0;i<aReturn.length;i++){
			if(aReturn[i].type=="text"){
								
				aReturn[i].onfocus=function(){
				this.style.border="1px solid #c40204";
				}
				aReturn[i].onblur=function(){
				this.style.border="1px solid #336699";
				}
			}
		}
		
		var aReturn=document.getElementsByTagName("textarea");
		for(i=0;i<aReturn.length;i++){
										
				aReturn[i].onfocus=function(){
				this.style.border="1px solid #c40204";
				}
				aReturn[i].onblur=function(){
				this.style.border="1px solid #336699";
				}
		}
		
		var aReturn=document.getElementsByTagName("select");
		for(i=0;i<aReturn.length;i++){
										
				aReturn[i].onfocus=function(){
				this.style.border="1px solid #c40204";
				}
				aReturn[i].onblur=function(){
				this.style.border="1px solid #336699";
				}
		}
		
		var aReturn=document.getElementsByTagName("option");
		for(i=0;i<aReturn.length;i++){
										
				aReturn[i].onfocus=function(){
				this.style.border="1px solid #c40204";
				}
				aReturn[i].onblur=function(){
				this.style.border="1px solid #336699";
				}
		}
		
		
	
}

function newWindow(url, win_name, height, width, toolbar, menubar, scrollbars, 
                   location, resizable, directories) {

    // Assign Defaults
    height      = (height != null) ? height : 600;
    width       = (width != null) ? width : 800;
    toolbar     = (toolbar != null) ? toolbar: 'no';
    menubar     = (menubar != null) ? menubar: 'no';
    scrollbars  = (scrollbars != null) ? scrollbars: 'yes';
    location    = (location != null) ? location: 'no';
    resizable   = (resizable != null) ? resizable: 'no';
    directories = (directories != null) ? directories: 'no';

    // Create features string
    var features = "'toolbar=" + toolbar +
                   ",menubar=" + menubar +
                   ",scrollbars=" + scrollbars +
                   ",location=" + location +
                   ",resizable=" + resizable +
                   ",directories=" + directories +
                   ",height=" + height +
                   ",width=" + width +
				   "'";
	win_name.onload=function(){
		this.focus();
		//this.parent.document.onclose=function(){this.close()};
	
	};
	
	
	
	// Intialize and display our new window
	window.open(url, win_name, features);
}

//////////////////////////////////////
function loadSource(s){document.body.innerHTML=s;}
// -->

function setImage(imgName, type) {
	//type = 0-23
   if (document.images) {
      document.images[imgName].filters["DXImageTransform.Microsoft.Fade"].apply( );
      if (type == "hilite") {
          document.images[imgName].src = imagesHilite[imgName].src;
      } else if (type == "normal") {
          document.images[imgName].src = imagesNormal[imgName].src;
      }
      document.images[imgName].filters["DXImageTransform.Microsoft.Fade"].play( );
      return true;
   }
   return false;
}
//////////////////////////////////////////
show=false;
function showDiv(divId){
//alert(show);

if(show==false){
document.getElementById(divId).style.visibility="visible";
show=true;
}else{

document.getElementById(divId).style.visibility="hidden";
show=false;
}

}
