window.onload = function() {
    try {
        if (window.external.msIsSiteMode()) {
            // Continue initialization.
        }
        else {
            // Display prompt.
            document.getElementById('divPinSite').style.display = "block";
        }
    }
    catch(ex) {
        // Fail silently.
    }
}


function addSite() {
    try {
        window.external.msAddSiteMode();
    }
    catch (e) {
        alert("This feature is only available in Internet Explorer 9.");
    }
}
// Copyright 2006-2007 javascript-array.com

var timeout	= 50;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 


/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}



function live_clock()
     {
         var today  = new Date();
         var second = today.getSeconds();
         var minute = today.getMinutes();
         var hour   = today.getHours();
         var hour24 = today.getHours();
         var ampm   = "";
         
         var day    = today.getDay();
         var date   = today.getDate();
         var month  = today.getMonth();
         var year   = today.getFullYear();
		 year = String(year).substr(2, 2);

         
         var days   = new Array();
          days[0]   = "So.";
          days[1]   = "Mo.";
          days[2]   = "Di.";
          days[3]   = "Mi.";
          days[4]   = "Do.";
          days[5]   = "Fr.";
          days[6]   = "Sa.";
          
         var mns   = new Array();
          mns[0]   = "Januar";
          mns[1]   = "Februar";
          mns[2]   = "März";
          mns[3]   = "April";
          mns[4]   = "Mai";
          mns[5]   = "Juni";
          mns[6]   = "Juli";
          mns[7]   = "August";
          mns[8]   = "September";
          mns[9]   = "Oktober";
          mns[10]  = "November";
          mns[11]  = "Dezember";
           
        if(second<10)
            {
                second = "0"+second;
            }
            
        if(minute<10)
            {
                minute = "0"+minute;
            }
        if(hour<10)
            {
                hour = "0"+hour;
            }
        
        
        document.getElementById('live_clock').innerHTML=(days[day]+' '+date+' '+mns[month]+' '+year+", "+hour+":"+minute+":"+second);
    }


// Cookie-Functions
function em_px() {
var node = document.createElement('span');
node.style.padding = node.style.margin = 0;
node.style.border = 'none';
node.style.position = 'absolute';
node.style.width = '1em';
document.body.appendChild(node);
document.getElementById("aktfont").innerHTML="Schrift (" + node.offsetWidth + "):";
}

function setCookie( name, value )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

var expires = 360;
var path = "/";
var domain = "";
var secure = "";

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

if(name != '')
	{document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" );
		document.body.style.fontSize = value;
		em_px();
	}
}
			


function getCookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}




function clearCookie(name)
         {                  
         expires = new Date();
         expires.setYear(expires.getYear() - 1);

         document.cookie = name + '=null' + '; expires=' + expires; 		 
         }
         
function clearCookies()
         {
         Cookies = document.cookie;
         Cookie = Cookies;
         expires = new Date();
         expires.setYear(expires.getYear() - 1);

         while(Cookie.length > 0)
              {
              //All cookie name-value pairs end with a semi-colon, except the last one.
              Cookie = Cookies.substr(0, Cookies.indexOf(';'));
              Cookies = Cookies.substr(Cookies.indexOf(';') + 1, Cookies.length);

              if(Cookie != '')
                 document.cookie = Cookie + '; expires=' + expires;
              else
                 document.cookie = Cookies + '; expires=' + expires;			  			  	  
              }		 		 
         }

function checkfontsize () {
	var name = "ms68font";
	var cookiewert = getCookie(name);
		if (cookiewert == "90%") {
			document.write('<link rel="stylesheet" type="text/css" href="/ms68_small.css">');
		} else if (cookiewert == "110%") {
			document.write('<link rel="stylesheet" type="text/css" href="/ms68_big.css">');
		}
}


