//function vrweb_window(URL,winName,features) { window.open(URL,winName,features); }

(function(){
        function encode(b){
                if (typeof encodeURIComponent=="function")
                        {return encodeURIComponent(b)}
                else
                        {return escape(b)}
        }
        function add_parameter_to_url(b,a)
        {
                if (a) {window.vrweb_url+="&"+b+"="+a}
        }
        function add_parameter(b,a)
        {
                if (a) {add_parameter_to_url(b,encode(a))}
        }
        function icon()
        {
                var icon;
                if (window.vrweb_iconalign == 'none') {
                        return '';
                } else {
                        if (parseInt(window.vrweb_icon)<1 || parseInt(window.vrweb_icon)>6) {
                                icon = '2';
                        } else { icon = window.vrweb_icon; }
                        
                        return '<img class="vrweb_img" style="'+css_img()+'" src="http://www.linguatec.net/images/vrweb/speakbutton'+icon+'.png" align="'+window.vrweb_iconalign+'" />';
                }
        }
        
        function css_a()
        {
                if (window.vrweb_styles == 'own') {
                        return '';
                } else {
                        return 'text-decoration:none;color:#4360AC;font-size:9pt;font-family:arial,sans-serif;font-weight:normal;font-style:normal;';
                }
        }

        function css_img()
        {
                if (window.vrweb_styles == 'own') {
                        return '';
                } else {
                        return 'border:0px;';
                }
        }
                
        function start() {
                a = document.location;
                b = window;
                b.vrweb_url="http://www.voicereadera.net/vrwebpremium.pl?";
                add_parameter('url',a);
                add_parameter('lang',b.vrweb_lang);
                //add_parameter('gui','popup');
                add_parameter('gui',b.vrweb_gui);
                add_parameter('readcontent',b.vrweb_readcontent);
                add_parameter('srctype',b.vrweb_srctype);
                add_parameter('srccharset',b.vrweb_srccharset);
                add_parameter('readelementsName',b.vrweb_readelementsname);
                add_parameter('readelementsClass',b.vrweb_readelementsclass);
                add_parameter('exclelementsName',b.vrweb_exclelementsname);
                add_parameter('exclelementsClass',b.vrweb_exclelementsclass);
                add_parameter('sitetopic',b.vrweb_sitetopic);
                add_parameter('CustomerID',b.vrweb_customerid);
                add_parameter('cache',b.vrweb_cache);
                add_parameter('sndpitch',b.vrweb_sndpitch);
                add_parameter('sndspeed',b.vrweb_sndspeed);
                add_parameter('sndtype',b.vrweb_sndtype);
                add_parameter('sndquality',b.vrweb_sndquality);
                b.vrweb_popup = 'javascript:window.open(\''+b.vrweb_url+'\',\'vrweb\',\'scrollbars=no,resizable=no,width='+b.vrweb_popupwidth+',height='+b.vrweb_popupheight+'\');return false;'
                icon_html = icon();
                //document.write('<div id="vrweb_div" style="width:'+b.vrweb_width+'px;"><a class="vrweb_a" style="'+css_a()+'" href="'+b.vrweb_popup+'" target="vrweb">'+icon()+b.vrweb_icontext+'</a></div>');
                document.write('<div id="vrweb_div" style="width:'+b.vrweb_width+'px;"><a class="vrweb_a" style="'+css_a()+'" href="#" onclick="'+b.vrweb_popup+'">'+icon()+b.vrweb_icontext+'</a></div>');
        }
        start();
})()
