  
   
	
	
    
    var folio_caption_fade_speed = 300;
    var folio_mask_fade_slidedown_speed = 300;
    var folio_desc_fade_speed = 300;
    var folio_photos_bg_fade_speed = 1000;
    var folio_photos_gal_fade_speed = 500;
    var prev_scroll_top = 0;

    function update_photos_events() {
        if (menu_timeout_open) clearTimeout(menu_timeout_open);
        $("#nav div").hide();
        $(".big_gallery", current_album).show().css('visibility', 'hidden');
        if (1) $('.multipics', current_album).masonry({
            columnWidth: 240,
            itemSelector: '.go_pic',
            animate: false
        });
        $(".big_gallery", current_album).css('visibility', 'visible').hide();
        if ($.browser.opera || $.browser.msie && $.browser.version < 8) {
            $('#bg').css({
                'display': 'none'
            })
        }
        Cufon('.big_gallery h1', {
            fontWeight: 'bold',
            color: '-linear-gradient(#f5f2eb, 0.3=#f5f2eb, #a6a39d)',
            textShadow: '0 -2px #000'
        });
        Cufon('.go_back', {
            fontWeight: 'bold',
            color: '-linear-gradient(#473e2b, 0.4=#473e2b, #1c1a19)',
            textShadow: '0 1px #fff'
        });
        $(".big_gallery .go_back").unbind().click(function () {
            if ($.browser.opera) $(document).unbind('mousewheel');
            $(".big_gallery").fadeOut(folio_photos_gal_fade_speed, function () {
                $(".big_gallery_bg").fadeOut(folio_photos_bg_fade_speed, function () {
                    $("html:not(:animated)" + (!$.browser.opera ? ",body:not(:animated)" : "")).animate({
                        scrollTop: prev_scroll_top
                    }, 500, function () {
                        $('#bg').css({
                            'height': 'auto',
                            'overflow': 'visible'
                        });
                        if ($.browser.opera || $.browser.msie && $.browser.version < 8) {
                            $('#bg').css({
                                'display': 'block'
                            })
                        }
                    })
                })
            });
            return false
        });
        if (!$.browser.msie) {
            $(".multipics a i").css({
                display: 'block',
                opacity: 0
            });
            $(".multipics a").hover(function () {
                $("i", this).animate({
                    opacity: 1
                }, {
                    duration: 500,
                    queue: false
                })
            }, function () {
                $("i", this).animate({
                    opacity: 0
                }, {
                    duration: 500,
                    queue: false
                })
            })
        }
        $(".go_pic").each(function () {
            $(this).attr("rel", "gal[g]").attr("title", "")
        });
        $("a[rel=gal\\[g\\]]").prettyPhoto({
            theme: 'light_rounded'
        })
    }
   
   var current_album = false;
    $(function () {
        if (!$(".folio").length) return;
        $(".folio").each(function () {
            var box = $(this);
            box.click(function () {
                var cl = box.parent().attr("class").replace(/^.*for_(post_[0-9]+).*$/, '$1');
                current_album = $("." + cl);
                if (!current_album.length) alert("Album not found (." + cl + ")");
                prev_scroll_top = $(window).scrollTop();
                $(".big_gallery", current_album).hide();
                $(".big_gallery_bg", current_album).css({
                    display: 'block',
                    opacity: 1,
                    visibility: 'visible',
                    'height': $("#bg").height() + "px",
                    'min-height': $(window).height() + "px",
                    top: 0
                }).hide().fadeIn(folio_photos_bg_fade_speed, function () {
                    update_photos_events();
                    $("html:not(:animated)" + (!$.browser.opera ? ",body:not(:animated)" : "")).animate({
                        scrollTop: 0
                    }, 500, function () {
                        var hh = $(".big_gallery", current_album).height() + 118;
                        if (hh < $(window).height()) hh = $(window).height();
                        $("#bg, .big_gallery_bg").css({
                            height: hh + "px",
                            overflow: 'hidden'
                        })
                    });
                    $(".big_gallery", current_album).hide().fadeIn(folio_photos_gal_fade_speed)
                });
                return false
            });
            box.hover(function () {
                if ($.browser.msie) {
                    $(".folio_just_caption", box).css({
                        visibility: 'hidden'
                    });
                    $(".folio_mask", box).css({
                        display: 'block',
                        height: '100%'
                    })
                } else {
                    $(".folio_just_caption", box).animate({
                        opacity: 0
                    }, {
                        queue: false,
                        duration: folio_caption_fade_speed
                    });
                    var to_height = $(".folio_mask", box).css('height', '100%').height();
                    $(".folio_mask .folio_desc", box).hide();
                    $(".folio_mask", box).css({
                        display: 'block',
                        height: 0,
                        opacity: 0
                    }).animate({
                        height: to_height,
                        opacity: 1
                    }, {
                        queue: false,
                        duration: folio_mask_fade_slidedown_speed,
                        complete: function () {
                            $(".folio_desc", box).css({
                                display: 'block',
                                opacity: 0
                            }).animate({
                                opacity: 1
                            }, {
                                queue: false,
                                duration: folio_desc_fade_speed,
                                complete: function () {
                                    if ($.browser.msie) this.style.removeAttribute('filter')
                                }
                            })
                        }
                    })
                }
            }, function () {
                if ($.browser.msie) {
                    $(".folio_just_caption", box).css({
                        visibility: 'visible'
                    });
                    $(".folio_mask", box).css({
                        display: 'none',
                        height: '100%'
                    })
                } else {
                    $(".folio_mask", box).animate({
                        height: 0,
                        opacity: 0
                    }, {
                        queue: false,
                        duration: folio_mask_fade_slidedown_speed
                    });
                    $(".folio_just_caption", box).animate({
                        opacity: 1
                    }, {
                        queue: false,
                        duration: folio_caption_fade_speed
                    })
                }
            })
        })
    });
	
    $(function () {
        $('.folio, .folio_mask, .folio_caption, .folio_just_caption').each(function () {
            if ($.browser.msie) PIE.attach(this)
        })
    });
	
$(function () {								
	$("input[title!='']").each( function() {    	
    	 var ttl = $(this).attr('title');    
	 	$(this).val(ttl);
	 	$(this).click(function(){ if($(this).val()==ttl)$(this).val(''); });		
	 	$(this).blur(function(){ if($(this).val()=='')$(this).val(ttl); });
	});							
})
