function Init() {
	EventsInit();
}

function InitAfterHTML() {
	
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

function GetScreenSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ parseInt(myWidth), parseInt(myHeight) ];
}

function getMousePosition(ev) {
	function processEvent(e) { // catches and processes the mousemove event 
		if (isIE) { // for IE
			y = window.event.y+document.body.scrollTop;
			x = window.event.x+document.body.scrollLeft;
		} else { // for Navigator
			y = e.pageY;
			x = e.pageX;
		}
	}
var isIE = false,isNav = false
if (document.all) {
	isIE = true
}
					
	processEvent(ev);
	return [ parseInt(x) , parseInt(y) ];
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function CheckRegex(str, typ) {
	if (typ == 'godzina')    var regex = /^[0-9]{1,2}[/:]{1}[0-9]{1,2}$/;
	else if (typ == 'data')  var regex = /^[0-9]{4}(-[0-9]{2}){2}$/;
	else if (typ == 'email') var regex = /^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/;
	else if (typ == 'login') var regex = /^[a-zA-Z0-9\-_]{3,20}$/;
	else if (typ == 'haslo') var regex = /^[a-zA-Z0-9\-_]{6,20}$/;
	else return false;
	if (regex.test(str) == true) return true;
	else return false;
}

function EventsInit() {
	var xy = GetScreenSize();
	var allxy = parseInt($('#All').height());
	//alert(xy[1] + ' / ' + allxy);
	if (allxy < parseInt(xy[1]))
	{
		$('#Footer').css('position', 'absolute');
		$('#Footer').css('top', xy[1] - 94 + 'px');
	}
}

	window.mX = 0;
	window.mY = 0;

if (window.addEventListener) {
	window.addEventListener("load", Init, false);
}else if (window.attachEvent) {
	window.attachEvent("onload", Init);
}

