');
url = "/page-"+source+".html";
$box.appendTo($("#"+target+"_content"));
$box.find(".boxcontent").load(url);
xPages.push(source);
}else{try{console.log('Page already loaded');}catch(e){}}
}
function xDialog(cont,dtitle){
closexDialog();
$dialog = $('
');
$cont = $('
'+cont+'
');
$cont.css("minWidth","200px");
var dleft = ($(window).width() - $cont.width()) / 2;
var dtop = '20%';
$cont.appendTo($dialog.find('.boxcontent'));
$("
").appendTo('body').css({'left':'0px','top':'0px','position':'absolute','width':'100%','height':'100%'});
$dialog.css("position","absolute").css("left",dleft).css("top",dtop).appendTo('body');
}
function closexDialog(){
$('#xDialog , #xOverlay').remove();
}
function doContentSubscribe(userid,target_type,target_id,target_parent_id,target_parent_cat_id){
submethod = "subscribe";
handleContentSubscription(submethod ,userid,target_type,target_id,target_parent_id,target_parent_cat_id);
}
function doContentUnsubscribe(userid,target_type,target_id,target_parent_id,target_parent_cat_id){
submethod = "unsubscribe";
handleContentSubscription(submethod ,userid,target_type,target_id,target_parent_id,target_parent_cat_id);
}
function handleContentSubscription(method,userid,target_type,target_id,target_parent_id,target_parent_cat_id){
userid = typeof userid !== 'undefined' ? userid : 0;
target_type= typeof target_type!== 'undefined' ? target_type: 0;
target_id= typeof target_id !== 'undefined' ? target_id: 0;
target_parent_id= typeof target_parent_id !== 'undefined' ? target_parent_id : 0;
target_parent_cat_id = typeof target_parent_cat_id !== 'undefined' ? target_parent_cat_id : 0;
target_mail = 0;
if(!userid){
//email abfragen
}
cururl = "/ajax/subscriptionHandler.php?method="+method;
idata = {'userid':userid,'target_type':target_type,'target_id':target_id,'target_parent_id':target_parent_id,'target_parent_cat_id':target_parent_cat_id,'email':target_mail};
$.ajax({
url: cururl,
type: 'POST',
cache: false,
data:idata,
dataType:'json',
success: function(response) {if(response.done){location.reload();}}
});
}
var resize_set = 0;
function fixBusinessImages(){
//adjust max image size
try{
padding = 100;
max_img_size = 0;
//Beiträge und ähnliches:
if($('td.sidebar').length){
max_img_size = $('.footer').width() - $('td.sidebar').first().width()- padding;
}
else if($("#wiki_page").length){
max_img_size = $('.footer').width() - padding;
}
if(max_img_size > 0){
$('.mtextwrap img, .xembedded img').css('maxWidth',max_img_size );
}
}catch(e){try{console.log("Error on resize " + e)}catch(h){/*no console*/}}
if(!resize_set){
try{window.addEventListener("resize", fixBusinessImages);}catch(e){/*IE<9*/}
resize_set = 1;
}
}