// Funktionen, um den Ruby-Interpreter und das Result-Fenster zu öffnen

function openInterpreter()
{
   winStats='resizable=yes,toolbar=no,location=no,directories=no,menubar=no,'
   winStats+='scrollbars=yes,width=500,height=480'
   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left=10,top=25'
    }else{
      winStats+=',screenX=10,screenY=25'
    }
   floater=window.open("../interpreter/rubyinterpreter.shtml","RubyInterpreter",winStats);
   floater.focus();
}


//=============================================================
// Öffne ein leeres Fenster für das Interpreter-Resultat
//
function openResultWindow()
{
    winStats='resizable=yes,toolbar=no,location=no,directories=no,'
    winStats+='scrollbars=no,width='+400+',height='+300
    if (navigator.appName.indexOf("Microsoft")>=0) {
        winStats+=',left=10,top=25'
    }else{
        winStats+=',screenX=10,screenY=25'
    }
    resultWindow=window.open("","RubyResults",winStats);
    resultWindow.focus();
}

function ajaxCall(rubyCodeToBeExecuted)
{
    req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) {
    	try {
    req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
    if(req) {
      req.onreadystatechange = onlineRubyInterpreterResult;
      req.open("GET", url, true);
      req.send("");
    }
}