// JavaScript Document



	function isIE() {
	  return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
	}
	
	function isFF() {
		return (navigator.userAgent.indexOf('Firefox') !=-1)?true:false
	}
		
	function getWidth() {
		var width;
		if (window.innerWidth) width = window.innerWidth
		else if (document.documentElement && document.documentElement.clientWidth) width = document.documentElement.clientWidth
		else if (document.body) width = document.body.clientWidth
		return width;
	}
	
	function getHeight() {
		var height;
		if (window.innerHeight) height = window.innerHeight
		else if (document.documentElement && document.documentElement.clientHeight) height = document.documentElement.clientHeight
		else if (document.body) height = document.body.clientHeight
		return height;
		
	}

	function doResizeTo(x, y) {    
    	window.resizeTo(x, y)
	}	
	
	function getScrollTop() {
		if(document.all) {
			if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop
			else if (document.body) return document.body.scrollTop;
		} 
		else return window.pageYOffset								
	}

	function showPopup(n) {
				
		var frmPopupAll = document.getElementById('FrmPopupAll')
		var frmPopup = document.getElementById('FrmPopup')
		
		if(n) {
			frmPopupAll.style.width = document.body.offsetWidth+'px';
			frmPopupAll.style.height = (isFF() || isIE())?document.body.offsetHeight+'px':getHeight()+'px';			
			frmPopup.style.left=((getWidth()/2)-350)+'px';
			frmPopup.style.top=((getHeight()/2)-210)+'px';
			//frmPopup.style.top=getScrollTop()+150+'px';
			frmPopupAll.style.display='block';
			frmPopup.style.display='block';
			window.activeMovie = n;
		} else {
			frmPopupAll.style.display='none';
			frmPopup.style.display='none';		
		}
	}	
	
	function showPopup2(n) {
        var frmPopupAll = document.getElementById('FrmPopupAll')
        var frmPopup = document.getElementById('FrmPopup2')
        if(n) {
                frmPopupAll.style.width = document.body.offsetWidth+'px';
                frmPopupAll.style.height = (isFF() || isIE())?document.body.offsetHeight+'px':getHeight()+'px';                        
                frmPopup.style.left=((getWidth()/2)-350)+'px';
                frmPopup.style.top=((getHeight()/2)-210)+'px';
                //frmPopup.style.top=getScrollTop()+150+'px';
                frmPopupAll.style.display='block';
                frmPopup.style.display='block';
        } else {
                frmPopupAll.style.display='none';
                frmPopup.style.display='none';
        }
	}    
	
	function showOnlyOncePopup2() {
		var seen = WP.mcookie.get('openid_popup2seen');
		if('true' != seen) {
			showPopup2(true);
			WP.mcookie.set('openid_popup2seen', 'true');
		}
	}
	
	function setMovie(movie) {
		var flashPlayer = document.getElementById('flashNr1')
				
		flashVars = flashPlayer.children.item(1);
		flashVars.value = '_movie='+movie+'&_advMovie=&_advClick=&_autostart=false&_smooth=true&_volume=1&_img=';
		
	}
	
	function cancelRegulation(elem) {
		
		var alert = document.getElementById('CancelRegulation')
		if (true == elem.checked ) {			
			alert.style.display='none'
		} else {
			alert.style.display='block'
		}
	}
	
	function alertRegulation() {
		
		var check = document.getElementById('chkAgree')
		if (true != check.checked ) {
			var r = window.confirm("Jesteś pewien?")
			if (r==true) {
				return true;
			} else {
				return false;
			}
		}
	}
	
	function checkAcceptation() {
		
		var check = document.getElementById('chkAgree')
		if (true != check.checked ) {			
			window.alert("Musisz wyrazić akceptację regulaminu.")
			return false;
		}
	}
	
	
	
