/////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// ////////////////////////// // Set global variables ////////////////////////// var SEARCHTYPE = 'Web'; // Default to Web var LASTREQUEST = 0; var AUTOGUESS = 1; var LASTROW = 1; // create an array of all of the search types var search_types = new Array; search_types = [ 'Restaurants', 'Saved', 'Recipes', 'People', 'Notes', 'Shopping', 'Site', 'Web', 'YellowPages', 'Weather', 'Video', 'Sports', 'News', 'Music', 'Directions', 'Directory', 'Dictionary', 'Coupons', 'Classifieds', 'Encyclopedia', 'Finance', 'Maps', 'Movies', 'Jobs', 'Images', 'Health', 'Blogs', ]; // create an array of all of the search sites var search_data = new Array; search_data['Blogs'] = [ 'BLOGS_100100', 'BLOGS_100200', 'BLOGS_100300', ]; search_data['Classifieds'] = [ 'CLASSIFIEDS_100100', 'CLASSIFIEDS_100200', 'CLASSIFIEDS_100300', 'CLASSIFIEDS_100400', 'CLASSIFIEDS_100500', ]; search_data['Coupons'] = [ 'COUPONS_100100', 'COUPONS_100200', 'COUPONS_100300', 'COUPONS_100400', 'COUPONS_100500', 'COUPONS_100600', 'COUPONS_100700', 'COUPONS_100800', 'COUPONS_100900', ]; search_data['Dictionary'] = [ 'DICTIONARY_100100', 'DICTIONARY_100200', 'DICTIONARY_100300', 'DICTIONARY_100400', 'DICTIONARY_100500', 'DICTIONARY_100600', 'DICTIONARY_100700', 'DICTIONARY_100800', 'DICTIONARY_100900', ]; search_data['Directions'] = [ 'DIRECTIONS_100100', 'DIRECTIONS_100200', 'DIRECTIONS_100300', 'DIRECTIONS_100400', ]; search_data['Directory'] = [ ]; search_data['Encyclopedia'] = [ 'ENCYCLOPEDIA_100100', 'ENCYCLOPEDIA_100200', 'ENCYCLOPEDIA_100300', 'ENCYCLOPEDIA_100400', 'ENCYCLOPEDIA_100500', 'ENCYCLOPEDIA_100600', 'ENCYCLOPEDIA_100700', 'ENCYCLOPEDIA_100800', ]; search_data['Finance'] = [ 'FINANCE_100050', 'FINANCE_100100', 'FINANCE_100200', 'FINANCE_100300', 'FINANCE_100400', 'FINANCE_100500', 'FINANCE_100550', ]; search_data['Health'] = [ 'HEALTH_100100', 'HEALTH_100200', 'HEALTH_100300', 'HEALTH_100400', 'HEALTH_100500', 'HEALTH_100600', 'HEALTH_100700', 'HEALTH_100800', 'HEALTH_100900', 'HEALTH_101000', ]; search_data['Images'] = [ 'IMAGES_100100', 'IMAGES_100200', 'IMAGES_100300', 'IMAGES_100400', 'IMAGES_100500', 'IMAGES_100600', ]; search_data['Jobs'] = [ 'JOBS_100100', 'JOBS_100200', 'JOBS_100300', 'JOBS_100400', 'JOBS_100500', 'JOBS_100600', ]; search_data['Maps'] = [ 'MAPS_100100', 'MAPS_100200', 'MAPS_100400', 'MAPS_100500', ]; search_data['Movies'] = [ 'MOVIES_100100', 'MOVIES_100200', 'MOVIES_100300', 'MOVIES_100400', 'MOVIES_100500', 'MOVIES_100600', 'MOVIES_100700', 'MOVIES_100800', 'MOVIES_100900', 'MOVIES_101000', 'MOVIES_101100', ]; search_data['Music'] = [ 'MUSIC_100100', 'MUSIC_100200', 'MUSIC_100300', 'MUSIC_100400', 'MUSIC_100500', 'MUSIC_100600', 'MUSIC_100700', ]; search_data['News'] = [ 'NEWS_100100', 'NEWS_100200', 'NEWS_100300', 'NEWS_100500', 'NEWS_100600', 'NEWS_100700', 'NEWS_100750', 'NEWS_100800', 'NEWS_100900', 'NEWS_101000', 'NEWS_101100', 'NEWS_101200', 'NEWS_101300', 'NEWS_101350', 'NEWS_101400', 'NEWS_101500', ]; search_data['Notes'] = [ ]; search_data['People'] = [ 'PEOPLE_100100', 'PEOPLE_100200', 'PEOPLE_100300', 'PEOPLE_100400', 'PEOPLE_100500', 'PEOPLE_100600', ]; search_data['Recipes'] = [ 'RECIPES_100100', 'RECIPES_100200', 'RECIPES_100300', 'RECIPES_100400', 'RECIPES_100500', 'RECIPES_100600', 'RECIPES_100700', 'RECIPES_100800', 'RECIPES_100900', 'RECIPES_101000', 'RECIPES_101100', 'RECIPES_101200', ]; search_data['Restaurants'] = [ 'RESTAURANTS_100100', 'RESTAURANTS_100200', 'RESTAURANTS_100300', 'RESTAURANTS_100400', 'RESTAURANTS_100500', ]; search_data['Saved'] = [ ]; search_data['Shopping'] = [ 'SHOPPING_100100', 'SHOPPING_100200', 'SHOPPING_100300', 'SHOPPING_100400', 'SHOPPING_100500', 'SHOPPING_100600', 'SHOPPING_100700', 'SHOPPING_100800', 'SHOPPING_100900', 'SHOPPING_101000', 'SHOPPING_101100', 'SHOPPING_101200', ]; search_data['Site'] = [ 'SITE_100100', 'SITE_100200', 'SITE_100300', 'SITE_100400', 'SITE_100500', 'SITE_100700', 'SITE_100900', ]; search_data['Sports'] = [ 'SPORTS_100100', 'SPORTS_100200', 'SPORTS_100300', 'SPORTS_100400', 'SPORTS_100500', 'SPORTS_100600', 'SPORTS_100700', 'SPORTS_100800', 'SPORTS_100900', ]; search_data['Video'] = [ 'VIDEO_100100', 'VIDEO_100200', 'VIDEO_100300', 'VIDEO_100400', 'VIDEO_100500', 'VIDEO_100600', 'VIDEO_100700', 'VIDEO_100800', 'VIDEO_100900', ]; search_data['Weather'] = [ 'WEATHER_100100', 'WEATHER_100200', 'WEATHER_100300', 'WEATHER_100400', 'WEATHER_100500', 'WEATHER_100600', ]; search_data['Web'] = [ 'WEB_100100', 'WEB_100200', 'WEB_100300', 'WEB_100400', 'WEB_100500', 'WEB_100600', 'WEB_100700', 'WEB_100800', 'WEB_100900', 'WEB_101100', ]; search_data['YellowPages'] = [ 'YELLOWPAGES_100100', 'YELLOWPAGES_100200', 'YELLOWPAGES_100300', 'YELLOWPAGES_100400', 'YELLOWPAGES_100500', ]; // create an array of all of the search sites names var search_names = new Array; search_names['BLOGS_100100'] = 'Blogger'; search_names['BLOGS_100200'] = 'Google Blogs'; search_names['BLOGS_100300'] = 'Technorati'; search_names['CLASSIFIEDS_100100'] = 'CraigsList'; search_names['CLASSIFIEDS_100200'] = 'eBay'; search_names['CLASSIFIEDS_100300'] = 'Oodle.com'; search_names['CLASSIFIEDS_100400'] = 'Sell.com'; search_names['CLASSIFIEDS_100500'] = 'Yahoo! Classifieds'; search_names['COUPONS_100100'] = '#1 Coupons'; search_names['COUPONS_100200'] = 'AllFreeCoupons.com'; search_names['COUPONS_100300'] = 'Coupon Album'; search_names['COUPONS_100400'] = 'Coupon Cabin'; search_names['COUPONS_100500'] = 'Coupon Craze'; search_names['COUPONS_100600'] = 'Coupon Mountain'; search_names['COUPONS_100700'] = 'eCoupons'; search_names['COUPONS_100800'] = 'FlamingoWorld.com'; search_names['COUPONS_100900'] = 'GotApex.com'; search_names['DICTIONARY_100100'] = 'Dictionary.com'; search_names['DICTIONARY_100200'] = 'Merriam-Webster'; search_names['DICTIONARY_100300'] = 'MSN Encarta'; search_names['DICTIONARY_100400'] = 'OneLook'; search_names['DICTIONARY_100500'] = 'The Free Dictionary'; search_names['DICTIONARY_100600'] = 'The Urban Dictionary'; search_names['DICTIONARY_100700'] = 'Law.com - Law Dictionary'; search_names['DICTIONARY_100800'] = 'Oxford Dictionaries'; search_names['DICTIONARY_100900'] = 'Internet Picture Dictionary'; search_names['DIRECTIONS_100100'] = 'Google Maps'; search_names['DIRECTIONS_100200'] = 'Mapquest.com'; search_names['DIRECTIONS_100300'] = 'MSN Maps & Directions'; search_names['DIRECTIONS_100400'] = 'Yahoo! Maps'; search_names['ENCYCLOPEDIA_100100'] = 'About.com'; search_names['ENCYCLOPEDIA_100200'] = 'Answers.com'; search_names['ENCYCLOPEDIA_100300'] = 'Encyclopedia Brittanica'; search_names['ENCYCLOPEDIA_100400'] = 'Highbeam Encyclopedia'; search_names['ENCYCLOPEDIA_100500'] = 'MSN Encarta'; search_names['ENCYCLOPEDIA_100600'] = 'Reference.com'; search_names['ENCYCLOPEDIA_100700'] = 'Wikipedia'; search_names['ENCYCLOPEDIA_100800'] = 'Yahoo! Education'; search_names['FINANCE_100050'] = 'Financial Times'; search_names['FINANCE_100100'] = 'Google Finance'; search_names['FINANCE_100200'] = 'Motley Fool'; search_names['FINANCE_100300'] = 'MSN Money'; search_names['FINANCE_100400'] = 'NASDAQ'; search_names['FINANCE_100500'] = 'Yahoo! Finance'; search_names['FINANCE_100550'] = 'Wall Street Journal'; search_names['HEALTH_100100'] = 'CNN Health'; search_names['HEALTH_100200'] = 'Discovery Health'; search_names['HEALTH_100300'] = 'Health.com'; search_names['HEALTH_100400'] = 'Healthfinder'; search_names['HEALTH_100500'] = 'KidsHealth.com'; search_names['HEALTH_100600'] = 'Mayo Clinic'; search_names['HEALTH_100700'] = 'NY Times Health'; search_names['HEALTH_100800'] = 'U.S. Dept. of Health'; search_names['HEALTH_100900'] = 'Yahoo! Health'; search_names['HEALTH_101000'] = 'WebMD'; search_names['IMAGES_100100'] = 'AltaVista - Images'; search_names['IMAGES_100200'] = 'Ditto.com'; search_names['IMAGES_100300'] = 'Flickr'; search_names['IMAGES_100400'] = 'Google Images'; search_names['IMAGES_100500'] = 'Picsearch'; search_names['IMAGES_100600'] = 'Yahoo! Images'; search_names['JOBS_100100'] = 'CareerBuilder.com'; search_names['JOBS_100200'] = 'Google Job Search'; search_names['JOBS_100300'] = 'Hotjobs.com'; search_names['JOBS_100400'] = 'Jobs.com'; search_names['JOBS_100500'] = 'Jobster'; search_names['JOBS_100600'] = 'Monster.com'; search_names['MAPS_100100'] = 'Google Maps'; search_names['MAPS_100200'] = 'Mapquest.com'; search_names['MAPS_100400'] = 'MSN Maps'; search_names['MAPS_100500'] = 'Yahoo! Maps'; search_names['MOVIES_100100'] = 'Aint it Cool News'; search_names['MOVIES_100200'] = 'Fandango'; search_names['MOVIES_100300'] = 'Hollywood.com'; search_names['MOVIES_100400'] = 'iFilm'; search_names['MOVIES_100500'] = 'Internet Movie Database (IMDb)'; search_names['MOVIES_100600'] = 'Moviefone'; search_names['MOVIES_100700'] = 'Movies.com'; search_names['MOVIES_100800'] = 'MSN Entertainment'; search_names['MOVIES_100900'] = 'Netflix'; search_names['MOVIES_101000'] = 'Rotten Tomatoes'; search_names['MOVIES_101100'] = 'Yahoo! Movies'; search_names['MUSIC_100100'] = 'AOL Music'; search_names['MUSIC_100200'] = 'iTunes'; search_names['MUSIC_100300'] = 'MP3.com'; search_names['MUSIC_100400'] = 'MSN Music'; search_names['MUSIC_100500'] = 'MTV Music Videos'; search_names['MUSIC_100600'] = 'Napster'; search_names['MUSIC_100700'] = 'Yahoo! Music'; search_names['NEWS_100100'] = 'ABC News'; search_names['NEWS_100200'] = 'BBC'; search_names['NEWS_100300'] = 'CBS News'; search_names['NEWS_100500'] = 'CNET News'; search_names['NEWS_100600'] = 'CNN'; search_names['NEWS_100700'] = 'Digg'; search_names['NEWS_100750'] = 'Financial Times'; search_names['NEWS_100800'] = 'Fox News'; search_names['NEWS_100900'] = 'Google News'; search_names['NEWS_101000'] = 'MSNBC'; search_names['NEWS_101100'] = 'New York Times'; search_names['NEWS_101200'] = 'Slashdot'; search_names['NEWS_101300'] = 'USA Today'; search_names['NEWS_101350'] = 'Wall Street Journal'; search_names['NEWS_101400'] = 'Washington Post'; search_names['NEWS_101500'] = 'Yahoo! News'; search_names['PEOPLE_100100'] = 'Friendster'; search_names['PEOPLE_100200'] = 'LinkedIn'; search_names['PEOPLE_100300'] = 'Lycos People Search'; search_names['PEOPLE_100400'] = 'MySpace'; search_names['PEOPLE_100500'] = 'Yahoo! White Pages'; search_names['PEOPLE_100600'] = 'Zoominfo.com'; search_names['RECIPES_100100'] = 'Allrecipes.com'; search_names['RECIPES_100200'] = 'AOL Food'; search_names['RECIPES_100300'] = 'Betty Crocker'; search_names['RECIPES_100400'] = 'Cooking.com'; search_names['RECIPES_100500'] = 'Epicurious.com'; search_names['RECIPES_100600'] = 'Food Network'; search_names['RECIPES_100700'] = 'KidsHealth.com Recipes'; search_names['RECIPES_100800'] = 'Kraftfoods.com'; search_names['RECIPES_100900'] = 'MSN Lifestyle'; search_names['RECIPES_101000'] = 'Recipe Land'; search_names['RECIPES_101100'] = 'Recipe Source'; search_names['RECIPES_101200'] = 'Recipe Zaar'; search_names['RESTAURANTS_100100'] = 'Citysearch'; search_names['RESTAURANTS_100200'] = 'Fodors'; search_names['RESTAURANTS_100300'] = 'Google Local'; search_names['RESTAURANTS_100400'] = 'Yahoo! Local'; search_names['RESTAURANTS_100500'] = 'Yelp'; search_names['SHOPPING_100100'] = 'AOL Shopping'; search_names['SHOPPING_100200'] = 'Amazon.com'; search_names['SHOPPING_100300'] = 'CNET.com'; search_names['SHOPPING_100400'] = 'eBay'; search_names['SHOPPING_100500'] = 'Froogle'; search_names['SHOPPING_100600'] = 'HSN.com'; search_names['SHOPPING_100700'] = 'MSN Shopping'; search_names['SHOPPING_100800'] = 'Overstock.com'; search_names['SHOPPING_100900'] = 'QVC.com'; search_names['SHOPPING_101000'] = 'Shopping.com'; search_names['SHOPPING_101100'] = 'Shopzilla'; search_names['SHOPPING_101200'] = 'Yahoo! Shopping'; search_names['SITE_100100'] = 'Alta Vista'; search_names['SITE_100200'] = 'Ask.com'; search_names['SITE_100300'] = 'Excite'; search_names['SITE_100400'] = 'Google'; search_names['SITE_100500'] = 'MSN Live.com'; search_names['SITE_100700'] = 'Lycos'; search_names['SITE_100900'] = 'Yahoo!'; search_names['SPORTS_100100'] = 'CBS Sportsline'; search_names['SPORTS_100200'] = 'ESPN'; search_names['SPORTS_100300'] = 'Fox Sports'; search_names['SPORTS_100400'] = 'MLB.com'; search_names['SPORTS_100500'] = 'NBA.com'; search_names['SPORTS_100600'] = 'NHL.com'; search_names['SPORTS_100700'] = 'New York Times - Sports'; search_names['SPORTS_100800'] = 'Sports Illustrated'; search_names['SPORTS_100900'] = 'Yahoo! Sports'; search_names['VIDEO_100100'] = 'AOL Video'; search_names['VIDEO_100200'] = 'Flurl'; search_names['VIDEO_100300'] = 'Google Video'; search_names['VIDEO_100400'] = 'Go Fish'; search_names['VIDEO_100500'] = 'Live Digital'; search_names['VIDEO_100600'] = 'MSN Video'; search_names['VIDEO_100700'] = 'MySpace Video'; search_names['VIDEO_100800'] = 'YouTube'; search_names['VIDEO_100900'] = 'Yahoo! Video'; search_names['WEATHER_100100'] = 'Accuweather'; search_names['WEATHER_100200'] = 'MSN Weather'; search_names['WEATHER_100300'] = 'National Weather Service'; search_names['WEATHER_100400'] = 'Weather.com'; search_names['WEATHER_100500'] = 'Weather Underground'; search_names['WEATHER_100600'] = 'Yahoo! Weather'; search_names['WEB_100100'] = 'Alta Vista'; search_names['WEB_100200'] = 'Alexa.com'; search_names['WEB_100300'] = 'Ask.com'; search_names['WEB_100400'] = 'Excite'; search_names['WEB_100500'] = 'Google'; search_names['WEB_100600'] = 'Live.com'; search_names['WEB_100700'] = 'Looksmart'; search_names['WEB_100800'] = 'Lycos'; search_names['WEB_100900'] = 'Mamma.com'; search_names['WEB_101100'] = 'Yahoo!'; search_names['YELLOWPAGES_100100'] = 'AOL CityGuide'; search_names['YELLOWPAGES_100200'] = 'Google Local'; search_names['YELLOWPAGES_100300'] = 'Verizon SuperPages'; search_names['YELLOWPAGES_100400'] = 'Yahoo! Yellow Pages'; search_names['YELLOWPAGES_100500'] = 'YellowPages.com'; // create an array with all of the search assistant flag preferences var searchAssistantPrefs = new Array; searchAssistantPrefs['Blogs'] = 1; searchAssistantPrefs['Classifieds'] = 1; searchAssistantPrefs['Coupons'] = 1; searchAssistantPrefs['Dictionary'] = 1; searchAssistantPrefs['Directions'] = 1; searchAssistantPrefs['Directory'] = 0; searchAssistantPrefs['Encyclopedia'] = 1; searchAssistantPrefs['Finance'] = 1; searchAssistantPrefs['Health'] = 1; searchAssistantPrefs['Images'] = 1; searchAssistantPrefs['Jobs'] = 1; searchAssistantPrefs['Maps'] = 1; searchAssistantPrefs['Movies'] = 1; searchAssistantPrefs['Music'] = 1; searchAssistantPrefs['News'] = 1; searchAssistantPrefs['Notes'] = 0; searchAssistantPrefs['People'] = 1; searchAssistantPrefs['Recipes'] = 1; searchAssistantPrefs['Restaurants'] = 1; searchAssistantPrefs['Saved'] = 1; searchAssistantPrefs['Shopping'] = 1; searchAssistantPrefs['Site'] = 1; searchAssistantPrefs['Sports'] = 1; searchAssistantPrefs['Video'] = 1; searchAssistantPrefs['Weather'] = 1; searchAssistantPrefs['Web'] = 1; searchAssistantPrefs['YellowPages'] = 1; // create an array with all of the user's default search sites var defaultSearchSites = new Array; defaultSearchSites['Blogs'] = ''; defaultSearchSites['Classifieds'] = ''; defaultSearchSites['Coupons'] = ''; defaultSearchSites['Dictionary'] = ''; defaultSearchSites['Directions'] = ''; defaultSearchSites['Directory'] = ''; defaultSearchSites['Encyclopedia'] = ''; defaultSearchSites['Finance'] = ''; defaultSearchSites['Health'] = ''; defaultSearchSites['Images'] = ''; defaultSearchSites['Jobs'] = ''; defaultSearchSites['Maps'] = ''; defaultSearchSites['Movies'] = ''; defaultSearchSites['Music'] = ''; defaultSearchSites['News'] = ''; defaultSearchSites['Notes'] = ''; defaultSearchSites['People'] = ''; defaultSearchSites['Recipes'] = ''; defaultSearchSites['Restaurants'] = ''; defaultSearchSites['Saved'] = ''; defaultSearchSites['Shopping'] = ''; defaultSearchSites['Site'] = ''; defaultSearchSites['Sports'] = ''; defaultSearchSites['Video'] = ''; defaultSearchSites['Weather'] = ''; defaultSearchSites['Web'] = ''; defaultSearchSites['YellowPages'] = ''; // create an array with all of the default search sites var system_defaultSearchSites = new Array; system_defaultSearchSites['Blogs'] = 'BLOGS_100200'; system_defaultSearchSites['Classifieds'] = 'CLASSIFIEDS_100200'; system_defaultSearchSites['Coupons'] = 'COUPONS_100700'; system_defaultSearchSites['Dictionary'] = 'DICTIONARY_100100'; system_defaultSearchSites['Directions'] = 'DIRECTIONS_100100'; system_defaultSearchSites['Directory'] = 'DIRECTORY_100100'; system_defaultSearchSites['Encyclopedia'] = 'ENCYCLOPEDIA_100700'; system_defaultSearchSites['Finance'] = 'FINANCE_100500'; system_defaultSearchSites['Health'] = 'HEALTH_101000'; system_defaultSearchSites['Images'] = 'IMAGES_100500'; system_defaultSearchSites['Jobs'] = 'JOBS_100600'; system_defaultSearchSites['Maps'] = 'MAPS_100100'; system_defaultSearchSites['Movies'] = 'MOVIES_100600'; system_defaultSearchSites['Music'] = 'MUSIC_100700'; system_defaultSearchSites['News'] = 'NEWS_100600'; system_defaultSearchSites['Notes'] = 'NOTES_100100'; system_defaultSearchSites['People'] = 'PEOPLE_100600'; system_defaultSearchSites['Recipes'] = 'RECIPES_100500'; system_defaultSearchSites['Restaurants'] = 'RESTAURANTS_100100'; system_defaultSearchSites['Saved'] = 'NOTES_101000'; system_defaultSearchSites['Shopping'] = 'SHOPPING_101000'; system_defaultSearchSites['Site'] = 'SITE_100400'; system_defaultSearchSites['Sports'] = 'SPORTS_100200'; system_defaultSearchSites['Video'] = 'VIDEO_100800'; system_defaultSearchSites['Weather'] = 'WEATHER_100200'; system_defaultSearchSites['Web'] = 'WEB_100500'; system_defaultSearchSites['YellowPages'] = 'YELLOWPAGES_100200'; /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // set the form criteria on initial load/startup function startup() { // put the cursor on the search bar document.forms[0].q.focus(); if (c == '' || c == 'AutoGuess' ) { // if there is no category selected _setTab_auto('AutoGuess'); _setSearchType('Web'); _setSearchSites('Web'); _hideExtraForms(); _populateForms(); _setSearchAssistantFlag('Web'); AUTOGUESS = 1; document.getElementById('autoGuessInstructions').style.display = 'none'; } else { // if there is a fixed category selected // document.forms[0].st.disabled = true; if ( t == 'utility' ) { _setTab_auto( c ); c = 'Web'; } else { _setTab(c); } _setSearchType(c); _setSearchSites(c); _showSpecialSearchForm(c); _hideExamples(1); _setSearchAssistantFlag(c); AUTOGUESS = 0; document.getElementById('autoGuessInstructions').style.display = ''; } // if there was a value passed in the URL, autosearch if ( document.forms[0].q.value != '' ) autosearch(); } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// function autosearch() { _updateForms(); if ( AUTOGUESS == '0' ) { return false; } else { // guess the current search _guessSearchType(); // query for the lucky guess box _luckyGuess(); } } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// function manualsearch( stype ) { AUTOGUESS = 0; // if there is a fixed category selected _setTab( stype ); _setSearchType( stype ); _setSearchSites( stype ); _hideExtraForms(); _showSpecialSearchForm( stype ); _setSearchAssistantFlag( stype ); _hideExamples(1); } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // guess what type of search this is using Ajax function _guessSearchType() { // for debugging/anti-caching purposes var timestamp = new Date(); time = timestamp.getTime(); var url = 'http://www.whizler.com/bin/guessSearch.php?q=' + document.forms[0].q.value + '&t=' + time; makeHttpRequest( url ,'_updateSearch', 'returnXML'); } /////////////////////////////////////////////////////////////////// // display the "Lucky Guess" box if there is a matching search function _luckyGuess() { mapBlock = document.getElementById('map'); _query = document.forms[0].q.value; if ( SEARCHTYPE == 'Maps' ) { if ( mapBlock.style.display != '' ) { mapBlock.style.display = ''; GoogleMap_loadMap(); } mapLocation = document.forms[0].Maps_Address.value + ' ' + document.forms[0].Maps_CityStateZip.value; if ( mapLocation.match(/,/) || mapLocation.match(/\d\d\d\d\d/) ) { GoogleMap_showAddress( mapLocation ); } } else { mapBlock.style.display = 'none'; ajax_loadContent('search_guess','http://www.whizler.com/bin/luckyguess.php?q=' + document.forms[0].q.value + '&'); } } /////////////////////////////////////////////////////////////////// // return function for ajax function _updateSearch ( xmldoc ) { var root = xmldoc.getElementsByTagName('search_match')[0]; var stype = root.getAttribute('type'); var utility = root.getAttribute('utility'); // since AJAX is asynchronous, make sure that this request is not older // than a previous request. If it is older than return. var rtime = root.getAttribute('rtime'); if ( rtime < LASTREQUEST ) { return false; } LASTREQUEST = rtime; SEARCHTYPE = stype; if ( utility == 1 ) { _setTab_auto( SEARCHTYPE ); SEARCHTYPE = 'Web'; } else { // update form _hideExtraForms(); _showSpecialSearchForm( SEARCHTYPE ); // update select boxes _setSearchType( SEARCHTYPE ); _setSearchSites( SEARCHTYPE ); // select tab _setTab_auto( SEARCHTYPE ); _setSearchAssistantFlag( SEARCHTYPE ); } // Maps luckyguess bug fix if ( SEARCHTYPE == 'Maps' ) _luckyGuess(); } /////////////////////////////////////////////////////////////////// // update the search sites list based on the selected search type function _setSearchSites( stype ) { // clear_searchlist document.forms[0].sd.options.length = 0; for (x = 0; x < search_data[ stype ].length; x++) { if ( search_data[stype][x] ) document.forms[0].sd.options[x] = new Option( search_names[search_data[stype][x]], search_data[stype][x] ); if ( defaultSearchSites[stype] == search_data[stype][x] ) { document.forms[0].sd.options[x].selected = true; } // if there is no user selected default if ( ! defaultSearchSites[stype] && search_data[stype][x] == system_defaultSearchSites[stype] ) { document.forms[0].sd.options[x].selected = true; } } } /////////////////////////////////////////////////////////////////// // set the search type function _setSearchType( stype ) { for (x = 0; x < document.forms[0].st.options.length; x++) { if ( stype == document.forms[0].st.options[x].value ) document.forms[0].st.options.selectedIndex = x; } } /////////////////////////////////////////////////////////////////// // updates all of the search criteria and form info function _showSpecialSearchForm( stype ) { document.forms[0].ipf_smartsubmit.value = 'Search ' + stype; sform = document.getElementById( stype + '_form' ); // show/hide the examples and extra search forms if ( sform ) { sform.style.display = ''; } // show/hide the specialized search button searchweb_d = document.getElementById('ipf_searchweb'); if ( stype == 'Web' || ( c != '' && c != 'AutoGuess' ) ) { document.forms[0].ipf_searchweb.style.visibility = 'hidden'; } else { document.forms[0].ipf_searchweb.style.visibility = ''; } } /////////////////////////////////////////////////////////////////// // updates all of the search criteria and form info function _hideExamples( flag ) { examples_d = document.getElementById('examples'); // show/hide the examples if ( flag == '1' ) { examples_d.style.display = 'none'; } else { examples_d.style.display = ''; } } /////////////////////////////////////////////////////////////////// // hide all of the extra forms function _hideExtraForms() { for (x = 0; x < search_types.length; x++ ) { sform = document.getElementById( search_types[x] + '_form' ); if ( sform ) { sform.style.display = 'none'; } } } /////////////////////////////////////////////////////////////////// // populate forms with saved cookie values function _populateForms() { for (x = 0; x < search_types.length; x++ ) { sform = eval( 'document.forms[0].' + search_types[x] + '_CityStateZip'); if ( sform ) { if ( WM_readCookie( search_types[x] + '_CityStateZip' ) ) { sform.value = WM_readCookie( search_types[x] + '_CityStateZip' ); sform.style.color = 'green'; } } } } /////////////////////////////////////////////////////////////////// // select tab function _setTab( activetab ) { // turn on the active tab if ( atab = document.getElementById( 'tab_' + activetab ) ) { atab.className='topnav_hover'; } // turn off inactive tabs alltabs = search_types; alltabs.push ('AutoGuess'); for (x = 0; x < alltabs.length; x++ ) { tab = document.getElementById( 'tab_' + alltabs[x] ); if ( tab && alltabs[x] != activetab ) { tab.className = 'topnav'; } } // show the form elements for this tab if ( document.getElementById( activetab + '_form' ) ) { document.getElementById( activetab + '_form' ).style.display = ''; } } /////////////////////////////////////////////////////////////////// // select the autotab function _setTab_auto( activetab ) { // make sure the auto tab is highlighted atab = document.getElementById( 'tab_AutoGuess1' ); atab.className='topnav_hover'; atab = document.getElementById( 'tab_AutoGuess2' ); atab.className='topnav_hover'; atab = document.getElementById( 'tab_AutoGuess3' ); atab.className='topnav_hover'; // do not highlight anything if the search box is blank if ( document.forms[0].q.value != '' ) { // select the tab row // if ( LASTROW ) { document.getElementById('categories_row' + LASTROW ).style.display = 'none'; // } document.getElementById('categories_row' + NAVROW[activetab] ).style.display = ''; // highlight the guessed tab in a different color, but only if it is displayed on the main nav if ( activetab == 'AutoGuess' ) { gtab = document.getElementById( 'tab_AutoGuess1' ); } else { gtab = document.getElementById( 'tab_' + activetab ); } gtab.className='topnav_guessed'; LASTROW = NAVROW[activetab]; } // turn off inactive tabs alltabs = search_types; for (x = 0; x < alltabs.length; x++ ) { tab = document.getElementById( 'tab_' + alltabs[x] ); if ( tab && alltabs[x] != activetab && alltabs[x] != 'AutoGuess' ) { tab.className = 'topnav'; } } // if the search field is blank, make sure the Web tab is not highlighted if ( document.forms[0].q.value == '' ) { tab = document.getElementById( 'tab_Web' ); tab.className = 'topnav'; } } /////////////////////////////////////////////////////////////////// function _updateForms() { YellowPages_updateForms(); Maps_updateForms(); Directions_updateForms(); Restaurants_updateForms(); Weather_updateForms(); Movies_updateForms(); Jobs_updateForms(); Site_updateForms(); } /////////////////////////////////////////////////////////////////// // set the search type function _setSearchAssistantFlag( stype ) { if ( searchAssistantPrefs[stype] == 1 ) { document.forms[0].ipf_useSearchNav.checked = true; } else { document.forms[0].ipf_useSearchNav.checked = false; } // if a URL is entered, turn off the search assistant if ( document.forms[0].q.value.match (/^\w+\.\w+\.\w+$/) || document.forms[0].q.value.match (/^http:\/\/.*\w+\.\w+.*/) || document.forms[0].q.value.match (/^https:\/\/.*\w+\.\w+.*/) ) { document.forms[0].ipf_useSearchNav.checked = false; document.forms[0].ipf_smartsubmit.value = 'Go to Site'; } } /////////////////////////////////////////////////////////////////// function turnAutoGuessOn() { document.location.href = 'http://www.whizler.com/?q=' + c; }