// Home Page Slider
$(function() {
    $('#page-header-home p').cycle({
		fx: 'fade',
		speed: 700,
		pause: 0,
		timeout: 4000,
		pager:  '.paging'
	});
});

// All Other Page Sliders
$(function() {
    $('#page-header p').cycle({
		fx: 'fade',
		speed: 700,
		pause: 1,
		timeout: 4000,
	});
});

// Portfolio Colorbox Add On
$(function() {			
	$("#portfolio-single img").parent("a").each(function() {	
		$(this).attr("rel", "portfolio");	
		//Colorbox
		$("#portfolio-single a[rel='portfolio']").colorbox({
			slideshow:true,
			slideshowAuto:true,
			slideshowSpeed:5000,
			speed:500,
			transition:"fade",
			title:"PS Photography",
			opacity: .85,
		});	
	});	
	
		$("#portfolio-single a[rel='portfolio']:first").click();
			
});

// Blog Posts Colorbox Add On
$(function() {			
	$(".post img").parent("a").each(function() {
		$postValue = $(this).parents(".post").attr("id");
		$(this).attr("rel", $postValue);
		
		//Colorbox
		$(".post a[rel=" + $postValue + "]").colorbox({
			slideshow:true,
			slideshowAuto:true,
			slideshowSpeed:5000,
			speed:500,
			transition:"fade",
			title:"PS Photography",
			opacity: .85,
		});	
	});			
});

// Remove margin bottom from last 3
$(function() {
	$(".post .gallery-item").slice(-3).css({
		"margin-bottom" : 0
	});

});

// Remove Dashed Line on Last News on Home Page
$(function() {
	$("#home-news .section:last").css({
		"margin-bottom" : 0,
		"border-bottom" : "none"
	});

});

// Disbale Right Click on Website
function clickBYIE()
{
  if(document.all)
  {
      alert(DisplayMsg);
      return false;
  }
}
// return message
function clickBYNS(e)
{
  if (document.layers||(document.getElementById&&!document.all))
  {
      if (e.which==2||e.which==3)
      {
       alert(DisplayMsg);
       return false;
      }
  }
}	
// set the function as per browser
if (document.layers)
{
  document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickBYNS;
}
else
{
  document.onmouseup=clickBYNS;document.oncontextmenu=clickBYIE;
}
// disabled the right click on the browser
document.oncontextmenu=new Function("return false")
