<script type="text/javascript">function change(){
var x=document.getElementById('them').value;
var Str1 =document.getElementById('them').value;;
var patt1 = /<\/head>/i;
var code = '<div style="border:4px solid none;z-index:500;color:#999;font-size:11px;line-height:20px;padding:10px;border-top-right-radius:25px;border-top-left-radius:25px;text-align:center;position:fixed;left:15px;bottom:0;background-color:#999;background-repeat:repeat;font-family:tahoma" dir="rtl">\n<form method="get" action="?search=">\n<p dir="rtl"><input type="search" name="search" placeholder="دنبال چي هستي؟" size="15"><input style="margin:1;height:27px;padding:7;cursor:pointer;border-radius:5px;font:11px tahoma;text-shadow:1px 1px 0 #fff;border:1px #ccc solid;background:#fff;background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffffff),color-stop(100%,#e5e5e5))" type="submit" value="بگرد"></p>\n</form>\n</div></head>';
document.getElementById('newthem').value=Str1.replace(patt1,code);
}
</script>
<textarea id="them"></textarea><br />
<textarea id="newthem""></textarea>
<input type="button" value="click" onClick="change()">