// JavaScript Document

var toggledDisplay = new Object();
    toggledDisplay['desc'] = true;
    toggledDisplay['tips'] = true;
    toggledDisplay['subcat'] = true;
    toggledDisplay['morecontacts'] = true;

function toggleDisplay(bDisplayed,bName)
{
  if(!document.getElementById || toggleDisplay.arguments.length < 2) return;

	var displayed = new Object();
      displayed['true'] = 'block';
      displayed['false'] = 'none';

	if (bName == "tips")
	{
		tempvar = "<p>By default (when neither + nor - is specified) the word is optional, but the rows that contain it will be rated higher. * An asterisk is the truncation operator. Unlike the other operators, it should be appended to the word.</p>";
		tempvar = tempvar + "<p>+ A leading plus sign indicates that this word must be present in every row returned. This is a very easy way to specify a geographical preferences. For example, a query for \"motors + China\" will return a list of companies in China that make motors.</p>";
		tempvar = tempvar + "<p>- A leading minus sign indicates that this word must not be present in any row returned. Similar to the example above, a query for \"motors -China\" will return results for companies except those located in China.</p>";
		tempvar = tempvar + "<p>\" A phrase that is enclosed within double quote (\"...\") characters matches only rows that contain the phrase literally, as it was typed.</p>";
		tempvar = tempvar + "<p>> < These two operators are used to change a word's contribution to the relevance value that is assigned to a row. The > operator increases the contribution and the < operator decreases it. See the example below.</p>";
		tempvar = tempvar + "<p>( ) Parentheses are used to group words into subexpressions. Parenthesized groups can be nested.</p>";
		tempvar = tempvar + "<p>~ A leading tilde acts as a negation operator, causing the word's contribution to the row relevance to be negative. It's useful for marking noise words. A row that contains such a word will be rated lower than others, but will not be excluded altogether, as it would be with the - operator.</p>";
		tempvar = tempvar + "<p>The following examples demonstrate some search strings that use boolean full-text operators:</p>";
		tempvar = tempvar + "<p>|apple banana| Find rows that contain at least one of the two words.</p>";
		tempvar = tempvar + "<p>|+apple +juice| Find rows that contain both words.</p>";
		tempvar = tempvar + "<p>|+apple macintosh| Find rows that contain the word \"apple'', but rank rows higher if they also contain \"macintosh''.</p>";
		tempvar = tempvar + "<p>|+apple -macintosh| Find rows that contain the word \"apple'' but not \"macintosh''.</p>";
		tempvar = tempvar + "<p>|apple*| Find rows that contain words such as \"apple'', \"apples'', \"applesauce'', or \"applet''.</p>";
		tempvar = tempvar + "<p>|\"some words\"| Find rows that contain the exact phrase \"some words'' (for example, rows that contain \"some words of wisdom'' but not \"some noise words''). Note that the `\"' characters that surround the phrase are operator characters that delimit the phrase. They are not the quotes that surround the search string itself.</p>";
		tempvar = tempvar + "<p>|+apple +(>turnover <strudel)| Find rows that contain the words \"apple'' and \"turnover'', or \"apple'' and \"strudel'' (in any order), but rank \"apple turnover'' higher than \"apple strudel''.</p>";
		tempvar = tempvar + "<p><a href=\"JavaScript://\" onclick=\"toggleDisplay(toggledDisplay['tips'], 'tips')\">close this</a></p>";
		document.getElementById('tips').innerHTML = tempvar;
	}
	if(bName == "desc")
	{
		tempvar = "<p><a href=\"http://www.sourcetool.com\">SourceTool.com</a> is the speediest, most relevant, most user-friendly <strong>free</strong> business to business search engine on the Internet. It is the <strong>only</strong> business to business search engine whose Directory is based on the <strong>United Nations Standard Products and Services Code (UNSPSC),</strong> which provides the most efficient, flexible and accurate classification of goods and services available (see <a rel=\"nofollow\" href=\"http://www.unspsc.org\" target=\"_blank\">What is UNSPSC</a>). To use the SourceTool.com directory to find a supplier from other parts of the world, especially North America and Europe, follow this link to the <a href=\"http://directory.sourcetool.com\">SourceTool Directory</a>.</p>";
		tempvar = tempvar + "<p><strong>SourceTool.com</strong> lists more than 750,000 businesses that do business with other businesses. We list companies for free. We serve users for free. We'd don't sell advertising, although we benefit when you link to the Google advertisers that appear on our pages. If you are a Google AdWords advertiser, you can request that your ads appear on SourceTool.com. Our search results rankings cannot be bought, although they will be improved. Companies are shown in order of their importance to the category searched. If you are a supplier, you can also help us and help yourself by taking the time to complete our <a rel=\"nofollow\" href=\"http://profile.sourcetool.com/profile_form.php\">SourceTool Free Supplier Profile</a>.</p>";
		tempvar = tempvar + "<p><a href=\"JavaScript://\" onclick=\"toggleDisplay(toggledDisplay['desc'], 'desc')\">close this</a></p>";
		document.getElementById('desc').innerHTML = tempvar;
	}



	for(var i = 1; i < toggleDisplay.arguments.length; i++)
  {
    oDisplay = document.getElementById(toggleDisplay.arguments[i]);
    if(oDisplay)
    {
      oDisplay.style.display = displayed[bDisplayed];
      // mozilla is the only browser out of the lot that can't get this right.  so, if we're
      // setting an object's display style to block, we gotta reload any images contained
      // within that block.  mozilla won't do it for you like every other browser that
      // supports the functionality of changing the display style dynamically.
      // begin crap browser hack
      if(bDisplayed)
      {
        oImages = oDisplay.getElementsByTagName('IMG');
        for(var j = 0; j < oImages.length; j++)
          oImages[j].src = oImages[j].src;
      }
      // end mozilla, err, crap browser hack
       if(typeof toggledDisplay[toggleDisplay.arguments[i]] != 'undefined')
	   {
			toggledDisplay[toggleDisplay.arguments[i]] = !bDisplayed;
	   }
	}
  }
}