	
	var myHistory=new Array()
	
	function googleSearch(strSearch) {
		var strSearchText = strSearch.replace(" ","+");
		var strSearchString = "http://www.google.com/custom?q=" + strSearchText + "&sa=Search&client=pub-2016455859263302&forid=1&channel=7856413523&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%239A2C06%3BGL%3A1%3BDIV%3A%2333FFFF%3BVLC%3AD03500%3BAH%3Acenter%3BBGC%3A99CCFF%3BLBGC%3ACCE5F9%3BALC%3A440066%3BLC%3A440066%3BT%3A336699%3BGFNT%3A223472%3BGIMP%3A223472%3BFORID%3A1&hl=en";
		loadPage(strSearchString);
	}
	
	function loadPage (strURL) {
		document.getElementById("pageframe").src = strURL;
		document.getElementById("newURL").value = strURL;
		checkFavs(strURL);
	}
	
	function setHistory(strURL) {
		myHistory.push(strURL);
	}
	
	function getHistory(strURL, strDirection) {
		//check to see where in the array the current URL is then move forward or back
		for ( var i = 0; i < myHistory.length; i++ ){
			if (strURL == myHistory[i]) {
				if (strDirection == "back" && i != 0) {
					loadPage (myHistory[i-1]);
				}
				if (strDirection == "forward" && i < myHistory.length-1) {
					loadPage (myHistory[i+1]);						
				}
			}
		}
		
	}
	
	function newURLAction () {
		loadPage (document.getElementById('newURL').value);
		setHistory (document.getElementById('newURL').value);
		document.getElementById('newURLtoAdd').value = document.getElementById('newURL').value;
		document.getElementById('newURLtoAddImage').src = 'http://open.thumbshots.org/image.pxf?url='+document.getElementById('newURL').value;
	}
	
	function getPrivate() {
		if (document.getElementById("makeprivateNo").checked) {
			return "no"
		} else{
			return "yes"		
		}
	}

	function checkFavs(strURL) {
		var getstr = "&strURL=" + strURL;
		//add a random variable number to the URL so that IE does not cache
		var varnum = Math.floor(Math.random()*100000);
		var url = 'ajax/checkFavs.asp?varnum='+varnum+getstr;
		var pars = '';
		var target = 'addAction';	
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});	
	}

	
	function AddNewURL(strTitle, strURL, strPrivate, CatID) {
		var getstr = "&strTitle=" + strTitle + "&strURL=" + strURL + "&strPrivate=" + strPrivate + "&CatID=" + CatID;
		//add a random variable number to the URL so that IE does not cache
		var varnum = Math.floor(Math.random()*100000);
		var url = 'ajax/addNewURL.asp?varnum='+varnum+getstr;
		var pars = '';
		var target = 'thumbs';	
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});
		
		//Close the popup window
		closePopup();
		document.getElementById("addAction").innerHTML = "";		
	}
	
	function simpleURLAction(){
		loadPage (document.getElementById('newURL').value);
		setHistory (document.getElementById('newURL').value);
	}

	function showTop10() {
		var getstr = ""
		//add a random variable number to the URL so that IE does not cache
		var varnum = Math.floor(Math.random()*100000);
		var url = 'includes/showTop10.asp?varnum='+varnum+getstr;
		var pars = '';
		var target = 'thumbs';	
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});	
		
		//need to load the first URL from the Top 10 list in the iFrame

	}
	
	function showFavs() {
		var getstr = ""
		//add a random variable number to the URL so that IE does not cache
		var varnum = Math.floor(Math.random()*100000);
		var url = 'includes/showFavs.asp?varnum='+varnum+getstr;
		var pars = '';
		var target = 'thumbs';	
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});	
		
		//need to load the first URL from the Favs list in the iFrame

	}
	
	function showPreview() {
		var getstr = ""
		//add a random variable number to the URL so that IE does not cache
		var varnum = Math.floor(Math.random()*100000);
		var url = 'includes/showPreview.asp?varnum='+varnum+getstr;
		var pars = '';
		var target = 'thumbs';	
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});	
		
		//need to load the first URL from the Favs list in the iFrame

	}	
	
	function switchNavState(activeTab,inactiveTab) {
		document.getElementById(activeTab).className = "current";
		document.getElementById(inactiveTab).className = "";
	}