function blur() {
    $(this.selector + " img.blur").fadeIn(speed);
}

function focus() {
    $(this.selector + " img.blur").fadeOut(speed);
}

function goRight() {
    $(this.selector).css("z-index", "50");
    $(this.selector).animate(
        {
            left: '383',
            width: '217',
            height: '252',
            top: '40',
            opacity: '.45'
        }, {
            duration: speed,
            specialEasing: {
                width: 'linear',
                height: 'easeOutBounce'
            },
            complete: function() {
                
            }
        }
    );
    this.position = "right";
}

function goCenter() {
    $(this.selector).animate(
        {
            left: '146',
            width: '310',
            height: '360',
            top: '10',
            opacity: '1'
        }, {
            duration: speed,
            specialEasing: {
                width: 'linear',
                height: 'easeOutBounce'
            },
            complete: function() {
                
            }
        }
    );
    $(this.selector).css("z-index", "80");
    
    this.position = "center";
}

function goBackCenter() {
    $(this.selector).css("z-index", "20");
    $(this.selector).animate(
        {
            left: '223',
            width: '155',
            height: '180',
            top: '60',
            index: '3',
            opacity: '0'
        }, {
            duration: speed,
            specialEasing: {
                width: 'linear',
                height: 'easeOutBounce'
            },
            complete: function() {
                
            }
        }
    );
    this.position = "backcenter";
}

function goLeft() {
    $(this.selector).css("z-index", "50");
    $(this.selector).animate(
        {
            left: '0',
            width: '217',
            height: '252',
            top: '40',
            opacity: '.45'
        }, {
            duration: speed,
            specialEasing: {
                width: 'linear',
                height: 'easeOutBounce'
            },
            complete: function() {
                
            }
        }
    );
    this.position = "left";
}

function moveRight() {
    switch (this.position) {
        case "left" : {
            this.goCenter();
            break;
        }
        case "center" : {
            this.goRight();
            break;
        }
        case "right" : {
            this.goBackCenter();
            break;
        }
        case "backcenter" : {
            this.goLeft();
            break;
        }
    }

}

function moveLeft() {
    switch (this.position) {
        case "left" : {
            this.goBackCenter();
            break;
        }
        case "center" : {
            this.goLeft();
            break;
        }
        case "right" : {
            this.goCenter();
            break;
        }
        case "backcenter" : {
            this.goRight();
            break;
        }
    }

}

function GImage(selector){
    this.selector = selector;
    this.position = "left";
    this.activeImageSize = 320;
    this.inactiveImageSize = 160;

    this.blur = blur;
    this.focus = focus;
    this.goRight = goRight;
    this.goCenter = goCenter;
    this.goBackCenter = goBackCenter;
    this.goLeft = goLeft;
    this.moveRight = moveRight;
    this.moveLeft = moveLeft;
}


