$(document).ready(function () { initSite(); $('.submit').click(function () { autosubmit($(this)); }); $('#adult .button-accept').live('click', function () { jQuery.cookie('adult', '1', {expires: 180}) $('#site').removeClass('adult'); $('#adult').remove(); }); $('#adult .button-cancel').live('click', function () { window.location = "http://www.prv.pl/"; }); $('.module-contact form .button-site').click(function () { contact($(this)); }); fixImages(); $(window).resize(function () { fixImages(); }); }); function initSite() { $('.fancybox').fancybox({ 'autoDimensions': false, 'autoScale': false, 'transitionIn': 'none', 'transitionOut': 'none', 'onComplete': function () { var oView = getViewport(); iTop = parseInt($('#fancybox-wrap').css('top')); iMargin = iTop - oView.t; if (iMargin > 100) { iMargin = iMargin - 100; $('#fancybox-wrap').css('margin-top', '-' + iMargin + 'px'); } } }); $('.module-maps').each(function () { aMaps = []; aMarkers = []; aPoints = []; sId = $(this).children('.module-map-content').attr('id'); sLat = $(this).children('.map-settings').children('.lat').attr('value'); sLng = $(this).children('.map-settings').children('.lng').attr('value'); sZoom = $(this).children('.map-settings').children('.zoom').attr('value'); sHeight = $(this).children('.map-settings').children('.height').attr('value'); $(this).children('.map-settings').children('.points').each(function () { aPoints.push($(this).attr('value')); }); oCoords = new google.maps.LatLng(sLat, sLng); oMapOptions = { zoom: parseInt(sZoom), center: oCoords, mapTypeId: google.maps.MapTypeId.ROADMAP, streetViewControl: true, mapTypeControl: true }; aMaps[sId] = new google.maps.Map(document.getElementById(sId), oMapOptions); if (aPoints.length > 0) { for (i = 0; i < aPoints.length; i++) { aPoint = aPoints[i].split("|"); oCoords = new google.maps.LatLng(aPoint[0], aPoint[1]); aMarkers[i] = new google.maps.Marker({ position: oCoords, map: aMaps[sId], title: aPoint[2], }); } } }); $('.module-slider').each(function () { sId = $(this).children('.blueberry').attr('id'); sInterval = $(this).children('.slider-settings').children('.interval').attr('value'); sHeight = $(this).children('.slider-settings').children('.height').attr('value'); sDuration = $(this).children('.slider-settings').children('.duration').attr('value'); $('#' + sId).blueberry({ interval: sInterval, duration: sDuration }); }); $('.module-album a').each(function () { if ($(this).hasClass('fancybox')) { $(this).attr('rel', 'list'); } sHref = $(this).attr('href'); var iPos = sHref.indexOf("reklamy.sterta.pl"); if (iPos > -1) { sHref = $(this).children('img').attr('src').replace('thumb', 'big'); $(this).attr('href', sHref); } }); $('.module-album .thumb').css('background', 'inherit'); $('.module-album .thumb a').fadeToggle(600).css('display', 'inline-block'); sUri = window.location.pathname.substr(1); $('.main-menu li').each(function () { if ($(this).children('a').attr('href') == "/" + sUri) { $(this).addClass('active'); } }); if ($('#site').hasClass('adult') && jQuery.cookie('adult') == null) { sInfo = 'Strona na którą wchodzisz może zawierać treści wulgarne, obraźliwe lub przeznaczone dla osób pełnoletnich. Wchodząc na stronę potwierdzasz, że masz ukończone 18 lat i wchodzisz na własną odpowiedzialność.'; $('#contentSite').after('