var insyma = new InsymaUtilities();

function InsymaUtilities()
{
	this.window = new InsymaWindow();
	this.xmlhttp = new InsymaXmlHttp();
	this.queryString = InsymaQueryString();
}


function InsymaWindow()
{
	this.getInnerHeight =  InsymaInnerHeight;
	this.getInnerWidth = InsymaInnerWidth;
	this.getScrollTop = InsymaScrollTop;
	this.getScrollLeft = InsymaScrollLeft;



// Eigenschaften und Methoden des insyma Window objekt

function InsymaInnerHeight()
{
	 var height = 0;
	  if( typeof( window.innerHeight) == 'number' )
	  {
	    //Non-IE
	   	height = window.innerHeight;
	  }
	  else if( document.documentElement && document.documentElement.clientHeight   )
	  {
	     //IE 6+ in 'standards compliant mode'
	    height = document.documentElement.clientHeight;
	  }
	  else if( document.body && document.body.clientHeight )
	  {
	    //IE 4 compatible
	    height = document.body.clientHeight;
	  }
	return height;
}

function InsymaInnerWidth()
{
	 var width = 0;
	  if( typeof( window.innerWidth ) == 'number' )
	  {
	    //Non-IE
	    width = window.innerWidth;
	  }
	  else if( document.documentElement && document.documentElement.clientWidth  )
	  {
	     //IE 6+ in 'standards compliant mode'
	    width = document.documentElement.clientWidth;
	  }
	  else if( document.body && document.body.clientWidth )
	  {
	    //IE 4 compatible
	    width = document.body.clientWidth;
	  }
	return width;
}


function InsymaScrollTop()
{
	var y;
	if (self.pageYOffset) // all except Explorer
	{
		y = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
	{
		y = document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		y = document.body.scrollTop;
	}

	return y
}


function InsymaScrollLeft()
{
	var x;
	if (self.pageYOffset) // all except Explorer
	{
		x = self.pageXOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
	{
		x = document.documentElement.scrollLeft;
	}
	else if (document.body) // all other Explorers
	{
		x = document.body.scrollLeft;
	}
	return x
}



}

function InsymaXmlHttp() {
	var xmlhttp
    try {
	// Mozilla / Safari
		xmlhttp = new XMLHttpRequest();
    } catch (e) {
		// IE
		var MSXML_XMLHTTP_PROGIDS = new Array(
                'MSXML2.XMLHTTP.5.0',
                'MSXML2.XMLHTTP.4.0',
                'MSXML2.XMLHTTP.3.0',
                'MSXML2.XMLHTTP',
                'Microsoft.XMLHTTP'
            	);
            	var success = false;
            	for (var i=0;i < MSXML_XMLHTTP_PROGIDS.length && !success; i++) {
                	try {
	                    xmlhttp = new ActiveXObject(MSXML_XMLHTTP_PROGIDS[i]);
	                    success = true;
                } catch (e) {}
            }
            if ( !success ) {
                alert('Cant create XMLHttpRequest - not supported');
            }
        }
        return xmlhttp
}



function InsymaQueryString()
{
		var queryArray = new Array();
	    var query = window.location.search.substring(1);

		 var vars = query.split("&");
		 for (var i=0;i<vars.length;i++) {
			try{
		   		var pair = vars[i].split("=");
		   		var myString = new String(pair[0]);
		   		queryArray[myString] = pair[1];

		   } catch (e) {}
		 }
		  return queryArray;

}

