//UOC 2003(c)
var ortografia='ortografia_off.gif';
var gramatica='gramatica_off.gif';
var lexic='lexic_off.gif';
var redaccio='redaccio_off.gif';
var convencions='convencions_off.gif';
var nomenclatura='nomenclatura_off.gif';

var capa_ortografia, capa_gramatica, capa_lexic, capa_redaccio, capa_convencions, capa_nomenclatura;
if (document.all){	
			
			capa_ortografia=document.getElementById('ortografia').style;
			capa_gramatica=document.getElementById('gramatica').style;
			capa_lexic=document.getElementById('lexic').style;
			capa_redaccio=document.getElementById('redaccio').style;
			capa_convencions=document.getElementById('convencions').style;
			capa_nomenclatura=document.getElementById('nomenclatura').style;			
}else{
	if (document.layers){				
			capa_ortografia=document.layers['ortografia'];
			capa_gramatica=document.layers['gramatica'];
			capa_lexic=document.layers['lexic'];
			capa_redaccio=document.layers['redaccio'];
			capa_convencions=document.layers['convencions'];
			capa_nomenclatura=document.layers['nomenclatura'];
		}else{			
			capa_ortografia=document.getElementById('ortografia').style;
			capa_gramatica=document.getElementById('gramatica').style;
			capa_lexic=document.getElementById('lexic').style;
			capa_redaccio=document.getElementById('redaccio').style;
			capa_convencions=document.getElementById('convencions').style;
			capa_nomenclatura=document.getElementById('nomenclatura').style;
	}
}

if(location.href.indexOf('criteris.html') <= -1)
{
	if(location.href.indexOf('ortografia') > -1) ortografia='ortografia_on.gif';
	if(location.href.indexOf('gramatica') > -1) gramatica='gramatica_on.gif';
	if(location.href.indexOf('lexic') > -1) lexic='lexic_on.gif';
	if(location.href.indexOf('redaccio') > -1) redaccio='redaccio_on.gif';
	if(location.href.indexOf('convencions') > -1) convencions='convencions_on.gif';
	if(location.href.indexOf('nomenclatura') > -1) nomenclatura='nomenclatura_on.gif';
}
document.write('<table cellpadding="0" cellspacing="0" border="0">');
document.write('<tr>');
document.write('	<td><img src="../../img/espai.gif" height="2" width="1"></td>');
document.write('</tr>');
document.write('<tr>');
if (document.layers){
document.write('<td><a href="#" onMouseover="shower(capa_ortografia,\'ortografia\');"><img  id="ortografia" name="ortografia" src="../../img/nivells/'+ortografia+'" border="0"></a><a href="#" onMouseover="shower(capa_gramatica,\'gramatica\')"><img  id="gramatica" name="gramatica" src="../../img/nivells/'+gramatica+'" border="0"></a><a href="#" onMouseover="shower(capa_lexic,\'lexic\')"><img id="lexic" name="lexic" src="../../img/nivells/'+lexic+'"  border="0"></a><a href="#" onMouseover="shower(capa_redaccio,\'redaccio\')"><img  width="119" id="redaccio" name="redaccio" src="../../img/nivells/'+redaccio+'"  border="0"></a><a href="#" onMouseover="shower(capa_convencions,\'convencions\')"><img  width="119" id="convencions" name="convencions" src="../../img/nivells/'+convencions+'"  border="0"></a><!--<a href="../nomenclatura/nomenclatura.html" onMouseover="shower(capa_nomenclatura,\'nomenclatura\')"><img  width="119" id="nomenclatura" name="nomenclatura" src="../../img/nivells/'+nomenclatura+'"  border="0"></a>--></td>');
}else{
document.write('<td><a href="#" onMouseover="shower(capa_ortografia,\'ortografia\');" onMouseOut="hidder(capa_ortografia);"><img  id="ortografia" name="ortografia" src="../../img/nivells/'+ortografia+'" border="0"></a><a href="#" onMouseover="shower(capa_gramatica,\'gramatica\')"  onMouseOut="hidder(capa_gramatica);"><img  id="gramatica" name="gramatica" src="../../img/nivells/'+gramatica+'" border="0"></a><a href="#" onMouseover="shower(capa_lexic,\'lexic\')"  onMouseOut="hidder(capa_lexic);"><img id="lexic" name="lexic" src="../../img/nivells/'+lexic+'"  border="0"></a><a href="#" onMouseover="shower(capa_redaccio,\'redaccio\')"  onMouseOut="hidder(capa_redaccio);"><img  width="119" id="redaccio" name="redaccio" src="../../img/nivells/'+redaccio+'"  border="0"></a><a href="#" onMouseover="shower(capa_convencions,\'convencions\')"  onMouseOut="hidder(capa_convencions);"><img  width="119" id="convencions" name="convencions" src="../../img/nivells/'+convencions+'" border="0"></a><!--<a href="../nomenclatura/nomenclatura.html" onMouseover="shower(capa_nomenclatura,\'nomenclatura\')"  onMouseOut="hidder(capa_nomenclatura);"><img  width="119" id="nomenclatura" name="nomenclatura" src="../../img/nivells/'+nomenclatura+'"  border="0"></a>--></td>');
}
document.write('</tr>');
document.write('</table>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
/*
document.write('<table cellpadding="0" cellspacing="0" width="715" border="0">');
document.write('<tr>');
document.write('	<td colspan="7"><img src="../../img/espai.gif" height="10" width="1"></td>');
document.write('</tr>');
document.write('</table>');
*/
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('<table cellpadding="0" cellspacing="0" border="0" width="756">');




function alertSize() {
  // Start code from http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=16
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' )
	  {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  }
	  else
	  {
	    if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	    {
	      //IE 6+ in 'standards compliant mode'
	      myWidth = document.documentElement.clientWidth;
	      myHeight = document.documentElement.clientHeight;
	    } 
	    else 
	    {
	      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	      {
	        //IE 4 compatible
	        myWidth = document.body.clientWidth;
	        myHeight = document.body.clientHeight;
	      }
	    }
	  }
  // End code
  
  //Capa ortografia
  var result=0;    
  if (document.all){  	
  	result=((myWidth-750)/2)+58  	
  	if (myWidth<756){
  			capa_ortografia.left=61;
		}else{	
			capa_ortografia.left=result;}  	
  }else{    	
  	if (document.layers){
	  		result=((myWidth-750)/2)+49  	
		  	if (myWidth<770){
		  			document.layers['ortografia'].left=document.layers['ortografia'].left-123;
				}else{	
						document.layers['ortografia'].left=result;}
		 }else{
	  	result=((myWidth-750)/2)+48
	  	if (myWidth<770){
	  			capa_ortografia.left=capa_ortografia.left+61;
			}else{	
					capa_ortografia.left=result;}
	}
 }
 
 //Capa gramatica
 result=0;    
  if (document.all){  	
  	result=((myWidth-750)/2)+151  	
  	if (myWidth<756){
  			capa_gramatica.left=155;
		}else{	
			capa_gramatica.left=result;}  	
  }else{    	
  	if (document.layers){
	  		result=((myWidth-750)/2)+143  	
		  	if (myWidth<770){
		  			document.layers['gramatica'].left=document.layers['gramatica'].left-7;
				}else{	
						document.layers['gramatica'].left=result;}
		 }else{
	  	result=((myWidth-750)/2)+142
	  	if (myWidth<770){
	  			capa_gramatica.left=capa_gramatica.left+155;
			}else{	
					capa_gramatica.left=result;}
	}
 }	 
 
 //Capa lexic
 result=0;    
  if (document.all){  	
  	result=((myWidth-750)/2)+250  	
  	if (myWidth<756){
  			capa_lexic.left=253;
		}else{	
			capa_lexic.left=result;}  	
  }else{    	
  	if (document.layers){
	  		result=((myWidth-750)/2)+241  	
		  	if (myWidth<770){
		  			document.layers['lexic'].left=document.layers['lexic'].left-7;
				}else{	
						document.layers['lexic'].left=result;}
		 }else{
	  	result=((myWidth-750)/2)+240
	  	if (myWidth<770){
	  			capa_lexic.left=capa_lexic.left+253;
			}else{	
					capa_lexic.left=result;}
	}
 } 
 
 //Capa redaccio
 result=0;    
  if (document.all){  	
  	result=((myWidth-750)/2)+329  	
  	if (myWidth<756){
  			capa_redaccio.left=332;
		}else{	
			capa_redaccio.left=result;}  	
  }else{    	
  	if (document.layers){
	  		result=((myWidth-750)/2)+320  	
		  	if (myWidth<770){
		  			document.layers['redaccio'].left=document.layers['redaccio'].left-7;
				}else{	
						document.layers['redaccio'].left=result;}
		 }else{
	  	result=((myWidth-750)/2)+319
	  	if (myWidth<770){
	  			capa_redaccio.left=capa_redaccio.left+332;
			}else{	
					capa_redaccio.left=result;}
	}
 } 
 
 //Capa convencions
 result=0;    
  if (document.all){  	
  	result=((myWidth-750)/2)+448
  	if (myWidth<756){
  			capa_convencions.left=451;
		}else{	
			capa_convencions.left=result;}  	
  }else{    	
  	if (document.layers){
	  		result=((myWidth-750)/2)+439  	
		  	if (myWidth<770){
		  			document.layers['convencions'].left=document.layers['convencions'].left-7;
				}else{	
						document.layers['convencions'].left=result;}
		 }else{
	  	result=((myWidth-750)/2)+438
	  	if (myWidth<770){
	  			capa_convencions.left=capa_convencions.left+451;
			}else{	
					capa_convencions.left=result;}
	}
 }  
 
} 


function hidder(nombrecapa){
	
	var miCapa;      
   
  miCapa = nombrecapa;

	if(document.layers){
		miCapa.visibility = 'hide';
	}else{		
		miCapa.visibility = 'hidden';
	}
   
	MM_swapImgRestore();
}

function shower(nombrecapa,imatge){
	var miCapa;      
  miCapa = nombrecapa;
  
  if(document.layers){	
	capa_ortografia.visibility='hide';		
	capa_gramatica.visibility='hide';
	capa_lexic.visibility='hide';		
	capa_redaccio.visibility='hide';		
	capa_convencions.visibility='hide';		
	}

if(document.layers){
	miCapa.visibility ='show';	
	if(location.href.indexOf('criteris.html') > -1)
	{
		document.images['ortografia'].src='../../img/nivells/ortografia_off.gif';
		document.images['gramatica'].src='../../img/nivells/gramatica_off.gif';
		document.images['lexic'].src='../../img/nivells/lexic_off.gif';
		document.images['redaccio'].src='../../img/nivells/redaccio_off.gif';		
		document.images['convencions'].src='../../img/nivells/convencions_off.gif';
	}
	if(location.href.indexOf('ortografia') > -1){
		document.images['gramatica'].src='../../img/nivells/gramatica_off.gif';
		document.images['lexic'].src='../../img/nivells/lexic_off.gif';
		document.images['redaccio'].src='../../img/nivells/redaccio_off.gif';
		document.images['convencions'].src='../../img/nivells/convencions_off.gif';
	}
	if(location.href.indexOf('gramatica') > -1){
		document.images['ortografia'].src='../../img/nivells/ortografia_off.gif';
		document.images['lexic'].src='../../img/nivells/lexic_off.gif';
		document.images['redaccio'].src='../../img/nivells/redaccio_off.gif';
		document.images['convencions'].src='../../img/nivells/convencions_off.gif';
	}
	if(location.href.indexOf('lexic') > -1){
		document.images['ortografia'].src='../../img/nivells/ortografia_off.gif';
		document.images['gramatica'].src='../../img/nivells/gramatica_off.gif';
		document.images['redaccio'].src='../../img/nivells/redaccio_off.gif';
		document.images['convencions'].src='../../img/nivells/convencions_off.gif';
	}
	if(location.href.indexOf('redaccio') > -1){
		document.images['ortografia'].src='../../img/nivells/ortografia_off.gif';
		document.images['lexic'].src='../../img/nivells/lexic_off.gif';
		document.images['gramatica'].src='../../img/nivells/gramatica_off.gif';
		document.images['convencions'].src='../../img/nivells/convencions_off.gif';
	}
	if(location.href.indexOf('convencions') > -1){
		document.images['ortografia'].src='../../img/nivells/ortografia_off.gif';
		document.images['lexic'].src='../../img/nivells/lexic_off.gif';
		document.images['gramatica'].src='../../img/nivells/gramatica_off.gif';
		document.images['redaccio'].src='../../img/nivells/redaccio_off.gif';
	}
	document.images[imatge].src='../../img/nivells/'+imatge+'_on.gif';
}else{		
	miCapa.visibility = 'visible';
	if(imatge)MM_swapImage(imatge,'','../../img/nivells/'+imatge+'_on.gif',1);
}



}
onresize = alertSize;
alertSize();
