$(function()
{
	Forum.init();
	
	var $album_images = $("body#albums ul#pics_list li a");
	
	if ($album_images.size())
	{
		$album_images.fancybox(
		{
			'overlayOpacity':1,
			'overlayColor':'#000'
		});
	}
});

var Forum =
{
	init:function()
	{
		var $forum_form = $('#post_form.forum-form');
		
		if ( ! $forum_form.size())
		{
			return false;
		}
		
		$forum_form.before('<p class="post-link"><a href="#">Posta i forumet</a></p>');
		
		var $post_link = $('p.post-link a');
		
		$post_link.toggle(function()
		{
			$forum_form.fadeIn('fast').find('#forum_comment').focus();
			return false;
		},
		function()
		{
			$forum_form.fadeOut('fast');
			return false;
		});
		
		$forum_form.find('input#btn_cancel').click(function()
		{
			$post_link.trigger('click');
		});
		
	}
};




// startList = function() {
// 	if (document.all&&document.getElementById) {
// 		navRoot = document.getElementById("menu");
// 		for (i=0; i<navRoot.childNodes.length; i++) {
// 			node = navRoot.childNodes[i];
// 			if (node.nodeName == "LI") {
// 				node.onmouseover=function() {
// 					this.className+=" over";
//   				}
//   			
// 				node.onmouseout=function() {
//   					this.className=this.className.replace(" over", "");
//    				}
//    			}
//   		}
//  	}
// }