/*******************************************************************************

	CSS on Sails Framework
	Title: Agworld
	Author: XHTMLized (http://www.xhtmlized.com/)
	Date: August 2011

*******************************************************************************/

$(document).ready(function() {


	$('#findoutmore').click(function(){
		
		

		$("#mainbit").slideToggle('slow',function() {

		  $('#slider').cycle('resume');

		});



	});
	
	// fix css for chrome
	
	if(jQuery.browser.webkit != undefined) {
		$("#copyright ul li ul").css('margin','-25px 0 0 0');
	}
	
	$('#slider').cycle({
			    timeout: 8 * 1000,
                speed: 700,
                fx: 'fade',
/*                 easing:  'backinout', */
                height : '310px',
                pause: false,
                cleartypeNoBg: true,
                pager: $('#subtabnav'),
                pagerAnchorBuilder: pagerFactory
	});


	$('#footers').cycle({
			    timeout: 4 * 1000,
                fx: 'fade',
                height : '140px',
                pause: false,
                cleartypeNoBg: true
	});	
	
	
	$(".panel").click(function(){
         $('#slider').cycle('next')
    });
	
});

/* <ul class="thumbNav">
	<li class="first"><a href="#" class="panel1 cur"><span>1</span></a></li>
	<li class=""><a href="#" class="panel2"><span>2</span></a></li>
	<li class=""><a href="#" class="panel3"><span>3</span></a></li>
	<li class=""><a href="#" class="panel4"><span>4</span></a></li>
	<li class="last"><a href="#" class="panel5"><span>5</span></a></li>
  </ul> */

function pagerFactory(idx, slide) {
    var s = idx+1;
    return '<li><a href="#" class="tab"><span>'+(s)+'</span></a>';
};


// DD_belatedPNG fix for IE6
if (typeof DD_belatedPNG !== 'undefined') {
	var PNG_fix_selectors = [
		'img', 
		'.logo a',
		'a.button',
		'a.button span',
		'a.plain-button',
		'a.plain-button span',
		'.testimonial',
		'.divider',
		'.showcase',
		'#slider',
		'.who-for',
		'#footer'
	];
	DD_belatedPNG.fix(PNG_fix_selectors.join(','));
}
