<!--

function get_poll_path (poll_id) {
    var number_path = poll_id + "";
    for (var i = number_path.length; i < 9; i++) {
        number_path = "0" + number_path;
    }
    number_path = number_path.substr(0,3) + "/" + number_path.substr(3,3) + "/" + number_path.substr(6);
    return number_path;
}

function vizu_show_ad() {
    var w = window;
    var d = document;
    
    var poll_url = "";
    var path_to_poll = w.vizu_panel_base_url.replace("http://","");
    path_to_poll = path_to_poll.substr(path_to_poll.indexOf("/")+1);
    path_to_poll = "poll/" + get_poll_path(w.vizu_poll_id) + "/";        
    poll_url = w.vizu_panel_base_url + path_to_poll;

    var iframe_url = (w.vizu_simple) ? poll_url + 'simple.htm' : poll_url + 'index.htm';

    iframe_url += '?n=' + w.vizu_poll_id;
    iframe_url += '&cId=' + w.vizu_category_id;
    iframe_url += '&bg_c=' + escape(w.vizu_bg_color);
    iframe_url += '&bgTwo_c=' + escape(w.vizu_bgTwo_color);
    iframe_url += '&border_c=' + escape(w.vizu_border_color);
    iframe_url += '&question_c=' + escape(w.vizu_question_color);
    iframe_url += '&answers_c=' + escape(w.vizu_answers_color);
    iframe_url += '&button_c=' + escape(w.vizu_button_color);
    iframe_url += '&buttontext_c=' + escape(w.vizu_buttonText_color);
    iframe_url += '&table_w=' + escape(w.vizu_panel_width);
    iframe_url += (typeof(w.vizu_simple) != "undefined" && w.vizu_simple == 1) 
        ? '&table_h=' + escape(w.vizu_panel_height - 12) : '&table_h=' + escape(w.vizu_panel_height - 20);
    if (typeof(w.vizu_simple) != "undefined") {
        iframe_url += '&simple=' + escape(w.vizu_simple);
    }
    
    var iframe_width = w.vizu_panel_width;
    var iframe_height = w.vizu_panel_height;
    
    var iframe_width_corrected = (typeof(w.vizu_simple) != "undefined" && w.vizu_simple == 1) ? iframe_width : iframe_width-4;
    var iframe_height_corrected = (typeof(w.vizu_simple) != "undefined" && w.vizu_simple == 1) ? iframe_height-12 : iframe_height-20;
    

    d.write('<iframe' +
              ' name="vizu_ads_frame"' +
              ' width=' + iframe_width_corrected +
              ' height=' + iframe_height_corrected +
              ' frameborder=' + 0 +
              ' src="' + iframe_url + '"' +
              ' marginwidth="0"' +
              ' marginheight="0"' +
              ' vspace="0"' +
              ' hspace="0"' +
              ' allowtransparency="true"' +
              ' scrolling="no">');
    d.write('</iframe>');
}


vizu_show_ad();
//-->
