/// <reference path="jquery-1.4.2.min-vsdoc.js" />

$.fn.ccmenu = function(options) {
    //settings
    var settings = $.extend({
        cutat: 3 //the number of items that will remain in the old menu 
    }, options);

    //manipulating settings
    settings.cutat = settings.cutat - 1;

    //selectors
    $t = $(this).children('ul.left');

    //creating new menu
    var newmenu = $('<ul />').attr('class', 'right').insertAfter($t);

    //removing list objects from old menu and places them in the new menu
    $t.children('li:gt(' + settings.cutat + ')').appendTo(newmenu);
    $t.children('li:last-child').children('a').attr('class', 'last');

    return this;
}
