function getItem(func,cor,id){
	$.ajax({
	   type: "POST",
	   url: "../"+func+"s/getItem.php",
	   data: "cor="+cor+"&id="+id+"&origem="+func,
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   	
	   }
	});
}

function getItemHP(func,cor,id){
	
	var divHeight = $('#homepage').height();
	var divWidth = $('#homepage').width();	
	$("#append").prepend("<div id='backPopup' style='height: "+divHeight+";width:"+divWidth+";' align='center'></div><div id='popupMain'></div>");
	$.ajax({
	   type: "POST",
	   url: "../"+func+"s/getItem.php",
	   data: "cor="+cor+"&id="+id+"&origem=hp",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   }
	});
}

function getPermLink(path,cor,id){
	
	var divHeight = $('#homepage').height();
	var divWidth = $('#homepage').width();	
	$("#append").prepend("<div id='backPopup' style='height: "+divHeight+";width:"+divWidth+";' align='center'></div><div id='popupMain'></div>");
	$.ajax({
	   type: "POST",
	   url: "../"+path+"getItem.php",
	   data: "cor="+cor+"&id="+id+"&origem=hp",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   }
	});
}

function getPermLinkDocumentos(path,cor,id){
	
	var divHeight = $('#homepage').height();
	var divWidth = $('#homepage').width();	
	$("#append").prepend("<div id='backPopup' style='height: "+divHeight+";width:"+divWidth+";' align='center'></div><div id='popupMain'></div>");
	$.ajax({
	   type: "POST",
	   url: "../"+path+"getLista.php",
	   data: "cor="+cor+"&categoria="+id+"&origem=hp",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   }
	});
}

function getItemHighlight(func,cor,id){
	
	var divHeight = $('#homepage').height();
	var divWidth = $('#homepage').width();	
	$("#append").prepend("<div id='backPopup' style='height: "+divHeight+";width:"+divWidth+";' align='center'></div><div id='popupMain'></div>");
	$.ajax({
	   type: "POST",
	   url: "../"+func+"getItem.php",
	   data: "cor="+cor+"&id="+id+"&origem=hp",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   }
	});
}

function getItemPesquisa(func,cor,id){
	
	var divHeight = $('#homepage').height();
	var divWidth = $('#homepage').width();	
	$("#append").prepend("<div id='backPopup' style='height: "+divHeight+";width:"+divWidth+";' align='center'></div><div id='popupPesquisa'></div>");
	
	$.ajax({
	   type: "POST",
	   url: "../"+func+"s/getItem.php",
	   data: "cor="+cor+"&id="+id+"&origem=pesquisa",
	   cache: false,
	   success: function(html){
		$("#popupPesquisa").html(html);
	   },
	   error: function(){
	   }
	});
}

function getFicheirosHP(func,cor,id){
	var divHeight = $('#homepage').height();
	var divWidth = $('#homepage').width();	
	$("#append").prepend("<div id='backPopup' style='height: "+divHeight+";width:"+divWidth+";' align='center'></div><div id='popupMain'></div>");
	
	$.ajax({
	   type: "POST",
	   url: "../documentos/getLista.php",
	   data: "cor="+cor+"&categoria="+id+"&origem=hp",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   }
	});
}

function getFicheirosDestaques(func,cor,id){
	$.ajax({
	   type: "POST",
	   url: "../documentos/getLista.php",
	   data: "cor="+cor+"&categoria="+id+"&origem=destaque",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){
	   }
	});
}

function getItemDestaques(func,cor,id){
	$.ajax({
	   type: "POST",
	   url: "../"+func+"s/getItem.php",
	   data: "cor="+cor+"&id="+id+"&origem=destaque",
	   cache: false,
	   success: function(html){
		$("#popupMain").html(html);
	   },
	   error: function(){

	   }
	});
}

function showPermLink(url){
	$("#itemPermLink").css("font-size","9px");
	$("#itemPermLink").css("font-weight","normal");
	$("#itemPermLink").css("cursor","auto");
	$("#itemPermLink").html(url);
}

function showPermLink_large(url){
	$("#itemPermLink_large").css("font-size","9px");
	$("#itemPermLink_large").css("font-weight","normal");
	$("#itemPermLink_large").css("cursor","auto");
	$("#itemPermLink_large").html(url);
}