﻿var glob_concerts = [];
var ie = false;

if( typeof XMLHttpRequest == "undefined" )
{
	XMLHttpRequest = function ()
	{
		try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
		catch( e ) {}
		try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
		catch( e ) {}
		try { return new ActiveXObject("Msxml2.XMLHTTP"); }
		catch( e ) {}
		throw new Error("This browser does not support XMLHttpRequest.");
	};
}

/* BASIC FUNCTIONS START */
function evClick( elem, func )
{
	if( elem.addEventListener ) { elem.addEventListener( "click", func, false ); }
	else if( elem.attachEvent ) { elem.attachEvent( "onclick", func ); }
	else { elem.onclick = func; }
}

function newChild( parent, tag, cls, id )
{
	var child;
	child = document.createElement( tag );
	if( cls !== undefined ) { child.className = cls; }
	if( id !== undefined ) { child.id = id; }
	parent.appendChild( child );
	return child;
}

function addText( elem, text )
{
	if( !ie ) { elem.textContent = text; }
	else { elem.innerHTML = text; }
}
/* BASIC FUNCTIONS END */


/* LOADER FUNCTIONS START */
function load_news( content, json_data )
{
	var i, header, text, details, a_link;

	for( i = 0; i != json_data["data"].length; i++ )
	{
		header = newChild( content, "h1" );
		header.className = "h1_" + json_data["data"][i]["class"];
		addText( header, json_data["data"][i]["title"] );
		text = newChild( content, "div", "text" );
		text.innerHTML = json_data["data"][i]["text"];
		details = newChild( content, "div", "details" );
		addText( details, json_data["data"][i]["date"] + " - " + json_data["data"][i]["writer"] );
	}

	if( json_data["page"] == "news" )
	{
		text = newChild( content, "div" );
		text.style.textAlign = "center";
		text.style.paddingTop = "15px";
		a_link = newChild( text, "a", "", "archives" );
		a_link.href= "#";
		addText( a_link, "Arhívum" );
		evClick( a_link, load_content );
	}
}

function load_concerts( content, json_data )
{
	var i, text, a_link;

	for( i = 0; i != json_data["data"].length; i++ )
	{
		text = newChild( content, "div", "h1_" + json_data["data"][i]["class"] );
		text.innerHTML = "<span class=\"red\">" + json_data["data"][i]["date"] + "</span> - ";
		a_link = newChild( text, "a", "", "concert_" + json_data["data"][i]["id"] );
		a_link.href = "#";
		addText( a_link, json_data["data"][i]["place"] );
		evClick( a_link, concert_info );
	}

	if( json_data["page"] == "concerts" )
	{
		text = newChild( content, "div" );
		text.style.textAlign = "center";
		text.style.paddingTop = "15px";
		a_link = newChild( text, "a", "", "previous_concerts" );
		a_link.href= "#";
		addText( a_link, "Korábbi koncertek" );
		evClick( a_link, load_content );
	}
}

function media_menu_single( parent, id, text )
{
	var cell;

	cell = newChild( parent, "td", "", id );
	addText( cell, text );
	evClick( cell, load_content );
}

function media_menu( content )
{
	var table, row, cell;

	table = newChild( content, "table", "", "media_menu" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr" );
	media_menu_single( row, "media_discography", "Diszkogáfia" );
	media_menu_single( row, "media_biography", "Biogáfia" );
	media_menu_single( row, "media_pictures", "Képek" );
	media_menu_single( row, "media_videos", "Videók" );
	media_menu_single( row, "media_press", "Sajtó" );
}

function load_media_discography( content, json_data )
{
	var table, i, row, cell, img;

	table = newChild( content, "table", "", "media_discography" );
	table.cellPadding = "0";
	table.cellSpacing = "0";

	for( i = 0; i != json_data["data"].length; i++ )
	{
		row = newChild( table, "tr", "media_row" );
		cell = newChild( row, "td", "media_discography_title", "media_discography_" + json_data["data"][i].id.toString( ) );
		addText( cell, json_data["data"][i].name );
		evClick( cell, load_content );
		cell = newChild( row, "td", "media_discography_cover" );
		cell.rowSpan = "2";
		img = newChild( cell, "img", "", "media_discography_" + json_data["data"][i].id.toString( ) + "_cover" );
		img.src = json_data["data"][i].cover;
		evClick( img, load_content );
		row = newChild( table, "tr", "media_row" );
		cell = newChild( row, "td", "media_discography_description" );
		cell.innerHTML = json_data["data"][i].description;
		row = newChild( table, "tr", "media_discography_empty" );
	}
}

function load_media_disc( content, json_data )
{
	var table, row, cell, img, i, a;

	table = newChild( content, "table", "", "media_discography" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr", "media_row" );
	cell = newChild( row, "td", "media_discography_title" );
	addText( cell, json_data["data"][0].name );
	cell = newChild( row, "td", "media_discography_cover" );
	cell.rowSpan = "2";
	img = newChild( cell, "img" );
	img.src = json_data["data"][0].cover;
	row = newChild( table, "tr", "media_row" );
	cell = newChild( row, "td", "media_discography_description" );
	cell.innerHTML = json_data["data"][0].description;
	row = newChild( table, "tr", "media_discography_empty_small" );
    
    
    table = newChild( content, "table", "galleries" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr", "header" );
	
    cell = newChild( row, "td", "gallery_header" );
    cell.colSpan = 4;
	addText( cell, "Borító" );
    
    row = newChild( table, "tr", "gal_line" );
      
    for( i = 0; i < 4; i++ )
    {
        cell = newChild( row, "td" );
        inArray = false;
        
        for( j = 0; j < json_data["data"][0].covers.length; j++ )
        {
            if( json_data["data"][0].covers[j] == i )
            {
                inArray = true;
            }
        }
        if( inArray )
        {
            a_link = newChild( cell, "a" );
            a_link.href = "#";
            a_link.id = "pic_0_cover_" + json_data["data"][0].id + "_" + i + ".jpg";
            
            img = newChild( a_link, "img" );
            img.src = "thumbs/0/cover_" + json_data["data"][0].id + "_" + i + ".jpg";
            img.id = "p_0_cover_" + json_data["data"][0].id + "_" + i + ".jpg";
        }
    }

	table = newChild( content, "table", "", "media_discography" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr", "media_row" );
	cell = newChild( row, "td", "media_discography_track_header", "media_discography_track_title" );
	addText( cell, "Cím" );
	cell = newChild( row, "td", "media_discography_track_header" );
	addText( cell, "Letöltés" );
	row = newChild( table, "tr", "media_discography_empty_small" );

	for( i = 1; i != json_data["data"].length; i++ )
	{
		row = newChild( table, "tr", "media_row" );
		cell = newChild( row, "td", "media_discography_track" );
		addText( cell, json_data["data"][i].num.toString() + " - " + json_data["data"][i].title );
		cell = newChild( row, "td", "media_discography_track" );
		a = newChild( cell, "a" );
		a.href = "download.php?id=" + json_data["data"][i].id;
		a.target = "_blank";
		addText( a, "Letöltés" );
		row = newChild( table, "tr", "media_discography_empty_small" );
	}
    
    galleryInit( );
}

function load_media_biography( content, json_data )
{
	var div;

	div = newChild( content, "div", "media_biography" );
	div.style.paddingTop = "15px";
	div.innerHTML = json_data["data"][0].text;
}

function load_media_pictures( content, json_data )
{
    table = newChild( content, "table", "galleries" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr", "header" );
	cell = newChild( row, "td", "gallery_header" );
	addText( cell, "" );
	cell = newChild( row, "td", "gallery_header" );
	addText( cell, "Esemény" );
    row = newChild( table, "tr", "empty" );
	for( i = 0; i != json_data["data"].length; i++ )
	{
		row = newChild( table, "tr", "empty" );
		row = newChild( table, "tr", "line" );
		cell = newChild( row, "td", "pic" );
        cell.rowSpan = 2;
        
        im = newChild( cell, "img" );
        im.id = "media_pictures_" + json_data["data"][i].id.toString( );
        im.src = "thumbs/" + json_data["data"][i].id.toString( ) + "/" + json_data["data"][i].rand_pic;
        im.alt = "Zajforrás kép";
        evClick( im, load_content );
        
		cell = newChild( row, "td", "event" );
        cell.id = "media_pictures_" + json_data["data"][i].id.toString( );
        addText( cell, json_data["data"][i].date + " - " + json_data["data"][i].event );
        evClick( cell, load_content );
        
        row = newChild( table, "tr", "line" );        
		cell = newChild( row, "td", "description" );
		addText( cell, json_data["data"][i].description );
	}
}

function load_media_gal( content, json_data )
{   
    picsperrow = 4;
    
    table = newChild( content, "table", "galleries" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr", "header" );
	
    cell = newChild( row, "td", "gallery_header" );
    cell.colSpan = picsperrow;
	addText( cell, json_data["data"][0]["name"] );
      
    for( i = 1; i < ( Math.floor( ( json_data["data"].length - 1 ) / picsperrow ) + 1 ) * picsperrow + 1; i++ )
    {
        if( i % picsperrow == 1 )
        {
            row = newChild( table, "tr", "gal_line" );
        }
        cell = newChild( row, "td" );
        if( i < json_data["data"].length )
        {
            a_link = newChild( cell, "a" );
            a_link.href = "#";
            a_link.id = "pic_" + json_data["data"][0]["id"] + "_" + json_data["data"][i];
            
            img = newChild( a_link, "img" );
            img.src = "thumbs/" + json_data["data"][0]["id"] + "/" + json_data["data"][i];
            img.id = "p_" + json_data["data"][0]["id"] + "_" + json_data["data"][i];
        }
    }
    
    row = newChild( table, "tr", "header" );
    cell = newChild( row, "td", "event" );
    cell.colSpan = picsperrow;
    cell.id = "media_pictures";
	addText( cell, "Vissza" );
    evClick( cell, load_content );
    
    galleryInit( );
}

function load_media_videos( content, json_data )
{
	var div, obj, param, embed;

	div = newChild( content, "div", "", "media_video" );
	if( !ie )
	{
		obj = newChild( div, "object" );
		obj.width = parseInt( json_data["data"][0].width );
		obj.height = parseInt( json_data["data"][0].height );
		param = newChild( obj, "param" );
		param.name = "movie";
		param.value = json_data["data"][0].url;
		param = newChild( obj, "param" );
		param.name = "allowFullScreen";
		param.value = "true";
		param = newChild( obj, "param" );
		param.name = "allowscriptaccess";
		param.value = "always";
		embed = newChild( obj, "embed" );
		embed.src = json_data["data"][0].url;
		embed.type = "application/x-shockwave-flash";
		embed.width = parseInt( json_data["data"][0].width );
		embed.height = parseInt( json_data["data"][0].height );
		embed.allowscriptaccess = "always";
		embed.allowfullscreen = "true";
	}
	else
	{
		div.innerHTML = '<object width="480" height="385">'
		+ '<param name="movie" value="http://www.youtube.com/p/B5264FD46C67BC55?hl=hu_HU&fs=1"></param>'
		+ '<param name="allowFullScreen" value="true"></param>'
		+ '<param name="allowscriptaccess" value="always"></param>'
		+ '<embed src="http://www.youtube.com/p/B5264FD46C67BC55?hl=hu_HU&fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed>'
		+ '</object>';
	}
}

function load_media_press( content, json_data )
{
	var i, text, a_link;

	for( i = 0; i != json_data["data"].length; i++ )
	{
		text = newChild( content, "div", "media_press" );
		a_link = newChild( text, "a" );
		a_link.href = json_data["data"][i]["url"];
		a_link.target = "_blank";
		addText( a_link, json_data["data"][i]["name"] );
	}
}

function load_forum( content, json_data )
{
	var table, row, cell, i;

	table = newChild( content, "table", "", "forum" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr", "header" );
	cell = newChild( row, "td", "forum_header" );
	addText( cell, "Téma" );
	cell = newChild( row, "td", "forum_header" );
	addText( cell, "Hozzászólások" );
	cell = newChild( row, "td", "forum_header" );
	addText( cell, "Utolsó hozzászólás" );
	for( i = 0; i != json_data["data"].length; i++ )
	{
		row = newChild( table, "tr", "empty" );
		row = newChild( table, "tr", "line" );
		cell = newChild( row, "td", "topic" );
		cell.id = "forum_" + json_data["data"][i].id.toString( ) + "_1";
		addText( cell, json_data["data"][i].name );
		evClick( cell, load_content );
		cell = newChild( row, "td", "num" );
		addText( cell, json_data["data"][i].num.toString( ) );
		cell = newChild( row, "td" );
		addText( cell, json_data["data"][i].last );
	}
}

function load_topic( content, json_data )
{
	var table, row, cell, i, a, span;

	table = newChild( content, "table", "", "forum" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	forum_box( table, json_data["data"][0].id );
	row = newChild( table, "tr", "line" );
	cell = newChild( row, "td", "topic_title" );
	addText( cell, json_data["data"][0].topic );

	for( i = 1; i != json_data["data"].length; i++ )
	{
		row = newChild( table, "tr", "empty" );
		row = newChild( table, "tr", "line" );
		cell = newChild( row, "td", "details" );
		addText( cell, json_data["data"][i].name + " - " + json_data["data"][i].date );
		row = newChild( table, "tr", "line" );
		cell = newChild( row, "td", "text" );
		cell.innerHTML = json_data["data"][i].text;
	}

	row = newChild( table, "tr", "empty" );
	row = newChild( table, "tr", "line" );
	cell = newChild( row, "td", "pages" );

	for( i = 1; i < json_data["data"][0].pages + 1; i++ )
	{
		if( i == json_data["data"][0].page ) { a = newChild( cell, "span" ); }
		else
		{
			a = newChild( cell, "a", "", "forum_" + json_data["data"][0].id.toString( ) + "_" + i.toString( ) );
			a.href = "#";
			evClick( a, load_content );
		}
		addText( a, i.toString( ) );
		if( i != json_data["data"][0].pages )
		{
			span = newChild( cell, "span" );
			addText( span, " - " );
		}
	}
}

function load_contact( content, json_data )
{
	var row, cell, i;

	for( i = 0; i != json_data["data"].length; i++ )
	{
		row = newChild( content, "div", "function" );
		addText( row, json_data["data"][i]["topic"] );
		row = newChild( content, "div", "name" );
		addText( row, json_data["data"][i]["name"] );
		if( json_data["data"][i]["telephone"] != "" )
		{
			row = newChild( content, "div", "contact" );
			addText( row, json_data["data"][i]["telephone"] );
		}
		if( json_data["data"][i]["email"] != "" )
		{
			row = newChild( content, "div", "contact" );
			addText( row, json_data["data"][i]["email"] );
		}
		row = newChild( content, "div", "empty" );
	}
}

function load_content_handler( )
{
	var i, json_data, content;

	if( this.readyState == 4 && this.status == 200 )
	{
		if( this.responseText !== null )
		{
			json_data = JSON.parse( this.responseText );
			content = document.getElementById( "content" );
			content.innerHTML = "";

			if( json_data["page"] == "news" || json_data["page"] == "archives" ) { load_news( content, json_data ); }
			else if( json_data["page"] == "concerts" || json_data["page"] == "previous_concerts" )
			{
				glob_concerts = json_data["data"];
				load_concerts( content, json_data );
			}
			else if( json_data["page"].indexOf( "media" ) == 0 )
			{
				media_menu( content );
				if( json_data["page"] == "media_discography" ) { load_media_discography( content, json_data ); }
				else if( json_data["page"].indexOf( "media_discography_" ) == 0 ) { load_media_disc( content, json_data ); }
				else if( json_data["page"] == "media_biography" ) { load_media_biography( content, json_data ); }
				else if( json_data["page"] == "media_pictures" ) { load_media_pictures( content, json_data ); }
                else if( json_data["page"].indexOf( "media_pictures_" ) == 0 ) { load_media_gal( content, json_data ); }
				else if( json_data["page"] == "media_videos" ) { load_media_videos( content, json_data ); }
				else if( json_data["page"] == "media_press" ) { load_media_press( content, json_data ); }
			}
			else if( json_data["page"] == "forum" ) { load_forum( content, json_data ); }
			else if( json_data["page"].indexOf( "forum_" ) == 0 ) { load_topic( content, json_data ); }
			else if( json_data["page"] == "contact" ) { load_contact( content, json_data ); }
		}
		else { alert( "Nincs adat!" ); }
	}
	else if( this.readyState == 4 && this.status != 200 ) { alert( "Nincs ilyen oldal!" ); }
}

function load_content( ev )
{
	var e, target, content, text, img, http;

	e = ev || event;
	target = e.srcElement || e.target;
	content = document.getElementById( "content" );
	content.innerHTML = "";
	text = newChild( content, "div" );
	text.style.textAlign = "center";
	img = newChild( text, "img" );
	img.src = "img/ajax-loader.gif";
	http = new XMLHttpRequest();
	http.onreadystatechange = load_content_handler;
	http.open( "GET", "content.php?page=" + target.id );
	http.send( );
}

function forum_box( table, id )
{
	var nick = "", start, end, row, cell, span, name, textarea, button;

	start = document.cookie.indexOf( "forum_name=" );
	if( start != -1 )
    {
    	start += 11;
    	end = document.cookie.indexOf( ";", start );
		if( end < 0 ) { end = document.cookie.length; }
    	nick = unescape( document.cookie.substring( start, end ) );
	}
	row = newChild( table, "tr", "line" );
	cell = newChild( row, "td", "topic_title" );
	addText( cell, "Új hozzászólás" );
	row = newChild( table, "tr", "line" );
	cell = newChild( row, "td", "text" );
	span = newChild( cell, "span" );
	addText( span, "Név: " );
	name = newChild( cell, "input", "", "name_box" );
	name.type = "text";
	name.value = nick;
	row = newChild( table, "tr", "line" );
	cell = newChild( row, "td", "text" );
	textarea = newChild( cell, "textarea", "", "text_box" );
	row = newChild( table, "tr", "line" );
	cell = newChild( row, "td", "center" );
	button = document.createElement( "input" );
	button.type = "button";
	button.value = "Elküld";
	evClick( button, function( ev ){ forum_post( id ); } );
	cell.appendChild( button );
	row = newChild( table, "tr", "empty" );
}

function forum_post( id )
{
	var name, text, params, http, ev;

	name = document.getElementById( "name_box" ).value;
	text = document.getElementById( "text_box" ).value;
	if( name == "" || text == "" ) { alert( "Minden mezőt ki kell tölteni!" ); return 0; }
	params = "id=" + id + "&name=" + name + "&text=" + text;
	http = new XMLHttpRequest();
	http.onreadystatechange = function( ) {
		if( this.readyState == 4 && this.status == 200 )
		{
			if( this.responseText != null )
			{
				if( this.responseText == "0" ) { alert( "Minden mezőt ki kell tölteni!" ); }
				else if( this.responseText == "1" ) { alert( "Tiltólistán vagy!" ); }
				else if( this.responseText == "2" ) { alert( "Nem írhatsz admin nevében!" ); }
				else if( this.responseText == "3" )
				{
					ev = { target: { id : "forum_" + id.toString( ) + "_1" } };
					load_content( ev );
				}
			}
		}
	};
	http.open( "POST", "forum.php" );
	http.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
	http.setRequestHeader( "Content-length", params.length );
	http.send( params );
}

function concert_info( ev )
{
	var e, target, id, i, box;

	e = ev || event;
	target = e.srcElement || e.target;
	id = target.id.split( "_" );
	id = parseInt( id[1] );
	for( i = 0; i != glob_concerts.length && glob_concerts[i]["id"] != id; i++ );
	box = document.getElementById( "tooltip" );
	if( box.style.visibility == "visible" && !ie )
	{
		box_close( 0 );
		window.setTimeout( box_open, 550 );
		window.setTimeout( concert_details, 550, i );
	}
	else
	{
		box_open( );
		concert_details( i )
	}
}

function concert_details( i )
{
	var box;

	box = document.getElementById( "box_content" );
	if( glob_concerts[i]["url"] !== null ) { box.innerHTML = "Helysz&iacute;n:<br><div class=\"vastag\"><a href=\"" + glob_concerts[i]["url"] + "\" target=\"_blank\">" + glob_concerts[i]["place"] + "</div>"; }
	else { box.innerHTML = "Helysz&iacute;n:<br><div class=\"vastag\">" + glob_concerts[i]["place"] + "</div>"; }
	box.innerHTML = box.innerHTML + "Kezd&eacute;s:<br><div>" + glob_concerts[i]["date"] + " " + glob_concerts[i]["start"] + "</div>";
	box.innerHTML = box.innerHTML + "Jegy&aacute;r:<br><div>" + glob_concerts[i]["price"] + "Ft </div>";
	box.innerHTML = box.innerHTML + "Fell&eacute;p&#337;k:<br><div>" + glob_concerts[i]["performers"] + "</div>";
}

function box_open( )
{
	var scroll_x = 0, scroll_y = 0, box, table, row, cell, i;

	if( window.innerWidth ) { scroll_x = window.innerWidth; }
	else if( document.body.clientWidth ) { scroll_x = document.body.clientWidth; }
	else if( document.body.clientWidth ) { scroll_x = screen.width; } 

	if( typeof( window.pageYOffset ) == "number" ) { scroll_y = window.pageYOffset; }
	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scroll_y = document.body.scrollTop; }
	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scroll_y = document.documentElement.scrollTop; }

	box = document.getElementById( "tooltip" );
	box.className = "tooltip";
	box.style.top = ( scroll_y + 200 ) + 'px';
	box.style.opacity = "0.0";
	box.MozOpacity = "0.0";
	box.KhtmlOpacity = "0.0";
	box.filter = "alpha(opacity=0)";
	box.style.left = ( scroll_x / 2 - 150 ) + 'px';
	box.innerHTML = "";

	table = newChild( box, "table" );
	table.cellPadding = "0";
	table.cellSpacing = "0";
	row = newChild( table, "tr" );
	cell = newChild( row, "td" );
	cell.width = "223px";
	cell.height = "25px";
	cell = newChild( row, "td" );
	cell.style.cursor = "pointer";
	cell.width = "25px";
	evClick( cell, box_close ); 
	row = newChild( table, "tr" );
	cell = newChild( table, "td", "", "box_content" );
	cell.colSpan = "2";

	if( !ie ) { for( i = 1; i != 11; i++ ) { window.setTimeout( box_fade, 50 * i, i ); } }
	else { box_fade( 10 ); }
}

function box_fade( op )
{
	var box;

	box = document.getElementById( "tooltip" );
	if( op > 0 ) { box.style.visibility = "visible"; }
	else { box.style.visibility = "hidden"; }
	box.style.opacity = op / 10;
	box.MozOpacity = op / 10;
	box.KhtmlOpacity = op / 10;
	box.filter = "alpha(opacity=" + op + "0)";
}

function box_close( ev )
{
	var i;

	if( !ie ) { for( i = 1; i != 11; i++ ) { window.setTimeout( box_fade, 50 * i, 10 - i ); } }
	else { box_fade( 0 ); }
}

function intro_fade( op )
{
	var box;

	box = document.getElementById( "intro" );
	if( op > 0 ) { box.style.visibility = "visible"; }
	else
	{
		box.style.visibility = "hidden";
		var ev = { target : { id : "news" } };
		load_content( ev );
	}
	box.style.opacity = op / 20;
	box.MozOpacity = op / 20;
	box.KhtmlOpacity = op / 20;
	box.filter = "alpha(opacity=" + ( op * 5 ).toString( ) + ")";
}

function intro( )
{
	var box, i;

	box = document.getElementById( "intro" );
	box.style.paddingTop = "40px";
	for( i = 1; i < 21; i++ ) { window.setTimeout( intro_fade, 3000 + 50 * i, 20 - i ); }
	return 0;
}

function buttons( )
{
	var menu, i;

	menu = document.getElementById( "menu" );
	for( var i = 0; i != menu.childNodes.length; i++ ) { if( menu.childNodes[i].id !== undefined ) { evClick( menu.childNodes[i], load_content ); } }
}

function init( )
{
	if( navigator.appName.indexOf( "Microsoft" ) != -1 ) { ie = true; }
	intro( );
	buttons( );
	return 0;
}

