How would I form this js into a single string?
<script type="text/javascript">
function SearchForIt()
{
var searchWord = document.getElementById("searchWord").value;
var searchSelection = document.getElementById('searchSelection').value;
if(searchSelection != "")
{
window.open(searchSelection + escape(searchWord));
}
if(searchSelection == "")
{
document.getElementById('errorSelect').innerHTML = 'Please select a site to search!';
}else {document.getElementById('errorSelect').innerHTML = "";
}
}
</script>
<script type="text/javascript">
function SearchForIt()
{
var searchWord = document.getElementById("searchWord").value;
var searchSelection = document.getElementById('searchSelection').value;
if(searchSelection != "")
{
window.open(searchSelection + escape(searchWord));
}
if(searchSelection == "")
{
document.getElementById('errorSelect').innerHTML = 'Please select a site to search!';
}else {document.getElementById('errorSelect').innerHTML = "";
}
}
</script>