jQuery(document).ready(function(){
	jQuery("a[rel='lightbox']").colorbox({height:"95%"});
	jQuery("a[rel='lightmap']").colorbox({width:"670px" ,height:"480px", iframe:true});
	jQuery("a[rel='lightframe']").colorbox({width:"90%" ,height:"90%", iframe:true});
	jQuery("a[rel='lightfrsmall']").colorbox({width:"530px" ,height:"485px", iframe:true});
	
	jQuery("ul.colapse").each(
		function()
		{
			iterateList(this);
		}
	);

});

function iterateList(node)
{
	var ul, toggleLink;
	jQuery("li",node).each(
		function()
		{
			if(this.parentNode != node) return;
			ul = jQuery("div",this).get(0);
			if(ul)
			{
				jQuery("div",this).hide();
				toggleLink = document.createElement("a");
				toggleLink.href = "#";
				jQuery(toggleLink).addClass("toggle");
				jQuery(ul.parentNode.childNodes[0]).wrap(toggleLink);
				jQuery("a.toggle", ul.parentNode).click(
					function()
					{
						jQuery(">div",this.parentNode).toggle();
						return false;
					}
				);
				iterateList(ul);
			}
		}
	);
}