// Writes the standard header 
// valign = 'middle' by default
// halign = 'center' by default
// height = '100%'   by default
// width  = '760px'  by default
function header(valign,halign,height,width)
{
    if (valign==undefined) valign = "middle";
    if (halign==undefined) halign = "center";
    if (height==undefined) height = "100%";
    if (width ==undefined) width  = "760px";
    document.write("<TABLE border='0' align='center' height='"+height+"' width='"+width+"'>");
    document.write("<TR valign='"+valign+"' height='100%'><TD colspan='3' align='"+halign+"'>");
}

// Writes the standard footer
// farolito = true  by default
// mail     = ''    by default
function footer(farolito, mail)
{

    if (mail==undefined) mail = "&nbsp";
    if (farolito==undefined) farolito = 1;

    document.write("</TD></TR>");
    document.write("<TR align='center' height='5%'>");
    // col1
    document.write("<TD width='33%' align='left'>&nbsp;</TD>");
    // col2
    document.write("<TD width='33%' align='center'>"+mail+"</TD>");
    // col3
    document.write("<TD width='33%' align='right'>");
    if (farolito)
        load_flash("farolito",100,30);
    else
        document.write("&nbsp;");
    document.write("</TD>");
    document.write("</TR></TABLE>");
}

// Returns webmaster link
function webmaster_link()
{
    return "<a href='mailto:diegoyan@hotmail.com.ar'>webmaster</a>";
}

// Returns lacolifa link
function lacolifa_link(text)
{
	if (text==undefined)
	{
		text = "la_colifa@hotmail.com";
	}
	// tels: 15-508-9522 / 482-2695 / 421-5024 / 15-546-6794
    return "<a href='mailto:la_colifa@hotmail.com'>"+text+"</a>";
}

// Prints a null row (with the specified colspan) in the given window
// colspan = 1      by default
// win     = window by default
function null_row(colspan,win)
{
    if (colspan==undefined) colspan = 1;
    if (win==undefined) win = window;
    win.document.write("<tr><td colspan='"+colspan+"'>&nbsp;</td></tr>");
}

// Searchs a parameter in the given window object
// Returns default_value if parameter is absent
// win           = window by default
// default_value = null   by default
function getParam(param_id, win, default_value) {
    if (win==undefined) win = window;
    if (default_value==undefined) default_value = null;
    var params_values = win.location.search.substr(1).split("&");
    for(var i=0;i<params_values.length;i++)
    {
        var param_value = params_values[i].split("=");
        if (param_id==param_value[0])
            return param_value[1];
    }
    return default_value;
}

// Prints a flash movie in current document
function load_flash(name,width,height,id)
{
	if (id==undefined){ id = name; }
    document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
    document.writeln("codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'");
    document.writeln("WIDTH='"+width+"' HEIGHT='"+height+"' ID='"+id+"' >");
    document.writeln("<PARAM NAME=movie VALUE='flash/"+name+".swf'>");
	document.writeln("<param name='allowScriptAccess' value='sameDomain'>");
	document.writeln("<PARAM NAME=quality VALUE=high>");
	document.writeln("<PARAM NAME=wmode VALUE=transparent>");
	document.writeln("<EMBED src='flash/"+name+".swf' NAME='"+id+"' allowScriptAccess='sameDomain' quality=high wmode=transparent WIDTH='"+width+"' HEIGHT='"+height+"' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>");
    document.writeln("</OBJECT>");
}

// Prints (in current document) an animation 
function en_construccion()
{
    document.writeln("<TABLE border='0' align='center' height='100%'>");
    document.writeln("<TR valign='middle'><TD>");
    // en construcción
    load_flash("enconstruccion",131,111);
    document.writeln("</TD></TR>");
    document.writeln("</TABLE>");
}

// Converts a month number into month name
function monthToText(m)
{
    switch(m){
    case  0: return "Enero";
    case  1: return "Febrero";
    case  2: return "Marzo";
    case  3: return "Abril";
    case  4: return "Mayo";
    case  5: return "Junio";
    case  6: return "Julio";
    case  7: return "Agosto";
    case  8: return "Septiembre";
    case  9: return "Octubre";
    case 10: return "Noviembre";
    case 11: return "Diciembre";
    default: return null;
    }
}

// Returns a long description of the given date (eg. '19 de Noviembre de 2002')
function long_date(d)
{
    return d.getDate() + " de " + monthToText(d.getMonth()) + " de " + d.getFullYear();
}

// Returns a medium description of the given date (eg. '19 de Noviembre')
function mid_date(d)
{
    return d.getDate() + " de " + monthToText(d.getMonth());
}

// Returns a short description of the given date (eg. '2002.11.19')
function short_date(d)
{
    return d.getFullYear() + "." + (d.getMonth()+1) + "." + d.getDate();
}

/* Text functions */
function trimBlanks(text)
{
    var s = "";
    var ws = text.split(" ");
    for(var i=0;i<ws.length;i++)
        s += ws[i];
    return s;
}

function title(text)
{
    document.write("<DIV class='title'>"+text+"</DIV>\n");
}

function toggle(i){
	if (document.getElementById(i).style.display == "")
		document.getElementById(i).style.display = "none";
	else
		document.getElementById(i).style.display = "";
}

/* Available hosts */

// main host
var host0 = "http://usuarios.advance.com.ar/lacolifa/";
// mp3 host
var host1 = "http://club.telepolis.com/raiker/";

