var xmlHttp = false;	
	var REQUEST_GET		= 0;
	var REQEST_POST		= 2;
	var REQUEST_HEAD	= 1;
	var REQUEST_XML		= 3;
	var targetobj_name = "";
	var gMedKey = 0;
	
	function getXMLRequester( )	{
		var xmlHttp = false;					
		try		{
			if( window.ActiveXObject ){
				for( var i = 5; i; i-- ){
					try	{
						if( i == 2 ) {
							xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );	
						}
						else {							
							xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );
						}
						break;
					}
					catch( excNotLoadable )	{						
						xmlHttp = false;
					}
				}
			}
			else if( window.XMLHttpRequest ) {
				xmlHttp = new XMLHttpRequest();
			}
		}
		catch( excNotLoadable )	{
			xmlHttp = false;
		}
		return xmlHttp ;
	}
	
	function sendRequest( strSource, strData, intType, intID )
	{		
		if( !strData )
			strData = '';	
		if( isNaN( intType ) )
			intType = 0; 	
		if( xmlHttp && xmlHttp.readyState )	{
			xmlHttp.abort( );
			xmlHttp = false;
		}			
		if( !xmlHttp ){
			xmlHttp = getXMLRequester( );
			if( !xmlHttp )
				return;
		}
		
		if( intType != 1 && ( strData && strData.substr( 0, 1 ) == '&' || strData.substr( 0, 1 ) == '?' ) )
			strData = strData.substring( 1, strData.length );

		var dataReturn = strData ? strData : strSource;
		
		switch( intType ){
			case 1:	
				strData = "xml=" + strData;
			case 2: 
				xmlHttp.open( "POST", strSource, true );
				xmlHttp.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
				xmlHttp.setRequestHeader( 'Content-length', strData.length );
				break;
			case 3: 
				xmlHttp.open( "HEAD", strSource, true );
				strData = null;
				break;
			default: 
				var strDataFile = strSource + (strData ? '?' + strData : '' );
				xmlHttp.open( "GET", strDataFile, true );
				strData = null;}		
		xmlHttp.onreadystatechange = new Function( "", "processResponse(" + intID + ")" );
		xmlHttp.send( strData );	
		
		return dataReturn;
	}
	function processResponse( intID ){
		switch( xmlHttp.readyState ){
			case 3:
				break;
			case 4:	
				if( xmlHttp.status == 200 )	{
					processData( xmlHttp, intID );}
				else{
					if( window.handleAJAXError )
						handleAJAXError( xmlHttp, intID );
					else
						alert( "ERROR\n HTTP status = " + xmlHttp.status + "\n" + xmlHttp.statusText ) ;				}
		}
	}
	
	function processData( xmlHttp, intID )
	{
		var vContent = "";
		gMedKey = xmlHttp.responseText.substr(0, xmlHttp.responseText.indexOf(';',0));
		vContent = xmlHttp.responseText.substr(xmlHttp.responseText.indexOf(';',0) + 1, xmlHttp.responseText.length - xmlHttp.responseText.indexOf(';',0));
		
		document.getElementsByTagName("body")[0].style.backgroundImage="url(" + vContent + ")";
		//document.getElementById("RndImg").innerHTML = vContent;		
		window.setTimeout("Bildwechsel()", 5000);
		}	
	function getData()
	{
		var jetzt = new Date();
		var strURL = "/pages/inc/GetFrontPic_data.asp?cat=156&medkey=" + gMedKey + "&" + jetzt.getSeconds();
		sendRequest( strURL );	
	}
	
	function runSlideShow() {
		if (document.all) {
			document.images.SlideShow.style.filter="blendTrans(duration=2)";
			document.images.SlideShow.filters.blendTrans.Apply();
			document.images.SlideShow.filters.blendTrans.Play();
		}
	}	
