
nN=navigator.appName;
nV=navigator.appVersion;

function fsearch(str){
open('http://yandex.ru/yandsearch?text='+str+'&serverurl='+document.location.hostname+'/');
return true;
}

function MouseUpHandler(e) {
if (nN=='Netscape') {
if (document.getSelection()){
if(frames.length){
var i;
for(i=0;i<length;i++){
str=frames[i].document.getSelection(); 
if(str){
break;
}
}
}
else{
str=document.getSelection();
}
newstr=str.replace(/\n+/g,' ');
str=newstr.replace(/\ +/g,' ');
if(str.length > 100){
var i;
i=0;
str=str.slice(0,100);
i=str.lastIndexOf(' ');

if (i>0){
str=str.slice(0,i);
} 
}
document.fform.strf.value=str;
}
}
else 
if (nN=='Microsoft Internet Explorer') { 
if (document.selection.createRange()){
var range = document.selection.createRange();
var str = range.text;
}
if (str){
str=str.replace(/\ +/g, " ");
document.fform.strf.value=str;
}
}
return true;
}
if (window.Event)
document.captureEvents(Event.MOUSEUP);
document.onmouseup = MouseUpHandler;
