function handleMouseonMenu(){
	$('#menu li').hover(
		function() {
			$(this).stop().animate({

				paddingLeft:'20px'
			}, 500).addClass("menuOver");;
		},
		function () {
			$(this).stop().animate({

				paddingLeft:'10px'
			}, 400).removeClass("menuOver");
		}
	);
	$('#menu').delegate('li', 'click', function() {
		$(this).addClass('current').siblings().removeClass('current')
		$(this).parent().siblings().removeClass('current');
		$(this).siblings().children().removeClass('current');
		$(this).parent().siblings().children().siblings().removeClass('current');

		$(this).parent().parent().siblings().removeClass('current');
	});
}

function handleAnagrams(){
	if($('#accordion').css("display") == "none"){
		$('#accordion').slideDown(500, function(){});
	}
	else{
		$('#accordion').slideUp(500, function(){});
	}
}

function showNews(position, limit){
	if(Number(position) <= Number(limit) +Number(1)){
	$.get(
		"includes/php/getNews.php",{offset: position},
		function(data){
		$("#blog").append(data);
		fadeNoticia();
		},
		"html"
	);
		if(Number(position) + 4 < Number(limit)){
			var valor = Number(position) + Number(4);
			$("#showMoreNews").replaceWith("<div id=\"showMoreNews\"><p onclick=\"showNews("+ valor +","+Number(limit)+");\">More News</p></div>");
			position = Number(valor);
			$("#showMoreNews").fadeIn(500, function(){});
		}
		else{
			$("#showMoreNews").html("");
		}
	}
}

function showStoreItems(){

	$.get(
		"includes/php/getStoreItems.php",
		function(data){
			$("#industries").append(data);
			bindStore();
		},
		"html"
	);

}

function showLinks(){
	$.get(
		"includes/php/getLinks.php",
		function(data){
		$("#links").append(data);
		fadeLinks();
		},
		"html"
	);
}

function showPhotos(pagina){
	$.get(
		"photo.php",{page: pagina},
		function(data){
		$("#photo").html(data);
		fadePhoto();
		},
		"html"
	);
}

function showMusic(){
	$.get(
		"includes/php/music.php",
		function(data){
		$("#music").append(data);
		fadeMusic();
		},
		"html"
	);
}

function showWords(){
	$.get(
		"includes/php/words.php",
		function(data){
		$("#words").append(data);
		fadeWords();
		},
		"html"
	);
}


function openDialog(iddoprod){
	 $("#itemviewer").load('includes/php/getItem.php?producto='+iddoprod).dialog({modal: true, autoOpen: true, width: 720,show: "blind", hide: "blind", draggable: false, closeText: 'Close'});
}

function openDialogGal(iddoprod){
	 $("#itemviewer").load('image.php?pic='+iddoprod).dialog({modal: true, width:"auto", height:"auto", autoOpen: true,show: "blind", hide: "blind", draggable: false, closeText: 'Close'});
}

