softForum={};
SF = softForum;
SF.app={};
SF.Modul={};
SF.script= function(){
	var mainParams= (''+window.location).split('?')[1];
	var waitBlock=null;
	var waitCount=0;
	return {
		getUniqId:function() 
		{
			return new Ext.ux.GUID();
		}
		,currentPfad:function(endName)
		{
			var head = document.getElementsByTagName("head")[0];
			var ch = head.childNodes;var pl = String(endName).length;
			for ( var i=0,l=ch.length;i<l;i++ )
			{
				if ( ch[i].tagName && ch[i].tagName.toLowerCase() == 'script' )
				{
					var s = String(ch[i].src);var p = s.indexOf(endName);
					if ( p > 0 &&  (s.length - pl ) == p )
					{
						return s.substr(0,s.lastIndexOf('/'))+'/';
					}
				}
			}
			return '/';
		}
		,getObj:function(x)
		{
			return document.getElementById(x);
		}
		,getSFID:function()
		{
			return mainParams||'';
		}
		,waitCursor:function(bWait)
		{
			waitCount += bWait ?1:-1;
			if ( waitCount == 1 )
			{
				if ( !waitBlock )
				{
					waitBlock=document.createElement('div');
					waitBlock.style.cssText="position:absolute;left:0px;top:0px;width:100%;height:100%;cursor:wait;z-index:10000;";
					document.body.appendChild(waitBlock);
				}
				waitBlock.style.display='block';
			}
			else if ( waitCount == 0 && waitBlock)
				waitBlock.style.display='none';
		}
		,loadScript:function(scripts,on_complete,scope){
			while ( scripts.length )
			{
				var script_url = scripts.shift();
			    var id = 'js_'+script_url;
			    if (this.getObj(id)) {
			    	SF.script.loadScript(scripts,on_complete,scope);
			    	return;
			    }
			    script_url+='?sfid='+SF.script.getSFID();
			    var s = document.createElement("script");
			    s.id = id;
			    s.type = 'text/javascript';
				s.onload= s.onreadystatechange = function(ev) 
				{
					if (s.readyState && s.readyState != 'loaded' && s.readyState != 'complete')
						return;
					s.onload= s.onreadystatechange = null;
			    	SF.script.loadScript(scripts,on_complete,scope);
				};
				s.src=script_url;    
			    document.getElementsByTagName("head")[0].appendChild(s);
			    return;
			}
			if ( !scripts.length )
				if (on_complete) on_complete.call(scope||window,scripts,true);
		}
	}
}();
if ( !window.console) 
{
	window.console=function()
	{
		return {
			log:function(txt){
			}
			,profile:function(){
			}
			,profileEnd:function(){
			}	
			,assert:function(a){
			}
			,count:function(a){
			}			
			,debug:function(a){
			}
			,dir:function(a){
			}
			,dirxml:function(a){
			}
			,error:function(a){
			}
			,group:function(a){
			}
			,groupEnd:function(a){
			}
			,info:function(a){
			}
			,time:function(a){
			}
			,timeEnd:function(a){
			}
			,trace:function(a){
			}
			,warn:function(a){
			}
		}
	}();	
}
