function MoveToItem(link) {
    // дописать код красивого перехода, пока грубо
    window.location = link.href;
}

var _itemsIndex = null;
var _itemsMax = 7;
var _currentItem = null;
var _topIndex = 8;

function FocusItem(div) {

    if (_itemsIndex == null) {
        InitIndex();
    }

    var divItem = GetItemFromDiv(div);
    
    // move current item on front
    if (divItem != _currentItem) {
        divItem.children().children().animate({ width: "130%" }, 500);
        divItem.css('zIndex', _topIndex);
        _currentItem = divItem;
    }
}

function BlurItem() {
    if (_currentItem != null) {
        _currentItem.children().children().animate({ width: "100%" }, 500);
        
        // setting original index
        var index = _itemsIndex[_currentItem.attr('class')];
        _currentItem.css('zIndex', index);
        
        _currentItem = null;
    }
}

function GetItemFromDiv(div) {
    return $('.' + div.className);
}

function InitIndex() {
    _itemsIndex = new Array(_itemsMax);
    _itemsIndex["work1"] = 7;
    _itemsIndex["work2"] = 6;
    _itemsIndex["work3"] = 5;
    _itemsIndex["work4"] = 4;
    _itemsIndex["work5"] = 3;
    _itemsIndex["work6"] = 2;
    _itemsIndex["work7"] = 1;
}