﻿$(document).ready(
	function(){
	
	$(document).pngFix();

	$("a[href^='http:']").not("[href*='nigelcoates.com']").attr('target','_blank');
	
	$("#special").click(function(){
		$('#special').fadeOut();
	});


	var scrollWidth = ($('.post').length * 310);
	$('#posts').css('width',  scrollWidth);

	$('.blog .scroll-pane').jScrollHorizontalPane({scrollbarHeight:10, scrollbarMargin:0, showArrows:false, resize:true});
		$('.jScrollPaneContainer').css('height','100%');
	
	$(window).resize(function(){
		å$('.blog .scroll-pane').jScrollHorizontalPane({scrollbarHeight:10, scrollbarMargin:0, showArrows:false, resize:true});
		$('.jScrollPaneContainer').css('height','100%');
	})
	
	$(".container").smoothDivScroll({
		scrollingSpeed: 12, 
		mouseDownSpeedBooster: 3, 
		autoScroll: "onstart", 
		autoScrollDirection: "endlessloop", 
		autoScrollSpeed: 2, 
		visibleHotSpots: "always"/*, 
		hotSpotsVisibleTime: 9*/
		});		


	$(".category_panel  dl dd a span").hide();
	$(".category_panel  dl dd a").hover(
		function(){
			$(this).find('span').show();
		},
		function(){
			$(this).find('span').hide();
		}
	);
	


/*	$('.category_panel').each(function(i){
		$(this).find('dl:last').attr('id','last'+i);
	})

	$(".category_panel:odd").smoothDivScroll({
		scrollingSpeed: 10, 
		pauseAutoScroll: "mouseover",
		mouseDownSpeedBooster: 3, 
		autoScroll: "onstart", 
		autoScrollDirection: "right", 
		autoScrollSpeed: 1, 
		visibleHotSpots: "always"
		});	


	$(".category_panel:even").smoothDivScroll({
		scrollingSpeed: 10, 
		pauseAutoScroll: "mouseover",
		mouseDownSpeedBooster: 3, 
		autoScroll: "onstart", 
		autoScrollDirection: "left", 
		startAtElementId:  $(this).find('dl:last'),
		autoScrollSpeed: 1, 
		visibleHotSpots: "always"
		});	
*/	


	$(".category_panel").each(function(i,c){
	
	$(this).find('dl:last').attr('id','last'+i);
	
	var e = i % 2 ? 0 : 1; 
	
	if (e == 1) {

		$(this).smoothDivScroll({
		scrollingSpeed: 10, 
		pauseAutoScroll: "mouseover",
		mouseDownSpeedBooster: 3, 
		autoScroll: "onstart", 
		autoScrollDirection: "endlessloop", 
		autoScrollSpeed: 1, 
		visibleHotSpots: "always"
		});	


		}
	else {
		

		$(this).smoothDivScroll({
		scrollingSpeed: 10, 
		pauseAutoScroll: "mouseover",
		mouseDownSpeedBooster: 3, 
		autoScroll: "onstart", 
		autoScrollDirection: "left", 
		startAtElementId:  "last"+i,
		autoScrollSpeed: 1, 
		visibleHotSpots: "always"
		});	
	}
	
	})
	


  $().newsTicker({
    newsList: "#headlines",
    startDelay: 100,
    tickerRate: 80,
    loopDelay: 10000,
    placeHolder1: "_"
  });




}); 



