var joliprint_url = null;
function joliprint_getPdf(u){
joliprint_url = null;
var d = new Date();
var t = d.getTime();
tb_show('Joliprint PDF', 'https://hadopinfo.fr/wp-content/plugins/joliprint/joliprint_getpdf.php?TB_iframe=true&height=400&t=' + t + '&modal=true');
jQuery.getJSON( u + "&callback=?", function(json){
try{
var status = json.status_code;
if(status == null){
joliprint_error( "Le serveur Joliprint n\'est pas accessible." );
return;
}else if( status == "500" ){
joliprint_error( json.status_txt );
return;
}else if( status == "200" ){
joliprint_url = json.data.url;
iframeSrc = document.getElementById( "TB_iframeContent" ).src = "https://hadopinfo.fr/wp-content/plugins/joliprint/joliprint_getpdf.php?TB_iframe=true&modal=true&skip=true&url=" + encodeURIComponent(joliprint_url);
}else{
}
}catch(e){
alert(e);
}
});
}
function joliprint_error( msg ){
document.getElementById( "TB_iframeContent" ).src = "https://hadopinfo.fr/wp-content/plugins/joliprint/joliprint_getpdf.php?TB_iframe=true&modal=true&error=" + encodeURIComponent(msg);
var joliprint_int_error = setInterval( function(){
clearInterval(joliprint_int_error);
tb_remove();
},10000);
}