function sayit() {
   if (document.getSelection) <!-- older Mozilla versions // -->
   {
              var selectedString = document.getSelection();
   }
   else if (document.all) <!-- MSIE 4+ // -->
   {
              var selectedString = document.selection.createRange().text;
   }
   else if (window.getSelection) <!-- recent Mozilla versions // --> 
   {
              var selectedString = window.getSelection();
   }
   document.forms['rs_form'].rstext.value = selectedString;
   if (window.location.href) {
              document.forms['rs_form'].url.value = window.location.href;
   }
   else if (document.location.href) {
              document.forms['rs_form'].url.value = document.location.href;
   }
}

function createWindow() {
    settings=
    "toolbar=no,location=no,directories=no,"+
    "status=no,menubar=no,scrollbars=no,"+
    "resizable=no,width=300,height=160,";

    if ((parseInt(navigator.appVersion)>3) && (navigator.appName=="Netscape") || 
       (navigator.appName.indexOf("Microsoft")!=-1) && (parseInt(navigator.appVersion)>=4) ||
       (navigator.appVersion.indexOf("MSIE") != -1) && (parseInt(navigator.appVersion))>=4) {     
           settings = settings + "screenX=" + (screen.width-300) + ",screenY=0,left=" + (screen.width-300) + ",top=0";
    }
    else {
        settings = settings + "screenX=0,screenY=0,left=0,top=0";   
    }
    
   	window.open('', 'mywin', settings);
    document.forms['rs_form'].target = 'mywin';
    document.forms['rs_form'].submit();
}

function copyselected() {
	setTimeout("sayit()",50);
	return true;
}



