// JavaScript Document

function mapa() {
var winl = (screen.width - 750) / 2;
var wint = (screen.height - 550) / 2;
winprops = 'width=750,height=550,top='+wint+',left='+winl+',scrollbars=yes,resizable'
win = window.open('mapa.html', 'mapa', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function noticia(idfitxa) {
var winl = (screen.width - 600) / 2;
var wint = (screen.height - 525) / 2;
winprops = 'width=550,height=450,top='+wint+',left='+winl+',scrollbars=yes,resizable'
win = window.open('noticia.html?idfitxa=' + idfitxa, 'noticia', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function foto(foto) {
var winl = (screen.width - 600) / 2;
var wint = (screen.height - 525) / 2;
winprops = 'width=600,height=525,top='+wint+',left='+winl+',scrollbars=no,resizable'
win = window.open('foto.html?foto=' + foto, 'Galeria', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}


function foto_amb_peu(foto, peu) {
var winl = (screen.width - 1000) / 2;
var wint = (screen.height - 875) / 2;
winprops = 'width=600,height=525,top='+wint+',left='+winl+',scrollbars=no,resizable'
win = window.open('foto.html?foto=' + foto + '&peu=' + peu, 'Galeria', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function foto_(idfitxa, width_, height_) {
var width = width_ + 50;
var height = height_ + 100;
var winl = (screen.width - width) / 2;
var wint = (screen.height - height) / 2;
winprops = 'width='+width+',height='+height+',top='+wint+',left='+winl+',scrollbars=no,resizable'
win = window.open('foto.html?idfitxa=' + idfitxa, 'Galeria', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function llegirGET(cadenaGET, nomVariable) {
        var cadGET = cadenaGET;
        var arrGET = cadGET.split("&");
        var asocGET = new Array();
        var variable = "";
        var valor = "";
        for(i=0; i< arrGET.length;i++){
          var aux = arrGET[i].split("=");
          variable = aux[0];
          valor = aux[1];
          asocGET[variable] = valor;
        }
        //return asocGET;
        return asocGET[nomVariable];
}

function getImatgePortada() {
        images = new Array(6);
        images[0] = "../img/1.jpg";
        images[1] = "../img/2.jpg";
        images[2] = "../img/3.jpg";
        images[3] = "../img/4.jpg";
        images[4] = "../img/5.jpg";
        images[5] = "../img/6.jpg";
	index = Math.floor(Math.random() * images.length);
        return images[index];
}

function mostrarNoticia(idnoticia) {
var winl = (screen.width - 550) / 2;
var wint = (screen.height - 450) / 2;
winprops = 'width=550,height=450,top='+wint+',left='+winl+',scrollbars=yes,resizable'
win = window.open('noticia' + idnoticia +'.html', 'noticia', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


