﻿/*
* This function is required and is used to display
* the ads that are returned from the JavaScript
* request. You should modify the document.write
* commands so that the HTML they write out fits
* with your desired ad layout.
*/
function google_ad_request_done(google_ads) {
    var s = '';
    var i;
    /* optional clickable backgrounds. If this is set,
    * the second and third lines of text ads are
    * linked to the advertiser's URL. This increases
    * click-through but decreases click-through
    * accuracy.
    */
    var clickable_background = 0;
    /*
    *Attribution for Google ads
    */
    var google_attribution = '';
    var title_span = '<span>';
    var description_span = '<span style="color:#000000">';
    var url_style = ' style="color:#0160ce;text-decoration:none">';
    /*
    * Verify that there are actually ads to display.
    */
    if (google_ads.length == 0)
        return;
    /*
    * If an image or Flash ad is returned, display that ad.
    * If a rich media ad is returned, display that as "as is."
    * 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 == "image") {
        s += '<a style="cursor: pointer; cursor: hand" href="'
        + google_ads[0].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 == "flash") {
        s += '<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 == "html") {
        s += google_ads[0].snippet;
    }
    /*attributes ad to Google*/
    if (google_ads[0].type == "image") {
        s += '<table border="0" '
        + '"width="' + google_ads[0].image_width
        + 'height=11px cellspacing="0" cellpadding="0" bgcolor="#000000"><tr><td>'
        + '<a href="' + google_ads[0].url + '" '
        + 'onmouseout="window.status=\'\'" '
        + 'onmouseover="window.status=\'go to '
        + google_ads[0].visible_url + '\';return true;" '
        + 'style="text-decoration:none;font-size:8pt;color: #FFF; cursor: pointer;cursor: hand">'
        + google_ads[0].visible_url + '</span></a>'
        + '</span></td><td align="right"><span style="font-size:8pt;color: #FFF;">'
        + google_attribution
        + '</span></td></tr></table>';
    }
    else if (google_ads[0].type == "text") {
        s += '<div style="text-align:left;font-weight:bold;font-size:10pt">' +
        google_attribution + '</div>';
        /*
        * Larger text for single ad.
        */
        /*	if (google_ads.length == 1) {
        title_span = '<span style="text-decoration:none;font-size:20pt">';
        description_span = '<span style="color:#000000;font-size:16pt">';
        url_style =' style="color:#008000;font-size:14pt;text-decoration:none">' ;
        }*/
        /*
        * For text ads, append each ad to the string.
        */
        for (i = 0; i < google_ads.length; ++i) {
            s += '<br><a href="' + google_ads[i].url + '" ' +
            'onmouseout="window.status=\'\'" ' +
            'onmouseover="window.status=\'go to ' +
            google_ads[i].visible_url + '\';return true;" ' +
            'style="text-decoration:none">' +
            title_span +
            '<b>' + google_ads[i].line1 + '</b><br></span>';
            if (clickable_background == 0) {
                s += '</a>';
            }
            s += description_span +
        google_ads[i].line2 + ' ' +
        google_ads[i].line3 + '<br></span>';
            if (clickable_background == 1) {
                s += '</a>';
            }
            s += '<a href="' + google_ads[i].url + '" ' +
        'onmouseout="window.status=\'\'" ' +
        'onmouseover="window.status=\'go to ' +
        google_ads[i].visible_url + '\';return true;" ' +
        url_style +
        google_ads[i].visible_url + '</span><br></a>';
        }
    }
    document.write(s);
    return;
}
google_ad_client = 'ca-myhomeie_residential'; // substitute your client_id
google_max_num_ads = '3';
google_adtest = 'off';


google_ad_channel = 'property';
google_ad_output = 'js';
google_ad_type = 'text'; // type of ads to display
google_language = 'en';
google_encoding = 'utf8';
google_safe = 'high';