

<!--

<!--
var locProdInfo;
function callExternalInterface(movie) {
 getMovieName("intro").changeVideoContent(movie);
}
function getMovieName(movieName) {
 if (window[movieName]) {
  if (window[movieName].id != undefined){
   return window[movieName];
  }
  else {
   x = window[movieName];
   return x;
  }
 }
 else if (document[movieName]){
  return document[movieName];
 }
 else {
 }
}
function checkAge(){
			/* the minumum age you want to allow in */
			var min_age = 18;
			var loc = document.location.href;
			var fd = loc.search('dev');
            if(fd<1){
				site_loc = 'http://tyskie.pl/';
			}
			else{
				site_loc = 'http://dev.tyskie.pl/';
			}
			/* change "age_form" to whatever your form has for a name="..." */
			var year = parseInt($('#y').attr('rel'));
			var month = parseInt($('#m').attr('rel'));
			var day = parseInt($('#d').attr('rel'));
			var theirDate = new Date((year + min_age), month, day);
			var today = new Date;
			if ( (today.getTime() - theirDate.getTime()) < 0) {
				//alert("You are too young to enter this site!");
				return false;
			}
			else {
				document.location.href = site_loc+'setCookie?lang=en';
				return true;
			}
		}
		function descSetup(valId, slId){
			Yperc = $('#'+slId+' .ui-slider-handle').css('left');
			Yperc = parseInt(Yperc)/100;
			var rowWidth = 385;
			if(slId){
				rowWidth = 388;
			}
			$('#'+valId).css({'marginLeft':Yperc*rowWidth+'px'});
		}
		function documentSize() {
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = window.innerWidth + window.scrollMaxX;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }
    var windowWidth, windowHeight;
    if (self.innerHeight) {	// all except Explorer
        if (document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        } else {
            windowWidth = self.innerWidth;
        }
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }
    // for small pages with total height less then height of the viewport
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }
    // for small pages with total width less then width of the viewport
    if (xScroll < windowWidth) {
        pageWidth = xScroll;
    } else {
        pageWidth = windowWidth;
    }
    var viewportwidth;
    var viewportheight;

    // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

    if (typeof window.innerWidth != 'undefined') {
        viewportwidth = window.innerWidth;
      viewportheight = window.innerHeight;
    }

    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

    else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0) {
        viewportwidth = document.documentElement.clientWidth;
       viewportheight = document.documentElement.clientHeight;
    }

    // older versions of IE

    else {
        viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
       viewportheight = document.getElementsByTagName('body')[0].clientHeight;
    }
    return [pageWidth, pageHeight, viewportheight];
}
$(document).ready(function(){
//$('.sprawdzpromile a').attr({'title':'www.abcalkoholu','href':'http://www.abcalkoholu.pl'});
 $("#flashMovies a").click(function(){
  callExternalInterface($(this).attr("rel"));
  $("#flashMovies a").removeClass();
  $(this).addClass("active");
  return false;
 });
 if($('#new_age').length>0){
		$(window).bind('resize', function () {
			docW  = documentSize();
			//if(docW[0]<
			if(docW[0]<740){
				//leftPos = 1060 - docW[0];
				leftPos = (740-docW[0])/2;
				//$('#contentWrapper').css({'backgroundPosition':'-'+leftPos+'px -43px'});
				$('#content').css({'marginLeft':'-'+leftPos+'px'});
			}
			else{
				$('#content').css({'margin':'0 auto'});
				//$('#contentWrapper').css({'backgroundPosition':'50% -43px'});
			}
		});
		 $(window).resize(function () {
			if (this.resizeTO) clearTimeout(this.resizeTO);
			this.resizeTO = setTimeout(function () {
				$(this).trigger('resize');
			}, 50);
		});
		$(window).trigger('resize');
		Cufon.replace(('.age_row span, .value, #total span, #total_desc span'), {fontFamily: 'Myriad Pro', hover: true});
		Cufon.now();
		var miesiace = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
		var started = [false,false,false];
		var Yperc;
		var t;
		var tt;
		$('#a_year').slider({
			min: 1900,
			max:2000,
			start: function(){
				$('#y_value').css({'display':'block'});
				$('#d_y').css({'visibility':'visible'});
			},
			slide: function(event, ui) {
				$('#y_value').html(ui.value);//.css({'marginLeft':Yperc*351+'px'});
				$('#y').html(ui.value).attr('rel',ui.value);
				Cufon.refresh();
				started[0] = true;
				descSetup('y_value','a_year');
				
			},
			stop:function(event,ui){
				if(started[0]===true&&started[1]===true&&started[2]===true){
					checkAge();
				}
				descSetup('y_value','a_year');
				$('#y_value').css({'display':'none'});
			},
			change: function(){
				descSetup('y_value','a_year');
			}
		});
		$('#a_month').slider({
			min:1,
			max:12,
			start:function(){
				t = setInterval(function(){descSetup('m_value','a_month');},50);
				$('#m_value').css({'display':'block'});
				$('#d_m').css({'visibility':'visible'});
			},
			slide: function(event, ui) {
				descSetup('m_value','a_month');
				$('#m_value').html(miesiace[ui.value-1]);
				var v = ui.value;
				if (v<10){
					v = '0'+v;
				}
				$('#m').html(v).attr('rel',v);
				Cufon.refresh();
				started[1] = true;
				
			},
			stop:function(){
				if(started[0]===true&&started[1]===true&&started[2]===true){
					checkAge();
				}
				descSetup('m_value','a_month');
				clearInterval(t);
				$('#m_value').css({'display':'none'});
			},
			change: function(){
				descSetup('m_value','a_month');
			}
		});
		$('#a_day').slider({
			min: 1,
			max:31,
			start:function(){
				t = setInterval(function(){descSetup('d_value','a_day');},50);
				$('#d_value').css({'display':'block'});
				$('#d_d').css({'visibility':'visible'});
			},
			slide: function(event, ui) {
				$('#d_value').html(ui.value);
				var v = ui.value;
				if (v<10){
					v = '0'+v;
				}
				$('#d').html(v).attr('rel',v);
				Cufon.refresh();
				started[2] = true;
				descSetup('d_value','a_day');
				
			},
			stop:function(){
				if(started[0]===true&&started[1]===true&&started[2]===true){
					checkAge();
				}
				descSetup('d_value','a_day');
				clearInterval(tt);
				$('#d_value').css({'display':'none'});
			},
			change: function(){
				descSetup('d_value','a_day');
			}
		});
		
	}
 $('#slider').accordion();
 $('.prodWrapper').slider();
 $('.prodWrapper .prodFotos a').click(function() {
  var that = $(this);
  var locHTML = that.attr('rel');
  if($('.prodImg img').attr('src')!==locHTML){
	  $('#prodInfo .prodImg img').fadeOut(function(){
	  var c = $(this);
	   c.load(function(){
	   $(this).fadeIn();
	   }).attr('src',locHTML);
	  });
  }
  return false;
 });
/*
 $("#newsletter").submit(function(){
 var f = $(this);
 $("input#newsletter_save", f).val((newsletterSave === true) ? "save" : "delete");
 
 $.ajax({
  url: f.attr("action"),
  data: f.serialize(),
  dataType: "json",
  type: "post",
  beforeSend: function(){
   $(":text", f).removeClass("error");
  },
  success: function(re){
   if (re.result === false) {
    $(":text", f).addClass("error");
    newsletterSave = true;
   } else {
    window.location = "/dziekujemy.html";
   }
  },
  error: function(){
   alert("Przepraszamy! Problemy z serwerem.");
   newsletterSave = true;
  }
 });
 return false;
 });
*/
 function request() {
  var bodyHeight = $('body').height();  
  var body = $('body');
  body.prepend('<div id="layer"><!-- --></div>');
  var layer = $('body #layer');
  layer.css({'height': '100%','opacity': 0.6});
  layer.fadeIn('slow');
 }
 $("#newsletter input.submit").click(function(){
  request();
  var top = $('body');
  top.prepend('<div id="layerContent"><p class="text">I hereby give consent for the processing of my personal data for marketing purposes by Kompania Piwowarska S.A., ul. Szwajcarska 11, 61-285 Poznań, Poland, or entities acting at Kompania Piwowarska S.A.’s request, in accordance with the Polish Act of 29 August 1997 on Personal Data Protection (Dz. U. [Polish Journal of Laws] of 2002, No. 101, item 926, as amended). I understand that I have the right to access my personal data, right to amend them and object to their processing, and any provision of data is voluntary. I agree to receive information in electronic form, including by e-mail and text message.</p><p class="buttons english"><a href="#" class="tak"></a><a href="#" class="nie"></a></p></div>');
  var layerContent = $('#layerContent');
  layerContentWidth = layerContent.width();
  layerContentHeight = layerContent.height();
  var contentWidth = top.width();
  var center = (contentWidth-layerContentWidth)/2;
  layerContent.css({'left':center});
  layerContent.fadeIn('slow');
  return false;
 });
 layerContentNie = $('#layerContent a.nie');
 layerContentNie.live('click',function() {
  cleanUp();
  cleanLayerContent();
  return false;
 });
 layerContentNie = $('#layerContent a.tak');
 layerContentNie.live('click',function() {
  cleanUp();
  cleanLayerContent();
  newSave();
  return false;
 });
 var newsletterSave = true;
 $("#newsletter a.signOut").click(function(){
  newsletterSave = false;
  var f = $('#newsletter');
  $("input#newsletter_save", f).val((newsletterSave === true) ? "save" : "delete");
  $.ajax({
   url: f.attr("action"),
   data: f.serialize(),
   dataType: "json",
   type: "post",
   beforeSend: function(){
    $(":text", f).removeClass("error");
   },
   success: function(re){
    if (re.result === false) {
     $(":text", f).addClass("error");
     newsletterSave = true;
    }
    else {
     window.location = "/en/thanks.html";
    }
   },
   error: function(){
    alert("Przepraszamy! Problemy z serwerem.");
    newsletterSave = true;
   }
  });
  return false;
 });
 function newSave() {
  var f = $('#newsletter');
  $("input#newsletter_save", f).val((newsletterSave === true) ? "save" : "delete");
  $.ajax({
   url: f.attr("action"),
   data: f.serialize(),
   dataType: "json",
   type: "post",
   beforeSend: function(){
    $(":text", f).removeClass("error");
   },
   success: function(re){
    if (re.result === false) {
     $(":text", f).addClass("error");
     newsletterSave = true;
    }
    else {
     window.location = "/en/thanks.html";
    }
   },
   error: function(){
    alert("Przepraszamy! Problemy z serwerem.");
    newsletterSave = true;
   }
  });
  return false;
 }
 function cleanUp() {
  var layer = $('body #layer');
  layer.fadeOut('slow', function() { layer.remove(); });
  var layerContent = $('body #layerContent');
  layerContent.fadeOut('slow', function() { layerContent.remove(); });
 }
 function cleanLayerContent() {
  var layerContent = $('body #layerContent');
  layerContent.fadeOut('slow', function() { layerContent.remove(); });
 }
 $("#kontaktform").submit(function(){
  var f = $(this);
  $.ajax({
   url: f.attr("action"),
   data: f.serialize(),
   dataType: "json",
   type: "post",
   beforeSend: function(){
    $(".error:text, textarea.error", f).removeClass("error");
   },
   success: function(re){
    if (re.result === false) {
     $.each(re.message, function(id, val){
      $("[name=contact[" + id + "]]", f).addClass("error");
     });
    }
    else {
     $("#kontaktbox").children().fadeOut("fast", function(){
      $("p.thanks").fadeIn("fast");
     });
    }
   },
   error: function(){
    alert("Przepraszamy! Problemy z serwerem.");
   }
  });
  return false;
 });
 
});
//-->
//-->

