function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImgRestore() {//v1.0
 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
  doc.$imgSwaps=null; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

//Protector codi
document.oncontextmenu=function()
{
alert ('Comparsa Saudites');
return false
}

//Ocultar informació a la barra d'estat
function ocultaestat(){
window.status='Comparsa Saudites'
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=ocultaestat
document.onmouseout=ocultaestat

//Localitzador del cami

if(typeof(loc)=="undefined"||loc=="")
	{
	var loc="";
	if(document.body&&document.body.innerHTML)
		{
		var tt=document.body.innerHTML.toLowerCase();
		var last=tt.indexOf("comun_c.js\"");
		if(last>0)
			{
			var first=tt.lastIndexOf("\"",last);
			if(first>0&&first<last)loc=document.body.innerHTML.substr(first+1,last-first-1);
			}
		}
	}

//Resolució i posició iframe

var pantalla = screen.width;
var ample_ifr
var ample_marge
var alt_ifr  = screen.height;
		if (alt_ifr < 768)
			{
			ample_ifr = 760
			alt_ifr = 185
			ample_marge = 100
			
			ample_ifr1 = 750
			alt_ifr1 = 175
			}
		else if(alt_ifr > 1000)
			{
			ample_ifr = 800
			alt_ifr = 560
			ample_marge = 200
			
			ample_ifr1 = 780
			alt_ifr1 = 555
			} 
		else
			{
			ample_ifr = 800
			alt_ifr = 315
			ample_marge = 110
			
			ample_ifr1 = 780
			alt_ifr1 = 310
			}		

//Obri pągina flotant

function obripg(pagina, ample, alt)	{
var pantalla = screen.width;
var alt_pant = screen.height;
var esquerra = (pantalla-ample)/2;
var amunt = (alt_pant-alt)/2;

if (ample=="0")
	{
	ample = pantalla;
	alt = alt_pant;
	esquerra = 0;
	amunt=0;
	}

window.status='Comparsa Saudites - Ontinyent'
Vent=window.open(pagina, 'Vent','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=yes, resizable=1,width='+ample+',height='+alt+',left='+esquerra+',top='+amunt);
}

//Obri finestra amb l'imatge seleccionada

function envia(imatge, text, ample, alt)	{

var pantalla = screen.width;
var alt_pant = screen.height;
var esquerra = (pantalla-ample)/2;
var amunt = (alt_pant-alt)/2;
var titol = document.title;
if (ample=="0")
	{
	ample = pantalla;
	alt = alt_pant;
	esquerra = 0;
	amunt=0;
	}
	
if (text == "")
	{
	text = titol;
	}

window.status='Comparsa Saudites - Ontinyent'
newWin=window.open('','newWin','toolbar=no, scrollbars=yes, location=no,directories=no, status=no,resizable=yes, copyhistory=no, width='+ample+', height='+alt+', top='+amunt+', left='+esquerra+'');


//newWin.focus();

newWin.document.writeln("<HTML><HEAD><TITLE>Comparsa Saudites</TITLE><meta http-equiv='imagetoolbar' content='no'></HEAD>");
newWin.document.write("<script language='javascript'>");
newWin.document.write("document.oncontextmenu=function()");
newWin.document.write("{");
newWin.document.write("alert ('Comparsa Saudites');");
newWin.document.write("return false");
newWin.document.write("}");
newWin.document.write("<\/script>");
newWin.document.write("<link rel='stylesheet' type='text/css' href='"+loc+"../comuns/saudites.css'>");
newWin.document.write("<BODY>");
newWin.document.write("<center><img border='1' src="+ imatge +"><p class='normal_n_noidt'>"+ text);
newWin.document.write("<FORM><INPUT type='image' src='"+loc+"cerrar.gif' onClick='window.close();'>");
newWin.document.write("</FORM></DIV></BODY></HTML>");
newWin.document.close();  
}
