$(document).ready(function(){    
function onBefore(curr, next, opts) 
{ 
	var index = $(this).parent().children().index(this);
	var title = $('#rotatorimageid'+ index).attr('title'); 
	var alt = $('#rotatorimageid'+ index).attr('alt'); 
	var link = $('#rotatorimageid'+ index).attr('link'); 
	var color = $('#rotatorimageid'+ index).attr('color'); 
	
	$('#rotatortitle').fadeOut('slow', function() { 
			$('#rotatortitle').html(title); 
			if (color != '') $('#rotatortitle').css('color','#'+ color); else $('#rotatortitle').css('color','#FFFFFF');
			$('#rotatortitle').fadeIn('slow'); 
	}); 
	$('#rotatorsubtitle').fadeOut('slow', function() { 
			$('#rotatorsubtitle').html(alt); 
			if (color != '') $('#rotatorsubtitle').css('color','#'+ color);  else $('#rotatorsubtitle').css('color','#FFFFFF');
			$('#rotatorsubtitle').fadeIn('slow'); 
	}); 
	$('#rotatorlink').fadeOut('slow', function() { 
			$('#rotatorlink').click(function(){ window.location= link; }); 
			$('#rotatorbglink').click(function(){ window.location= link; }); 
			$('#rotatorlink').fadeIn('slow'); 
	}); 
	
} 
	
	$('#slideshow').cycle({ speed: 2400, timeout: 6000, continuous: 0, before: onBefore, pager: '#rotatorpages' }); 
	$('#rotatorpause').click(function() { $('#slideshow').cycle('pause'); }); 
	$('#rotatorresume').click(function() { $('#slideshow').cycle('resume', true); }); 
 
$("#videoscroller").jCarouselLite({
			btnNext: "#scrollRight",
			btnPrev: "#scrollLeft",
			visible: 3,
			auto: 3000,
			autoStart: false,
			autoStartText: 'View Slideshow',
			autoStopText: 'Stop Slideshow',
			autoID: '#videoslideshow',
			speed: 500,
			circular: false,
			beforeStart: function(a) {
       		}
});
  
if ($.browser.msie && parseInt($.browser.version)< 7) { 
$("#dropdownmenu li").hover(
				function(){ $("ul", this).fadeIn("fast");  }, 
				function() {  } 
);

if (document.all) {
				$("#dropdownmenu li").hoverClass ("sfHover");
			}
			
}


		$("#guarantee").css('cursor', 'pointer');
		$("#guarantee").click(function(){ 
									$.ajax({
											   
											   url: "/guarantee.html",
											   data: "",
											   success: function(html){
												 		$(this).dialog( {
														title: "Satisfaction Guaranteed",
														width: 500, 
														height: 320 ,
														content: html 
														}); 
											   }
									});
			
												
		})
				
$('img[@src$=.png], #maincontainer').ifixpng();
$('#rotate > ul').tabs({ fx: { opacity: 'toggle' } }).tabs();

var leftHeight = $("#leftcolumn").height(); var centerHeight = $("#centercolumn").height();  if (leftHeight < centerHeight){	var paddingAds = 0;	paddingAds = centerHeight - leftHeight;	$("#titles").css('padding-top', paddingAds +  'px'); }

});