

/*********************************************************************************/
/*		BARRA D'EINES		*/
/*********************************************************************************/
var gFinBar; // Contindrà la capa amb la finestra de la barra d'eines
function escribirBarraEines(nivell)
{
	if (!nivell){ tmp=".";	}
	else if (nivell == 'nivell1'){ tmp=".";	}
	else if (nivell == 'nivell2'){ tmp="..";	}
	else if (nivell == 'nivell3'){ tmp="../..";	}
	else if (nivell == 'nivell4'){ tmp="../../..";	}
	else	{ alert("S'ha sobrepassat el nombre màxim de nivells. Mirar partsComuns.js.");	}

	txt = "";
	txt += '<div style="position:relative; z-index:5;">                                                                                                                                                                                                                                                                           ';	
	txt += '	<img src="' + tmp + '/img/ikonos/barra-icones.gif" useMap="#mapaBarraIcones" border="0">                                                                                                                                                                                                                      ';
	txt += '	<map name="mapaBarraIcones">                                                                                                                                                                                                                                                                         ';
	txt += '	  <area shape="rect" coords="3,1,39,38" 									onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(000, \'Crea un boletín nuevo.\');">                                                  ';
	txt += '	  <area shape="rect" coords="40,0,77,37" 									onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(000, \'Abre un boletín para que pueda ser editado.\');">                             ';
	txt += '	  <area shape="rect" coords="77,0,114,39" 									onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(000, \'Guarda el boletín.\');">                                                      ';
	txt += '	  <area shape="rect" coords="114,1,152,38" 	href="' + tmp + '/comoFunciona/crearNoticia.php" 		onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(117, \'Crea una noticia nueva.\');">                                                 ';
	txt += '	  <area shape="rect" coords="152,1,192,36" 	href="' + tmp + '/comoFunciona/modificarNoticia.php" 	onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(155, \'Modifica una noticia ya existente.\');">                                  ';
	txt += '	  <area shape="rect" coords="191,-1,229,38" href="' + tmp + '/comoFunciona/crearNoticiaAmpliada.php" onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(193, \'Crea la amplicación de una noticia.\');">                                                     ';
	txt += '	  <area shape="rect" coords="230,1,271,39" 	href="' + tmp + '/comoFunciona/crearPieDePagina.php"	onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(231, \'Crea el pie de página. Éste es aplicable tanto al boletín como a las noticias ampliadas.\');">';
	txt += '	  <area shape="rect" coords="270,0,308,39" 	href="' + tmp + '/comoFunciona/modificarDiseno.php"		onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(272, \'Permite cambiar las fotos y los links generales del boletín.\');">                            ';
	txt += '	  <area shape="rect" coords="308,0,347,36" 	href="' + tmp + '/comoFunciona/modificarLinks.php"		onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(309, \'Permite modificar los links de debajo del banner. Su número puede variar de 1 a 8\');">       ';
	txt += '	  <area shape="rect" coords="346,0,384,38" 	href="' + tmp + '/comoFunciona/libretaDirecciones.php" 	onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(347, \'Libreta de direcciones y campañas de mailing.\');">                                           ';
	txt += '	  <area shape="rect" coords="383,1,423,37" 	href="' + tmp + '/comoFunciona/enviar.php" 				onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(387, \'Enviar\');">                                                                                  ';
	txt += '	  <area shape="rect" coords="424,1,461,37" 									onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(000, \'Recarga el boletín\');">                                                      ';
	txt += '	  <area shape="rect" coords="465,0,503,39" 	href="' + tmp + '/comoFunciona/ftp.php" 			onMouseOut="mouseForaBarraEines();"	onMouseOver="mouseSobreBarraEines(464, \'Servicio FTP.\');">                                           ';
	txt += '	</map>                                                                                                                                                                                                                                                                                               ';
	txt += '</div>                                                                                                                                                                                                                                                                           ';	
	txt += '<div style="position:absolute; z-index:4;">                                                                                                                                                                                                                                                                           ';	
				if (!is.ie)	 	iTmp1 = 38;
				else			iTmp1 = 42;
	txt += '	<div id="highlightBarraEines" style="position:absolute; top:-' + iTmp1 + 'px; left:155px; visibility:hidden;">                                                                                                                                                                                                                                                                           ';	
	txt += '		<img src="' + tmp + '/img/highlight-barra-eines.gif">                                                                                                                                                                                                                                                                       ';	
	txt += '	</div>                                                                                                                                                                                                                                                                            ';	
	txt += '</div>                                                                                                                                                                                                                                                                           ';	
	txt += '<div id="descripcioBarraEines" class="gristxt">                                                                                                                                                                                                                                                      ';
	txt += '	&nbsp;<!-- aquí dins hi va la descripció de les icones de la barra d\'eines -->                                                                                                                                                                                                                  ';
	txt += '</div>                                                                                                                                                                                                                                                                           ';	
	document.write(txt);
	gFinBar = MM_findObj("highlightBarraEines");
}

function mouseForaBarraEines()
{
	MM_setTextOfLayer('descripcioBarraEines','','&nbsp;');
	gFinBar.style.visibility = "hidden";
}

function mouseSobreBarraEines(tLeft, txt)
{
	MM_setTextOfLayer('descripcioBarraEines','',txt);
	if (tLeft > 0) {
		gFinBar.style.left = tLeft;
		gFinBar.style.visibility = "visible";
	}
}


/*********************************************************************************/
/*		BANNER		*/
/*********************************************************************************/
var gBannerEnMoviment = false;
var gbBanner; 			// Agafarà el valor de TRUE o FALSE al fitxer .php on es carrega aquest .js(d'una Session)
var gNivellBanner="";	// Es guarda el nivell de quan fem la crida a "escriuBanner()" per utilitzar-ho a amagaBanner(), ensenyaBanner() I bannerVisibleSession()
var gNumBanner = 1;		// De 1 a 4
function escriuBanner(nivell, titol, bn)
{
	if (!nivell){ tmp=".";	}
	else if (nivell == 'nivell1'){ tmp=".";	}
	else if (nivell == 'nivell2'){ tmp="..";	}
	else if (nivell == 'nivell3'){ tmp="../..";	}
	else if (nivell == 'nivell4'){ tmp="../../..";	}
	else	{ alert("S'ha sobrepassat el nombre màxim de nivells. Mirar partsComuns.js.");	}
	
	gNivellBanner = tmp;

	if (gbBanner){
		tmpHeight = 246;
		tmpVisibility = 'visible';
		tmpPestanya = 'pestanyaAmaga.gif';
		tmpStr = "Ocultar banner";
	}
	else{
		tmpHeight = 1;
		tmpVisibility = 'hidden';
		tmpPestanya = 'pestanyaEnsenya.gif';
		tmpStr = "Mostrar banner";
	}

	txt = "";
	txt += '<center>                                                                                                                                                                                                                                                                                  ';
	txt += '	<div id="bannerSupDiv" style="position:relative; top:0px; height:' + tmpHeight + 'px; border: 1px solid #FFFFFF; visibility:' + tmpVisibility + ';overflow:hidden;">                                                                                                                                                                 ';
	txt += '	<div style="position:absolute; left:6; width:757px; height:244px;" align="center">';
	if (flashinstalled == 2){
		txt += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="757" height="244" id="banner" align="middle">';
		txt += '<param name="allowScriptAccess" value="sameDomain" />';
		txt += '<param name="movie" value="' + tmp + '/img/banners/banner'+gNumBanner+'.swf" />';
		txt += '<param name="quality" value="high" />';
		txt += '<param name="bgcolor" value="#ffffff" />';
		txt += '<param name="wmode" value="transparent" />';
		txt += '<embed src="' + tmp + '/img/banners/banner'+gNumBanner+'.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="757" height="244" name="banner" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		txt += '</object>';
	}
	else{
		txt += '<img src="' + tmp + '/img/banners/banner.jpg" border="0" alt="download">';
	}
	txt += '	</div><div style="position:absolute; left:6; width:757; height:244;"><a href="' + tmp + '/download.php" alt="download">';
	txt += '		<img src="' + tmp + '/img/transparent.gif" width="757" height="244" border="0">';
	txt += '	</a></div>';
	
	txt += '	</div>                                                                                                                                                                                                                                                                                ';
	txt += '	<div style="position:relative; top:3px; width:757px; height:45px; background-image: url(' + tmp + '/img/banners/fonsBarraVerda.gif); layer-background-image: url(' + tmp + '/img/banners/fonsBarraVerda.gif); border: 1px solid #FFFFFF;">                                                                    ';
	txt += '		                                                                                                                                                                                                                                                                                  ';
	txt += '		<div style="position:absolute; left:0px; top:0px; width:100%;"><img id="pestanyaBannerImg" src="' + tmp + '/img/banners/' + tmpPestanya + '" border="0"></div>                                                                                                                                     ';
	//txt += '		<div id="strMostraOcultaBannerDiv" style="position:absolute; left:0px; top:10px; width:100%;" class="grisEspaiat">' + tmpStr + '</div>                                                                                                                                     ';

	txt += '		<div style="position:absolute; left:0px; top:3px; width:99%;" align="right"><img src="' + tmp + '/img/banners/gmkPressV1.7.gif" border="0"></div>                                                                                                                                     ';
	txt += '		<div style="position:absolute; left:0px; top:27px; width:99%;" align="right" class="unAltreVerd">Crea campañas de Email Marketing</div>                                                                                                                                     ';
	if (titol) txt += '		<div style="position:absolute; left:20px; top:10px; width:500px;" align="left" class="blancGran">' + titol + '</div>                                                                                                                                     ';
    txt += '                                                                                                                                                                                                                                                                                          ';
	txt += '		<!-- Tapa del banner inferior -->                                                                                                                                                                                                                                                 ';
	txt += '		<div style="position:absolute; top:0px; left:0px; width:757px; height:45px;"><a href="#" onClick="mouBanner();" alt="Oculta/Visualiza el banner superior" title="Oculta/Visualiza el banner superior"><img src="' + tmp + '/img/transparent.gif" width="757px" height="45px" border="0"></a></div>';
	txt += '	</div>                                                                                                                                                                                                                                                                                ';
	txt += '</center>                                                                                                                                                                                                                                                                                 ';
	if (jsUsuari != ""){
		txt += '<div style="position:relative; top:6px; left:-9px;" align="right"><a href="' + tmp + '/scripts/desconnectarUsuari.php" target="frameOcult" class="vermellLink"> desconectar ' + jsUsuari + '</a></div>';
	}

	txt += '<br>';
	document.write(txt);
		
}

function mouBanner()
{
	if (!gBannerEnMoviment){
		gBannerEnMoviment = true;

		if (gbBanner){
			amagaBanner();
		}
		else{
			ban = MM_findObj('bannerSupDiv');
			ban.style.visibility = "visible";
			ensenyaBanner();
		}
	}
}

function amagaBanner()
{
	ban = MM_findObj('bannerSupDiv');
	if (!ban) return;
	alcada = parseInt(ban.style.height);
	if (alcada > 5){ 	
		alcada -= alcada / 5;
	}
	else{
		alcada = 1;
		pest = MM_findObj("pestanyaBannerImg");
		pest.src = gNivellBanner + "/img/banners/pestanyaEnsenya.gif";
		tmpDiv = MM_findObj("strMostraOcultaBannerDiv");
		if (tmpDiv){
			tmpDiv.innerHTML = "Mostrar banner";
		}
		ban.style.visibility = "hidden";
		gBannerEnMoviment = false;
		gbBanner = false;
		bannerVisibleSession(gbBanner);
	}
	ban.style.height = alcada + "px";
	
	if (alcada > 1) setTimeout("amagaBanner()",50);		
}

function ensenyaBanner()
{
	var jaEstic = false;
	ban = MM_findObj('bannerSupDiv');
	if (!ban) return;
	alcada = parseInt(ban.style.height);
	if (alcada <= 246){ 	
		alcada += (alcada / 3) + 1;
		if (alcada > 246){
			 alcada = 246;
			 jaEstic = true;
		}
	}
	if (jaEstic){
		pest = MM_findObj("pestanyaBannerImg");
		pest.src=gNivellBanner + "/img/banners/pestanyaAmaga.gif";
		tmpDiv = MM_findObj("strMostraOcultaBannerDiv");
		if (tmpDiv){
			tmpDiv.innerHTML = "Ocultar banner";
		}
		gBannerEnMoviment = false;
		gbBanner = true;
		bannerVisibleSession(gbBanner);
	}
	ban.style.height = alcada + "px";
	
	if (!jaEstic) setTimeout("ensenyaBanner()",50);		
}
	
	
function bannerVisibleSession(visible){
	if (visible) 	tmp = "true";
	else			tmp = "false";
	ifrm = MM_findObj("frameOcult");
	ifrm.src = gNivellBanner + "/scripts/guardaSessions.php?banVis=" + tmp;
}
	
	
	


/*********************************************************************************/
/*		BARRA INFERIOR		*/
/*********************************************************************************/

function escribirFooter(nivell)
{
	tmp = "";
	if (!nivell){ tmp=".";	}
	else if (nivell == 'nivell1'){ tmp=".";	}
	else if (nivell == 'nivell2'){ tmp="..";	}
	else if (nivell == 'nivell3'){ tmp="../..";	}
	else if (nivell == 'nivell4'){ tmp="../../..";	}
	else	{ alert("S'ha sobrepassat el nombre màxim de nivells. Mirar menu.js.");	}

	txt = "";
	txt += '<center>                                                                                                                                                                                                            ';
	txt += '	<div style="position:relative; width:773px; height:25px; background-image: url(' + tmp + '/img/degradatFranjaFinal.gif); layer-background-image: url(' + tmp + '/img/degradatFranjaFinal.gif); border: 1px solid #84A49C;" align="left">';
	txt += '		<div style="position:relative; top:3px; left:10px;">';
	txt += '			<img src="' + tmp + '/img/iconesFranjaInf.gif" width="83" height="19" border="0" usemap="#footerMap">';
	txt += '			<map name="footerMap">											';
	txt += '			  	<area shape="rect" coords="-1,1,19,18" href="' + tmp + '/index.php" alt="ir a la home">            ';
	txt += '				<area shape="rect" coords="23,-1,43,17" href="' + tmp + '/siteMap.php" alt="ir al mapa de la web">           ';
	txt += '			  	<area shape="rect" coords="45,1,63,20" href="mailto:info@gmkpress.com" alt="enviar correo electrónico a un amigo">            ';
	txt += '				<area shape="rect" coords="64,1,83,19" href="#" onClick="imprimir()" alt="imprimir esta página">            ';
	txt += '			</map>                                                          ';
	txt += '	</div>';
	txt += '		<div style="position:absolute; top:5px; left:100px; width:85%;" align="right" class="verdeoscuro">copyright 2005 GMK Press ©</div>                                                                       ';
	txt += '	</div>                                                                                                                                                                                                          ';
	txt += '</center>                                                                                                                                                                                                           ';
	document.write(txt);
}
	

function imprimir()
{ 
	
	if (window.print) {
	    window.print() ;  
	}
}
