/**********************************************************************
Browser: IE5, IE5.5, IE6 und NS6
Das Setup erzeugt ein IFrame ....

***********************************************************************/

var IFrameObj; // our IFrame object
var oLayer;
var sRemoteURL;

sRemoteURL = "/scripts/AktContent/fRemoteScript_Server.asp";

window.onerror = handleError;

function Remote_SetRemoteURL( szURL )
{
	if( !szURL == "" )
		sRemoteURL = szURL;
}

function callToServer( sList , sLang ) {

  var IFrameDoc;
  var URL = sRemoteURL + "?List=" + escape( sList ) + "&PgLang=" + escape( sLang );

  if( brw.ns4  )
  	return false; // leave where NS4
  
  if (!IFrameObj && document.createElement) {
    var tempIFrame=document.createElement('iframe');
    tempIFrame.setAttribute('id','RSIFrame');
    tempIFrame.setAttribute('name','RSIFrame');
    tempIFrame.setAttribute('application','yes');
    tempIFrame.style.border='0px';
    tempIFrame.style.width='0px';
    tempIFrame.style.height='0px';
    IFrameObj = document.body.appendChild(tempIFrame);
  
    if (document.frames && brw.mac ) {
      // this is for IE5 Mac, because it will only
      // allow access to the document object
      // of the IFrame if we access it through
      // the document.frames array
      IFrameObj = document.frames['RSIFrame'];
    }
  }
  
  if( !document.createElement && !oLayer )
  {
  	oLayer = new Layer(0);
  	oLayer.visibility = "hide";
  }

  if( oLayer )
  {
  	oLayer.src=URL;
  	return true;
  }
  
  if (navigator.userAgent.indexOf('Gecko') !=-1 
    && !IFrameObj.contentDocument) {
    // we have to give NS6 a fraction of a second
    // to recognize the new IFrame
    setTimeout('callToServer( )',10);
    return false;
  }
  
  if (IFrameObj.contentDocument) {
    // For NS6
    IFrameDoc = IFrameObj.contentDocument; 
  } else if (IFrameObj.contentWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.contentWindow.document;
  } else if (IFrameObj.document) {
    // For IE5
    //IFrameDoc = IFrameObj.document;
    var oFrame = document.frames.RSIFrameIE50;
		oFrame.location.replace( URL );
    
    return true;
    
  } else {
    return true;
  }

  if( IFrameObj )
  	IFrameDoc.location.replace( URL );
  
  return false;
}

function handleError()
{
	
}

/* Diese Funktion muss auf der jeweiligen Seite implementiert und modifiziert werden

function handleResponse(msg) {
  
}
*/
