var swap_text_boxes = []; function init_swap_text_boxes(){ //Store the default value for each box $('input[type=text][value].swaptextbox').each(function() { swap_text_boxes[$(this).attr('id')] = $(this).attr('value'); }); //Add focus and blur events to set or clear the value $('input[type=text][value].swaptextbox').bind('focus', function() { if($(this).val() == swap_text_boxes[$(this).attr('id')]) { $(this).css('color', '#000'); $(this).css('font-style', 'normal'); $(this).val(''); } }); $('input[type=text][value].swaptextbox').bind('blur', function() { if($(this).val() == '') { $(this).css('color', '#ababab'); $(this).css('font-style', 'italic'); $(this).val(swap_text_boxes[$(this).attr('id')]); } }); } /**************************************** Barebones Lightbox Template by Kyle Schaeffer kyleschaeffer.com * requires jQuery ****************************************/ // display the lightbox function lightbox(insertContent, ajaxContentUrl){ // add lightbox/shadow
's if not previously added if($('#lightbox').size() == 0){ var theLightbox = $(''); var theShadow = $(''); $(theShadow).click(function(e){ closeLightbox(); }); $('body').append(theShadow); $('body').append(theLightbox); } // remove any previously added content $('#lightbox').empty(); // insert HTML content if(insertContent != null){ $('#lightbox').append(insertContent); } // insert AJAX content if(ajaxContentUrl != null){ // temporarily add a "Loading..." message in the lightbox //$('#lightbox').append('Loading...
'); // request AJAX content $.ajax({ type: 'GET', url: ajaxContentUrl, success:function(data){ // remove "Loading..." message and append AJAX content $('#output').empty(); $('#output').append(data); closeLightbox(); }, error:function(){ alert('AJAX Failure!'); } }); } // move the lightbox to the current window top + 100px $('#lightbox').css('top', $(window).scrollTop() + 100 + 'px'); // display the lightbox $('#lightbox').show(); $('#lightbox-shadow').show(); } // close the lightbox function closeLightbox(){ // hide lightbox and shadow 's $('#lightbox').hide(); $('#lightbox-shadow').hide(); // remove contents of lightbox in case a video or other content is actively playing $('#lightbox').empty(); } function goToByScroll(id){ $('html,body').animate({scrollTop: $('#'+id).offset().top},'slow'); } $(document).ready(function(){ // titulka zobrazeni typu zakazek $("#searcherType_1, #searcherType_2").click(function(){ id = ($(this).attr("id")).split("_"); $("#menicko_1, #menicko_2").hide(); $("#menicko_"+id[1]).css({visibility: "visible", display: "block"}).show(1268); }); //text inputy hide show value text init_swap_text_boxes(); //fancybox $("a.rel").fancybox({ "transitionIn" : "none", "transitionOut" : "none", "titlePosition" : "over", "titleFormat" : function(title, currentArray, currentIndex, currentOpts) { return 'Foto ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title :'') + ''; } }); // nemovitosti, mapove nebo seznamove hledani $("#change_map").click(function(){ if ( $(this).attr('class') == 'listing'){ lightbox('Načítám mapu nemovitostí...
', '/ajax/getmap.php?id=15&offset=1&page_name=realitni-poradna%2Farchiv-clanku%2F%2Farchiv-clanku'); $(this).css('background-position', 'left top'); $(this).removeClass(); $(this).addClass('mapping'); }else{ //lightbox('Načítám seznam nemovitostí...
', '/ajax/getlist.php'); $.ajax({ url: "/ajax/getlist.php", type: "GET", cache: false, data: "id=15&offset=1&page_name=realitni-poradna%2Farchiv-clanku%2F%2Farchiv-clanku", success: function(data){ location.reload (); } }); //location.reload (); // lightbox('Načítám seznam nemovitostí...
', '/ajax/getlist.php?'); $(this).css('background-position', 'right top'); $(this).removeClass(); $(this).addClass('listing'); } }); $(function() { $(".chci-nabidnout").fancybox({ "transitionIn" : "elastic", "transitionOut" : "elastic", "scrolling" : false, "autoDimensions" : false, "width" : "700", "height" : "440", "autoScale" : false, "type" : "inline" }); }); // nemovitosti, mapove nebo seznamove hledani $("#change_mapz").click(function(){ if ( $(this).attr('class') == 'listing'){ lightbox('Načítám mapu nemovitostí...
', '/ajax/zahranicni.php?id=15&offset=1&page_name=realitni-poradna%2Farchiv-clanku%2F%2Farchiv-clanku'); $(this).css('background-position', 'left top'); $(this).removeClass(); $(this).addClass('mapping'); }else{ //lightbox('Načítám seznam nemovitostí...
', '/ajax/getlist.php'); $.ajax({ url: "/ajax/getlist.php", type: "GET", cache: false, data: "id=15&offset=1&page_name=realitni-poradna%2Farchiv-clanku%2F%2Farchiv-clanku", success: function(data){ location.reload (); } }); //location.reload (); // lightbox('Načítám seznam nemovitostí...
', '/ajax/getlist.php?'); $(this).css('background-position', 'right top'); $(this).removeClass(); $(this).addClass('listing'); } }); //chci prodat $(function() { $("a#searcherType_3, .detail-info-interest, .get-price, .sending").fancybox({ "transitionIn" : "elastic", "transitionOut" : "elastic", "scrolling" : false, "autoDimensions" : false, "width" : "700", "height" : "440", "autoScale" : false, "type" : "inline" }); }); // $("#slider").nivoSlider({effect: "fade", pauseTime: 5000, directionNav: true, controlNav: true}); //menu $("#searcher_types li ul").hover(function(){ $(this).parent().children('a').addClass('active'); },function(){ $(this).parent().children('a').removeClass('active'); }); });