function trace (argument) { console.log(argument); }

var pd = {
	
	_init : function() {
		pd.prepTypography();
		pd.subMenuShow();
		pd.lowerSubMenuShow();
		pd.nivoSlider();
		pd.readMore();
		pd.prepInputs();
	}
	
	,prepTypography : function() {
		Cufon.replace('div#nav li a, div#feature-text a', { fontWeight: 400, hover: true })('div#feature-text h2, div#content h2, div#content h1', { fontWeight: 300 })('h2', { fontWeight: '300' });
	}
	
	,subMenuShow : function() {
    $('div#nav li').hover(
      function() {
        $(this).children('div.mod_navigation').show();
        $(this).addClass('active');
        Cufon.refresh();
      },
      function() {
        setTimeout('2000', $(this).children('div.mod_navigation').hide());
        //.css({ display: 'none' })
        $(this).removeClass('active');
        Cufon.refresh();
      }
    )
  }
  
  ,lowerSubMenuShow : function() {
    $('ul.level_1>li.submenu>a, ul.level_1>li.submenu>span').hover(
      function() {
        $('ul.level_2').fadeOut('slow')
        $(this).siblings('ul.level_2').show().addClass('current');
        
      },
      function() {
        //$(this).siblings('ul.level_2').fadeOut('slow');
      }
    )
  }

	,nivoSlider : function() {
		$('#slider').nivoSlider({
			effect: 'fade',
			slices: "10",
			controlNav: false,
			controlNavThumbs: false,
			animSpeed:800,
			pauseTime:5000,
			afterChange: function(){
				Cufon.refresh()
			}
		});
	}
	
	,readMore : function() {
		$('a.readmore').each(function() {
			$(this).toggle(function() {
				$(this).parent().next("div.readmore").fadeIn();
				$(this).html("Read Less");
			}, function() {
				$(this).parent().next("div.readmore").fadeOut();
				$(this).html("Read More");
			})
		})
	}
	
	,prepInputs : function() {
			$('input[type=text], textarea').each(function() {
				var value = $(this).attr("value");
			  $(this).click(function(){
					if ($(this).attr("value") == value) {
						$(this).attr("value", "");
					};
				})

				$(this).blur(function() {
					if ($(this).attr("value") == "") {
						$(this).attr("value", value);
					};
				});
			});
		}
	
	
}

$(function() {
	pd._init();
});
