$(function(){
	$('<div id="dec"><blink>Loading...</blink><br/><img src="images/indicator.gif" /></div>')
	.ajaxStart(function() {$(this).show();})
	.ajaxStop(function() {$(this).hide();})
	.appendTo('#decxt');
});

$(document).ready(function()
{
  var nodes = $('.button');
  $('form').each(function(i)
  {
    $(this).bind('submit', function(e)
    {
      nodes[i].onclick();
      e.preventDefault();
    })
  });
});

function aboutclick()
{
$('#about').css('display','block');
$(document).ready(function(){
  $("#about").dialog({
    title: "#About",
    width: 300,
    height: 200,
    resizable: false,
    draggable: true,
    position: 'center',
    buttons: {  
      "Close": function() {
        $(this).dialog("close");
	$('#about').css('display','none');
      }  
    }  
  });
});
$("#about").dialog("open");
}

function contactclick()
{
    $.post("contacts.php", { pwd: 'notspam' },
   function(data)
   {
        document.getElementById("contact").innerHTML = data;
   });
$('#contact').css('display','block');
$(document).ready(function(){
  $("#contact").dialog({
    title: "#Contacts",
    width: 220,
    height: 150,
    resizable: false,
    draggable: true,
    position: 'center',
    buttons: {  
      "Close": function() {
        $(this).dialog("close");
	$('#contact').css('display','none');
      }  
    }  
  });
});
$("#contact").dialog("open");
}

function show(id)
{
	tmp = id.search("\\d+");
	result = id.substring(tmp);

	x = document.getElementById(id);

	if($('#node'+result).is(undefined) || $('#node'+result).is(':hidden')) 
	{
                $('#node'+result).toggle('fast');
	//	document.getElementById('img'+result).src = 'images/more2.gif';
        }
	else
	{
		$('#node'+result).toggle('fast');
	//	document.getElementById('img'+result).src = 'images/more.gif';
	}
}

