function showMp3Selection(selName) {
	var divElements = document.getElementsByTagName("div");
	var id;
	for (var i = 0; i < divElements.length; i++) {
		id = divElements[i].id;
		if (id == selName) {
			divElements[i].style.visibility = "visible";
		}
		else if (id.lastIndexOf('mp3dw') != -1) {
			divElements[i].style.visibility = "hidden";
		}
	}
	
}

function backgroundDark(elem) {
	elem.style.backgroundImage = "url(../../images/menuhighlightback.jpg)";
	elem.style.color = "white";
	document.getElementsByTagName('body')[0].style.cursor='pointer';
}
function backgroundLight(elem) {
	elem.style.backgroundImage = "url(../../images/menuback.jpg)";
	elem.style.color = "#595959";
	document.getElementsByTagName('body')[0].style.cursor='auto';
}


/*

    ** external JavaScript-functions **
    by Axel Hahn * http://www.axel-hahn.de/
    Feel free to use and modify this code
    for your own page.
*/

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// START: Tooltip
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	// -- preload images
	function MM_preloadImages(){ //v3.0 - http://www.searchbliss.com/webmaster_tools/preload_images_generator.htm
        var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
        for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}



	// -- show tooltip
	//    e: event
	//    sHead: string: headerinfo/ title
	//    sText: string: main text
	//    sImageLeft: string: image to show on the left (optional)
    function show_tooltip(e, sHead, sText, sImageLeft)
    {
       tooltip = document.getElementById('tooltip');
       if (tooltip)
       {
       	  var sImageLeft2='';
       	  if (sImageLeft) sImageLeft2='<img src="' + sImageLeft + '">';
          document.getElementById('tooltiphead').innerHTML = sHead;
          document.getElementById('tooltipinfo').innerHTML = sText;
          document.getElementById('tooltipimage').innerHTML = sImageLeft2;
          if (e.pageX) {
             // Mozilla
             tooltip.style.left = (pageXOffset + e.clientX - 100) + "px";
             tooltip.style.top  = (pageYOffset + e.clientY + 25) + "px";
		  } else if (document.documentElement && document.documentElement.scrollTop) {
		  	 // IE when using doctype
             tooltip.style.left = (e.clientX + document.documentElement.scrollLeft - 100 ) + "px";
             tooltip.style.top  = (e.clientY + document.documentElement.scrollTop + 25) + "px";		  
          } else {
          	 // IE default mode
             tooltip.style.left = (e.clientX + document.body.scrollLeft - 100 ) + "px";
             tooltip.style.top  = (e.clientY + document.body.scrollTop + 25) + "px";
          }
          tooltip.style.visibility = "visible";
       }
    }

	// -- hide tooltip
    function hide_tooltip()
    {
       if (tooltip) {
          tooltip.style.visibility = "hidden";
       }
    }

	// -- init
    var tooltip = null;
    document.write('<div id="tooltip"><div id="tooltiphead"></div><div id="tooltipimage"></div><div id="tooltipinfo"></div></div>');
	/*MM_preloadImages(
		'/axel/defaultimages/tooltip_avi.gif',
		'/axel/defaultimages/tooltip_email.gif',
		'/axel/defaultimages/tooltip_exe.gif',
		'/axel/defaultimages/tooltip_mp3.gif',
		'/axel/defaultimages/tooltip_url.gif',
		'/axel/defaultimages/tooltip_wav.gif',
		'/axel/defaultimages/tooltip_xm.gif',
		'/axel/defaultimages/tooltip_zip.gif'
		);*/

	hide_tooltip();

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ENDE: Tooltip
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// START: exchange CSS

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



    // ----------------------------------------------

    // StyleSwitcher functions written by Paul Sowden

    // http://www.idontsmoke.co.uk/ss/

    // - - - - - - - - - - - - - - - - - - - - - - -

    // For the details, visit ALA:

    // http://www.alistapart.com/stories/alternate/



    function setActiveStyleSheet(title) {

      if (title){

	      var i, a, main;

    	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {

        	if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {

	          a.disabled = true;

    	      if(a.getAttribute("title") == title) a.disabled = false;

        	}

	      }

	  }

    }



    function getActiveStyleSheet() {

      var i, a;

      for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {

        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");

      }

      return null;

    }



    function getPreferredStyleSheet() {

      var i, a;

      for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {

        if(a.getAttribute("rel").indexOf("style") != -1

           && a.getAttribute("rel").indexOf("alt") == -1

           && a.getAttribute("title")

           ) return a.getAttribute("title");

      }

      return null;

    }



    function createCookie(name,value,days) {

      if (days) {

        var date = new Date();

        date.setTime(date.getTime()+(days*24*60*60*1000));

        var expires = "; expires="+date.toGMTString();

      }

      else expires = "";

      document.cookie = name+"="+value+expires+"; path=/";

    }



    function readCookie(name) {

      var nameEQ = name + "=";

      var ca = document.cookie.split(';');

      for(var i=0;i < ca.length;i++) {

        var c = ca[i];

        while (c.charAt(0)==' ') c = c.substring(1,c.length);

        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);

      }

      return null;

    }



/*

    window.onload = function(e) {

      var cookie = readCookie("style");

      var title = cookie ? cookie : getPreferredStyleSheet();

      setActiveStyleSheet(title);

    }



    window.onunload = function(e) {

      var title = getActiveStyleSheet();

      createCookie("style", title, 365);

    }



    var cookie = readCookie("style");

    var title = cookie ? cookie : getPreferredStyleSheet();

    setActiveStyleSheet(title);

*/



// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// ENDE: exchange CSS

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// START: get selected text

// basic source: http://www.webreference.com/js/column12/crossbrowser.html

// 2004-10-13  v1.0

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function display(e) {

  var str = "";

  var iMax=30;



  if (window.getSelection) {

    str = str+window.getSelection();

  } else if (document.selection && document.selection.createRange) {

    var range = document.selection.createRange();

    str = str+range.text;

  } // if (window.getSelection)



  if (str.length > iMax || (str.length == 0) ) hide_tooltip()

  else {



  		var strshort = str.substr(0, iMax);

  		if (str.length > iMax) strshort = strshort + '...'

  			show_tooltip(e,

                strshort,

                '<B>suchen in ...</B><BR>'

                + '<a href="#" OnMousedown="hide_tooltip(); window.location.href=\'/cgi-bin/sitesearch.php.cgi?query='+escape(str)+'&searchprocess=&language=&maxresults=20&template=axelhahn.tpl\'">Axels Webseite</A><BR>'

                + '<a href="#" OnMousedown="hide_tooltip(); window.location.href=\'http://de.wikipedia.org/w/wiki.phtml?search='+escape(str)+'\'">de.wikipedia.org</A><BR>'

                + '<a href="#" OnMousedown="hide_tooltip(); window.location.href=\'http://www.google.de/search?q='+escape(str)+'\'">google.de</A><BR>'

                + '<BR><B>übersetzen...</B><BR>'

                + '<a href="#" OnMousedown="hide_tooltip(); window.location.href=\'http://dict.leo.org/?search='+escape(str)+'\'">leo.org</A> (de &lt;-&gt; en)<BR>'

                );

  		} // if (str.length > 40 ...

} // function display(e)



// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// ENDE: get selected text

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// START: underline accesskeys

// basic source: http://clagnut.com/sandbox/dynamic-accesskeys

// 2005-05-22  v1.0

// changes:

// - added parameter sMenuId to function

// - add accesskey in title of link

// - set a return value to function

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function underlineAccesskeys(sMenuId) {

	var nav = document.getElementById(sMenuId);

	var navlinks = nav.getElementsByTagName('A');

	var sAllKeys = "";

	for (var i = 0; i < navlinks.length; i++) {

		var accesskey = navlinks[i].getAttribute('accesskey');

		if (accesskey) {

			sAllKeys = sAllKeys + accesskey;

			var link = navlinks[i];



			var linktext = link.childNodes[0].nodeValue;

			var keypos = linktext.indexOf(accesskey);

			var firstportion = linktext.substring(0,keypos);

			var keyportion = linktext.substring(keypos,keypos+1);

			var lastportion = linktext.substring(keypos+1,linktext.length);



			link.childNodes[0].nodeValue = firstportion;

			var s = document.createElement("span");

			var span = link.appendChild(s);

			var keyt = document.createTextNode(keyportion);

			span.appendChild(keyt);

			var lastt = document.createTextNode(lastportion);

			link.appendChild(lastt);



			// axel hahn: add accesskey in title of link

			var title = link.getAttribute('title');

			if (title) title = title + " ... ";

			else title = "";



			link.title = title + 'accesskey: ['+accesskey+']';

		}

	}

	// axel hahn: set a return value

	return sAllKeys;

}



// -- init

window.onload = function() {



	var sKeys="";

	// sKeys = sKeys + underlineAccesskeys('mmain');

	// sKeys = sKeys + underlineAccesskeys('mnavi2');

	// sKeys = sKeys + underlineAccesskeys('dFooter');

	// alert(sKeys);

}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// ENDE: underline accesskeys

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~







// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// EOF * info@Axel-Hahn.de

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


	/** 
		Funktion fuer Losungen
	 */
  	var isLoaded = false;

    function TheWord()
    {
      d     = new Date();
      Tag   = d.getDate();
      Monat = d.getMonth() + 1;
      Jahr  = d.getFullYear();

      if (Tag < 10)   { Tag   = "0" + Tag; };
      if (Monat < 10) { Monat = "0" + Monat; }; 
      url = Jahr + "/" + Monat + "/" + Jahr + "-" + Monat + "-" + Tag + ".html";
	  if (!isLoaded) {
		top.frames.ifr.location = url;
	  }
	  isLoaded = true;
    }

