	function forumTopicsPage(mode)
		{
			$('#LatestForumContent').block({ 
				message: $('img#load'),
            css: { 
				border: '0px',
                 width: '32'
            },
				    // styles for the overlay 
				overlayCSS:  { 
					backgroundColor: '#000',
					'-webkit-border-radius': '2px', 
					'-moz-border-radius': '2px', 					
					opacity:         0.7
				}
			});
			var cp = parseInt($("#cp").html());
			
			if ( mode == 'prev')
			{
				cp = cp-1;
			}
			else
			{			
				cp = cp+1;
			}
			
			$.ajax({
					url: "lastest_forum_data.php",
					cache: false,
					type: "POST",
					data: ({
						page	: cp
					}),
					success: function(data){
						$("#LatestForumContent").html(data);
						$('#LatestForumContent').unblock();
						$("#cp").html(cp);
						
						if ( cp == 1)
						{
							// disable page Prev
							$("#ForumPrevPage").addClass("BoxPagingLeftDisabled");
							$("#ForumPrevPage").attr("href","javascript:void(0);");
						}
						
						if ( cp == 4)
						{
							// disable page Next
							$("#ForumNextPage").addClass("BoxPagingRightDisabled");
							$("#ForumNextPage").attr("href","javascript:void(0);");
						}
						
						if ( mode == 'prev' && cp == 3 ) 
						{
							$("#ForumNextPage").removeClass("BoxPagingRightDisabled");
							$("#ForumNextPage").attr("href","javascript:forumTopicsPage('next');");
						}
						
						if ( mode == 'next' && cp == 2 ) 
						{
							$("#ForumPrevPage").removeClass("BoxPagingLeftDisabled");
							$("#ForumPrevPage").attr("href","javascript:forumTopicsPage('prev');");
						}
					}
			});
		}
	function latestNewsPage(mode)
		{
			$('#LatestNewsContent').block({ 
				message: $('img#load'),
            css: { 
				border: '0px',
                 width: '32'
            },
				    // styles for the overlay 
				overlayCSS:  { 
					backgroundColor: '#000',
					'-webkit-border-radius': '2px', 
					'-moz-border-radius': '2px', 					
					opacity:         0.7
				}
			});
			var cp = parseInt($("#cpln").html());
			
			if ( mode == 'prev')
			{
				cp = cp-1;
			}
			else
			{			
				cp = cp+1;
			}
			
			$.ajax({
					url: "lastest_news_data.php",
					cache: false,
					type: "POST",
					data: ({
						page	: cp
					}),
					success: function(data){
						$("#LatestNewsContent").html(data);
						$('#LatestNewsContent').unblock();
						$("#cpln").html(cp);
						
						if ( cp == 1)
						{
							// disable page Prev
							$("#LatestNewsPrevPage").addClass("BoxPagingLeftDisabled");
							$("#LatestNewsPrevPage").attr("href","javascript:void(0);");
						}
						
						if ( cp == 2)
						{
							// disable page Next
							$("#LatestNewsNextPage").addClass("BoxPagingRightDisabled");
							$("#LatestNewsNextPage").attr("href","javascript:void(0);");
						}
						
						if ( mode == 'prev' && cp == 1 ) 
						{
							$("#LatestNewsNextPage").removeClass("BoxPagingRightDisabled");
							$("#LatestNewsNextPage").attr("href","javascript:latestNewsPage('next');");
						}
						
						if ( mode == 'next' && cp == 2 ) 
						{
							$("#LatestNewsPrevPage").removeClass("BoxPagingLeftDisabled");
							$("#LatestNewsPrevPage").attr("href","javascript:latestNewsPage('prev');");
						}
					}
			});
		}
		
//	$(function(){
		
//	});
	
	function showHide(divId)
	{
		if ( ! $.browser.msie )
		{
			$("#quickImgHide").toggle();
			$("#quickImgShow").toggle();
		}	

		$("#" + divId).slideToggle(250);		
	}
	
	function listFeatures()
	{
		$("div[id^='nc-']").hide();
		$("#elist").attr("src","images/news_extend_list_off_100x31.gif");
		$("#flist").attr("src","images/news_filter_list_on_68x31.gif");
		$("img[id^='img']").attr("src","images/newsicon_expand_20x24.gif");
	}
	
	function extendFeatures()
	{
		$("div[id^='nc-']").show();
		$("#elist").attr("src","images/news_extend_list_on_100x31.gif");
		$("#flist").attr("src","images/news_filter_list_off_68x31.gif");
		$("img[id^='img']").attr("src","images/newsicon_collapse_20x24.gif");
	}
	

	
	function voteSurvey()
	{
		$('#divSurvey').block({ 
			message: $('img#load'),
            css: { 
				border: '0px',
                 width: '32'
            },
				    // styles for the overlay 
				overlayCSS:  { 
					backgroundColor: '#000',
					'-webkit-border-radius': '2px', 
					'-moz-border-radius': '2px', 					
					opacity:         0.7
				}
			});
			
			$.ajax({
				url: "lp_survey.php",
				cache: false,
				type: "POST",
				data: ({
					option_id	: $("input:radio[name='survey_options']:checked").val()
				}),
				success: function(data){
					$("#divSurvey").html(data);
					$('#divSurvey').unblock();
				}
			});		
	}
	
	function change_div_status(divId){
		if ( $("#img-" + divId).attr("src") == "images/newsicon_expand_20x24.gif" ){
			$("#nc-" + divId).show();
			$("#img-" + divId).attr("src","images/newsicon_collapse_20x24.gif");
		}else{
			$("#nc-" + divId).hide();
			$("#img-" + divId).attr("src","images/newsicon_expand_20x24.gif");
		}
	}
	
	function setNewsLike(newsId, currentLikes)
	{
		$.ajax({
			url: "news_set_like.php",
			cache: false,
			type: "POST",
			data: ({
				news_id	: newsId
			}),
			success: function(data){
				if (data != "0")
				{
					var newLikes = currentLikes + 1
					// review this, try to do it with find, childs, etc
					if (currentLikes >= 0 && currentLikes < 9)
					{
						// change to green
						$("#likes-" + newsId).html('<img src="images/like_standard_50x70.gif" alt="Ok" width="50" height="70" /><span class="ratingNumber ratingstandard">' +  newLikes + '</span>');
					}
					else if(currentLikes >= 9 )
					{
						// change to gold
						$("#likes-" + newsId).html('<img src="images/like_gold_50x70.gif" alt="Ok" width="50" height="70" /><span class="ratingNumber ratinggold">' +  newLikes + '</span>');
					}
					
					if ( $("#likesInf-" + newsId).length > 0 )
					{
						$("#likesInf-" + newsId).html(newLikes + " likes this");
					}

					$("#likes-" + newsId).parent().attr("href", "javascript:void(0);");		
				}
			}
		});		
	}
	function change_div_status(divId){
		if ( $("#img-" + divId).attr("src") == "images/newsicon_expand_20x24.gif" ){
			$("#nc-" + divId).show();
			$("#img-" + divId).attr("src","images/newsicon_collapse_20x24.gif");
		}else{
			$("#nc-" + divId).hide();
			$("#img-" + divId).attr("src","images/newsicon_expand_20x24.gif");
		}
	}
	var bodyclick = true;
	function showHideUserTools()
	{
		var display = $("#user_link_menucontent").css('display');
		//alert(display)
		
		if(display == 'none'){
			$("#user_link_menucontent").show();
			var obj = document.body;
			obj.onclick = function(){	
				showHideUserToolsBody();
			};
			
		}else{
			$("#user_link_menucontent").hide();		
			
		}
		bodyclick = true;
		//return false;
		//alert("2222");
	}
	
	function showHideUserToolsBody()
	{
		//var Bodyclick = true;
		if(!bodyclick){
			$("#user_link_menucontent").hide();
		}else{
			bodyclick = false;
		}
	}
	
	function roll_over_footer(img_name, img_src){
   document[img_name].src = img_src;
	}
	
	$(document).ready(function()
	{
		//var p = new MVD.Popup($("#divpopup"), function () {
			//alert("Abrio popup");
		//});
		$("#ImgRegister").click(function()
		{
			document.location.href="http://www.lp.com.uy/foros/index.php?app=core&module=global&section=register";
		})
		.hover(
		  function(){
			$(this).addClass("cursor_pointer");
		  },
		  function(){
			$(this).removeClass("cursor_pointer");
		  } 
		);
		//p.open();
	});
	

	
	
