jQuery.noConflict();
jQuery(document).ready(function(){
    jQuery('#colorpicker #openbtn').click(function(evnt){
        jQuery('#colorpicker').animate({marginLeft:"0px"}, "slow" );
        jQuery(this).hide();
        jQuery(this).next('#closebtn').show();
    });
    jQuery('#colorpicker #closebtn').click(function(evnt){
        jQuery('#colorpicker').animate({marginLeft:"-137px"}, "slow" );
        jQuery(this).hide();
        jQuery(this).prev('#openbtn').show();
    });
    
});
// Ratio is between 0 and 1
var changeColor = function(color, ratio, darker) {
    var difference = Math.round(ratio * 255) * (darker ? -1 : 1),
        decimal    = color.replace(
            /^#?([a-z0-9][a-z0-9])([a-z0-9][a-z0-9])([a-z0-9][a-z0-9])/i,
            function() {
                return parseInt(arguments[1], 16) + ',' +
                    parseInt(arguments[2], 16) + ',' +
                    parseInt(arguments[3], 16);
            }
        ).split(/,/);
    return [
        '#',
        pad(Math.max(parseInt(decimal[0], 10) + difference, 0).toString(16), 2),
        pad(Math.max(parseInt(decimal[1], 10) + difference, 0).toString(16), 2),
        pad(Math.max(parseInt(decimal[2], 10) + difference, 0).toString(16), 2)
    ].join('');
};
var lighterColor = function(color, ratio) {
    return changeColor(color, ratio, false);
};
var darkerColor = function(color, ratio) {
    return changeColor(color, ratio, true);
};
function changeCSS(tempValue){
	jQuery('head').append('<link rel="stylesheet" href="http://veritas.gothemeteam.com/wp-content/themes/veritas/js/toolbar/css/'+tempValue+'" type="text/css"/>');
}
