var IE = document.all?true:false; 
if (!IE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
function getMouseXY(e) { 
	if (IE) {
		tempX = event.clientX + document.body.scrollLeft; 
		tempY = event.clientY + document.body.scrollTop; 
	} else { 
		tempX = e.pageX; 
		tempY = e.pageY; 
	}
}

function $(id) {
	return document.getElementById(id);
}

function sets(id, name, value) {
	return $(id).style[name] = value;
}

function getAC() {
	var res;
	if (window.XMLHttpRequest) {
		try {
			res = new XMLHttpRequest();
	   } catch(e) {
			res = false;
	   }
	} else if (window.ActiveXObject) {
	   try {
	   	res = new ActiveXObject("Microsoft.XMLHTTP");
	  	} catch(e) {
			try {
				res =  new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
		  		res = false;
			}
		}
	}
	return res;
}

function createMethodReference(object, method) {
    if (!(method instanceof Function)) {
        method = object[method];
	}
	
    return function () {
        method.apply(object, arguments);
    };
}

var attachEventEx = function (o, sEventName, oCallback) {
    if (typeof o.addEventListener != 'undefined') {
      o.addEventListener(
        sEventName,
        oCallback,
        false
      );
    } else if (typeof o.attachEvent != 'undefined') {
      o.attachEvent(
        'on' + sEventName,
        oCallback
      );
    }
};

function favadd(name, url) {
	if (window.sidebar) {
		window.sidebar.addPanel(name, url, "");
	} else if(window.opera && window.print) { 
		var elem = document.createElement('a');
		elem.setAttribute('href', url);
		elem.setAttribute('title', name);
		elem.setAttribute('rel', 'sidebar');
		elem.click();
	} 
	else if(document.all) {
		window.external.AddFavorite(url, name);
	}
}

function goTo(loc) {
	window.location.href = loc;
}

function otworz_okno(arg,szerokosc,wysokosc) {
	//var param='width='+szerokosc+',height='+wysokosc+',toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes';
	var param='';

	window.open(arg,"",param);

}

