
var przeg, wer, ds, dw;
var nazwa = navigator.appName;
var agent = navigator.userAgent;

var isNS6 = ((document.getElementById&&!document.all) ? true : false);
var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

// podstawowe dane przegladarki
function sprawdzPrzegladarke() {
	if (agent.indexOf("Opera") != -1) { przeg = "Opera"; }
	else if (nazwa.indexOf("Microsoft") != -1 && agent.indexOf("Opera") == -1) { przeg = "MSIE"; }
	else if (nazwa.indexOf("Netscape") != -1 && agent.indexOf("Netscape") != -1) { przeg = "Netscape"; }
	else if (nazwa.indexOf("Netscape") != -1 && agent.indexOf("Netscape") == -1) { przeg = "Mozilla"; }
	else { przeg = "Inna"; }

	wer = navigator.appVersion.substr(0, navigator.appVersion.indexOf(" "));
	wer = parseInt(wer);
}

function layer_get(id) {
	var obj;
	if (isDOM || isNS6) { obj = document.getElementById(id); }
	else if (isNS4) { obj = document.layers[id]; }
	else { obj = document.all[id]; } // document.all && !isDOM
	return (obj);
}

function layer_obj(id) {
	obj = layer_get(id);
	if (obj.style) { obj = obj.style; }
	return (obj);
}

function layer_put(id, opis) {
	if (document.layers) { // zapis do starego netscape
		
	}
	else {
		obj = layer_get(id);
		obj.innerHTML = opis;
	}
}


// zmiana widocznosci
function layer_do(id, v) {
	obj = layer_obj(id);
	obj.visibility = v;
}

// zmiana koloru
function layer_kolor(id, kolor) {
	obj = layer_obj(id);
	if (!document.layers) { obj.backgroundColor = kolor; }
	else { obj.bgColor = kolor; }
}


// aktywacja / deaktywacja pol formularzy
function Active(id) {
	if(!document.layers) { id.style.backgroundColor='#FFFFFF'; }
	else { id.bgColor = '#FFFFFF'; }
}

function NotActive(id) {
	if(!document.layers) { id.style.backgroundColor='#E0EBE0'; }
	else { id.bgColor = '#E0EBE0'; }
}

