$(document).ready( function(){
	$("#navigation li").hover(
	  function () {
		 $(this).addClass('hover');
	  },
	  function () {
		 $(this).removeClass('hover');
	  }
	);
	$("#navigation li ul").each(function(){
		$('li:last', this).addClass('last');
	});
	
	Cufon.replace('.ps_book', { fontFamily: 'Prelo Slab Book' });
	Cufon.replace('.ps_bold', { fontFamily: 'Prelo Slab Bold', hover: 'true' });
	Cufon.replace('.ps_book_italic', { fontFamily: 'Prelo Slab Book Italic' });
	Cufon.replace('.saying', { fontFamily: 'Prelo Slab Book Italic' });
	
	$("#c_slider").jCarouselLite({
		btnPrev: '.cont_slider .btn_prev',
		btnNext: '.cont_slider .btn_next',
		speed: 700,
		scroll: 1,
		visible:1,
		auto: 4000,
		easing: 'easeInOutExpo',
		circular: true
	});

	$(".r_title").click(function(){
		$(this).toggleClass('r_title_on');
		if ($(this).next().is(':visible')){
			$(this).next().slideUp();
		}else{
			$(this).next().slideDown();
		}
	});

	$(".r_title").each(function(){
		var a = $(this).next();
		if ( a.attr("class") == 'closed' ) {
			a.slideUp();
		}
	});

	
	$("h1").addClass('ps_book');
	$("h2").addClass('ps_bold');
	$("h3").addClass('ps_book_italic');

	$(".single_lasted_blog:last").addClass('last_blog');
	
	$('.gallery_list li a').lightBox({
		fixedNavigation:true,
		imageBtnNext:'http://localhost/www/psdgator_orders/2010/12/FXI/wordpress/wp-content/themes/fxi/images/lightbox-btn-next.gif',
		imageBtnPrev:'http://localhost/www/psdgator_orders/2010/12/FXI/wordpress/wp-content/themes/fxi/images/lightbox-btn-prev.gif',
		imageLoading:'http://localhost/www/psdgator_orders/2010/12/FXI/wordpress/wp-content/themes/fxi/images/lightbox-ico-loading.gif',
		imageBtnClose:'http://localhost/www/psdgator_orders/2010/12/FXI/wordpress/wp-content/themes/fxi/images/lightbox-btn-close.gif'
	});
	
});

//Placeholder for ie
function activatePlaceholders() {
var detect = navigator.userAgent.toLowerCase();
if (detect.indexOf("safari") > 0) return false;
var inputs = document.getElementsByTagName("input");
for (var i=0;i<inputs.length;i++) {
  if (inputs[i].getAttribute("type") == "text" || inputs[i].getAttribute("type") == "email") {
   if (inputs[i].getAttribute("placeholder") && inputs[i].getAttribute("placeholder").length > 0) {
    inputs[i].value = inputs[i].getAttribute("placeholder");
    inputs[i].onclick = function() {
     if (this.value == this.getAttribute("placeholder")) {
      this.value = "";
     }
     return false;
    }
    inputs[i].onblur = function() {
     if (this.value.length < 1) {
      this.value = this.getAttribute("placeholder");
     }
    }
   }
  }
}
}
window.onload=function() {
activatePlaceholders();
}
