/*** ISO version ***/

var html = "";

if (typeof(nwb_type) == 'undefined'){
	  var nwb_type = 'dflt';
}

var stype = (nwb_type != "") ? nwb_type : "dflt" ;

//section array avec toute les propriétés pour chacunes des barres de recherches
var type_config = new Array();

type_config['dflt'] = new Array();
type_config['dflt']['id'] = 'nwsb_default';
type_config['dflt']['news_url'] = "http://search.canoe.ca/search?sen=news&";
type_config['dflt']['web_url'] = "http://web.canoe.ca/search?sen=yahoo&";

type_config['cpo'] = new Array();
type_config['cpo']['id'] = 'cpo_search';
type_config['cpo']['surl'] = 'http://search.canoe-inc.com/cpo/search?';
type_config['cpo']['name'] = 'Canadian Parents';

type_config['jam'] = new Array();
type_config['jam']['id'] = 'jam_search';
type_config['jam']['surl'] = 'http://search.canoe-inc.com/jam/search?';
type_config['jam']['name'] = 'JAM!';

type_config['money'] = new Array();
type_config['money']['id'] = 'money_search';
type_config['money']['surl'] = 'http://search.canoe-inc.com/money/search?';
type_config['money']['name'] = 'MONEY';

type_config['cnews'] = new Array();
type_config['cnews']['id'] = 'cnews_search';
type_config['cnews']['surl'] = 'http://search.canoe-inc.com/cnews/search?';
type_config['cnews']['name'] = 'CNEWS';

type_config['slam'] = new Array();
type_config['slam']['id'] = 'slam_search';
type_config['slam']['surl'] = 'http://search.canoe-inc.com/slam/search?';
type_config['slam']['name'] = 'SLAM!'; 

//function qui permet d'envoyer le formulaire a la bonne adresse selon le radio qui est coch<E9>
function send_form(form) {
	
	  var url = "";
	  var query = 'q='+escape(form['q'].value);
	  var search = "";
	
	  var nsen = form['sen'].length;
	  var n = 0;
	
	  //détection de qui est coché
	  while (n < nsen) {
		    if (form['sen'][n].checked == true) {
				    search = form['sen'][n].value;
				}
		    n++;
		}
	
	  //attribution du bon url de recherche
	  if (search == "news") {
		    url = type_config['dflt']['news_url'];
		} else if (search == "web") {
		   url = type_config['dflt']['web_url'];
		} else {
		   url = type_config[stype]['surl'];
		}
	
	  window.top.document.location = url+query+'&ie=ISO-8859-1';
	
}//send_form()

document.write('<link rel="StyleSheet" href="http://static.search.canoe.ca/s-toile/img/css/network_searchbar.css" />');

html += '<div id='+type_config[stype]['id']+' class="can_network_searchbar">'+
'<form name="seek" id="seek" action="" onsubmit="send_form(this); return false;" method="get">'+
'<input type="hidden" name="ie" value="ISO-8859-1" />'+
'<table border="0" celpadding="0" cellspacing="0" height="21px"><tr>'+
'<td><img src="http://static.search.canoe.ca/s-toile/img/network_searchbar/search.gif" class="title" />&nbsp;</td>'+
'<td><input type="text" class="text" name="q" /></td>'+
'';

if (stype != 'dflt') {
	  html += '<td><input type="radio" class="radio" name="sen" value="act" id="custom" checked="checked"></td>'+
	  '<td><label for="custom">'+type_config[stype]["name"]+'</label></td>';
}

html += '<td valign="center"><input type="radio" class="radio" name="sen" value="news" id="can"></td>'+
'<td><label for="can">Canoe</label></td>'+
'<td><input type="radio" class="radio" name="sen" value="web" id="web" checked="checked"></td>'+
'<td><label for="web">Web</label></td>'+
'<td><input type="image" class="go_btn" src="http://static.search.canoe.ca/s-toile/img/network_searchbar/bt_go_search.gif" /></td>'+
'</tr></table></form>'+

'</div>';

document.write(html);
