﻿
$(document).ready(function(){
    var search = $(".searchInput").val();
    $(".searchInput").focus(function(){
        $(this).css("color", "black");
        if ($(this).val() == search) {
            $(this).val("");
        }
    }).blur(function(){
        if ($(this).val() == "") {
            $(this).css("color", "#969696");
            $(this).val(search);
        }
    });

    $('.showMap').click(function(){
        var map = $(this).attr('id').replace(/map_/ig, "");
        $('.showMap').removeClass('active');
        $(this).addClass('active');
        $('.maps').hide();
        $('#'+map).fadeIn();
        return false;
    });
});



jQuery(document).ready(function() {
						
				/*	$().piroBox({
							my_speed: 400, //animation speed
							bg_alpha: 0.1, //background opacity
							slideShow : true, // true == slideshow on, false == slideshow off
							slideSpeed : 4, //slideshow duration in seconds(3 to 6 Recommended)
							close_all : '.piro_close,.piro_overlay'// add class .piro_overlay(with comma)if you want overlay click close piroBox

					});*/

				});
				
				
function update_photo_nav() {
	if ($('#exact_preview_image_shadow').size() == 0) { return; }

	if (photo_current == 0) { $('#prev_photo_button').hide(); }
	else { $('#prev_photo_button').show(); }
	
	if (photo_current == photo_count - 1) { $('#next_photo_button').hide(); }
	else { $('#next_photo_button').show(); }
	
	if (photo_current == 0) { photo_postfix = ''; }
	else { photo_postfix = '_' + photo_current; }
	
	$('#exact_preview_image_shadow').attr('src', photo_url + photo_postfix + '.jpg');
	
	$('.exact_thumb_image_shadow').removeClass('activ');
	$('#exact_thumb_image_shadow_' + photo_current).addClass('activ');
}

function next_photo_nav() {
	photo_current++;
	if (photo_current > photo_count - 1) {
		photo_current = 0;
	}
	update_photo_nav();
}

function prev_photo_nav() {
	photo_current--;
	if (photo_current < 0) {
		photo_current = photo_count - 1;
	}
	update_photo_nav();
}

$().ready(update_photo_nav);

function display_big_photo(id) {
	$(".photoBig").html('<a href="/up_img/verybig_'+$("#"+id).attr("class")+'" class="pirobox" onclick="$(\'#min_'+id+'\').click(); return false;"><img src="/up_img/big_'+$("#"+id).attr("class")+'"></a>');		
}
