/*
klickaktuelles.js
(c) 15.03.2010 khw, ADFC Rodgau e.V.
*/

document.write("<style type='text/css'>"+
                 "#aktuell_div {clear:right; width:584px; background:#FFFFFF url(images/layout2010/aktuell_schatten_.png) no-repeat; margin:10px 0 0 15px;padding-top:1px;}"+
                 "#aktuell {height:460px; width:570px; background:#FFFFFF url(touren2009/bilder/buchberg-fotogalerie/bilder%20097%20kl.JPG) no-repeat left bottom; margin:0 0 0 6px; overflow:auto;}"+
                 "#aktuell #aktuell_navi {background:#EDF4FA url(images/layout2010/aktuell_navi.png) left top no-repeat; margin:0; padding:12px 0 12px 125px; display:block;}"+
                 "#aktuell #aktuell_navi big {background: url(images/layout2010/aktuell_adfcrad.png) center center no-repeat; font-size:20px; padding:10px 14px 10px 14px; cursor:pointer;}"+
                 "#aktuell h3 {background:#004B80; padding:10px; margin:0; font-size:16px; font-weight:normal; line-height:133%; color:#F8F8F8; border-width:0;}"+
                 "#aktuell p {background:#EDF4FA; color:#3E5059; text-align:left; padding:10px 10px 0 10px; margin:0;}"+
                 "#aktuell #aktuell_ende {height:30px; background:url(images/layout2010/aktuell_ende.png) 0 -10px no-repeat; margin:0;}"+
                 "#aktuell_navi_vor {text-align:center; margin:-10px 0 0 0;}"+
                 "#aktuell_navi_vor img {cursor:pointer;}"+
                 "@media print{"+
                 "#aktuell, #aktuell_div {background:transparent; height:auto;}"+
                 "#aktuell #aktuell_navi {display:none;}"+
                 "#aktuell #aktuell_ende {background:url(images/layout2010/aktuell_ende.png) 0 -20px no-repeat;}"+
                 "#aktuell h3 {display:block; background:transparent; color:#000000; font-weight:bold;}"+
                 "#aktuell p {display:block; background:transparent; color:#000000;}"+
                 "#wetterlink, #decoimg, #aktuell_navi_vor, #fuss_home {display:none;}"+
                 "}"+
               "</"+"style>");

	var temp = document.getElementById('aktuell_div').innerHTML;
	temp = '<div id="aktuell"><div id="aktuell_navi"></div>'+temp+'<div id="aktuell_ende"></div></div>';
         document.getElementById('aktuell_div').innerHTML = temp;

     	var bereich= document.getElementById('aktuell'),
    	navi = document.getElementById('aktuell_navi'),
    	navi_tag_big = navi.getElementsByTagName('big'),
    	navi_vor = document.getElementById('aktuell_navi_vor'),
    	bereich_tag_h3 = bereich.getElementsByTagName('h3'),
    	bereich_tag_p = bereich.getElementsByTagName('p'),
    	bereich_ende = document.getElementById('aktuell_ende'),
    	i = 0, ii = 0, index = 0;

	for (i=0; i<bereich_tag_h3.length; i++) {
             navi.innerHTML+= ' <big>'+(i+1)+'</big> ';
             if (i>0) {
                bereich_tag_h3[i].style.display = 'none';
                bereich_tag_p[i].style.display = 'none';
             }
	}
	navi_tag_big[0].style.color = '#F6821F';
	navi_vor.innerHTML+= '<img id="navi_vor_img" src="images/layout2010/vor.png" width="28" height="28" border="0" alt="nächster Eintrag" title="nächster Eintrag">';
	var navi_img_vor = document.getElementById('navi_vor_img');

 	for (i=0; i<navi_tag_big.length; i++) {
 	    navi_tag_big[i].onclick = function() {
                 hide_h3_p();
                 this.style.color = '#F6821F';
                 index = parseInt(this.innerHTML)-1;
                 setTimeout("show_h3()",300);
                 setTimeout("show_p()",600);
             }
 	}
         navi_img_vor.onclick = function() {
		index++;
		if (index>=navi_tag_big.length) index = 0;
		hide_h3_p();
		navi_tag_big[index].style.color = '#F6821F';
		setTimeout("show_h3()",300);
		setTimeout("show_p()",600);
         }

         function hide_h3_p() {
           for (ii=0; ii<navi_tag_big.length; ii++) {
           	navi_tag_big[ii].style.color = '#3E5059';
               	bereich_tag_h3[ii].style.display = 'none';
               	bereich_tag_p[ii].style.display = 'none';
                 bereich_ende.style.display = 'none';
           }
         }

 	function show_h3() {
		bereich_tag_h3[index].style.display = 'block';
 	}

	function show_p() {
           	bereich_tag_p[index].style.display = 'block';
           	bereich_ende.style.display = 'block';
 	}

/*
Ende
*/
