﻿function searchWasClicked(){
    var searchStr = document.getElementById('searchBox').value;

    searchStr = searchStr.trim();
   
    if (searchStr=="" || searchStr=="Click here to search"){
        alert("Please enter a search term");
        return;
    }
    
    window.location = '/index.html?search='+escape(searchStr)+'#SearchResultsHere';
}

function clickSearch(el){
    if(el.value=='Click here to search') el.value='';
    
//    el.onmouseout=function() {
//        if(el.value=='') el.value='Click here to search';
//    }
    
//    el.onchange=function() {
//        if(el.value=='') el.value='Click here to search';
//    }
    
}
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
function onEnter(e) {//press enter on the textbox and it searches 
    var keyCode = null;

    if (e.which)
        keyCode = e.which;
    else if (e.keyCode)
        keyCode = e.keyCode;

    if (13 == keyCode) {//if it was "enter" key (ascii 13)
        document.getElementById('searchButton').click();
        return false;
    }
    return true;
}

//dock menu thingy here
	$(document).ready(
		function()
		{
			$('#dock').Fisheye(
				{
					maxWidth: 40,
					items: '.dock-item',
					itemsText: 'span',
					container: '.dock-container',
					itemWidth: 100,
					proximity: 80,
					halign : 'center'
				}
			)
		}
	);
	
//end footer dock menu thingy