
// Redirect to alternate locations *********************************************
function searchFormSubmit(form) {

//     if (form.aff.value == 'archives' || form.aff[1].checked == true) {
//
//         var region = 'mh';
//         window.location = "http://www.newslibrary.com/nlsearch.asp?" +
//                "search_mode=all&action=search&date_mode=year&year=last+180+days&" +
//                "sort=d%3Ah&nitems=10&region=" + region + "&dbquery=" + form.keywords.value;
//             return false;
//
//     } else if (form.aff.value == 'history' || form.aff[2].checked == true) {
     if (form.aff.value == 'archives') {
         var p_product = 'MS';
         var p_theme = 'ms';
         window.location = 'http://nl.newsbank.com/nl-search/we/Archives?' +
                'p_product=' + p_product + '&p_theme=' + p_theme + '&p_action=search&p_queryname=1&p_perpage=10&' +
                'p_sort=_rank_%3AD&p_bool_base-1=and&p_field_base-1=ProductID&sort=d:h&' +
                'p_text_base-0=' + form.keywords.value;
		 //'p_sort=_rank_%3AD&p_bool_base-1=and&p_field_base-1=ProductID&' +
         //'p_text_base-1=1126152C152E4978&p_text_base-0=' + form.keywords.value;
         return false;

     } else if (form.aff.value == 'web') {
//       if (form.aff.value == 'web' || form.aff[1].checked == true) {
         var encoded_keywords = encodeURIComponent(form.keywords.value);
         var section_num = '1982';
         var url_version = 'ysr';
         var sitename = 'modbee';
         var params = 'product=Yahoo%2COverture&' +
                      'collection=WEB&' +
                      'live_template=http%3A%2F%2Fwww.' + sitename + '.com%2F' + section_num + '%2Fv-'
                                + url_version + '%2Findex.html&' +
                      'error_template=http%3A%2F%2Fwww.' + sitename + '.com%2F' + section_num + '%2Fv-yerr%2Findex.html&' +
                      'preview_template=http%3A%2F%2Fpreview.' + sitename + '.com%2F' + section_num + '%2Fv-'
                                + url_version + '%2Findex.html&' +
                      'results_per_page=10&preview=1';
         window.location = "http://search2." + sitename + ".com/search-bin/search.pl.cgi?sf_Keywords="
                + encoded_keywords + '&' + params;
         return false;

     }

     return true;
 }
// end Redirect ****************************************************************

// getParams *******************************************************************
function getParams(params) {
   var Params = new Object ();
   if ( ! params ) return Params; // return empty object
   var Pairs = params.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) continue;
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;

}
// end getParams *****************************************************************

