$(document).ready(function() {	
	
$.ifixpng('images/blank.gif');
$('img[@src$=.png], .bgPng').ifixpng();	
	
//$('p:first').css('margin', '0px');	
//$('p').filter(':first').css('margin', '0px');

$('input,textarea').toggleVal('jq-active');
$('#nav-top a.active, #nav-footer a.active').css({color:'#ffffff', border:'1px solid #ffffff'});




jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$.preloadImages("images/pfl-l-01.jpg", "images/pfl-l-02.jpg","images/pfl-l-03.jpg", "images/pfl-l-04.jpg");


$('#thumbimg img, #thumbsimg img').fadeTo('fast', 0.8);
       
	   $('#thumbimg img, #thumbsimg img').hover(function(){
		$(this).fadeTo('fast', 1.0);
		},function(){
		$(this).fadeTo('fast', 0.8);
		});
            
			
			//$("#largeimg").html("<img src='images/pfl-l-01.jpg' />");
		  //$('#largeimg img').attr('src', 'images/pfl-l-01.jpg');
			
            // Select all thumb links
            $('#thumbimg a').click(function() {
         
			var imagepath = $(this).attr('href');
										
			$('#largeimg img').attr('src', imagepath);
			 return false;
					}/*, function() {
             
					//$('#largeimg img').attr('src', 'images/pfl-l-01.jpg');
					
					}*/
					);
			
			  $('#thumbsimg a').click(function() {
         
			var imagepath = $(this).attr('href');
										
			$('#largesimg img').attr('src', imagepath);
			 return false;
					}/*, function() {
             
					//$('#largesimg img').attr('src', 'images/pfl-l-01.jpg');
					
					}*/
					);


$('.body-text').find('p.hide').hide();

$(".body-text a.show").toggle(function() {								   
$('p.hide').slideDown();
$(this).text("Hide content...");
}, function() {
$('p.hide').slideUp();
$(this).text("Read more...");
});



});

jQuery.fn.toggleVal = function(focusClass) {
	this.each(function() {
		$(this).focus(function() {
			
			if($(this).val() == this.defaultValue) { $(this).val(''); }
			
			
			if(focusClass) { $(this).addClass(focusClass); }
		}).blur(function() {
		
			if($(this).val() == '') { $(this).val(this.defaultValue); }
			
			
			if(focusClass) { $(this).removeClass(focusClass); }
		});
	});
}

