/*

GLOBAL VARS

*/

var GLOB_URL;


function CoreLoad() {
	window.location.href="index.php?a="+GLOB_URL;
}
function T3Lock(id,url,mode) {
	//alert(id+loading+url);
	var Lock;
	var url = url;
	
	if(mode!="6") {
		document.getElementById(id).style.display="block";
	}
	GLOB_URL = url;
	window.setTimeout("CoreLoad()", 1400);
}


function sendToLock(lockerid,msg) {
	var id = lockerid;
	var msg = msg;
	mlo = document.getElementById(id);
	mlo.style.display="block";
	mlo.innerHTML='<div id="LockMessage">'+msg+'</div>';
}

function openpopup(theURL,winName,features) 
{
  // SessionID anhängen
  theURL = append_sessionid( theURL );
	window.open(theURL,winName,""+features);
}		


function MM_openBrWindowCenter(theURL,winName,features,w,h)
      {
        // SessionID anhängen
  theURL = append_sessionid( theURL );
				LeftPosition=(screen.width)?(screen.width-w)/2:100;
				TopPosition=(screen.height)?(screen.height-h)/2:100;
				
				features += ',top='+TopPosition+',left='+LeftPosition;
        OpenWin = window.open(theURL,winName,features);
        OpenWin.opener = self;
        OpenWin.focus();
      }

function MM_openBrWindow(theURL,winName,features)
{
  // SessionID anhängen
  theURL = append_sessionid( theURL );

  OpenWin = window.open(theURL,winName,features);
  OpenWin.opener = self;
  OpenWin.focus();
}

function append_sessionid( theURL )
{
  // SessionID ermitteln und bei Bedarf an URL anhängen
  get_param = document.location.search;
  if( get_param.length > 1 && theURL.indexOf("sessionid") == -1 )
  {
    get_param = get_param.substr(1,get_param.length);
    if( get_param.charAt(0) == "&" )
    {
      get_param = get_param.substr(1,get_param.length);
    }
    params    = get_param.split( "&" );
    sessionid = "";
    for( i=0; i<params.length; i++)
    {
      vars = params[i].split( "=" );
      key  = vars[0];
      if( vars.length > 1 )
      {
        val  = vars[1];
      }
      else
      {
        val  = "";
      }
      if( key == "sessionid" )
      {
        sessionid = val;
      }
    }
    if( sessionid != "" )
    {
      if( theURL.indexOf("?") == -1 )
      {
        theURL += "?sessionid=" + sessionid;
      }
      else
      {
        theURL += "&sessionid=" + sessionid;
      }
    }
  }
  return theURL;
}
