function linksOpen(url, hash, updateIDStats) { $(document).scrollTop(0); var contentCenter = $("#content_center"); //contentCenter.html($("#progress_bar").html(); contentCenter.load('progressBarr.php', function() { document.location.hash = url + hash; contentCenter.load(url + hash, function(){ contentCenter.find("a.lightbox").fancybox({'type' : 'image'}); contentCenter.find("#IS_draggable").draggable({ containment: '#IS_draggable_frame', scroll: false }); preloadImage(); contentCenter.find(".HelpCloud").mouseover(); jQuery('#colorpickerHolder').ColorPicker( { flat: true, onSubmit: function (hsb, hex, rgb) { UpdateImage(rgb); } }); }); var _hash = hash; // aktualizuje koszyk przy ka�dym prze�adowaniu strony $("#koszyk_localization").load('jquery_koszykstatsupdate.php'); addHistoryStep(url + hash); jQuery.history.load(url + hash); }); if(updateIDStats) $('#runPhpWithoutSeeingThis').load('modules/gallery/GL_updatePhotoShowsNumer.php'+hash); pageTracker._trackPageview("/"+url + hash); } // wyłapanie otwarcia zdjęcia przez klienta i update mysql jako +1 oglądany function openPhotoByClient() { } function linksOpenNoHash(url) { $(document).scrollTop(0); var contentCenter = $("#content_center"); $("#content_center").load('progressBarr.php'); $("#content_center").load(url, function(){ contentCenter.find("a.lightbox").fancybox({'type' : 'image'}); contentCenter.find("#IS_draggable").draggable({ containment: '#IS_draggable_frame', scroll: false }); contentCenter.find(".HelpCloud").mouseover(); jQuery('#colorpickerHolder').ColorPicker( { flat: true, onSubmit: function (hsb, hex, rgb) { UpdateImage(rgb); } }); }); pageTracker._trackPageview("/"+url); } function linksOpenInChoosed(url, divID) { $(document).scrollTop(0); var div = $("#"+divID); div.load('loading.php', function() { div.load(url); }); } function returnOption(element2) { var returnThis; var element = document.getElementById("ppsd"); if(element.options[0].selected) { returnThis = element.options[0].value; } if(element.options[1].selected) { returnThis = element.options[1].value; } if(element.options[2].selected) { returnThis = element.options[2].value; } if(element.options[3].selected) { returnThis = element.options[3].value; } return returnThis; } function chechRadioColors() { var formularz=document.forms[1]; len = formularz.search_color.length; for (i = 0; i < len; i++) { if (formularz.search_color[i].checked) { wartosc = formularz.search_color[i].value; } } return wartosc; } function usun_pl(text) { text = text.replace("�","a"); text = text.replace("�","A"); text = text.replace("�","o"); text = text.replace("�","O"); text = text.replace("�","l"); text = text.replace("�","L"); text = text.replace("�","n"); text = text.replace("�","N"); text = text.replace("�","z"); text = text.replace("�","Z"); text = text.replace("�","z"); text = text.replace("�","Z"); text = text.replace("�","C"); text = text.replace("�","c"); text = text.replace("�","e"); text = text.replace("�","E"); text = text.replace("�","S"); text = text.replace("�","s"); return text; } function zmienneGET(link) { var q=wyjscie=temp=wyjscie=nw=new Array(),nazwa=wartosc="",i=0; link=link+''; //zamiana na typ string np. document.location to typ object i powoduje blad if(link.indexOf('?') == -1) return false; q=link.split('?'); // funkcja wykrywania podwójnych znaków '?' i rozdzielająca zmienne mimo to poprawnie var count = 0; for (key in q) { if (q.hasOwnProperty(key)) { count++; } } count--; if(link.indexOf('&') == -1) { if(q[count].indexOf('=') == -1 ) return false; nw=new Array(); nw[0]=q[count]; } else nw=q[1].split('&'); //tablica nazw i wartosci for (;i < nw.length;i++) { temp=nw[i].split('='); nazwa=temp[0]; wartosc=temp[1]; wyjscie[nazwa]=wartosc; } return wyjscie; } function adsenseHideShow() { var screen_width = screen.width; if(screen_width >= 1280) { $("#adsense_outofframes").show(); } else { $("#adsense_outofframes").hide(); } } function showRatingPanel(ID_Zdjecia) { // ratingStars if($('div#star_'+ID_Zdjecia).is(':hidden')) { var ID = ID_Zdjecia; $('div#star_'+ID_Zdjecia).raty({ //start: 0, //hintList: ['okropne!', 'brzydkie', 'średnie', 'ładne', 'piękne'], number: 10, //readOnly: false, //scoreName: 'score', //showHalf: true, //starHalf: 'star-half.png' onClick: function(score) { var DIR_mysqlSaveScript = 'modules/gallery/starRating/SR_SaveToMYSQL.php'; var hash = '?rate='+score+'&ID_Zdjecia='+ID_Zdjecia; $('div#star_'+ID_Zdjecia).load(DIR_mysqlSaveScript + hash); } }); $('div#star_'+ID_Zdjecia).show("slow"); }else { $('div#star_'+ID_Zdjecia).hide("slow"); $('div#star_'+ID_Zdjecia).html(''); } } function chooseFormat(clickedFormat, secondwaytoDoThis) { zamowienie_element_showhide("blejtram", 1); zamowienie_element_showhide("zbity_obraz", 1); zamowienie_element_showhide("express", 1); var ID = clickedFormat.name; if(secondwaytoDoThis != '' && clickedFormat == 0) ID = secondwaytoDoThis; //alert(ID); var imgDiv_jquery = $('#form_img_'+ID); var imgDiv_js = document.getElementById('form_img_choose'); var price = $('#form_price_'+ID).val(); var price_blejtram = $('#form_price_blejtram_'+ID).val(); var price_oprawienie = $('#form_price_oprawienie_'+ID).val(); UpdateImage(null, null, null, null, 1); $('#form_kwota').html(price); $('#form_ilosc').val(1); $('#konfig_price_wydruk').html(price); $('#konfig_price_blejtram').html(price_blejtram); $('#konfig_price_oprawienie').html(price_oprawienie); $('#price_wydruk').val(price); $('#price_blejtram').val(price_blejtram); $('#price_oprawienie').val(price_oprawienie); if(ID == '150') $('#express').hide(); else $('#express').show(); var IDZdjecia = $('#curIDnbr').val(); switch(ID) { case '60': UpdateImage(null, null, null, null, 1); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); break; break; case '90': UpdateImage(null, null, null, null, 1); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); break; case '120': UpdateImage(null, null, null, null, 1); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); break; case '150': UpdateImage(null, null, null, null, 1); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=1&fulls=2"); break; case 'm': UpdateImage(null, null, null, null, 4); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=4&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=4&fulls=2"); break; case 'p': UpdateImage(null, null, null, null, 5); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=5&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=5&fulls=2"); break; case 'p2': UpdateImage(null, null, null, null, 6); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=6&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=6&fulls=2"); break; case 'p3': UpdateImage(null, null, null, null, 7); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=7&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=7&fulls=2"); break; case 't4': UpdateImage(null, null, null, null, 3); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=3&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=3&fulls=2"); break; case 't6': UpdateImage(null, null, null, null, 2); $("#hrefZoomImgDynamVis").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=2&fulls=2"); $("#hrefZoomImgDynamVis2").attr("href", "modules/gallery/IS_system/GD_Canvas.php?id="+IDZdjecia+"&format=2&fulls=2"); break; } var unClick = imgDiv_js.value; $('#form_img_'+unClick).attr('src', 'images/formaty/'+unClick+'.png' ); imgDiv_jquery.attr('src', 'images/formaty/'+ID+'c.png' ); imgDiv_js.value = ID; // scrollowanie $(document).scrollTop(400); } function rotateObject(object, angle, site) { if(site == 'left') $(object).rotateLeft(angle); if(site == 'right') $(object).rotateRight(angle); } function preloadImage() { $('.preloader').each(function() { var idImage = $(this).attr('id'); $('#preloader_'+idImage).hide(); $('#preloader_loading_'+idImage).show(); $(this).load(function() { $('#preloader_loading_'+idImage).hide(); $('#preloader_'+idImage).show('slow'); }); }); $('.HelpCloud').each(function() { var idImage = $(this).attr('id'); $('#preloader_'+idImage).hide(); $('#preloader_loading_'+idImage).show(); $(this).load(function() { $('#preloader_loading_'+idImage).hide(); $('#preloader_'+idImage).show('slow'); }); }); } /* function preloadImage() { $('.preloader').each(function() { var src_img = $(this).attr('src'); var src_loader = 'images/loading.gif'; $('.preloader').attr('src', src_loader); var cacheImage = document.createElement('img'); cacheImage.src = src_img; }); }*/ function addHistoryStep(urlNow) { var string = window.location.href; var splitet = string.split("#"); _lastURL = splitet[1]; _urlNow = urlNow; } function setHashObserver () { window.setInterval ("observeHash()", 1); } function loadFirstPage() { var contentCenter = $("#content_center"); //contentCenter.html($("#progress_bar").html(); contentCenter.load('progressBarr.php', function() { contentCenter.load('gallery.php', function(){ contentCenter.find("a.lightbox").fancybox({'type' : 'image'}); contentCenter.find("#IS_draggable").draggable({ containment: '#IS_draggable_frame', scroll: false }); preloadImage(); contentCenter.find(".HelpCloud").mouseover(); jQuery('#colorpickerHolder').ColorPicker( { flat: true, onSubmit: function (hsb, hex, rgb) { UpdateImage(rgb); } }); }); //var _hash = hash; }); //var _OnceReady = true; } function observeHash() { var string = window.location.href; var splitet = string.split("#"); if (splitet[1] != _urlNow) { var ilosc = 0; // poprawka wczytywania pierwszej strony jeśli link == index.php var splitetSlash = string.split("/"); var splitetSlashLeng = splitetSlash.length; if(splitetSlash[splitetSlashLeng-1] == 'index.php' || splitetSlash[splitetSlashLeng-1] == '' || splitetSlash[splitetSlashLeng-1] == 'index.php#' || splitetSlash[splitetSlashLeng-1] == '#') { loadFirstPage(); }else { linksOpenNoHash(splitet[1]); } _urlNow = splitet[1]; } } /* * jQuery history plugin * * The MIT License * * Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari) * Copyright (c) 2010 Takayuki Miwa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ (function($) { var locationWrapper = { put: function(hash, win) { (win || window).location.hash = this.encoder(hash); }, get: function(win) { var hash = ((win || window).location.hash).replace(/^#/, ''); try { return $.browser.mozilla ? hash : decodeURIComponent(hash); } catch (error) { return hash; } }, encoder: encodeURIComponent }; var iframeWrapper = { id: "__jQuery_history", init: function() { var html = '