//* Javascript by Bring Me Business



//* Force CSS active state for Inputs
function inputClass($chosenClass){
$(document).ready(function() {  
    $('input[type="text"],select,textarea').focus(function() {  
        $(this).addClass($chosenClass);  
       });
	   
    $('input[type="text"],select,textarea').blur(function() {  
        $(this).removeClass($chosenClass);  
        });  
}); 
};

// BUBBLE DROP
$(document).ready(function(){

// Set Bubble Width
var $bubbleW = 168;

// Declare Variables
var $bubbleImgW;
var $bubbleImgH;
var $bubbleL;
var $bubbleT;

// Declare Functions
function bubbleOn(){
	$bubbleImgW = $(this).width();
	$bubbleImgH = $(this).height();
	$bubbleL = Math.round(($bubbleImgW - $bubbleW)/2) + "px";
	$bubbleT = ($bubbleImgH - 4) + "px";
	$(this).parent().next().css({left:$bubbleL,top:$bubbleT}).slideDown(150);
};
function bubbleOff(){
	$(this).parent().next().slideUp(150);
};

// Execute
$("div.bubbleDrop img").hover(bubbleOn,bubbleOff);

});

//* Create Dropdown Menu
function drop(){
$(document).ready(function() {
	
	$('ul.dropdown li').addClass("hover");
	$('ul.dropdown li').removeClass("hover");
	$('ul:first',this).css({opacity:0.95});
	$('ul.dropdown li').hover(function(){
				
        $('ul:first',this).show(250);
		$(this).addClass("hover");
            
    }, function(){
	
		$('ul:first',this).hide();
        $(this).removeClass("hover");
        
    });
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");
});
};

//* Find Images for Lightbox Gallery
function findImages(){
$(function() {
$('a.lightbox').lightBox();
});
}


//* Fading SlideShow
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 800, function() {
            $active.removeClass('active last-active');
        });
}


//* Call SlideShow
function startSlideShow(){
$(function() {
    setInterval( "slideSwitch()", 3600 );
});
}
