//nawigacja - menu
initNavigation();
populateMenu();

//przegladarka
usrAgent = navigator.userAgent;
bName    = (usrAgent.indexOf("Opera") > -1 ? "Opera" : navigator.appName);
if (bName == "Microsoft Internet Explorer") {
	pos = usrAgent.indexOf("MSIE");
	bVer = usrAgent.substring(pos + 5);
	pos = bVer.indexOf(';');
	bVer = parseFloat(bVer.substring(0,pos));
	bName = "ie";
} else if (bName == "Netscape") {
	if (usrAgent.indexOf("Netscape6") > -1) {
		pos  = usrAgent.indexOf("Netscape6");
		bVer = usrAgent.substring(pos + 10);
		bVer = parseFloat(bVer.substring(0,pos));
		bName = "ns";
	} else {
		bVer = usrAgent.substring(8);
		pos  = bVer.indexOf(' ');
		bVer = parseFloat(bVer.substring(0,pos));
		bName = "ns";
	};
} else if (bName == "Opera") {
		pos  = usrAgent.indexOf("Opera");
		bVer = usrAgent.substring(pos + 6);
		pos  = bVer.indexOf(' ');
		bVer = parseFloat(bVer.substring(0,pos));
		bName = "op";
} else {
		bName = "na";
		bVer  = "na";
}
platform = navigator.platform;

if (platform.indexOf("Win") > -1) {
            platform = "win";
}else if (platform.indexOf("Mac") > -1) {
            platform = "mac";
}else {
            platform = "na";
};
//alert(navigator.appname);
//1

var NS = (navigator.appName == "Netscape" || navigator.product == 'Gecko') ? 1 : 0;
if (NS) document.captureEvents(Event.DBLCLICK); 
document.ondblclick = dict;
var dictvar;
function dict() { 
	if (NS) { 
		t = document.getSelection();
		pass_to_dictionary(t);
	} else { 
		t = document.selection.createRange();
		if(document.selection.type == 'Text' && t.text != ''){ 
			document.selection.empty();
			pass_to_dictionary(t.text);
		};
	}
} 
function pass_to_dictionary(text) { 
	//alert(text);	
	if (text > '') { 
		window.open('http://dictionary.cambridge.org/learnenglish/results.asp?searchword='+text+ '&dict=L', 'dict_win', 'width=650,height=400,resizable=yes,scrollbars=yes');
	};
}
window.onresize = function() {
	if(ns4up){
		document.location.reload();
	};
};
