
$.fn.loadext = function(urlraw, callback){
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: "/CommunityConnection/crossdomain/",
    data: url,
    success: function(msg) {container.html(msg); if($.isFunction(callback)){callback();}}
});
};

function scJS_load_file(filename, divid) {

	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);
	} else {
		alert("scJS_load_file: ERROR, '"+divid+"' not found.");
	}

}

