﻿function WriteAd() {
    var baseUrl = "";
    var adformat = "0";

    if (document.location.protocol == "https:") {
        var baseUrl = "https://goudmarkt.nl";
    } else {
        var baseUrl = "http://goudmarkt.nl";
    }

    if (document.URL.indexOf("localhost") > -1) {
        baseUrl = "http://localhost:23000";
    }

    if (typeof(adbox_format) != 'undefined')
        adformat = adbox_format; 
    var url = baseUrl + "/ProductAdBox?adformat=" + adformat;
    if (typeof(adbox_affiliate) != 'undefined')
        url += "&adaffl=" + escape(adbox_affiliate);
    if (typeof(adbox_bordercolor) != 'undefined')
        url += "&bordercolor=" + escape(adbox_bordercolor);
    if (typeof (adbox_backgroundcolor) != 'undefined')
        url += "&backgroundcolor=" + escape(adbox_backgroundcolor);
    if (typeof (adbox_textcolor) != 'undefined')
        url += "&textcolor=" + escape(adbox_textcolor);
    if (typeof (adbox_titlecolor) != 'undefined')
        url += "&titlecolor=" + escape(adbox_titlecolor);
    if (typeof (adbox_urlcolor) != 'undefined')
        url += "&urlcolor=" + escape(adbox_urlcolor);
    url += "&ou=" + escape(document.URL);

    var frame = '<iframe src="' + url + '" frameborder="0" width="' + adbox_width + '" height="' + adbox_height + '" scrolling="no" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0"></iframe>';
    document.write(frame);
}
WriteAd();

