	if (document.layers) {
		window.captureEvents(Event.KEYPRESS);
		window.onKeyPress = fCheckReturnNS;
	}

	

	function OpenMyPortfolio() {
		var url, sTop, sLeft;
		
		url = "myfavorites.php";
		sTop =  (screen.availHeight-520) / 2;
		sLeft = (screen.availWidth-700) / 2;
		
		var winZoom = window.open(url,"win_myportfolio","width=700,height=520,top=sTop,left=sLeft,scrollbars=1,resizable=1");
		winZoom.focus();
	}
	
	function AddToMyPortfolio(id) {
		var url, sTop, sLeft;
		
		url = "myfavorites.php?picID="+ id;
		sTop =  (screen.availHeight-520) / 2;
		sLeft = (screen.availWidth-700) / 2;
		
		var winZoom = window.open(url,"win_myportfolio","width=700,height=520,top=sTop,left=sLeft,scrollbars=1,resizable=1");
		winZoom.focus();
	}
	

	function OpenView(k){
	     var sURL = 'view.php?ID=' + k;
	     window.open(sURL,'new',"menubar=0,scrollbars=1,location=0,directories=0,resizable=1, width=600, height=520, top=0, left=0")
	}

	
	function DoSearch()
	{
		var strSearch = document.frmSearch.search.value;
		var objSelSearchInCat = document.frmSearch.sel_search_in;
		strSearch = strSearch.toLowerCase();
		
		if (strSearch == "")
		{
			alert("Please enter a keyword.");
			document.frmSearch.search.focus();
		}
		else
		{
			document.frmListThumbs.SearchAll.value = 1;
			/* ----- 
			if (objSelSearchInCat.selectedIndex == 0) {
				document.frmListThumbs.SearchAll.value = 1;
			}
			if (objSelSearchInCat.selectedIndex > 0) {
				document.frmListThumbs.category.value = objSelSearchInCat.value;
				document.frmListThumbs.SearchAll.value = 0;
			}
			----- */
			document.frmListThumbs.search.value = strSearch;
			document.frmListThumbs.submit();
		}
    }

	
	function fCheckReturnNS(e) {
		if (document.layers) {
			if (e.which == 13) {
				if (eval(e.target).name == "search")
					DoSearch();
				return false;
			}
			else
				return true;
		}
	}
	
	function fCheckReturn() {
		if (!document.layers) {
			if (window.event.keyCode == 13) {
				if (window.event.srcElement.name == "search")
					DoSearch();
				return false;
			}
		}
	}

