function resize()
{
	var sizes = getPageSize();
	var w = sizes[0];
	var h = sizes[1];
	var target = document.getElementById("flashContent");
	
	if(w >= "970")
		target.style.width = "100%";
	else
		target.style.width = "970px";
		
	if(h >= "815")
		target.style.height = "100%";
	else
		target.style.height = "815px";
}

function dodajDoUlubionych() {

    var tytul = 'Podkarpackki Klub Golfowy';
    var adres = 'http://www.pkgolf.pl';

    //FireFox
    if (window.sidebar) { 

        window.sidebar.addPanel(tytul, adres, ""); 

    //IE
    } else if (window.external) {

        window.external.AddFavorite(adres, tytul); 

    //Opera
    } else if (window.opera && window.print) {

        var a = document.createElement('a');
        a.setAttribute('href', adres);
        a.setAttribute('title', tytul);
        a.setAttribute('rel','sidebar');
        a.click();
    }
}

function load_bg()
{
	var bd = document.getElementsByTagName("body")[0];
	var winH = 0;
	var winW = 0;
	winH = screen.height;
	winW = screen.width;
	bd.style.backgroundRepeat = "no-repeat";
	bd.style.backgroundAttachment = "fixed";
	bd.style.backgroundImage = "url('bg.php?w="+winW+"&h="+winH+"')";
}

function chgMonthKalendarzRezerwacjeSymulatora(nr)
{
		advAJAX.get({
			url: 'index.php?ajax=1&module=ajaxRezerwacjeSymulatoraKalendarz&nr='+ nr,
			onInitialization : function() 
			{
				//$( 'prawa_kalendarium' ).innerHTML = "<p style='color:#00ff00; text-align:center; padding:20px;'></p>";
				document.getElementById('prawa_kalendarium').innerHTML = "<p style='text-align:center; padding-top:100px;'><img src='tpl/images/loader.gif'></p>";
			},
			onSuccess : function(obj) 
			{
				document.getElementById('prawa_kalendarium').innerHTML = obj.responseText;
			},
			onError : function(obj) 
			{
				document.getElementById('prawa_kalendarium').innerHTML = "";
				//<p style='color:#ff0000; text-align:center; padding:20px;'>wystąpił błąd podczas ładowania danych ...</p>
			}	
		});	
}

function chgMonthKalendarzRezerwacjeSal(nr)
{
		advAJAX.get({
			url: 'index.php?ajax=1&module=ajaxRezerwacjeSalKalendarz&nr='+ nr,
			onInitialization : function() 
			{
				//$( 'prawa_kalendarium' ).innerHTML = "<p style='color:#00ff00; text-align:center; padding:20px;'></p>";
				document.getElementById('prawa_kalendarium').innerHTML = "<p style='text-align:center; padding-top:100px;'><img src='tpl/images/loader.gif'></p>";
			},
			onSuccess : function(obj) 
			{
				document.getElementById('prawa_kalendarium').innerHTML = obj.responseText;
			},
			onError : function(obj) 
			{
				document.getElementById('prawa_kalendarium').innerHTML = "";
				//<p style='color:#ff0000; text-align:center; padding:20px;'>wystąpił błąd podczas ładowania danych ...</p>
			}	
		});	
}

