function popup(id, f){
    if (!window.focus) 
        return true;
    
    window.open('/popup/' + id + '/' + f + '/', 'popupwin', 'width=520,height=500,scrollbars=yes');
    return false;
}

function roller(id){
    div = document.getElementById(id);
    
    if (div.style.display == 'block') {
        div.style.display = 'none';
    }
    else {
        div.style.display = 'block';
    }
}

$(document).ready(function(){
    // set cookie sort
    $('a.get-sort').click(function(){
        var date = new Date();
        
        date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
        
        $.cookie('sort_cookie', this.id, {
            path: '/',
            expires: date
        });
    });
	
	var searchKeyword = 'Поиск';
    
    if ($("#searchKeywords").val() != searchKeyword) {    
        $("#searchKeywords").attr("style", "color:#000");
    }
    
    $("#searchKeywords").focus(function(){    
        $(this).attr("style", "color:#000");        
        
        if ($("#searchKeywords").val() == searchKeyword) {        
            this.value = "";            
        }        
    });
    
    $('#gallery a').lightBox();
});
