function getSelectedText(textbox){
// ie > 8,ff chrome
if(typeof textbox.selectionStart == 'number'){
return textbox.value.substring(textbox.selectionStart,textbox.selectionEnd);
}else if(document.selection){
// ie <=8
return document.selection.createRange().text;
}
}