/*
 * Created on 2008-03-20
 * by JeminK
 * - Javascript for API Services	
 */
window.addEvent
(
	'domready',
	function ()
	{
		// html for mediawiki search
		var HTMLS_search	= '<div id="searchBody" style="margin-top: 20px;">' +
							'<form action="/index.php/Special:Search" id="searchform">' +
							'<table align="center"><tr>' +
							'<td><label for="searchInput"><font size="4" color="#000000"> Search Biosites </font></label></td>' +
							'<td width=9></td>' +
							'<td><input type="text" id="search_input" name="search" title="Search TestWiki [f]" accesskey="f" size="50" value="" /></td>' +
							'<td width=9></td>' +
							'<td><input type="submit" name="go" class="searchButton" id="searchGoButton" value="Go" /></td>' +
							'<td width=9></td>' +
							'<td><input type="submit" name="fulltext" class="searchButton" value="Search" /></td>' +
							'</tr></table>' +
							'</form>' +
							'</div>';

		// html for google search
		var HTMLS_Google	= '<div id="div_google_search">' +
							'<form method="get" action="http://www.google.com/custom" target="_top">' +
							'<table border="0" bgcolor="#ffffff" align="center">' +
							'<tr><td nowrap="nowrap" valign="top" align="left" height="32">' +
							'<a href="http://www.google.com/">' +
							'<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>' +
							'</td>' +
							'<td nowrap="nowrap">' +
							'<input type="hidden" name="domains" value="' + wgServer.replace( 'http://', '' ) + '"></input>' +
							'<label for="sbi" style="display: none">Enter your search terms</label>' +
							'<input type="text" name="q" size="32" maxlength="255" value="" id="sbi"></input>' +
							'<label for="sbb" style="display: none">Submit search form</label>' +
							'<input type="submit" name="sa" value="Search" id="sbb"></input>' +
							'</td></tr>' +
							'<tr>' +
							'<td>&nbsp;</td>' +
							'<td nowrap="nowrap">' +
							'<table>' +
							'<tr>' +
							'<td>' +
							'<input type="radio" name="sitesearch" value="" checked id="ss0"></input>' +
							'<label for="ss0" title="Search the Web"><font size="-1" color="#000000">Web</font></label></td>' +
							'<td>' +
							'<input type="radio" name="sitesearch" value="biosites.org" id="ss1"></input>' +
							'<label for="ss1" title="Search biosites.org"><font size="-1" color="#000000">' + wgServer.replace( 'http://', '' ) + '</font></label></td>' +
							'</tr>' +
							'</table>' +
							'<input type="hidden" name="client" value="pub-3047927949898464"></input>' +
							'<input type="hidden" name="forid" value="1"></input>' +
							'<input type="hidden" name="channel" value="7957303104"></input>' +
							'<input type="hidden" name="ie" value="ISO-8859-1"></input>' +
							'<input type="hidden" name="oe" value="ISO-8859-1"></input>' +
							'<input type="hidden" name="safe" value="active"></input>' +
							'<input type="hidden" name="flav" value="0001"></input>' +
							'<input type="hidden" name="sig" value="Mv_isl5PePwk8a0C"></input>' +
							'<input type="hidden" name="hl" value="en"></input>' +
							'</td></tr></table>' +
							'</form>';
		HTMLS_search = HTMLS_Google = '';

		// html for Addthis API
		var HTMLS_AddThis	= '<div id="div_addthis" style="text-align: right; padding: 10px 0;">AddThis Button</div>';


		// create element for APIs
		var APIs			= new Element( 'div' ).setHTML( HTMLS_search + HTMLS_Google + HTMLS_AddThis ).injectBefore( 'top' );
		

		// html for google search
		var HTMLS_Google	= '<div id="div_google_search">' +
							'<form method="get" action="http://www.google.com/custom" target="_top">' +
							'<table border="0" bgcolor="#ffffff" align="center">' +
							'<tr>' +
							'<td nowrap="nowrap">' +
							'<input type="hidden" name="domains" value="' + wgServer.replace( 'http://', '' ) + '"></input>' +
							'<label for="sbi" style="display: none">Enter your search terms</label>' +
							'<input type="text" name="q" size="16" maxlength="255" value="" id="sbi"></input>' +
							'<label for="sbb" style="display: none">Submit search form</label>' +
							'<br/><input type="submit" name="sa" value="WWW Search" id="sbb"></input>' +
							'</td></tr>' +
							'<tr>' +
							'<td nowrap="nowrap">' +
							'<table>' +
							'<tr>' +
							'<td>' +
							'<input type="radio" name="sitesearch" value="" checked id="ss0"></input>' +
							'<label for="ss0" title="Search the Web"><font size="-1" color="#000000">Web</font></label></td>' +
							'</tr>' +
							'<tr>' +
							'<td>' +
							'<input type="radio" name="sitesearch" value="' + wgServer.replace( 'http://', '' ) + '" id="ss1"></input>' +
							'<label for="ss1" title="Search biosites.org"><font size="-1" color="#000000">' + wgServer.replace( 'http://', '' ) + '</font></label></td>' +
							'</tr>' +
							'</table>' +
							'<input type="hidden" name="client" value="pub-3047927949898464"></input>' +
							'<input type="hidden" name="forid" value="1"></input>' +
							'<input type="hidden" name="channel" value="7957303104"></input>' +
							'<input type="hidden" name="ie" value="ISO-8859-1"></input>' +
							'<input type="hidden" name="oe" value="ISO-8859-1"></input>' +
							'<input type="hidden" name="safe" value="active"></input>' +
							'<input type="hidden" name="flav" value="0001"></input>' +
							'<input type="hidden" name="sig" value="Mv_isl5PePwk8a0C"></input>' +
							'<input type="hidden" name="hl" value="en"></input>' +
							'</td></tr></table>' +
							'</form>';
		// create element for APIs
		var APIs2			= new Element( 'div' ).setHTML( HTMLS_Google ).injectInside( 'searchBody' );


		// execute Addthis API
		at12l();
		at12y();
		
	}
);
