var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}



function embedObject() {

if(getVar('L') == 0 || getVar('L') ==null || getVar('L') =='')
{
	document.write('	<object type=\"application/x-shockwave-flash\" data=\"fileadmin/sab/Abbildungen/map/map_sab.swf\" width=\"390\" height=\"400\">' +
	'	<param name=\"movie\" value=\"fileadmin/sab/Abbildungen/map/map_sab.swf\" />' +
	'	<param name=\"wmode\" value=\"transparent\" />' +
        '	<img src="fileadmin/sab/Abbildungen/nonflashmaps/map_sab.gif" width="390" height="400" alt="" />' +
	'	</object>');
}
if(getVar('L') == 1)
	document.write('	<object type=\"application/x-shockwave-flash\" data=\"fileadmin/sab/Abbildungen/map/map_sab_GB.swf\" width=\"390\" height=\"400\">' +
	'	<param name=\"movie\" value=\"fileadmin/sab/Abbildungen/map/map_sab_GB.swf\" />' +
	'	<param name=\"wmode\" value=\"transparent\" />' +
        '	<img src="fileadmin/sab/Abbildungen/nonflashmaps/map_sab_GB.gif" width="390" height="400" alt="" />' +
	'	</object>');
}

function embedObjectTickerTop() {

if(getVar('L') == 0 || getVar('L') ==null || getVar('L') =='')
{
	document.write('	<object type=\"application/x-shockwave-flash\" data=\"fileadmin/sab/Abbildungen/flash/sab_ticker.swf\" width=\"385\" height=\"12\">' +
	'	<param name=\"movie\" value=\"fileadmin/sab/Abbildungen/flash/sab_ticker.swf\" />' +
	'	<param name=\"scale\" value=\"noScale\" />' +
	'	<param name=\"wmode\" value=\"transparent\" />' +
	'	</object>');
}
if(getVar('L') == 1)
	document.write('	<object type=\"application/x-shockwave-flash\" data=\"fileadmin/sab/Abbildungen/flash/sab_ticker_GB.swf\" width=\"385\" height=\"12\">' +
	'	<param name=\"movie\" value=\"fileadmin/sab/Abbildungen/flash/sab_ticker_GB.swf\" />' +
	'	<param name=\"scale\" value=\"noScale\" />' +
	'	<param name=\"wmode\" value=\"transparent\" />' +
	'	</object>');
}

function embedObjectTickerBottom() {

if(getVar('L') == 0 || getVar('L') ==null || getVar('L') =='')
{
	document.write('	<object type=\"application/x-shockwave-flash\" data=\"fileadmin/sab/Abbildungen/flash/sab_ticker2.swf\" width=\"385\" height=\"13\">' +
	'	<param name=\"movie\" value=\"fileadmin/sab/Abbildungen/flash/sab_ticker2.swf\" />' +
	'	<param name=\"scale\" value=\"noScale\" />' +
	'	<param name=\"wmode\" value=\"transparent\" />' +
	'	</object>');
}
if(getVar('L') == 1)
	document.write('	<object type=\"application/x-shockwave-flash\" data=\"fileadmin/sab/Abbildungen/flash/sab_ticker2_GB.swf\" width=\"385\" height=\"13\">' +
	'	<param name=\"movie\" value=\"fileadmin/sab/Abbildungen/flash/sab_ticker2_GB.swf\" />' +
	'	<param name=\"scale\" value=\"noScale\" />' +
	'	<param name=\"wmode\" value=\"transparent\" />' +
	'	</object>');
}


function getVar(name)
         {
         get_string = document.location.search;         
         return_value = '';
         
         do { //This loop is made to catch all instances of any get variable.
            name_index = get_string.indexOf(name + '=');
            
            if(name_index != -1)
              {
              get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);
              
              end_of_value = get_string.indexOf('&');
              if(end_of_value != -1)                
                value = get_string.substr(0, end_of_value);                
              else                
                value = get_string;                
                
              if(return_value == '' || value == '')
                 return_value += value;
              else
                 return_value += ', ' + value;
              }
            } while(name_index != -1)
            
         //Restores all the blank spaces.
         space = return_value.indexOf('+');
         while(space != -1)
              { 
              return_value = return_value.substr(0, space) + ' ' + 
              return_value.substr(space + 1, return_value.length);
							 
              space = return_value.indexOf('+');
              }
          
         return(return_value);        
         }

