// Custom js 
var $j = jQuery.noConflict();


$j(function(){
	
	 //alert(1);
	// Setting text vertically middle	
	$j('.nav li').each(function(index) {
		var navHeight = $j(this).find('span').height();
		var navWidth = $j(this).find('span').width();
		var setTop = (39-navHeight)/2;
		var setLeft = (97-navWidth)/2;
		$j(this).find('span').css({'margin-top':setTop,'margin-left':setLeft});		
	  });
	
	
});

var status=true,flag=0, counter=0, duration=7000;
function rotate(){
    var total = $j('.slider img').size();
    $j('.slider img').fadeOut(1000);
    counter++;
    if(counter==total){
        counter=0;
    }    
    $j('.slider img:eq('+counter+')').fadeIn(6000);
    //console.log(counter);
    
    
    //console.log(counter);
}
$j(function(){        
    var timer = setInterval("rotate()", duration);    
    var items = $j('.slider img');
    items.hide();
    items.eq(0).show();
    
     $j('.stop').toggle(function(){
        //alert(1);
        $j(this).addClass('play');
        status = false;        
        clearInterval(timer);
    },function(){
        //alert(1);
        $j(this).removeClass('play');
        status = true;
        timer = setInterval("rotate()", duration);
    });
    
    $j('.footerNav li:last, .footer li:last span').css({'border-right' : 'none'});
});
