jQuery(document).ready(function() {

jQuery("a#faceclose").click(function(){

jQuery("a#faceclick").click();


});


jQuery("a#faceclick").toggle(function () {

jQuery(this).html("Close X");
jQuery('#facbooky').animate({height: "500px"}, 500);

jQuery('#groovybox').fadeOut();

}, function () {

jQuery(this).html("");
jQuery('#facbooky').animate({height: "130px"}, 500);

jQuery('#groovybox').fadeIn();

});


var slidespeed = 5000;
var dontknow = setInterval('inoutad()', slidespeed);	



jQuery('#groovybox').hover(
		
		function() {
			clearInterval(dontknow);
		}, 
		function() {
			dontknow = setInterval('inoutad()', slidespeed);	
		}
	); 














jQuery("ul#fc_hom_inout li").each(function() {

jQuery(this).hide();

}); 
jQuery("ul#fc_hom_inout li.4").show().addClass("openedd");



jQuery("ul#fc_mv_ull li").each(function() {


jQuery(this).mouseover(function(){

var theidsf = jQuery(this).attr("class"); 

var thetext = jQuery(this).attr("id");

jQuery("ul#fc_hom_inout li.openedd").hide().removeClass("openedd");

jQuery("ul#fc_hom_inout li."+theidsf+"").show().addClass("openedd");

jQuery("ul#fc_hom_inout li."+theidsf+" div.insideText").html(thetext);



}).mouseout(function(){

var theidsf = jQuery(this).attr("class"); 

jQuery("ul#fc_hom_inout li.openedd").hide().removeClass("openedd");

jQuery("ul#fc_hom_inout li.4").show().addClass("openedd");


});






});









	//rotation speedhm and timer
	var speedhm = 3000;
	var runhm = setInterval('rotatehm()', speedhm);	
	
	//grab the width and calculate left value
	var item_width = jQuery('.slideshm ul li').outerWidth(); 
	var left_value = (25 + item_width) * (-1); 
        
    //move the last item before first item, just in case user click prev button
	jQuery('.slideshm  ul li:first').before(jQuery('.slideshm ul li:last'));
	
	//set the default item to the correct position 
	jQuery('.slideshm ul').css({'left' : left_value});

    //if user clicked on prev button
	jQuery('#prevhm').click(function() {

		//get the right position            
		var left_indent = parseInt(jQuery('.slideshm ul').css('left')) + item_width;

		//slide the item            
		jQuery('.slideshm ul').animate({'left' : left_indent}, 200,function(){    

            //move the last item and put it as first item            	
			jQuery('.slideshm ul li:first').before(jQuery('.slideshm ul li:last'));           

			//set the default item to correct position
			jQuery('.slideshm ul').css({'left' : left_value});
		
		});

		//cancel the link behavior            
		return false;
            
	});

 
    //if user clicked on next button
	jQuery('#nexthm').click(function() {
		
		//get the right position
		var left_indent = parseInt(jQuery('.slideshm ul').css('left')) - item_width;
		
		//slide the item
		jQuery('.slideshm ul').animate({'left' : left_indent}, 200, function () {
            
            //move the first item and put it as last item
			jQuery('.slideshm li:last').after(jQuery('.slideshm li:first'));                 	
			
			//set the default item to correct position
			jQuery('.slideshm ul').css({'left' : left_value});
		
		});
		         
		//cancel the link behavior
		return false;
		
	});        
	
	//if mouse hover, pause the auto rotation, otherwise rotate it
	jQuery('.slideshm').hover(
		
		function() {
			clearInterval(runhm);
		}, 
		function() {
			runhm = setInterval('rotatehm()', speedhm);	
		}
	); 
        
});

//a simple function to click next link
//a timer will call this function, and the rotation will begin :)  
function rotatehm() {
	jQuery('#nexthm').click();
}


jQuery(document).ready(function() {

	//rotation speedhm and timer
	
	jQuery('.bgslideshm h2').hide();
	
	//grab the width and calculate left value
	var item_widths = jQuery('.bgslideshm li').outerWidth(); 
	var left_values = (25 - item_widths) * (-1); 
        
    //move the last item before first item, just in case user click prev button
	jQuery('.bgslideshm li:first').before(jQuery('.bgslideshm li:last'));
	
	//set the default item to the correct position 
	jQuery('.bgslideshm ul').css({'left' : left_values});

    //if user clicked on prev button
	jQuery('#nexthm').click(function() {
		
		
				//get the right position
		var left_indents = parseInt(jQuery('.bgslideshm ul').css('left')) - item_widths;
		
		//slide the item
		jQuery('.bgslideshm ul').animate({'left' : left_indents}, 200, function () {
            
            //move the first item and put it as last item
			jQuery('.bgslideshm li:last').after(jQuery('.bgslideshm li:first'));                 	
			
			//set the default item to correct position
			jQuery('.bgslideshm ul').css({'left' : left_values});
		
		});
		         
		//cancel the link behavior
		return false;
		
	            
	});

 
    //if user clicked on next button
	jQuery('#prevhm').click(function() {
	
	//get the right position            
		var left_indents = parseInt(jQuery('.bgslideshm ul').css('left')) + item_widths;

		//slide the item            
		jQuery('.bgslideshm ul').animate({'left' : left_indents}, 200,function(){    

            //move the last item and put it as first item            	
			jQuery('.bgslideshm li:first').before(jQuery('.bgslideshm li:last'));           

			//set the default item to correct position
			jQuery('.bgslideshm ul').css({'left' : left_values});
		
		});

		//cancel the link behavior            
		return false;

		

	});        

        
});
function rotatehm() {
	jQuery('#nexthm').click();
}



jQuery(document).ready(function() {

	//rotation speedhm and timer
	
	jQuery('.bgslideshms h2').hide();
	
	//grab the width and calculate left value
	var item_widths = jQuery('.bgslideshms li').outerWidth(); 
	var left_values = (25 - item_widths) * (-1); 
        
    //move the last item before first item, just in case user click prev button
	jQuery('.bgslideshms li:first').before(jQuery('.bgslideshms li:last'));
	
	//set the default item to the correct position 
	jQuery('.bgslideshms ul').css({'left' : left_values});

    //if user clicked on prev button
	jQuery(' #prevhm').click(function() {
		
		
				//get the right position
		var left_indents = parseInt(jQuery('.bgslideshms ul').css('left')) - item_widths;
		
		//slide the item
		jQuery('.bgslideshms ul').animate({'left' : left_indents}, 200, function () {
            
            //move the first item and put it as last item
			jQuery('.bgslideshms li:last').after(jQuery('.bgslideshms li:first'));                 	
			
			//set the default item to correct position
			jQuery('.bgslideshms ul').css({'left' : left_values});
		
		});
		         
		//cancel the link behavior
		return false;
		
	            
	});

 
    //if user clicked on next button
	jQuery('#nexthm').click(function() {
	
	//get the right position            
		var left_indents = parseInt(jQuery('.bgslideshms ul').css('left')) + item_widths;

		//slide the item            
		jQuery('.bgslideshms ul').animate({'left' : left_indents}, 200,function(){    

            //move the last item and put it as first item            	
			jQuery('.bgslideshms li:first').before(jQuery('.bgslideshms li:last'));           

			//set the default item to correct position
			jQuery('.bgslideshms ul').css({'left' : left_values});
		
		});

		//cancel the link behavior            
		return false;

		

	});        

        
});


jQuery(document).ready(function() {

	//rotation speedhm and timer
	
	
	//grab the width and calculate left value
	var item_widths = jQuery('.mcFloater li').outerWidth(); 
	var left_values = (25 - item_widths) * (-1); 
        
    //move the last item before first item, just in case user click prev button
	jQuery('.mcFloater li:first').before(jQuery('.mcFloater li:last'));
	
	//set the default item to the correct position 
	jQuery('.mcFloater ul').css({'left' : left_values});

    //if user clicked on prev button
	jQuery('#nexthm').click(function() {
		
		
				//get the right position
		var left_indents = parseInt(jQuery('.mcFloater ul').css('left')) - item_widths;
		
		//slide the item
		jQuery('.mcFloater ul').animate({'left' : left_indents}, 200, function () {
            
            //move the first item and put it as last item
			jQuery('.mcFloater li:last').after(jQuery('.mcFloater li:first'));                 	
			
			//set the default item to correct position
			jQuery('.mcFloater ul').css({'left' : left_values});
		
		});
		         
		//cancel the link behavior
		return false;
		
	            
	});

 
    //if user clicked on next button
	jQuery(' #prevhm').click(function() {
	
	//get the right position            
		var left_indents = parseInt(jQuery('.mcFloater ul').css('left')) + item_widths;

		//slide the item            
		jQuery('.mcFloater ul').animate({'left' : left_indents}, 200,function(){    

            //move the last item and put it as first item            	
			jQuery('.mcFloater li:first').before(jQuery('.mcFloater li:last'));           

			//set the default item to correct position
			jQuery('.mcFloater ul').css({'left' : left_values});
		
		});

		//cancel the link behavior            
		return false;

		

	});        

        
});





function rotatehm() {
	jQuery('#nexthm').click();
}


function inoutad() {
	
	if (jQuery("#groovybox").hasClass("imopen")) {
	
	jQuery("#groovybox").animate({"left": "-=500px"}, 500).removeClass("imopen");
	
	
	} else {
	
	jQuery("#groovybox").animate({"left": "+=500px"}, 500).addClass("imopen");
	
	}
	
}
