var base_url = "http://vdict.com/";
var text = "";
function calldict(word, dict ){
window.open(base_url+'gateway.php?word='+word+'&dictionaries='+dict,'Vdict','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,titlebar=no,width=620,height=400')
}
function ctrlrightclick() {
	if (!window.event.ctrlKey) return true
	var x=document.body.createTextRange();
	x.moveToPoint(window.event.x, window.event.y);
	x.expand("word");
	if (x.text)
	{
		calldict(x.text, dictionaries);
	}
	return false
}
function detectKey() 
{
	if(event.type == 'keydown' && ( (event.keyCode == "A".charCodeAt(0)) || (event.keyCode == "a".charCodeAt(0)) ) )
	{
		if ( (event.ctrlKey) && (event.shiftKey) )
			{
				text = (document.all) ? document.selection.createRange().text : document.getSelection();
				calldict(text, dictionaries);
			}
	}
	return true
}
document.oncontextmenu = ctrlrightclick;
document.onkeydown = detectKey;