
var slide_menu_ready = false;

$(function() { // Register the menu
	// Add the click event handler on the list item with sub list
	$('div.slide_header').click(function(event) {
		if (this == event.target) {
			if(typeof($(this).attr('title')) != 'undefined' && $(this).attr('title') != '') {
				window.location = 'index.php?item=' + $(this).attr('title');
			} else {
				// Hide all the children of the other lists
				//alert($(this).attr('item'));
				$(this).parent().parent().find('div.slide_group').css("height","22px"); 
				$(this).parent().css("height", (336 - $(this).parent().parent().find('div.slide_group').size() * 23 + 23 - 1) +"px");
				$(this).parent().parent().find('div.slide_group a').hide(); 
				// Make the animation
				$(this).parent().children('a').animate({opacity:'toggle',height:'toggle'},'slow'); 
			}
		}

		return false;
	})
	// Change the cusrsor.
	.css({cursor:'pointer'});

	// Hide all the nested lists (on the first tinm only).
	//$('div.slide_group a').hide();
});



	function openImage(url, w, h, txt) {
		if (txt != '') {
			h = h + 15; //extra space for text
		}
		nPopUp = window.self.open('','_blank','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width='+w+',height='+h);
		ndoc = nPopUp.document;
		ndoc.close();
		ndoc.open();
		atrs = '<html><head><title>RESI</title></head>';
		atrs+= '<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><center>';
		atrs+= '<a href=\'javascript:self.close()\'><img src=\''+url+'\' border=0></a><br/>';
		atrs+= txt;
		atrs+= '</center></body></html>';
		ndoc.write(atrs);
		ndoc.close();
	}
