

// send the class to select, then the class all of the classes have
function checkByClass(select_class, all_class){
	selectNoneByClass(all_class);
    
    var slider_el = $$('.' + select_class);
    slider_el.each(function(el, i){
        el.checked = true;
    });
    
}


function selectNoneByClass(class_name){
    var slider_el = $$('.' + class_name);
    slider_el.each(function(el, i){
        el.checked = false;
    });
}


function doAjax(targetURL, targetContainer){
    $(targetContainer).innerHTML = '';
    $(targetContainer).addClass('ajaxLoading');
    
    var fxBlink = function(){
        var box = $(this.options.update);
        var fx = new Fx.Style(box, 'background', {
            duration: 5000,
            transition: Fx.Transitions.Quad.easeOut
        }).start('#CC0000', '#000000');
    };
    
    new Ajax(targetURL, {
        method: 'post',
        evalScripts: true,
        onComplete: fxBlink,
        update: $(targetContainer)
    }).request();
    $(targetContainer).removeClass('ajaxLoading');
}

function doAjaxPost(sourceForm, targetContainer){

    // lets tie the var to the containers name
    var sourceForm = $(sourceForm);
    
    // tie the name of the container to call to also give the 
    // ability to change the container to a loading stage. 
    var targetContainer = $(targetContainer);//.empty().addClass('ajaxLoading');
    // targetContainer.addClass('ajaxLoading');
    sourceForm.send({
        evalScripts: true,
        update: targetContainer,
        onComplete: function(){
            // targetContainer.removeClass('ajaxLoading');
        }
    });
}

function showResponse(request){
    //  alert(request);
};

