var hopfeed_path = (hopfeed_path==null)? 'http://'+hopfeed_affiliate+'.hopfeed.com': hopfeed_path;
var hopfeed_type = (hopfeed_type==null)? 'JS':hopfeed_type;
var hopfeed_cellpadding = (hopfeed_cellpadding==null)? 5:hopfeed_cellpadding;
var hopfeed_rows = (hopfeed_rows==null)? '': hopfeed_rows;
var hopfeed_cols = (hopfeed_cols==null)? '': hopfeed_cols;
var hopfeed_affiliate_tid = (hopfeed_affiliate_tid == null)? '': hopfeed_affiliate_tid;
var hopfeed_height = (hopfeed_height==null)? '': hopfeed_height;
var hopfeed_width = (hopfeed_width==null)? '': hopfeed_width;

var hopfeed_header_text = (hopfeed_header_text==null)? '': hopfeed_header_text;
var hopfeed_font = (hopfeed_font==null)? '': hopfeed_font;
var hopfeed_font_size = (hopfeed_font_size==null)? '': hopfeed_font_size;
var hopfeed_font_color = (hopfeed_font_color==null)? '': hopfeed_font_color;
var hopfeed_link_font_color = (hopfeed_link_font_color==null)? '': hopfeed_link_font_color;
var hopfeed_link_font_hover_color = (hopfeed_link_font_hover_color==null)? '': hopfeed_link_font_hover_color;
var hopfeed_background_color = (hopfeed_background_color==null)? '': hopfeed_background_color;
var hopfeed_align = (hopfeed_align==null)? '': hopfeed_align;
var hopfeed_fill_slots = (hopfeed_fill_slots==null)? '': hopfeed_fill_slots;

var src = hopfeed_path + '/serv/hopFeedServ.htm?type=' + hopfeed_type+ '&fillAllSlots=' + hopfeed_fill_slots + '&align=' + hopfeed_align + '&headerText='+escape(hopfeed_header_text.replace(/\+/g,'%2b'))+'&height='+hopfeed_height+'&width='+ hopfeed_width + '&linkFontHoverColor=' + escape(hopfeed_link_font_hover_color.replace(/\+/g,'%2b')) + '&linkFontColor=' + escape(hopfeed_link_font_color.replace(/\+/g,'%2b')) + '&backgroundColor=' + escape(hopfeed_background_color.replace(/\+/g,'%2b')) + '&font=' + escape(hopfeed_font.replace(/\+/g,'%2b'))+ '&fontSize=' + hopfeed_font_size + '&fontColor=' + escape(hopfeed_font_color.replace(/\+/g,'%2b'))+ '&rows='+hopfeed_rows+'&cols='+hopfeed_cols+'&keywords=' + escape(hopfeed_keywords.replace(/\+/g,'%2b')) +'&tid='+hopfeed_affiliate_tid+'&affiliate='+hopfeed_affiliate+'&cellpadding='+hopfeed_cellpadding;

function show_js() {
	output = '<script language="JavaScript" src="' + src + '&type=JS"></script>';
	document.write(output);
}

function show_iframe(type) {
	var output = '<iframe src="' + src + '&type='+ type+'" height="'+hopfeed_height+'" width="'+ (hopfeed_width + 5) +'" style="background:"' + hopfeed_background_color + '"border:none; padding:0px;overflow:hidden;margin:0px" frameborder="0" scrolling="no"></iframe>';
	document.write(output);
}

if (hopfeed_type == 'IFRAME' ) { 
	show_iframe(hopfeed_type);
} else {
	show_js(); 
}
