The appendTo method is what is causing the input to lose focus, as the input is now in the div, and it is calling the function on click. The following code will account for that.
function appendSearch(){
if ($("#placeHolder input").length == 0) {
$("#box").appendTo($("#placeHolder"));
}
}