function canoe_searchbar_onload()
{
  if ( !this.done ) {
    //document.forms["site_search_form"].elements["q"].focus();
  
    TabsManager.setCurrentTab(canoe_searchbar_tab);
    var validator = new Searchbar411Validator('en', 'canoe411_en');
    validator.bind();
  }
  this.done = true;
}

if ( !canoe_searchbar_tab )
  var canoe_searchbar_tab = 'site';
if ( !canoe_searchbar_query )
  var canoe_searchbar_query = '';
if ( !canoe_searchbar_query2 )
  var canoe_searchbar_query2 = '';
if ( !canoe_searchbar_domain )
  var canoe_searchbar_domain = 'search.torontosun.com';


if(window.location.href.indexOf("search.torontosun.com") != -1)
  var page_charset = "UTF-8";
else
  var page_charset = "ISO-8859-1";


document.write('<link rel="StyleSheet" href="http://static.search.canoe.ca/s-toile/img/css/search/searchbar10.css" type="text/css" />');
document.write('<script type="text/javascript" src="http://static.search.canoe.ca/s-toile/img/header/2007/js/tabs07.js"><\/script>');
document.write('<script type="text/javascript" src="http://static.search.canoe.ca/s-toile/img/js/searchbar_411_validator.js"><\/script>');

var html = '';

html += '<div id="cnsb_wrapper">'+
'<div id="searchbar_en">' +
'<div class="tabs_wrapper">'+
'<ul class="tabs">'+
'<li id="site_tab" '+ (canoe_searchbar_tab == 'site'? 'class="current"' : '') +'>'+
'<div class="tab_ctn"><div class="tab_ctn2" style="width: 75px;"><a href="#" onclick="TabsManager.changeTab(\'site\'); return false;">Toronto Sun</a></div></div>'+
'</li><li class="pipe">|</li>'+
'<li id="news_tab" '+ (canoe_searchbar_tab == 'news'? 'class="current"' : '') +'>'+
'<div class="tab_ctn"><div class="tab_ctn2"><a href="#" onclick="TabsManager.changeTab(\'news\'); return false;">Canoe.ca</a></div></div>'+
'</li><li class="pipe">|</li>'+
'<li id="web_tab" '+ (canoe_searchbar_tab == 'web'? 'class="current"' : '') +'>'+
'<div class="tab_ctn"><div class="tab_ctn2"><a href="#" onclick="TabsManager.changeTab(\'web\'); return false;">Google</a></div></div>'+
'</li><li class="pipe">|</li>'+
'<li id="enterprises_tab" '+ (canoe_searchbar_tab == 'ent'? 'class="current"' : '') +'>'+
'<div class="tab_ctn"><div class="tab_ctn2"><a href="#" onclick="TabsManager.changeTab(\'ent\'); return false;">Canoe411</a></div></div>'+
'</li>'+
'</ul>'+
'</div>'+
'<div id="searchbar">'+
'<div class="search_form">'+
'<div class="center">'+
'<div class="ie">'+

'<div id="site_container" class="container_search" '+ (canoe_searchbar_tab != 'site'? 'style="display: none;"' : '') +'>'+
'<div id="web_sponsor" class="web_sponsor"></div>'+
'<div class="container_in">'+
'<form action="http://' + canoe_searchbar_domain + '" method="get" name="site_search_form">'+
'<input type="hidden" name="sen" value="site" />'+
'<input type="hidden" name="dom" value="torontosun" />'+
'<input type="hidden" name="lang" value="en" />'+
'<input type="hidden" name="ie" value="UTF-8"/>'+
'<table class="fluid_container"><tr><td>'+
'<input type="text" name="q" class="query" value="'+ canoe_searchbar_query +'" /> '+
'</td><td class="button">'+
'<div class="search_btn_ctn"><input type="submit" class="q_submit" value="" /></div>'+
'</td></tr></table>'+
'</form>'+
'</div>'+
'</div>'+
				
'<div id="news_container" class="container_search" '+ (canoe_searchbar_tab != 'news'? 'style="display: none;"' : '') +'>'+
'<div id="web_sponsor" class="web_sponsor"></div>'+
'<div class="container_in">'+
'<form action="http://search.canoe.ca/search/" method="get" name="canoe_search_form" target="_blank">'+
'<input type="hidden" name="sen" value="news" />'+
'<input type="hidden" name="ie" value="'+ page_charset +'"/>'+
'<table class="fluid_container"><tr><td>'+
'<input type="text" name="q" class="query" value="'+ canoe_searchbar_query +'" /> '+
'</td><td class="button">'+
'<div class="search_btn_ctn"><input type="submit" class="q_submit" value="" /></div>'+
'</td></tr></table>'+
'</form>'+
'</div>'+
'</div>'+

'<div id="web_container" class="container_search" '+ (canoe_searchbar_tab != 'web'? 'style="display: none;"' : '') +'>'+
'<div id="web_sponsor" class="web_sponsor"></div>'+
'<div class="container_in">'+
'<form action="http://web.canoe.ca/search" method="get" name="web_search_form" target="_blank">'+
'<input type="hidden" name="sen" value="web" />'+
'<input type="hidden" name="ie" value="'+ page_charset +'"/>'+
'<table class="fluid_container"><tr><td>'+
'<input type="text" name="q" class="query" value="'+ canoe_searchbar_query +'" /> '+
'</td><td class="button">'+
'<div class="search_btn_ctn"><input type="submit" class="q_submit" value="" /></div>'+
'</td></tr></table>'+
'</form>'+
'</div>'+
'</div>'+
				
//canoe 411
'<div id="ent_container" class="container_search" '+ (canoe_searchbar_tab != 'ent'? 'style="display: none;"' : '') +'>'+
'<div id="web_sponsor" class="ent_sponsor"></div>'+
'<div class="container_in">'+
'<form action="http://www.toile.com/search" method="get" name="canoe411_en" target="_blank">'+
'<input type="hidden" name="sen" value="canoe411" />'+
'<input type="hidden" name="log411" value="torontoSun411">'+
'<input type="hidden" name="q" value="a" />'+
'<input type="hidden" name="lang" value="eng" />'+
'<input type="hidden" name="ie" value="'+ page_charset +'"/>'+

'<table width="100%" cellpadding=0 cellspacing=0 border=0><tr>'+
'<td class="q" width="1%" style="text-align:left;padding-right: 4px;vertical-align:middle;">'+
'<input type="text" name="name" class="query_short" style="color: #A5A5A5;" /> '+
'</td><td width="1%" class="q" style="text-align:left;vertical-align:middle;">'+
'<input type="text" name="location" class="query_short" style="color: #A5A5A5; margin-right: 7px; #margin-right: 0px;" /> '+
'</td>'+
'<td class="button" align="right" style="vertical-align:middle;">'+
'<div class="search_btn_ctn"><input type="submit" class="q_submit" value="" /></div>'+
'</td></tr></table>'+
'</form>'+
'</div>'+
'</div>'+

'</div>'+
'</div>'+    
'</div>'+
'</div>'+

'</div>'+
'</div>';

document.write(html);

var oldonload = window.onload;
if (typeof (window.onload) != 'function') {
  window.onload = canoe_searchbar_onload;
}
else {
  window.onload = function(){oldonload(); canoe_searchbar_onload();}
}
