var google_adnum = 0;
var zbGoogleAdBlock = "";
var zbGoogleAdTestChannel = "0";
var googlebox300x250html = "";

function google_ad_request_done(google_ads)
{
    var s = '';
    var style1;
    var i;

    if (google_ads.length == 0) { return; }

    if (google_ads[0].type == "flash")
    {
        s += '<a href="'+google_info.feedback_url+'" class="gnodeco" style="font-size:8pt;color:#666666" target="_blank">Google-Anzeigen</a><br>' +
             '<div class="googlebox300x250">' +
             '<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>' +
             '</div>';
    }
    else if (google_ads[0].type == "image")
    {
        s += '<a href="'+google_info.feedback_url+'" class="gnodeco" style="font-size:8pt;color:#666666" target="_blank">Google-Anzeigen</a><br>' +
	         '<div class="googlebox300x250">' +
             '<a href="' +
             google_ads[0].url + '" target="_blank" title="' +
             google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'' +
             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>' +
             '</div>';
    }
    else if (google_ads[0].type == "html")
    {
//        googlebox300x250html = google_ads[0].snippet;
//        s += '<a href="'+google_info.feedback_url+'" class="gnodeco" style="font-size:8pt;color:#666666" target="_blank">Google-Anzeigen</a><br>' +		             
//             '<iframe class="googlebox300x250" style="width:300px;height:250px;" src="googlebox300x250.php" ' + 
//             'scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>';
          s += '<a href="'+google_info.feedback_url+'" class="gnodeco" ' + 
               'style="font-size:8pt;color:#666666" target="_blank">Google-Anzeigen</a><br>' +
               '<div class="googlebox300x250">' + 
               '<div style="position:absolute;">' + 
               google_ads[0].snippet + 
               '</div></div>';
//               <div class="googlebox300x250">' + google_ads[0].snippet + '</div>';
    }
	else if (google_ads.length >= 1)
	{
	    if (zbGoogleAdBlock == 'zbGoogleRechnerseitenOben')	    
	    {
            s += '<div class="googlebox100pro" style="clear:both;margin-bottom:16px;">' +
                 '<div style="font-size:8pt;color:#666666;margin-bottom:6px;">' +
                 '<a href="'+google_info.feedback_url+'" class="gnodeco" style="color:#666666;" ' +
                 'target="_blank">Google-Anzeigen</a></div>';
                 
            var urlcolor_arr = new Array('#333333','#40454B','#818B96');
            var urlcolor = urlcolor_arr[zbGoogleAdTestChannel];
            var classtitel = 'gadstitel1'; // (zbGoogleAdTestChannel == 1) ? 'gadstitel1' : 'gadstitel';
            
            if (google_ads.length == 1)
            {
                i = 0;
                s += '<div style="line-height:19px;margin-bottom:1px;">' +
                     '<a href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" ' +
                     'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" ' +
                     'class="'+classtitel+'" target="_blank" style="font-weight:bold;font-size:14pt;">' +
                     google_ads[i].line1+'</a><br>' +
                     '<span style="font-size:11pt;">'+google_ads[i].line2+' '+google_ads[i].line3+'</span> ' +
                     '<a href="'+google_ads[i].url+'" class="gnodeco" onmouseout="window.status=\'\'" ' +
                     'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" target="_blank">' +
                     '<span style="font-size:8pt;color:'+urlcolor+';text-decoration:none;white-space:nowrap;">' +
                     google_ads[i].visible_url+'</span></a>' +
                     '</div>';
            }
            else
            {
                for (i=0;i<google_ads.length;i++)
                {
                    style1 = (i<google_ads.length-1) ? 'margin-bottom:8px;':'margin-bottom:1px;';
                    s += '<div style="line-height:13px;'+style1+'">' +
                         '<a href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" ' +
                         'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" ' +
                         'class="'+classtitel+'" target="_blank" style="font-weight:bold;font-size:11pt;">' +
                         google_ads[i].line1+'</a> ' +
                         '<span style="font-size:9pt;">'+google_ads[i].line2+' '+google_ads[i].line3+'</span> ' +
                         '<a href="'+google_ads[i].url+'" class="gnodeco" onmouseout="window.status=\'\'" ' +
                         'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" target="_blank">' +
                         '<span style="font-size:8pt;color:'+urlcolor+';text-decoration:none;white-space:nowrap;">' +
                         google_ads[i].visible_url+'</span></a>' +
                         '</div>';
                }
            }
            s += '</div>';
            if (google_ads[0].bidtype == "CPC") { google_adnum += google_ads.length; }
		}
        else if (zbGoogleAdBlock == 'zbGoogleRechnerseitenUnten')
        {
            s += '<div class="googlebox300x250" ' +
                 'style="border:none;background:transparent;height:auto;margin-bottom:16px;">' +
                 '<div style="font-size:8pt;color:#666666;margin:0 0 10px;">' +
                 '<a href="'+google_info.feedback_url+'" class="gnodeco" style="color:#666666;" ' +
                 'target="_blank">Google-Anzeigen</a></div>';
                 
            var urlcolor_arr = new Array('#333333','#40454B','#818B96');
            var urlcolor = urlcolor_arr[zbGoogleAdTestChannel];
            var classtitel = 'gadstitel1'; // (zbGoogleAdTestChannel == 1) ? 'gadstitel1' : 'gadstitel';

            for (i=0;i<google_ads.length;i++)
            {
                style1 = (i>0) ? 'margin-top:12px;':'';

                s += '<div style="line-height:18px;'+style1+'">' +
                     '<a href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" ' +
                     'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" ' +
                     'class="'+classtitel+'" target="_blank" style="font-weight:bold;font-size:12pt;">' +
                     google_ads[i].line1+'</a><br>' +
                     '<span style="font-size:10pt;">'+google_ads[i].line2+' '+google_ads[i].line3+'</span></div>' +
                     '<div style="line-height:13px;">' +
                     '<a href="'+google_ads[i].url+'" class="gnodeco" onmouseout="window.status=\'\'" ' +
                     'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" target="_blank">' +
                     '<span style="font-size:8pt;color:'+urlcolor+';text-decoration:none;white-space:nowrap;">' +
                     google_ads[i].visible_url+'</span></a>' +
                     '</div>';
            }
            s += '</div>';
            if (google_ads[0].bidtype == "CPC") { google_adnum += google_ads.length; }
        }
		else if (zbGoogleAdBlock == 'zbGoogleTextseitenOben')
		{
            s += '<div class="googlebox100pro" ' +
                 'style="border:none;margin-bottom:16px;">' +
                 '<div style="font-size:8pt;color:#666666;margin:1px 0 4px;">' +
                 '<a href="'+google_info.feedback_url+'" class="gnodeco" style="color:#666666;" ' +
                 'target="_blank">Google-Anzeigen</a></div>';
            i = 0;
            
            var urlcolor_arr = new Array('#333333','#40454B','#818B96');
            var urlcolor = urlcolor_arr[zbGoogleAdTestChannel];
            var classtitel = 'gadstitel1'; // (zbGoogleAdTestChannel == 1) ? 'gadstitel1' : 'gadstitel';
            
            s += '<div style="line-height:18px;">' +
                 '<a href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" ' +
                 'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" ' +
                 'class="'+classtitel+'" target="_blank" style="font-weight:bold;font-size:11pt;">' +
                 google_ads[i].line1+'</a><br>' +
                 '<span style="font-size:9pt;">'+google_ads[i].line2+' '+google_ads[i].line3+'</span> ' +
                 '<a href="'+google_ads[i].url+'" class="gnodeco" onmouseout="window.status=\'\'" ' +
                 'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" target="_blank">' +
                 '<span style="font-size:8pt;color:'+urlcolor+';text-decoration:none;white-space:nowrap;">' +
                 google_ads[i].visible_url+'</span></a>' +
                 '</div>';

            s += '</div>';
            if (google_ads[0].bidtype == "CPC") { google_adnum += google_ads.length; }
		}
		else if (zbGoogleAdBlock == 'zbGoogleTextseitenUnten')
	    {
            s += '<div class="googlebox100pro" ' +
                 'style="border:none;background:transparent;width:auto;margin-bottom:16px;">' +
                 '<div style="font-size:8pt;color:#666666;margin:0 0 10px;">' +
                 '<a href="'+google_info.feedback_url+'" class="gnodeco" style="color:#666666;" ' +
                 'target="_blank">Google-Anzeigen</a></div>';
            
            var urlcolor_arr = new Array('#333333','#40454B','#818B96');
            var urlcolor = urlcolor_arr[zbGoogleAdTestChannel];
            var classtitel = 'gadstitel1'; // (zbGoogleAdTestChannel == 1) ? 'gadstitel1' : 'gadstitel';            
            
            for (i=0;i<google_ads.length;i++)
            {
                style1 = (i>0) ? 'margin-top:12px;':'';

                s += '<div style="line-height:18px;'+style1+'">' +
                     '<a href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" ' +
                     'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" ' +
                     'class="'+classtitel+'" target="_blank" style="font-weight:bold;font-size:12pt;">' +
                     google_ads[i].line1+'</a><br>' +
                     '<span style="font-size:10pt;">'+google_ads[i].line2+' '+google_ads[i].line3+'</span></div>' +
                     '<div style="line-height:13px;">' +
                     '<a href="'+google_ads[i].url+'" class="gnodeco" onmouseout="window.status=\'\'" ' +
                     'onmouseover="window.status=\''+google_ads[i].visible_url+'\';return true" target="_blank">' +
                     '<span style="font-size:8pt;color:'+urlcolor+';text-decoration:none;white-space:nowrap;">' +
                     google_ads[i].visible_url+'</span></a>' +
                     '</div>';
            }
            s += '</div>';
            if (google_ads[0].bidtype == "CPC") { google_adnum += google_ads.length; }
		}
	}

    document.write(s);
}