function topframe() 
{ 
	document.top.topFrame.location.href = "topframe.php"; 
} 

function comprova_res()
{// comprova la resolucio de pantalla si es mes gran de 1024 x 768 escriu el contigut de pinta
	var hz=window.screen.height;
	var wz=window.screen.width;	
	var pinta = "<style type='text/css' media='screen'>.regisre1 {font-size:14px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-weight: normal;}</style>"
	if (wz > 1024)
		document.write(pinta);
	else
	{
		pinta = "<style type='text/css' media='screen'>.red {font-size:9px; color: #890000; font-family: Verdana, Arial, Helvetica, sans-serif;font-weight: normal;}</style>"
		document.write(pinta);
	}
}

function boton(objeto,cas)
{
	if(cas)
		objeto.style.border = '1px inset #B0B0A0';
	else
		objeto.style.border = '1px outset #B0B0A0';
}

function MM_reloadPage(init) 
{  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

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


function MM_openBrWindowPopUp(theURL,winName,w,h) { //v2.0

   var availHeight = screen.availHeight;
   var availWidth = screen.availWidth;
 
   var x = 0, y = 0; 
   if (document.all) {
        x = window.screenTop; 
        y = window.screenLeft;
   }
   else if (document.layers) {  
        x = window.screenX;
        y = window.screenY;
   }
   
 
   t = (screen.height / 2) - (h / 2);
   l = (screen.width /2) - (w / 2);
 

   var arguments = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width='+w+',height='+h+',left='+l+',top='+t;
   var newWindow = window.open(theURL,'popup','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width='+w+',height='+h+',left='+l+',top='+t);
 
   newWindow.focus();
}


function cambia(objeto,bandera)
{
    if(!document.layers){
      if(bandera)      
        objeto.style.backgroundColor='#F7F7F7';    
      else        
        objeto.style.backgroundColor='#ededed';             
    }
}
function cambia2(objeto2,bandera2)
{
    if(!document.layers){
      if(bandera2)      
        objeto2.style.backgroundColor='#ECEAEA';             
      else        
        objeto2.style.backgroundColor='#F7F7F7';             
    }
}
if(document.getElementById('anti'))
{
	noesprai2 = new Image();
	noesprai2.src = "../../img/imgparques/no-esprai2-1.jpg";
	anti2 = new Image();
	anti2.src = "../../img/imgparques/anti-graf2.jpg";
	noesprai1 = new Image();
	noesprai1.src = "../../img/imgparques/no-esprai.jpg";
	anti1 = new Image();
	anti1.src = "../../img/imgparques/anti-graf.jpg";
}
function cambia3(objeto2,bandera2)
{
	if(!document.layers)
	{
   		if(bandera2)
		{
        	objeto2.style.backgroundColor='#ECEAEA';
			document.noesprai.src = noesprai2.src;
			document.anti.src = anti2.src;			
		}
        else
		{       
        	 objeto2.style.backgroundColor='#F7F7F7';
			 document.noesprai.src = noesprai1.src;
			 document.anti.src = anti1.src;
		}
    }
}
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 seleccio(cas)
	{
		if(cas==1)
		{
			if (document.form.CatalogoFundicionductil.checked == true)
					document.form.CatalogoFundicionductil.checked = false;
			else 
				document.form.CatalogoFundicionductil.checked = true;
		}
		else if(cas==2)
		{
			if (document.form.CatalogoParquesyjardines.checked == true)
				document.form.CatalogoParquesyjardines.checked = false;
			else
				document.form.CatalogoParquesyjardines.checked = true;
		}			
		else if(cas==3)
		{
			if (document.form.CatalogoIguladaprefabricados.checked == true)
				document.form.CatalogoIguladaprefabricados.checked = false;
			else
				document.form.CatalogoIguladaprefabricados.checked = true;
		}
		else if(cas==4)
		{
			if (document.form.CatalogoJuegos.checked == true)
				document.form.CatalogoJuegos.checked = false;
			else
				document.form.CatalogoJuegos.checked = true;						
		}
		else if(cas==5)
		{
			if (document.form.Promofabregas2012.checked == true)
				document.form.Promofabregas2012.checked = false;
			else
				document.form.Promofabregas2012.checked = true;						
		}
		else if(cas == 6)
		{
			if (document.form.CatalogoTapasRuido.checked == true)
				document.form.CatalogoTapasRuido.checked = false;
			else
				document.form.CatalogoTapasRuido.checked = true;						
		}	
	}
	
function comprova_res_imatge(imatge)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img src='../img/"+imatge+".jpg' alt='Municipalia 2007' name='muni2007' width='430' height='95' id='muni2007' nosend='1' />"
	if (wz >= 1024)
		document.write(pinta);
	else
	{
		pinta = "<img src='../img/"+imatge+"-800.jpg' alt='Municipalia 2007' name='muni2007' width='250' height='55' id='muni2007' nosend='1' />"
		document.write(pinta);
	}
			
}
function comprova_res_imatge_(imatge)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img src='../img/"+imatge+".jpg' alt='Municipalia 2007' name='muni2007' width='430' height='95' id='muni2007' nosend='1' />"
	if (wz >= 1024)
		document.write(pinta);
	else
	{
		pinta = "<img src='../img/"+imatge+"-800.jpg' alt='Municipalia 2007' name='muni2007' width='250' height='55' id='muni2007' nosend='1' />"
		document.write(pinta);
	}
			
}

function comprova_res_text(text)
{// comprova la resolucio de pantalla per escollir si surt un texte
	var hz = window.screen.height;
	var wz = window.screen.width;	
	if (wz >= 1024)
		document.write(text);		
}
function comprova_res_ininci(cas)
{// comprova la resolucio de pantalla per la pantalla de inici quedi centrada	
	var hz = window.screen.height;
	var wz = window.screen.width;	
	if (!cas)
	{
		if (wz > 1024)
			document.write("<style type='text/css' media='screen'>#todo {background: url(imgindex/fons_bo.gif) repeat top left; WIDTH: 752px; height: 1165px; z-index:1; margin:auto; margin-top:14px;}</style>");
		else if (wz == 1024)
			document.write("<style type='text/css' media='screen'>#todo {background: url(imgindex/fons_bo.gif) repeat top left; WIDTH: 752px; height: 1165px; z-index:1; margin:auto; margin-top:14px;}</style>");
		else	
			document.write("<style type='text/css' media='screen'>#todo {background: url(imgindex/fons_bo.gif) repeat top left; WIDTH: 752px; height: 1165px; z-index:1; margin:auto; margin-top:14px;}</style>");	
	}
	else
	{
		if (wz > 1024)
			document.write("<style type='text/css' media='screen'>#todo {background: url(imgindex/fons_bo.gif) repeat top left;MARGIN-LEFT: -342px;WIDTH: 752px;height: 1165px;z-index:1; margin:auto; margin-top:14px;}</style>");
		else if (wz == 1024)
			document.write("<style type='text/css' media='screen'>#todo {background: url(imgindex/fons_bo.gif) repeat top left;MARGIN-LEFT: -342px;WIDTH: 752px;height: 1165px;z-index:1; margin:auto; margin-top:14px;}</style>");
		else	
			document.write("<style type='text/css' media='screen'>#todo {background: url(imgindex/fons_bo.gif) repeat top left;MARGIN-LEFT: -342px;WIDTH: 752px;height: 1165px;z-index:1; margin:auto; margin-top:14px;}</style>");			
	}
}
// JavaScript Document

function comprova_res_imatge1(imatge)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img style='padding-right:10px;' src='../img/"+imatge+".jpg' width='300' height='225' name='munici1' alt='Municipalia 2007 Fábregas mobiliario Urbano'>";
	if (wz >= 1024)
		document.write(pinta);
	else
	{
		pinta = "<img src='../img/"+imatge+"-800.jpg' width='200' height='150' name='munici1' alt='Municipalia 2007 Fábregas mobiliario Urbano'>";
		document.write(pinta);
	}			
}
function comprova_res_imatge1_(imatge)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img style='padding-right:10px;' src='../img/"+imatge+".jpg' width='300' height='225' name='munici1' alt='Municipalia 2007 Fábregas mobiliario Urbano'>";
	if (wz >= 1024)
		document.write(pinta);
	else
	{
		pinta = "<img src='../img/"+imatge+"-800.jpg' width='200' height='150' name='munici1' alt='Municipalia 2007 Fábregas mobiliario Urbano'>";
		document.write(pinta);
	}			
}

function comprova_res_imatge2(imatge)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img style='padding-right:10px;' src='../img/"+imatge+".jpg' width='290' height='225' name='munici3' alt='Municipalia 2007 Fábregas mobiliario Urbano'>";
	if (wz > 1025)
		document.write(pinta);			
}

function comprova_res_imatge2_(imatge)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img style='padding-right:10px;' src='../img/"+imatge+".jpg' width='290' height='225' name='munici3' alt='Municipalia 2007 Fábregas mobiliario Urbano'>";
	if (wz > 1025)
		document.write(pinta);			
}


function comprova_res_imatges(imatge, width, height, alt)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img src='../img/"+imatge+".jpg' name='"+imatge+"' alt='"+alt+"' border='0'>";
	if (wz > 1025)
		document.write(pinta);
	else
	{
		pinta = "<img src='../img/"+imatge+"-1024.jpg' name='"+imatge+"' alt='"+alt+"' border='0'>";
		document.write(pinta);
	}			
}

function comprova_res_imatges2(imatge, width, height, alt)
{// comprova la resolucio de pantalla per escollir tamany de la imatge
	var hz = window.screen.height;
	var wz = window.screen.width;	
	var pinta = "<img src='../img/"+imatge+".jpg' name='"+imatge+"' alt='"+alt+"' border='0'>";
	if (wz > 1025)
		document.write(pinta);
	else
	{
		pinta = "<img src='../img/"+imatge+"-1024.jpg' name='"+imatge+"' alt='"+alt+"' border='0'>";
		document.write(pinta);
	}			
}

function paginacio_res()
{// comprova la resolucio de pantalla si es mes gran de 1024 x 768 escriu el contigut de pinta
	var hz=window.screen.height;
	var wz=window.screen.width;	
	var pinta = "2"
	if (wz > 1024)
		document.write(pinta);
	else
	{
		pinta = "1"
		document.write(pinta);
	}
}

function muestraImagen(img, descripcion)
{
	tb_show(descripcion, "../img/" + img);
}

function muestraImagen2(img, descripcion)
{
	tb_show(descripcion, "../../img/" + img);
}
