function searchSubmitClick() {
    
    if(trim(document.getElementById('APPI_searchTerm').value).length > 0)
		window.location.assign('/SearchCenter/Pages/default.aspx?k=' + document.getElementById('APPI_searchTerm').value) 
    else{
		document.getElementById('APPI_searchTerm').value = "Please provide search term";
	   	document.getElementById('APPI_searchTerm').select();
	} 
}
function searchSubmitEnter(e) {
	  var intKey = 0;	  
	  if(window.event)
	  	intKey = e.keyCode;
		else
		  intKey = e.which;	  
	  
    if (intKey == 13) {
        
        if(trim(document.getElementById('APPI_searchTerm').value).length > 0)
	        window.location.assign('/SearchCenter/Pages/default.aspx?k=' + document.getElementById('APPI_searchTerm').value) 
	    else{
	    	document.getElementById('APPI_searchTerm').value = "Please provide search term";
	    	document.getElementById('APPI_searchTerm').select();
	    }    
	    return false;
    }
    return true;
}

function searchBooksGoogleSubmitClick() {
    window.location.assign('http://books.google.com/books/p/american_psych_publ2?q=' + document.getElementById('APPI_searchBookGoogleTerm').value + '&hl=en_US&ie=UTF-8&oe=UTF-8')
}
function searchGoogleSearchBookEnter() {
    if (window.event.keyCode == 13) { 
        window.event.cancelBubble = true; 
        window.event.returnValue = false; 
        window.location.assign('http://books.google.com/books/p/american_psych_publ2?q=' + document.getElementById('APPI_searchBookGoogleTerm').value + '&hl=en_US&ie=UTF-8&oe=UTF-8') 
    }
}

function signUpEnter()
{
	 if (window.event.keyCode == 13) { 
        window.event.cancelBubble = true; 
        window.event.returnValue = false; 
        doSubmit();
    }

}

function check_cdfs(form) 
{
	return true;
}
		
function doSubmit() 
{
	if (check_cdfs(document.survey)) 
	{
		window.open('','signup','resizable=1,scrollbars=0,width=300,height=150');
		jQuery().SharePointFormSubmit('#bullseye', 'post', 'http://paracom.paramountcommunication.com/phase2/bullseye/contactupdate1.php3');
    return true;
	}
	else 
	{ 
		return false; 
	}
}

	// Removes leading whitespaces
    function LTrim(value) {
        var re = /\s*((\S+\s*)*)/;
        return value.replace(re, "$1");
    }

    // Removes ending whitespaces
    function RTrim(value) {
        var re = /((\s*\S+)*)\s*/;
        return value.replace(re, "$1");
    }

    // Removes leading and ending whitespaces
    function trim(value) {
        return LTrim(RTrim(value));
    }

