function hopfeed_goToTab(tabid) {
    document.getElementById('hopfeed_tab1Content').style.display = (tabid == 1 ? "block" : "none");
    document.getElementById('hopfeed_tab2Content').style.display = (tabid == 2 ? "block" : "none");
    document.getElementById('hopfeed_tab3Content').style.display = (tabid == 3 ? "block" : "none");

    document.getElementById('hopfeed_li_1').className = (tabid == 1 ? "hopfeed_tab hopfeed_tabactive" : "hopfeed_tab hopfeed_tabinactive");
    document.getElementById('hopfeed_li_2').className = (tabid == 2 ? "hopfeed_tab hopfeed_tabactive" : "hopfeed_tab hopfeed_tabinactive");
    document.getElementById('hopfeed_li_3').className = (tabid == 3 ? "hopfeed_tab hopfeed_tabactive" : "hopfeed_tab hopfeed_tabinactive");
}

var hopfeed_path = hopfeed_path;
var hopfeed_affiliate = (hopfeed_affiliate == null ? null : hopfeed_affiliate);
var hopfeed_template_name = (hopfeed_template_name==null)? 'DEFAULT': hopfeed_template_name;
var hopfeed_width = (hopfeed_width==null)? '300': hopfeed_width;
var hopfeed_rows = (hopfeed_rows==null)? '5': hopfeed_rows;
var hopfeed_border_color = (hopfeed_border_color==null)? '000000': hopfeed_border_color;
var hopfeed_active_tab_color = (hopfeed_active_tab_color==null)? '000000': hopfeed_active_tab_color;
var hopfeed_inactive_tab_color = (hopfeed_inactive_tab_color==null)? '000000': hopfeed_inactive_tab_color;
var hopfeed_active_tab_font_color = (hopfeed_active_tab_font_color==null)? '000000': hopfeed_active_tab_font_color;
var hopfeed_inactive_tab_font_color = (hopfeed_inactive_tab_font_color==null)? '000000': hopfeed_inactive_tab_font_color;
var hopfeed_hover_color = (hopfeed_hover_color==null)? '000000': hopfeed_hover_color;
var hopfeed_font = (hopfeed_font==null)? 'Verdana, Arial, Helvetica, Sans Serif': hopfeed_font;
var hopfeed_font_size = (hopfeed_font_size==null)? '8pt': hopfeed_font_size;
var hopfeed_tab1_title = (hopfeed_tab1_title==null)? '': hopfeed_tab1_title;
var hopfeed_tab2_title = (hopfeed_tab2_title==null)? '': hopfeed_tab2_title;
var hopfeed_tab3_title = (hopfeed_tab3_title==null)? '': hopfeed_tab3_title;
var hopfeed_tab1_keywords = (hopfeed_tab1_keywords==null)? '': hopfeed_tab1_keywords;
var hopfeed_tab2_keywords = (hopfeed_tab2_keywords==null)? '': hopfeed_tab2_keywords;
var hopfeed_tab3_keywords = (hopfeed_tab3_keywords==null)? '': hopfeed_tab3_keywords;
var hopfeed_affiliate_tid = (hopfeed_affiliate_tid==null)? '': hopfeed_affiliate_tid;
var hopfeed_fill_slots = (hopfeed_fill_slots==null)? '': hopfeed_fill_slots;
var hopfeed_link_target = (hopfeed_link_target==null)? '_blank': hopfeed_link_target;
var hopfeed_referer = document.referrer;

var tab1src = hopfeed_path + '/serv/hopFeedServ.htm?hopfeedTabId=1&fillAllSlots=' + hopfeed_fill_slots + '&borderColor=&type=WIDGET&order=RANDOM&font='+escape(hopfeed_font.replace(/\+/g,'%2b'))+'&fontSize='+hopfeed_font_size+'&fontColor='+escape(hopfeed_active_tab_font_color.replace(/\+/g,'%2b'))+'&rows='+hopfeed_rows+'&cols=1&keywords='+escape(hopfeed_tab1_keywords.replace(/\+/g,'%2b'))+'&tid='+hopfeed_affiliate_tid+'&category=43' + (hopfeed_affiliate == null ? '' : '&affiliate='+hopfeed_affiliate) +'&hopfeedLinkTarget=' + hopfeed_link_target +'&hopfeed_referer=' + escape(hopfeed_referer.replace(/\+/g,'%2b'));
var tab2src = hopfeed_path + '/serv/hopFeedServ.htm?hopfeedTabId=2&fillAllSlots=' + hopfeed_fill_slots + '&borderColor=&type=WIDGET&order=RANDOM&font='+escape(hopfeed_font.replace(/\+/g,'%2b'))+'&fontSize='+hopfeed_font_size+'&fontColor='+escape(hopfeed_active_tab_font_color.replace(/\+/g,'%2b'))+'&rows='+hopfeed_rows+'&cols=1&keywords='+escape(hopfeed_tab2_keywords.replace(/\+/g,'%2b'))+'&tid='+hopfeed_affiliate_tid+'&category=43' + (hopfeed_affiliate == null ? '' : '&affiliate='+hopfeed_affiliate) +'&hopfeedLinkTarget=' + hopfeed_link_target +'&hopfeed_referer=' + escape(hopfeed_referer.replace(/\+/g,'%2b'));
var tab3src = hopfeed_path + '/serv/hopFeedServ.htm?hopfeedTabId=3&fillAllSlots=' + hopfeed_fill_slots + '&borderColor=&type=WIDGET&order=RANDOM&font='+escape(hopfeed_font.replace(/\+/g,'%2b'))+'&fontSize='+hopfeed_font_size+'&fontColor='+escape(hopfeed_active_tab_font_color.replace(/\+/g,'%2b'))+'&rows='+hopfeed_rows+'&cols=1&keywords='+escape(hopfeed_tab3_keywords.replace(/\+/g,'%2b'))+'&tid='+hopfeed_affiliate_tid+'&category=43' + (hopfeed_affiliate == null ? '' : '&affiliate='+hopfeed_affiliate) +'&hopfeedLinkTarget=' + hopfeed_link_target +'&hopfeed_referer=' + escape(hopfeed_referer.replace(/\+/g,'%2b'));

document.write('<style>');

document.write('.hopfeed_widget {');
document.write('overflow: hidden;');
document.write('width: ' + hopfeed_width+ ';');
document.write('font-family: \''+ hopfeed_font + '\';');
document.write('font-size: ' + hopfeed_font_size + ';');

document.write('}');

document.write('.hopfeed_tabbody {');
document.write('height: ' + 29 * hopfeed_rows + 'px;');
document.write('border-bottom: 2px solid '+ hopfeed_border_color + ';');
document.write('border-left: 2px solid '+ hopfeed_border_color + ';');
document.write('border-right: 2px solid '+ hopfeed_border_color + ';');
document.write('border-top: 2px solid '+ hopfeed_border_color + ';');
document.write('float:none;');
document.write('}');

document.write('.hopfeed_link {');
document.write('display: block;');
document.write('font-size: ' + hopfeed_font_size + ';');
document.write('font-family: ' + hopfeed_font + ';');
document.write('font-weight: bold;');
document.write('height: 14px;');
document.write('line-height: 14px;');
document.write('padding: 7px 0 7px 30px;');
document.write('text-decoration: none;');
document.write('}');

document.write('.hopfeed_content_counter {');
document.write('color: black;');
document.write('font-size: ' + hopfeed_font_size + ';');
document.write('font-weight: bold;');
document.write('left: 12px;');
document.write('line-height: 19px;');
document.write('position: absolute;');
document.write('top: 5px;');
document.write('}');

document.write('.hopfeed_content_counter hover{');
document.write('color: white;');
document.write('}');

document.write('.hopfeed_content_row {');
document.write('height: 29px;');
document.write('margin: 0;');
document.write('overflow: hidden;');
document.write('padding: 0;');
document.write('position: relative;');
document.write('}');

document.write('.hopfeed_tab_row {');
document.write('padding: 0;');
document.write('margin: 0;');
document.write('display : block;');
document.write('list-style-type : none;');
document.write('border-bottom: 2px solid '+ hopfeed_border_color + ';');
document.write('}');

document.write('.hopfeed_tab li {');
document.write('float: left;');
document.write('margin: 0;');
document.write('padding: 0;');
document.write('list-style: none;');
document.write('display: inline;');
document.write('}');

document.write('.hopfeed_tab_content {');
document.write('padding: 0;');
document.write('margin: 0;');
document.write('list-style: none;');
document.write('}');

document.write('#hopfeed_tab_content li:hover,#hopfeed_tab_content a:hover {');
document.write('background: ' + hopfeed_hover_color+ ';');
document.write('color: '+ hopfeed_inactive_tab_font_color + ';');
document.write('}');

document.write('#hopfeed_tab_content a.hopfeed {');
document.write('font-style: normal;');
document.write('color: '+ hopfeed_active_tab_color + ';');
document.write('text-decoration: none;');
document.write('}');

document.write('#hopfeed_tab_content li {');
document.write('background: none repeat scroll 0% 0%;'); 
document.write('-moz-background-clip: -moz-initial;');
document.write('-moz-background-origin: -moz-initial;');
document.write('-moz-background-inline-policy:'); 
document.write('-moz-initial;}');

document.write('#hopfeed_tab_content a.hopfeed:hover, li.hopfeed_content{');
document.write('font-style: normal;');
document.write('color: '+ hopfeed_inactive_tab_font_color +';');
document.write('text-decoration: none;');
document.write('}');

document.write('.hopfeed_tab {');
document.write('cursor: pointer;');
document.write('padding: 6px 0px 2px;');
document.write('list-style:none;');
document.write('display: inline;');
document.write('}');

document.write('ul.hopfeed_tab a,ul.hopfeed_tab span {');
document.write('display: block;');
document.write('float: left;');
document.write('white-space: nowrap;');
document.write('}');

document.write('/* Hide from IE5-Mac \*/');
document.write('ul.hopfeed_tab a,ul.hopfeed_tab span {');
document.write('float: none');
document.write('}');
document.write('/* End IE5-Mac hide */');

document.write('/* inactive left tab */');
document.write('.hopfeed_tab a{');
document.write('background: '+ hopfeed_inactive_tab_color + ' url(' + hopfeed_path+ '/images/ads/left-tab_'+ hopfeed_template_name.toLowerCase()+'.gif) left top no-repeat;');
document.write('padding-left: 7px;');
document.write('text-decoration: none;');
document.write('font-weight: bold;');
document.write('font-size: 1.0em;');
document.write('font-family: ' + hopfeed_font + ';');
document.write('border-width: 0px;');
document.write('border-bottom-width: 1px solid white;');
document.write('border-style: solid;');
document.write('color: '+ hopfeed_inactive_tab_font_color + ';');
document.write('margin-right: 2px;');
document.write('}');

document.write('.hopfeed_tabactive{');
document.write('color: '+ hopfeed_active_tab_font_color + ';');
document.write('}');

document.write('.hopfeed_tab a span{');
document.write('background: '+ hopfeed_inactive_tab_color + ' url(' + hopfeed_path+ '/images/ads/right-tab_'+ hopfeed_template_name.toLowerCase()+'.gif) right top no-repeat;');
document.write('padding-top: 6px;');
document.write('padding-bottom: 5px;');
document.write('padding-right: 7px;');
document.write('}');

document.write('.hopfeed_tab a:hover,.hopfeed_tab a:active,.hopfeed_tab a:focus {');
document.write('background: '+ hopfeed_active_tab_color + ' url(' + hopfeed_path+ '/images/ads/left-tab-on_'+ hopfeed_template_name.toLowerCase()+'.gif) left top no-repeat;');
document.write('color: '+ hopfeed_active_tab_font_color +';');
document.write('font-weight: bold;');
document.write('padding-left: 7px;');
document.write('margin-right: 2px;');
document.write('border-style: solid;');
document.write('border-color: '+ hopfeed_border_color + ';');
document.write('}');

document.write('.hopfeed_tab a:hover span,.hopfeed_tab a:active span,.hopfeed_tab a:focus span{');
document.write('background: url(' + hopfeed_path+ '/images/ads/right-tab-on_'+ hopfeed_template_name.toLowerCase()+'.gif) right top no-repeat;');
document.write('font-weight: bold;');

document.write('}');

document.write('.hopfeed_tabactive a {');
document.write('background: '+ hopfeed_active_tab_color + ' url(' + hopfeed_path+ '/images/ads/left-tab-on_'+ hopfeed_template_name.toLowerCase()+'.gif) left top no-repeat;');
document.write('border-style: solid;');
document.write('border-color: '+ hopfeed_border_color + ';');
document.write('color: '+ hopfeed_active_tab_font_color+';');
document.write('}');

document.write('.hopfeed_tabactive a span {');
document.write('background: '+ hopfeed_active_tab_color + ' url(' + hopfeed_path+ '/images/ads/right-tab-on_'+ hopfeed_template_name.toLowerCase()+'.gif) right top no-repeat;');
document.write('}');
document.write('</style>');

document.write('<table class="hopfeed_widget" style="width: ' + hopfeed_width + 'px" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td style="background-color: transparent;">');
document.write('<ul id="hopfeed_tabs" class="hopfeed_tab_row hopfeed_tab">');
document.write('<li class="hopfeed_tab hopfeed_tabactive" id="hopfeed_li_1"><a onclick="hopfeed_goToTab(1);"><span id="hopfeed_tab1" >'+hopfeed_tab1_title+'</span></a></li>');
document.write('<li class="hopfeed_tab hopfeed_tabinactive" id="hopfeed_li_2"><a onclick="hopfeed_goToTab(2);"><span id="hopfeed_tab2" >'+hopfeed_tab2_title+'</span></a></li>');
document.write('<li class="hopfeed_tab hopfeed_tabinactive" id="hopfeed_li_3"><a onclick="hopfeed_goToTab(3);"><span id="hopfeed_tab3" >'+hopfeed_tab3_title+'</span></a></li>');
document.write('</ul>');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td style="background-color:white">');
document.write('<div id="hopfeed_tabbody" class="hopfeed_tabbody" width="100%">');
document.write('<div id="hopfeed_tab1Content" style="display: block;" class="hopfeed_tabcontent">');
document.write('<script type="text/javascript" id="tab1JS" src="' + tab1src + '"></script>');
document.write('</div>');
document.write('<div id="hopfeed_tab2Content" style="display: none;" class="hopfeed_tabcontent">');
document.write('<script type="text/javascript" id="tab2JS" src="' + tab2src + '"></script>');
document.write('</div>');
document.write('<div id="hopfeed_tab3Content" style="display: none;" class="hopfeed_tabcontent">');
document.write('<script type="text/javascript" id="tab3JS" src="' + tab3src + '"></script>');
document.write('</div>');
document.write('</div>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</div>');
