
/* ----- custom.js ----- */
function switchDisplayMode(x) {
 if(document.getElementById(x).style.display=='none') document.getElementById(x).style.display='block';
 else {document.getElementById(x).style.display='none';}
}

function offer(path) {
 width = 660;
 height = 550;
 var winWidth = (screen.width - width) / 2;
 var winHeight = (screen.height - height) / 2;
 winprops = 'width='+width+',height='+height+',top='+winHeight+',left='+winWidth;
 var w = window.open('http://ext.makro.pl/'+path,'',winprops);
 w.focus();
}
function oferta(a,b) {offer(a+'/'+b);}

function addBookmark() {
        var url = window.location.href;
        var title = document.title;
        //var title = 'Makro Cash and Carry Polska S.A.';  
        //var url = url
        if (window.sidebar && window.sidebar.addPanel) { // firefox
                  window.sidebar.addPanel(title, url,"");
        } else if( document.all ) { //MSIE
                window.external.AddFavorite( url, title);
        } else {
               alert("Sorry, your browser doesn't support this");
        }
}


function mapka(mm, str, kat) {
		width = 660;
		height = 550;
		var winWidth = (screen.width - width) / 2;
		var winHeight = (screen.height - height) / 2;
		winprops = 'width='+width+',height='+height+',top='+winHeight+',left='+winWidth;
		neww = window.open('mapka-'+mm+'.php?kat='+kat+'&str='+str,'mapka_'+mm,winprops);
		neww.focus();
	}

function getDraftCookie(lng) {
	var all = document.cookie.split(';');
	for(var i=0;i < all.length;i++) {
		var c = all[i].split('=');
                while (c[0].charAt(0)==' ') c[0] = c[0].substring(1, c[0].length);
                if (c[0] == 'draft'+lng) return c[1].split('!').length
	}
	return 0;
}
	
