function showDetailFAQ(idComar){
	var Wtop=(screen.height-400)/2;
	var Wleft=(screen.width-520)/2;
	tmpAdr = window.location.pathname;
	tmpAdr = tmpAdr.replace("Portal","plugins/comarquage/Faq");
	tmpAdr = tmpAdr + "?id="+idComar;
	var w=window.open(tmpAdr,"nom_popup","menubar=no, location=no, status=no, scrollbars=yes , resizable=no , directories=no, width=520, height=400 ,top="+Wtop+",left="+Wleft);
	w.document.close();
    w.focus();
}

$(document).ready(function(){
	$("a.facebookLink").each(function(){
		tmp = $(this).attr('href');
		tmp = tmp  + encodeURIComponent(window.location.href) ;
		$(this).attr('href',tmp);
	});	 
	
	$("a.wikioLink").each(function(){
		tmp = $(this).attr('href');
		tmp = tmp + encodeURIComponent(window.location.href);
		$(this).attr('href',tmp);
	});
	
	$("a.twitterLink").each(function(){
		tmp = $(this).attr('href');
		tmp = tmp + encodeURIComponent(window.location.href);
		$(this).attr('href',tmp);
	});
});

function PopupPrint(idComar){
	tmp = idComar.replace(".xml","");
	var Wtop=(screen.height-400)/2;
	var Wleft=(screen.width-520)/2;
	tmpAdr = "/demarches/jsp/site/Portal.jsp";
	tmpAdr = tmpAdr.replace("Portal","plugins/comarquage/Print");
	tmpAdr = tmpAdr.replace("Faq","Print");
	tmpAdr = tmpAdr + "?id="+tmp;
	var w=window.open(tmpAdr,"nom_popup","menubar=no, location=no, status=no, scrollbars=yes , resizable=no , directories=no, width=520, height=400 ,top="+Wtop+",left="+Wleft);
	w.document.close();
    w.focus();
}

function SendToFriend(tmp){
	var tmptitle = $("#skeleton_page_id").attr('value');	
	var Wtop=(screen.height-725)/2;
	var Wleft=(screen.width-650)/2;
	tmpAdr = "/demarches/jsp/site/Portal.jsp";
	tmpAdr = tmpAdr.replace("Portal","plugins/comarquage/SendToFriend");
	tmpAdr = tmpAdr.replace("Faq","SendToFriend");
	tmpAdr = tmpAdr + "?title="+tmptitle+"&id="+window.location.href;
	var w=window.open(tmpAdr,"nom_popup","menubar=no, location=no, status=no, scrollbars=yes , resizable=no , directories=no, width=650, height=725 ,top="+Wtop+",left="+Wleft);
	w.document.close();
    w.focus();
}

function goToAncre(ancre)
{
	var url = window.location.href;
	var pos= url.lastIndexOf("#");
	if(pos>-1)
		url=url.substring(0,url.lastIndexOf("#"));
	window.location=url+ancre;

}
