// ------------------
// --- wetter.net ---
// ------------------

var openDiv = 'divA';
var Google_Advariante = 'leer';

function img_load(bild,name)
{
	document.images[name].src=bild;
}

function Aktivieren(LayerID)
{
	document.getElementById(LayerID).style.visibility = "visible";
}

function Deaktivieren(LayerID)
{
	document.getElementById(LayerID).style.visibility = "hidden";
}

function MM_jumpMenu(targ,selObj,restore) { 
  if (selObj.options[selObj.selectedIndex].value == "#" || selObj.options[selObj.selectedIndex].value == "")
  {
  }
  else  
  { 
     eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
  }
  if (restore) selObj.selectedIndex=0;
}

function OpenBrWindow(theURL,winName,features) {
  msgWindow=window.open(theURL,winName,features);   
  msgWindow.focus();
}

function showHide(str)
{
  var id ="div" + str;

  if(document.getElementById(id))
  {
    var el = document.getElementById(id);
    if(el.style.display == 'block')
    {
      return false;
    }
    else
    {
      el.style.display = 'block';
      if(openDiv != false)
      {
        document.getElementById(openDiv).style.display = 'none';
      }
      openDiv = id;
    }
  }
  else
  {
    return false;
  }
}



// ----------------------------------
// --- Werbung Stroer (Wallpaper) ---
// ----------------------------------

function checkWallpaper()
{
  if (typeof(adtype) != 'undefined')
  {
     if (adtype == 'wallpaper')
     {
        // Schiebe Skyscraper rechtsbuendig an Leaderboard
        document.getElementById("werbung_oben").style.left='109px';
        document.getElementById("werbung_oben").style.top='0px';
        document.getElementById("werbung_rechts").style.top='-95px';
     }

     if (adtype == 'expwallpaper')
     {
        // Schiebe Sky rechts unter das Leaderboard
        document.getElementById("werbung_oben").style.left='269px';
        document.getElementById("werbung_oben").style.top='0px';
        document.getElementById("werbung_rechts").style.top='-5px';
     }

     var sky_width = document.getElementById('werbung_rechts').offsetWidth;

     document.getElementById("werbung_rechts").style.width = sky_width + "px";
     document.getElementById("tabelle_rechts").style.width = '100%';

     var lboard_width = document.getElementById('werbung_oben').offsetWidth;
     document.getElementById("werbung_oben").style.width = lboard_width + "px";
     document.getElementById("tabelle_oben").style.width = '100%';	  
  }

  
  if (typeof(bgcolor) != 'undefined' && bgcolor != null)
  {
     // Faerbe moegliche Bereiche ein
     document.getElementById("tabelle_oben").style.backgroundColor = bgcolor;
     document.getElementById("tabelle_rechts").style.backgroundColor = bgcolor;
     document.getElementById("zelle_abstand").style.backgroundColor = bgcolor;
  }


  if (typeof(bgimage) != 'undefined' && bgimage != null)
  {
     // Setze Hintergrund Bild
     document.getElementById("wetterseite").style.backgroundImage = "url('" + bgimage + "')";
  }

  if (typeof(adclick) != 'undefined' && adclick != null)
  {
     // Verlinke bei Klick auf Hintergrund auf adclick     

     document.getElementById("tabelle_rechts").style.cursor = "pointer";
     document.getElementById("tabelle_rechts").onclick = function() { window.open(adclick, ''); }         

     document.getElementById("werbung_rechts").onmouseover = function() { document.getElementById("tabelle_rechts").onclick = ""; }     
     document.getElementById("werbung_rechts").onmouseout = function() { document.getElementById("tabelle_rechts").onclick = function() { window.open(adclick, ''); } } 
	 
     document.getElementById("tabelle_oben").style.cursor = "pointer";
     document.getElementById("tabelle_oben").onclick = function() { window.open(adclick, ''); }     
     document.getElementById("werbung_oben").onmouseover = function() { document.getElementById("tabelle_oben").onclick = ""; }     
     document.getElementById("werbung_oben").onmouseout = function() { document.getElementById("tabelle_oben").onclick = function() { window.open(adclick, ''); } }
  } 
}

// ------------------
// --- Google AFC ---
// ------------------

function google_ad_request_done(google_ads) 
{
   /* --- Flexible Google-Anzeigen --- */
   var s = '';
   var i;

   /* --- Anzeigen vorhanden? --- */
   if (google_ads.length == 0) { return; }

   /*
    * If an image or flash ad is returned, display that ad.
    * Otherwise, build a string containing all of the ads and
    * then use a document.write() command to print that string.
    */

   if (google_ads[0].type == "flash")
   {
      s += '<a href=\"' + google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br>' + 
           '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
           ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + 
           google_ad.image_width + '" HEIGHT="' + 
           google_ad.image_height + '"> <PARAM NAME="movie" VALUE="' + 
           google_ad.image_url + '">' + 
           '<PARAM NAME="quality" VALUE="high">' + 
           '<PARAM NAME="AllowScriptAccess" VALUE="never">' + 
           '<EMBED src="' + 
           google_ad.image_url + '" WIDTH="' + 
           google_ad.image_width + '" HEIGHT="' + 
           google_ad.image_height + 
           '" TYPE="application/x-shockwave-flash"' + 
           ' AllowScriptAccess="never" ' + 
           ' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
   } 
   else if (google_ads[0].type == "image") 
   {
      s += '<a href=\"' + 
           google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br> <a href="' + 
           google_ads[0].url + '" target="_top" title="go to ' + 
           google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
           google_ads[0].visible_url + '\';return true"><img border="0" src="' + 
           google_ads[0].image_url + '"width="' + 
           google_ads[0].image_width + '"height="' + 
           google_ads[0].image_height + '"></a>';
   } 
   else if (google_ads[0].type == "html") 
   {
      s += google_ads[0].snippet;
   }
   else
   {
      if (google_ads.length == 1) 
      {
         /* --- Einzelanzeige (Navigation) --- */
         if (Google_Advariante == 'ad_navi')
         {
            s += '<a href=\"' + 
                 google_info.feedback_url + '\"><span class="copyright2">Google Anzeige</span></a><br><a target="_blank" style="text-decoration:none" href="' + 
                 google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                 google_ads[0].visible_url + '\';return true"> <span style="font-size:12;text-decoration:underline;"> <b>' + 
                 google_ads[0].line1 + '</b><br></span></a> <span style="color:#ffffff;">' +
                 google_ads[0].line2 + '&nbsp;' +
                 google_ads[0].line3 + '<br></span> <a style="text-decoration:none" href="' + 
                 google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                 google_ads[0].visible_url + '\';return true"><span class="copyright2">' + 
                 google_ads[0].visible_url.substr(0,19) + ' ...</span></a><br>';
         }        
      } 
      else if (google_ads.length > 1) 
      {
         /* --- Zweier Anzeige (Header) --- */
         if (Google_Advariante == 'ad_header')
         {                  
            s += '<a target="_blank" href=\"' + google_info.feedback_url + '\"><span class="copyright2">Google Anzeigen</span></a><br>' +
                 '<table border="0" width="655" cellspacing="0" cellpadding="0" bgcolor="#e2e2e2">' 

            /* --- String aus allen Textanzeigen bilden --- */
            for (i = 0; i < google_ads.length; ++i) 
            {
              /*  
                s += '<td width="215" valign="top" style="padding: 5px 5px 5px 5px"><a target="_blank" href="' + 
                        google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                        google_ads[i].visible_url + '\';return true"> <span style="font-size:13;text-decoration:underline;color:#3393ea">' + 
                        google_ads[i].line1 + '</span></a><br>' +
                     '<span style="font-size:10;font-weight:lighter">' +
                        google_ads[i].line2 + ' ' + google_ads[i].line3 + '</span></br>' +
                     '<a target="_blank" href="' + 
                        google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                        google_ads[i].visible_url + '\';return true"><span style="font-size:10">' +
                        google_ads[i].visible_url + '</span></a></td>';                   
              */          
              
                s += '<tr><td width="655" valign="top" style="padding: 5px 5px 5px 5px"><a target="_blank" href="' + 
                        google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                        google_ads[i].visible_url + '\';return true"> <span style="font-size:13;text-decoration:underline;color:#3393ea">' + 
                        google_ads[i].line1 + '</span></a><br>' +
                     '<a target="_blank" href="' + 
                        google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                        google_ads[i].visible_url + '\';return true"><span style="font-size:10">' +
                        google_ads[i].visible_url + '</span></a> ' +                        
                     '<span style="font-size:10;font-weight:lighter">' +
                        google_ads[i].line2 + ' ' + google_ads[i].line3 + '</span>' +
                     '</td></tr>';                   
              
            }         
          
            s += '</table>';
         }   
         else if (Google_Advariante == 'ad_content')
         {
            s += '<div><a target="_blank" href=\"' + google_info.feedback_url + '\"><span class="copyright2">Google Anzeigen</span></a></div>' 

            /* --- String aus allen Textanzeigen bilden --- */
            for (i = 0; i < google_ads.length; ++i) 
            {
                s += '<a style="text-decoration:none" target="_blank" href="' + 
                   google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                   google_ads[i].visible_url + '\';return true"> <span style="text-decoration:underline"> <b>' + 
                   google_ads[i].line1 + '</b><br></span></a> <span style="color:#000000">' +
                   google_ads[i].line2 + ' ' +
                   google_ads[i].line3 + '<br></span> <a target="_blank" href="' + 
                   google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\' ' +
                   google_ads[i].visible_url + '\';return true"><span class="copyright2">' + 
                   google_ads[i].visible_url + '</span></a><br><br>';
            }                           
         }
      }             
   }

   document.write(s);
   /* document.write('<br>Variante:' + Google_Advariante); */
   return;
}




