
var baseurl = 'http://www.lluciariba.com';
var basename = '/ndxz-studio';

function img ( imatge , titulo , classe , W , H )
	{
		var c = (classe != ''? ' class="' + classe + '"' : '');
		var w = (W != ''? ' width="' + W + '"' : '');
		var h = (H != ''? ' height="' + H + '"' : '');
		var htmlText = '<img' + c + ' src="' + imatge + '" alt="' + titulo + '"' + w + h + ' />';
		//alert (htmlText);
		document.write (htmlText);
	}
	
	function br ( classe , ref )
	{
		if (ref != undefined) ancla(ref);
		
		switch (classe)
		{
			case 'home':
				document.write ('<img class="home" src="' + baseurl + '/files/pixel.gif" alt="space"/>');
				break;
			case 's':
				document.write ('<div style="clear: left">');
				document.write ('<img class="separador" src="' + baseurl + '/files/pixel.gif" alt="space"/>');
				break;
			default:
				document.write ('<br />');
				break;
		}
	}
	function ancla ( ref) 
	{
		document.write ('<a name="'+ ref +'" id="'+ ref +'"></a>')
	}
	
	function txt ( tag , texto , classe )
	{
		var c = (classe != ''? ' class="' + classe + '"' : '');
		document.write ('<' + tag + c + '>' + texto + '</' + tag + '>');
	}
	
	function linc ( enllas , texto , classe , finestra)
	{
		var c = (classe != ''? ' class="' + classe + '"' : '');
		var tar = (finestra != ''? ' target="' + finestra + '"' : '');
		var textHtml = '<p '+c+'><a href="' + enllas + '" tittle="' + texto + '"' + c + tar +'>' + texto + '</a></p>';
		document.write (textHtml);
	}
	/* ##################### */
	
	function insertaTitol ( titol , texto)
	{
		var textHtml = '<div id="contTitolNormal"><h1>' + titol + '</h1>' + texto + '<br /></div>';
		document.write (textHtml);
	}
	
	function insertaVideo (id, titol, imatge, texto, ref, W, H)
	{
		// alert (id);
		
		var w = (W != '' && W != undefined ? W : '640');
		var h = (H != '' && H != undefined ? H : '360');
		var video = '';
		var icona = '';
		
		var ext = imatge.substr(-4,4);
		
		ext == '.f4v'? imatge = imatge.substr(0,imatge.length-4) : ext = '.flv'; 
		
		var htmlText = '';
		htmlText += '<div id="insertaVideo">';
		htmlText += '<h1>_ ' + titol + '</h1><br />';
		
		// SHADOWBOX
		htmlText += '<a href="' + baseurl + '/videos/Llucia Riba - ' + imatge + ext + '" rel="shadowbox;width=' + w + ';height=' + h + '" >';
		
		htmlText += '<img src="' + baseurl + '/videos/Llucia Riba - ' + imatge + '.jpg" alt="' + texto + '" />';
		htmlText += '</a>';
		htmlText += '<h2>' + texto + '</h2>';
		htmlText += '</div>';
		
		//window.alert(htmlText);
		document.write (htmlText);
	}
	function insertaFlash (id, titol, imatge, texto, ref, W , H)
	{
		// alert (id);
		
		var w = (W != '' && W != undefined ? W : '900');
		var h = (H != '' && H != undefined ? H : '720');
		var video = '';
		var icona = '';
		
		var htmlText = '';
		htmlText += '<div id="insertaVideo">';
		htmlText += '<h1>_ ' + titol + '</h1>';
		htmlText += "<p><em><span class='soft'>Click sobre la imagen para reproducir<span></em></p>";
		htmlText += "<br />";
		// SHADOWBOX
		htmlText += '<a href="' + baseurl + '/galeria/Multimedia/' + imatge + '/flash.html" rel="shadowbox;width=' + w + ';height=' + h + '" >';
		
		htmlText += '<img src="' + baseurl + '/galeria/Multimedia/' + imatge + '/mini.jpg" alt="' + texto + '" />';
		htmlText += '</a>';
		htmlText += '<h2>' + texto + '</h2>';
		htmlText += '</div>';
		
		//window.alert(htmlText);
		document.write (htmlText);
	}
	function insertaWeb (id , titol , imatge , texto, ref, W , H, src, win)
	{
		// alert (id);
		
		var w = (W != '' && W != undefined ? W : '900');
		var h = (H != '' && H != undefined ? H : '720');
		var blank = '';
		
		var htmlText = '';
		htmlText += '<div id="insertaVideo">';
		htmlText += '<h1>_ ' + titol + '</h1>';
		htmlText += "<p><em><span class='soft'>Click sobre la imagen para abrir<span></em></p>";
		
		
		if (win == '_blank') 
		{
			htmlText += '<a href="' + src + '"  target="_blank">';
		}
		else
		{
			// SHADOWBOX
			htmlText += '<a href="' + src + '" rel="shadowbox;width=' + w + ';height=' + h + '">';
		}
		
		htmlText += '<img src="' + baseurl + '/galeria/Multimedia/' + imatge + '.jpg" alt="' + texto + '" />';
		htmlText += '</a>';
		htmlText += '<h2>' + texto + '</h2>';
		htmlText += '</div>';
		
		//window.alert(htmlText);
		document.write (htmlText);
	}
	
	function insertaGaleria (carpeta , id, mida, llista)
	{
		// Escriu tot de nou per cada imatge
		var imatge;
		var miniatura;
		var titol;
		var htmlText;
		
		document.write ("<p><em><span class='soft'>Click para ver la imagen ampliada<span></em></p>");
		//alert (llista.length);
		document.write ('<div class="galeria" style="max-width:750px">');
		document.write ('<ul class="gallery clearfix">');
		for (i = 0; i<llista.length; i++)
		{
			imatge = '' + baseurl + '/galeria/' + carpeta + '/Llucia Riba - ' + llista[i][0] + '.jpg';
			miniatura = '' + baseurl + '/galeria/' + carpeta + '/m/Llucia Riba - ' + llista[i][0] + '.jpg';
			
			titol = llista[i].length > 1 ? llista[i][1] : llista[i][0];
			
			htmlText = '<li class="insertaImatge">'; // neteja la variable
			
			// SHADOWBOX
			htmlText += '<a href="' + imatge + '" rel="shadowbox[gallery' + id + ']">';
			htmlText += '<img src="' + miniatura + '" alt="' + titol + '" height="' + mida + '" />';
			htmlText += '</a></li>';
			document.write (htmlText);
		}
		document.write ('</ul></div><div style="clear: left">');
	}
	
	function separador (classe)
	{
		document.write ('<div style="clear: left">');
		document.write ('<img class="' + classe + '" src="' + baseurl + '/files/pixel.gif" alt="separador"/>');
	}
