$(document).ready(function(){

/* Font Adjustment Widget */	
// Reset Font Size
var count = 3;
var originalFontSize = $('body').css('font-size');
$("#reset").click(function(){
count = 3;
$('body').css('font-size', originalFontSize);
});
// Increase Font Size
$("#increase").click(function(){
if(count < 5){
count++;
var currentFontSize = $('body').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum+2;
$('body').css('font-size', newFontSize);
return false;
}
});
// Decrease Font Size
$("#decrease").click(function(){

if(count > 1){
count--;
var currentFontSize = $('body').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum-2;
$('body').css('font-size', newFontSize);
return false;
}

});
/* end Font Adjustment Widget */	

/* Auto-expand textarea */	
$("textarea[class*=expand]").TextAreaExpander(80, 280);
/* end Auto-expand textarea */

/* info tip fade-out */	
$(".close-btn").click(function(){
	$(this).parent().fadeOut(300);
});
/* end info tip fade-out */

/* creation box */
$("#new-album").toggle(function() {
  $(".creation").fadeIn(300);
}, function() {
 $(".creation").fadeOut(300);
});

$("#new-photo").toggle(function() {
  $(".creation").fadeIn(300);
}, function() {
 $(".creation").fadeOut(300);
});
/* end creation box */

/* add fields */
var fnum = 1;

function addFields(){
$("#fields").append('<br /><input type="file" name="photo'+fnum+'" />');
	fnum++;
	if(fnum == 5){$("#add-field").hide(); }	
}
$("#add-field").click(addFields);
	
/* end add fields */

/* convert text links to hyperlink */

$('.comment-box').linkify();
$('.user-msg').linkify();

/* end convert */

/* profile page panels*/
$('.p-panel h4').click(function(){
	$(this).siblings('form').toggle();
	$(this).toggleClass('pop');
});
/* end p panels */


/* profile picture links */
var url = window.location.hash;
if (url == '#profile-picture') {
	$(".pop").removeClass('pop');
    $(".p-panel form").hide();
	$("#ppic").siblings('form').show();
	$("#ppic").addClass('pop');
  }
  

$('#edit-pp-e').click(function(){
	window.location = 'http://gardenbook.com.au/accounts/profile/basic#profile-picture';
});

$('#edit-pp-i').click(function(){
	$(".pop").removeClass('pop');
    $(".p-panel form").hide();
	$("#ppic").siblings('form').show();
	$("#ppic").addClass('pop');
});
/* end profile picture links */

/*tooltips*/

$('.friend-thumb a').tipsy({gravity: 'sw' });

/* end tooltips*/

//$(document).pngFix();

});


