function searchTopQuarter(){}

searchTopQuarter.prototype.id = 0;
searchTopQuarter.prototype.name = 0;
searchTopQuarter.prototype.obj = 0;
searchTopQuarter.prototype.selected = false;

searchTopQuarter.prototype.init = function(Obj){
    var thiss = this;
    this.obj = Obj;
    this.id = Obj.attr('rel');
    this.name = Obj.html();
    $(Obj).mouseover(function(){
       thiss.over();
    });
    $(Obj).mouseout(function(){
       thiss.out();
    });
    this.obj.click(function(){
       thiss.clickk();
    });
}

searchTopQuarter.prototype.over = function(){
    searchTopShowQuarterZones(this.id);
    if(!this.selected){
        this.setSelected();
    }else{
        this.setNotSelected();
    }
}
searchTopQuarter.prototype.out = function(){
    searchTopSetNotSelectedQuarterZones(this.id);
    if(!this.selected){
        this.setNotSelected();
    }else{
        this.setSelected();
    }
}
searchTopQuarter.prototype.clickk = function(){
    if(this.selected){
        this.deselect();
    }else{
        this.select();
    }
}

searchTopQuarter.prototype.setSelected = function(){
    this.obj.removeClass('notselected');
    this.obj.addClass('selected');
}

searchTopQuarter.prototype.setNotSelected = function(){
    this.obj.addClass('notselected');
    this.obj.removeClass('selected');
}

searchTopQuarter.prototype.select = function(reload){
    if(reload == undefined){
        reload = true;
    }
    SelectedQuarter.push(this.id);
    this.selected = true;
    this.setSelected();
    if(reload){
        sendSelectedToFlashMap();
        reloadListWithMap();
    }
}

searchTopQuarter.prototype.deselect = function(reload){
    if(reload == undefined){
        reload = true;
    }
    var newSelected = new Array();
    for(var i in SelectedQuarter){
        if(SelectedQuarter[i] != this.id){
            newSelected.push(SelectedQuarter[i]);
        }
    }
    SelectedQuarter = newSelected;
    this.selected = false;
    this.setNotSelected();
    if(reload){
        sendSelectedToFlashMap();
        reloadListWithMap();
    }
}


