
  $(document).ready( function() { 
 	    
    $('.box').corner();			
    
    // Make the boxes the same height  	
	var leftHeight = $('#chirowebsites').height(); 
	var rightHeight = $('#chiromarketing').height();  
	if ( rightHeight > leftHeight ) 
	  $('#chirowebsites').height( rightHeight ); 
    else if ( leftHeight > rightHeight )
      $('#chiromarketing').height( leftHeight ); 

	var leftHeight = $('#samplewebsites').height(); 
	var rightHeight = $('#whychirowebsite').height();  
	if ( rightHeight > leftHeight ) 
	  $('#samplewebsites').height( rightHeight ); 
    else if ( leftHeight > rightHeight )
      $('#whychirowebsite').height( leftHeight ); 
        
   /*
    $('#slideshow').click( function(){
    	location.href="/more-info";
    });
   */ 
    
	$('#slideshow').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    autostop: 6,
    timeout: 6500, 
	pager:  '#sstabs',
	next:   '#nextslide', 
    prev:   '#prevslide',
	
	pagerAnchorBuilder: function(idx, slide) { 
		var title;
		
		switch ( idx )
		{
		  case 0:
		  	title = 'Intro';
		  	break;
		  	
		  case 1:
		    title = 'Holistic Approach';			     
		    break;
					
		  case 2:
		    title = 'Fresh, Clean Designs';
		    break;
			
		  case 3:
		    title = 'Get Found';
		    break;
			
		  case 4:
		    title = 'Stay in Touch';
		    break;
			
		  case 5:
		    title = 'Get Started';
		    break;    
		}
        return '<a href="#">' + title + '<\/a>'; 
	}
	
    });
	
	$( '#playcontrol').append( '<img src="/images/control_pause.gif" alt="" style="vertical-align:middle;" >&nbsp;<span id="playcontroltext">pause<\/span>' );
	
	$('#playcontrol').toggle( 
		function() {
		  $(this).attr( 'src', '/images/control_play.gif' );
		  $('#slideshow').cycle('pause');		  
		  $('#playcontroltext').text( 'play' );
		},
		function() {
		  $(this).attr( 'src', '/images/control_pause.gif' );
		  $('#slideshow').cycle('resume');		  
		  $('#playcontroltext').text( 'pause' );
		}
	);
	
	
	$('#playcontrol').hover(
		function() {
		  $(this).css('cursor', 'pointer');
  		  $('#playcontroltext').css( 'color', '#D9E965' );		
		  if ( $('#playcontroltext').text() == 'pause' )
		  {
	  	    $(this).find('img').attr( 'src', '/images/control_pause_over.gif' );
	      }
		  else
		  {
		    $(this).find('img').attr( 'src', '/images/control_play_over.gif' );	  
		  }
		},
		function() {
		  $('#playcontroltext').css( 'color', '#CCC' );					
		  if ( $('#playcontroltext').text() == 'pause' )
		  {
	  	    $(this).find('img').attr( 'src', '/images/control_pause.gif' );
	      }
		  else
		  {
		     $(this).find('img').attr( 'src', '/images/control_play.gif' );	  		
		  }
		}
	);
	
	$('#prevslide').hover(
		function() {
  	      $(this).find('img').attr( 'src', '/images/control_prev_over.gif' );	      
		},
		function() {
		  $(this).find('img').attr( 'src', '/images/control_prev.gif' );	  				  
		}
	);	
	
	$('#nextslide').hover(
		function() {
  	      $(this).find('img').attr( 'src', '/images/control_next_over.gif' );	      
		},
		function() {
		  $(this).find('img').attr( 'src', '/images/control_next.gif' );	  				  
		}
	);		
	
 }); 