/* LIVE CLOCK */

function liveclock()

		{
		var curdate=new Date()
		var hours=curdate.getHours()
		var minutes=curdate.getMinutes()
		var seconds=curdate.getSeconds()
		var suffix="AM"
		if (hours>=12){
		suffix="PM"
		if (hours>=13)
		hours-=12
		}
		if (minutes<10)
		minutes="0"+minutes
		if (seconds<10)
		seconds="0"+seconds
		var thetime=" "+hours+":"+minutes+":"+seconds+" "+suffix
		document.time.time2.value=thetime
		setTimeout("liveclock()",1000)
		}

/* NEW WINDOW TEMPLATE */

function launchWin()
	{
	window.open("pageURL.html","NameOfWindow","width=500,height=500,scrollbars=yes,menubar=no,resizable=no,left=0,top=0");
	}	
	
/* TEST SEARCH CONDITIONS */

function nav(which)
{
document.theForm.theEngine.selectedIndex = which;
document.theForm.theEngine.focus();
}

function preSearchConditions()
{
var keywords = document.theForm.theText.value;
var searchSelection = document.theForm.theEngine.options[document.theForm.theEngine.selectedIndex].value;

if (keywords == "")
	{
	window.alert ("Please enter a keyword or keyword phrase in the search box.");
	document.theForm.theText.focus();
	return false;
	}

if (searchSelection == "")
	{
	window.alert ("Please choose a valid search using the 'SELECT SEARCH' list.");
	nav(0)
	return false;
	}	

else
	{return true;}			
}

/* SEARCH PAGE */

function Search()
{
theString = document.theForm.theText.value; 
if(theString != "")
	{
	Engines = document.theForm.theEngine.options[document.theForm.theEngine.selectedIndex].value;
	finalSearch = "";
	
	/* POPULAR */
	
	if(Engines == 'About'){
	finalSearch = "http://search.about.com/fullsearch.htm?terms=" + theString;}
	
	if(Engines == 'Amazon'){
	finalSearch = "http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&x=18&y=18&&field-keywords=" + theString;}
	
	if(Engines == 'Ask'){
	finalSearch = "http://www.ask.com/web?qsrc=2417&o=0&l=dir&q=" + theString;}
	
	if(Engines == 'Bing'){
	finalSearch = "http://www.bing.com/search?q=" + theString;}
	
	if(Engines == 'Ebay'){
	finalSearch = "http://shop.ebay.com/" + theString;}
	
	if(Engines == 'Google'){
	finalSearch = "http://www.google.com/search?q=" + theString;}
	
	if(Engines == 'Twitter'){
	finalSearch = "http://twitter.com/#search?q=" + theString;}
	
	if(Engines  == "Wikipedia"){
	finalSearch = "http://en.wikipedia.org/wiki/" + theString;}
	
	if(Engines == 'Yahoo'){
	finalSearch = "http://search.yahoo.com/search?p=" + theString;}
	
	if(Engines  == "Youtube"){
	finalSearch = "http://www.youtube.com/results?search_type=&aq=f&search_query=" + theString;}
	
	/* IMAGES */

	if(Engines  == "askImages"){
	finalSearch = "http://www.ask.com/pictures?qsrc=2072&o=0&l=dir&q=" + theString;}
	
	if(Engines == 'googleImages'){
	finalSearch = "http://images.google.com/images?ie=UTF-8&hl=en&btnG=Google+Search&q=" + theString;}
	
	if(Engines  == "bingImages"){
	finalSearch = "http://www.bing.com/images/search?q=" + theString;}
	
	if(Engines == 'picsearchImages'){
	finalSearch = "http://www.picsearch.com/search.cgi?q=" + theString;}
	
	if(Engines == 'yahooImages'){
	finalSearch = "http://images.search.yahoo.com/search/images?ei=UTF-8&fr=fp-tab-img-t&cop=mss&tab=3&p=" + theString;}
	
	/* NEWS */

	if(Engines  == "ap"){
	finalSearch = "http://www.google.com/search?hl=en&q=" + theString + "+site%3Aap.org&btnG=Search";}
	
	if(Engines  == "cnn"){
	finalSearch = "http://www.cnn.com/search/?sortBy=date&query=" + theString;}
	
	if(Engines  == "cbs"){
	finalSearch = "http://www.cbsnews.com/1770-5_162-0.html?tag=srch&searchtype=cbsSearch&query=" + theString;}
	
	if(Engines  == "fox"){
	finalSearch = "http://www.foxnews.com/search-results/search?submit=Search&q=" + theString;}
	
	if(Engines  == "googleNews"){
	finalSearch = "http://news.google.com/news?hl=en&tab=wn&ned=us&btnG=Search+News&q=" + theString;}
	
	if(Engines  == "msnbc"){
	finalSearch = "http://www.msnbc.msn.com/?id=11881780&p=1&st=1&sm=user&q=" + theString;}
	
	if(Engines  == "npr"){
	finalSearch = "http://www.npr.org/search/index.php?tabId=all&dateId=0&programId=0&topicId=0&searchinput=" + theString;}
	
	if(Engines  == "nytimes"){
	finalSearch = "http://query.nytimes.com/search/sitesearch?more=date_all&query=" + theString;}
	
	if(Engines  == "usatoday"){
	finalSearch = "http://www.usatoday.com/search/results?p=1&q=" + theString;}
	
	if(Engines == 'yahooNews'){
	finalSearch = "http://news.search.yahoo.com/search/news?ei=UTF-8&fr2=tab-web&fr=ush-news&p=" + theString;}

	/* SHOPPING */

	if(Engines  == "aboutShopping"){
	finalSearch = "http://about.pricegrabber.com/search.php?topcat_search=1&Search.x=19&Search.y=14&form_keyword="+ theString;}
	
	if(Engines  == "amazonShopping"){
	finalSearch = "http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&x=18&y=18&&field-keywords=" + theString;}
	
	if(Engines  == "bingShopping"){
	finalSearch = "http://www.bing.com/shopping/search?go=&form=QBRE&q=" + theString;}
	
	if(Engines  == "buycomShopping"){
	finalSearch = "http://www.buy.com/retail/usersearchresults.asp?querytype=home&qxt=home&display=col&qu=" + theString;}
	
	if(Engines  == "ebayShopping"){
	finalSearch = "http://shop.ebay.com/" + theString;}
	
	if(Engines  == "exciteShopping"){
	finalSearch = "http://shopping.excite.com/search.do?query=" + theString;}
	
	if(Engines  == "froogleShopping"){
	finalSearch = "http://froogle.google.com/froogle?btnG=Search+Froogle&q=" + theString;}
	
	if(Engines  == "hsnShopping"){
	finalSearch = "http://www.hsn.com/cnt/search/searchresults/default.aspx?Ntt=" + theString;}
	
	if(Engines  == "yahooShopping"){
	finalSearch = "http://shopping.yahoo.com/search;_ylt=Av1..SVGqj.wOnbqcnqEGAsbFt0A?did=0&p=" + theString;}

	/* SOFTWARE */

	if(Engines  == "downloadcomSoftware"){
	finalSearch = "http://download.cnet.com/1770-20_4-0.html?tag=srch&searchtype=downloads&filterName=&filter=&query=" + theString;}
	
	if(Engines  == "fdcenterSoftware"){
	finalSearch = "http://www.freedownloadscenter.com/Search/newsearch.php3?Category=0&S_S=" + theString;}
	
	if(Engines  == "microsoftSoftware"){ 
	finalSearch = "http://www.microsoft.com/downloads/results.aspx?pocId=&DisplayLang=en&freetext=" + theString;}
	
	if(Engines  == "rocketdownloadSoftware"){
	finalSearch = "http://www.rocketdownload.com/query.php?q=" + theString;}
	
	if(Engines  == "snapfilesSoftware"){
	finalSearch = "http://www.snapfiles.com/downloadfind.php?action=s&search=Find&st=" + theString;}
	
	if(Engines  == "tucowsSoftware"){
	finalSearch = "http://www.tucows.com/search.html?search_scope=&search_type=soft&&search_terms=" + theString;}
	
	if(Engines  == "winplanetSoftware"){
	finalSearch = "http://search.internet.com/query.php?site=winplanet&Search=Search&&IC_QueryText=" + theString;}
	
	/* VIDEOS */

	if(Engines  == "5Min.com"){
	finalSearch = "http://www.5min.com/Tag/" + theString + "?CategoryID=0";}
	
	if(Engines  == "AOL-Video"){
	finalSearch = "http://video.aol.com/video-search/query/" + theString;}
	
	if(Engines  == "Ask-Video"){
	finalSearch = "http://www.ask.com/videos?qsrc=167&o=0&l=dir&q=" + theString;}
	
	if(Engines  == "Bing-Video"){
	finalSearch = "http://www.bing.com/videos/search?q=" + theString;}
	
	if(Engines  == "Blinkx.com"){
	finalSearch = "http://www.blinkx.com/videos/" + theString;}
	
	if(Engines  == "Blip.tv"){
	finalSearch = "http://www.blip.tv/search?q=" + theString;}
	
	if(Engines  == "Break-Video"){
	finalSearch = "http://www.break.com/findvideo/" + theString;}
	
	if(Engines  == "CastTV.com"){
	finalSearch = "http://www.casttv.com/search/" + theString + "/1";}
	
	if(Engines  == "ClipBlast.com"){
	finalSearch = "http://www.clipblast.com/#search/offset=0&output=json&limit=18&userVideo=false&safeSearch=true&sortBy=standard&queryType=&negativeWords=&metadata=true&r=518402243&phrase=" + theString;}	
	
	if(Engines  == "ClipTa.com"){
	finalSearch = "http://www.clipta.com/search/" + theString;}	
	
	if(Engines  == "DailyMotion.com"){
	finalSearch = "http://www.dailymotion.com/relevance/search/" + theString;}
	
	if(Engines  == "DogPile-Video"){
	finalSearch = "http://www.dogpile.com/dogpile/ws/results/Video/" + theString + "/1/417/TopNavigation/Relevance/iq=true/zoom=off/_iceUrlFlag=7?_IceUrl=true/";}
	
	if(Engines  == "Fooooo.com"){
	finalSearch = "http://fooooo.com/search.php?ranking=0&q=" + theString;}
	
	if(Engines  == "FilesTube.com"){
	finalSearch = "http://video.filestube.com/look_for.html?cat=0&ch=0&q=" + theString;}
	
	if(Engines  == "FindInternetTV.com"){
	finalSearch = "http://www.findinternettv.com/Search.aspx?t=2&q=" + theString;}
	
	if(Engines  == "Google-Video"){
	finalSearch = "http://video.google.com/videosearch?key&hl=en&q=" + theString;}
	
	if(Engines  == "GrindTV.com"){
	finalSearch = "http://www.grindtv.com/search/videos/?term=" + theString;}
	
	if(Engines  == "Hulu.com"){
	finalSearch = "http://www.hulu.com/search?st=0&query=" + theString;}
	
	if(Engines  == "InfoSpace-Video"){
	finalSearch = "http://www.infospace.com/ispace/ws/results/Video/" + theString + "/1/417/content-top-left/Relevance/iq=true/zoom=off/enginefilter=all/_iceUrlFlag=7?_IceUrl=true";}
	
	if(Engines  == "LiveVideo.com"){
	finalSearch = "http://www.livevideo.com/media/search.aspx?sb=1&d=1&tag=" + theString;}
	
	if(Engines  == "Lycos-Video"){
	finalSearch = "http://search.lycos.com/video/?tab=multi&loc=searchbox&sortMode=&safeSearch=&cat=video&x=26&y=22&&query=" + theString;}
	
	if(Engines  == "MegaVideo.com"){
	finalSearch = "http://megavideo.com/?c=search&s=" + theString;}
	
	if(Engines  == "MetaCafe.com"){
	finalSearch = "http://www.metacafe.com/results/" + theString;}
	
	if(Engines  == "MegaCrawler-Video"){
	finalSearch = "http://www.metacrawler.com/metacrawler/ws/results/Video/" + theString + "/1/417/TopNavigation/Relevance/iq=true/zoom=off/_iceUrlFlag=7?_IceUrl=true";}
	
	if(Engines  == "MySpace-Video"){
	finalSearch = "http://searchservice.myspace.com/index.cfm?fuseaction=sitesearch.results&type=MySpaceTV&submit=+Search+&orig=video_hp_search_jumbo&qry=" + theString;}
	
	if(Engines  == "PerfSpot.com"){
	finalSearch = "http://www.perfspot.com/video2/search.asp?s=1&b=1&submit1=Search&q=" + theString;}
	
	if(Engines  == "Pixsy.com"){
	finalSearch = "http://www.pixsy.com/search.aspx?q=" + theString;}
	
	if(Engines  == "SearchforVideo.com"){
	finalSearch = "http://www.searchforvideo.com/search.php?k=" + theString;}
	
	if(Engines  == "Truveo.com"){
	finalSearch = "http://www.truveo.com/search.php?&uqs=&query=" + theString;}
	
	if(Engines  == "TV.com"){
	finalSearch = "http://www.tv.com/search.php?type=11&stype=all&tag=search%3B&stype=video_full&qs=" + theString;}
	
	if(Engines  == "Veoh-Video"){
	finalSearch = "http://www.veoh.com/search/videos/q/" + theString;}
	
	if(Engines  == "VideoLatte.com"){
	finalSearch = "http://www.videolatte.com/search/all/" + theString;}
	
	if(Engines  == "VideoSurf.com"){
	finalSearch = "http://www.videosurf.com/videos/" + theString;}
	
	if(Engines  == "VodPod.com"){
	finalSearch = "http://vodpod.com/search/browse?q=" + theString;}
	
	if(Engines  == "WebCrawler-Video"){
	finalSearch = "http://www.webcrawler.com/webcrawler/ws/results/Video/" + theString + "/1/417/TopNavigation/Relevance/iq=true/zoom=off/_iceUrlFlag=7?_IceUrl=true";}
	
	if(Engines  == "Yahoo-Video"){
	finalSearch = "http://video.search.yahoo.com/search/video?fr=yfp-t-414&toggle=1&cop=mss&ei=UTF-8&p=" + theString;}
	
	if(Engines  == "Zuula.com"){
	finalSearch = "http://www.zuula.com/video_srch/video_SearchResult.jsp?bst=1&prefpg=1&x=48&y=8&st=" + theString;}
	
	/* VIDEO - FOREIGN SITES */
	
	if(Engines  == "56.com"){
	finalSearch = "http://so.56.com/index?st=2&charset=utf-8&type=&bn=&kw=&key=" + theString;}	
	
	if(Engines  == "RuTube.ru"){
	finalSearch = "http://rutube.ru/search.html?page=index&search=" + theString;}	
	
	if(Engines  == "TU.tv"){
	finalSearch = "http://tu.tv/buscar/?str=" + theString;}	
	
	if(Engines  == "TuDou.com"){
	finalSearch = "http://so.tudou.com/isearch/" + theString;}	
	
	if(Engines  == "YouKu.com"){
	finalSearch = "http://www.soku.com/search_video/q_" + theString;}	

	window.location.href = finalSearch;

}}
