/*
Background Color Fading
*/
var rndc_ceiling = 100;   // color saturation - max 255
var rndc_speed = 800;     // refresh time  (ms)
var rndc_step = 1;       //  step (1 progressive, 50 quick)
$(document).ready(function(){
// color start
var rndc_red   = Math.floor(Math.random() * rndc_ceiling);
var rndc_green = Math.floor(Math.random() * rndc_ceiling);
var rndc_blue  = Math.floor(Math.random() * rndc_ceiling);
// color target
var rndc_red2   = Math.floor(Math.random() * rndc_ceiling);
var rndc_green2 = Math.floor(Math.random() * rndc_ceiling);
var rndc_blue2  = Math.floor(Math.random() * rndc_ceiling);
randomColor();
function randomColor() {
// R
if (Math.abs(rndc_red2-rndc_red)>rndc_step) rndc_red += ((rndc_red2-rndc_red)/Math.abs(rndc_red2-rndc_red)) * rndc_step;
else rndc_red = rndc_red2;
// G
if (Math.abs(rndc_green2-rndc_green)>rndc_step) rndc_green += ((rndc_green2-rndc_green)/Math.abs(rndc_green2-rndc_green)) * rndc_step;
else rndc_green = rndc_green2;
// B
if (Math.abs(rndc_blue2-rndc_blue)>rndc_step) rndc_blue += ((rndc_blue2-rndc_blue)/Math.abs(rndc_blue2-rndc_blue)) * rndc_step;
else rndc_blue = rndc_blue2;
if (rndc_red==rndc_red2  && rndc_green==rndc_green2 && rndc_blue==rndc_blue2) {
rndc_red2   = Math.floor(Math.random() * rndc_ceiling);
rndc_green2 = Math.floor(Math.random() * rndc_ceiling);
rndc_blue2  = Math.floor(Math.random() * rndc_ceiling);
}
if ($(".randombgcolor")) $(".randombgcolor").css("background-color","rgb("+rndc_red+","+rndc_green+","+rndc_blue+")");
var t = setTimeout(randomColor,rndc_speed);
}
});
/*
Icon Tooltips
*/
$(document).ready(function(){
$(".icon-t-popup a").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show", top: "-45"}, "slow");
}, function() {
$(this).next("em").animate({opacity: "hide", top: "-55"}, "fast");
});
$(".icon-l-popup a").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show", top: "-45"}, "slow");
}, function() {
$(this).next("em").animate({opacity: "hide", top: "-55"}, "fast");
});
$(".icon-f-popup a").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show", top: "-45"}, "slow");
}, function() {
$(this).next("em").animate({opacity: "hide", top: "-55"}, "fast");
});
$(".icon-fb-popup a").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show", top: "-45"}, "slow");
}, function() {
$(this).next("em").animate({opacity: "hide", top: "-55"}, "fast");
});
$(".icon-d-popup a").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show", top: "-45"}, "slow");
}, function() {
$(this).next("em").animate({opacity: "hide", top: "-55"}, "fast");
});
$(".icon-e-popup a").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show", top: "-45"}, "slow");
}, function() {
$(this).next("em").animate({opacity: "hide", top: "-55"}, "fast");
});
});
/*
Table Row Banding
*/
$(document).ready(function() {
  $('table.consulting tr:odd').addClass('odd');
});
