function getRss(c_id, tp, nt, ft){
 var tar_url   = 'rssparse.php3?';
 var p_id      = 'qst_rss_inner_data';

 tar_url = getCorrectUrl() + tar_url;

 return ( function(){
  if (ft == 'xml') {
    //for XML
  	getRssQuestionsXML(c_id, tp, nt, ft);
  } else {
  	getRssQuestionsTEXT(c_id, tp, nt, ft);
  } 
//  if($('ok_rss_pos').style.display != "") displayRssQuestionPos();
//if($(p_id).innerHTML != "") displayRssQuestionPos();

  function getRssQuestionsXML(c_id, tp, nt, ft) {
    var xotree = new XML.ObjTree();
    var opts = { postBody: "c=" + c_id + "&type=" + tp + "&ft=xml&" + nt};
    xotree.force_array = [ "item" ];
    xotree.parseHTTP( tar_url, opts, displayRssQuestionJS);
  }
  
  function getRssQuestionsTEXT(c_id, tp, nt, ft) { 
    var a = new Ajax.Request( 
    tar_url, { 
      "method": "get", 
      "parameters": "c=" + c_id + "&type=" + tp + "&" + nt + "&ft=" + ft, 
      "onComplete": function(request) { 
        if (ft == 'json') {
         displayRssQuestionJS(request);
        } else {
         displayRssQuestion(request);
        }
      }
    });
  }
  
  function displayRssQuestionJS(request, httpObj) {
    if (ft == 'json') {
     var json_array = request.responseText;
     var request = eval("("+json_array+")");
    }
    var insText = '';
    if (request.items.hasOwnProperty('item') &&
        request.items.item != null &&
        request.items.item.length > 0) {
      insText += '<div class="okrss">';
      for (i=0; i<request.items.item.length; i++ ) {
         insText += '<a href="' + request.items.item[i].link + '"';
         insText += ' title="header=[] body=[' + request.items.item[i].description + '] cssbody=[left_header_rss-tt]">';
         insText += request.items.item[i].title + '</a><br />';
      }
      insText += '</div>';
    }
    
    $(p_id).innerHTML = "";
    $(p_id).innerHTML = insText;
    if($(p_id).innerHTML != "") displayRssQuestionPos();
  }

  function displayRssQuestion(request) {
  	$(p_id).innerHTML = request.responseText;
  }
  
  function displayRssQuestionPos() {
   $('ok_rss_pos').style.display = "";
  }
  
 });
}
