//Elements for variable actualization
var gloSubscription = null;
var tElements = null;
var tTableElements = null;
var tRefreshTime = 500;
//SVG Elements
var mySVGLanguageNodes = null;
var myChildsLanguageNodes = null;
var mySVGVariableNodes = null;
var mySVGEventNodes = null;
var mySVGDocument = null;
var myViewBox = null;
//Common Document Elements
var myDocLanguageNodes = null;
var myDocVariableNodes = null;
var myDocEventNodes = null;
var mySubWindow = null;
var myData = null;
var mySVG = null;
var myLanguage = null;
var myVariables = null;
var nameSpace = "";
var instance = null;
var instanceIndex = 0;
var target = "";
var selectionNodeID = "";
var tInitialization = false;
var tmpTarget = 0;
var myControlMode = 0;
var myDiamMode = 0;
var myWindowMode = "global";
var currLocation = "";
function getEvents()
{
try
{
//tElements = new Array();
//get Variable information of SVG Document
if(mySVGEventNodes)
{
var myChilds = mySVGEventNodes[0].childNodes;
for(var i=0;i<myChilds.length;i++)
{
if(myChilds[i].nodeType == 1)//child nod type 1 is a text node
{
var myNodeID = myChilds[i].nodeName;
var myNode = mySVGDocument.getElementById(myNodeID);
if(myNode)
{
var myEvents = myChilds[i].childNodes;
for(var j=0;j<myEvents.length;j++)
{
if(myEvents[j].nodeType == 1)
{
var myEvent = myEvents[j].nodeName;
var myEventFunctions = myEvents[j].childNodes;
var myEventText = "";
for(var k=0;k<myEventFunctions.length;k++)
{
myEventText = myEventFunctions[k].nodeType == 3?myEventFunctions[k].nodeValue:"";
}
var myEventTextArray = myEventText.split(":");
myEventText = "";
myEventText = myEventTextArray[0] + "(";
for(var l=1;l<myEventTextArray.length;l++)
{
if(l>1)
{
myEventText += ",";
}
myEventText += myEventTextArray[l];
}
myEventText += ")";
myNode.setAttribute(myEvent, myEventText);
}
}
}
}
}
}
}
catch(e)
{
faultHandler(e, "getEvents");
}
}
//-----------------------------------------------------------------------------------------------------------------------
//Object extension name: uniqe
//-----------------------------------------------------------------------------------------------------------------------
//Description:
//Extends the Array Object to function 'unique'. This function removes double entries in an Array.
//-----------------------------------------------------------------------------------------------------------------------
//Parameters:
//-----------------------------------------------------------------------------------------------------------------------
Array.prototype.unique = function() {
var o = {};
var tmp = [];
for(var i = 0 ; i < this.length; i++) o[this[i]] = true;
for(var i in o) tmp[tmp.length] = i;
return tmp;
};
//-----------------------------------------------------------------------------------------------------------------------
//Function name: contains
//-----------------------------------------------------------------------------------------------------------------------
//Description:
//This function checkes an array of containing a search string.
//-----------------------------------------------------------------------------------------------------------------------
//Parameters: myArray: Array to check, searchString: String to search in the array.
//-----------------------------------------------------------------------------------------------------------------------
function contains(myArray, searchString) {
var tContains = false;
for(var i=0;i<myArray.length;i++)
{
if(myArray[i].nodeName.toLocaleString().toUpperCase() == searchString.toLocaleString().toUpperCase())tContains = true;
}
return tContains;
};
//-----------------------------------------------------------------------------------------------------------------------
//Function name: StringtoXML
//-----------------------------------------------------------------------------------------------------------------------
//Description:
//Converts responseText to XML Doc.
//-----------------------------------------------------------------------------------------------------------------------
//Parameters: text: responseText of http Request
//-----------------------------------------------------------------------------------------------------------------------
function StringtoXML(text){
var doc = null;
if (window.ActiveXObject){
doc=new ActiveXObject('Microsoft.XMLDOM');
doc.async='false';
doc.loadXML(text);
} else {
var parser=new DOMParser();
doc=parser.parseFromString(text,'text/xml');
}
return doc;
}
//-----------------------------------------------------------------------------------------------------------------------
// Function name: faultHandler
//-----------------------------------------------------------------------------------------------------------------------
// Description:
// This function reads an actual time stamp and alerts exception information.
//-----------------------------------------------------------------------------------------------------------------------
// Parameters: e: Exception catched in a function, source: function name of calling function
//-----------------------------------------------------------------------------------------------------------------------
function faultHandler(e, source)
{
try
{
var actDate = new Date();
var myErrorString = "An Error occured!\n\nTime:\t\t" + actDate.toLocaleTimeString() + "\nLocation:\t" + source + "\nDescription:\t" + e.message;
alert(myErrorString);
}
catch(e1)
{
alert(e1.mesage);
}
}
//-----------------------------------------------------------------------------------------------------------------------
//Function name: getDocument
//-----------------------------------------------------------------------------------------------------------------------
//Description:
//This function reads an document via http request and calls a callback function on reply.
//-----------------------------------------------------------------------------------------------------------------------
//Parameters: dataElement: Source string of file to read.
//-----------------------------------------------------------------------------------------------------------------------
function getDocument(dataElement)
{
try
{
if (window.XMLHttpRequest)
{
requestRead = new XMLHttpRequest();//works with firefox safari opera and chrome
}
else if (window.ActiveXObject)
{
try
{
requestRead = new ActiveXObject('Msxml2.XMLHTTP');//ie5
}
catch(e)
{
try
{
requestRead = new ActiveXObject('Microsoft.XMLHTTP');//ie6
}
catch(e)
{}
}
}
else
{
}
if(!requestRead)
{
alert("das XMLHTTP-Element konnte nicht erzeugt werden!");
return false;
}
else
{
requestRead.open('get', dataElement, true);
requestRead.s