
$.fn.loadext = function(urlraw, callback, sessid){
var urlselector = (urlraw).split(" ",1);
var url = urlselector[0];
var selector = urlraw.substring(urlraw.indexOf(' ')+1,urlraw.length);
var container = $(this);

 $.ajax({
    type: "POST",
    contentType: "application/html; charset=utf-8",
    dataType: "html",
    url: "CommunityServer/crossdomain.php",
    data: url,
    success: function(msg) {container.html(msg); if(typeof(window[callback]) === "function"){window[callback](sessid);}}
});
};

function scJS_load_file(filename, divid, callback, sessid) {
	if (document.getElementById(divid)) {
		document.getElementById(divid).innerHTML = '<div style="text-align:center;"><img src="http://www.vampyrs.de/CommunityServer/gfx/loading.gif" alt="Lade..." /></div>';
		$('#'+divid).loadext(filename, callback, sessid);
	} else {
		alert("scJS_load_file: ERROR, '"+divid+"' not found.");
	}
}

