﻿function CheckSearchBox()
{
    var txt = document.getElementById('ipk');
    
    if(txt.value == '')
    {
        alert('请输入搜索关键词');
        txt.focus();
        return false;
    }
    
    return true;
}

function searchBook()
{
    var txt = document.getElementById('ipk');
    
    if(txt.value == '')
    {
        alert('请输入搜索关键词');
        txt.focus();
        return false;
    }
    else
         window.location.href='/BookSearch.aspx?k='+escape(txt.value);
    
    return false;
}

function enter()
{		    
	if(window.event.keyCode == 13)
	{	
		var key = document.getElementById('ipk');
		if(key.value == '')
		{
			alert('请输入搜索关键词');
            key.focus();
           
		}
		else
		    window.location.href='/BookSearch.aspx?k='+escape(key.value);
		    
		 return false;
	}
}