var min=8;
var max=18;
var $j = jQuery.noConflict();

function increaseFontSize() {
	
	var p = document.getElementsByTagName('p');
	
	for(i=0;i<p.length;i++) {
		
		if(p[i].style.fontSize) {
	 		var s = parseInt(p[i].style.fontSize.replace("px",""));
	 	} else {
	 		var s = 12;
	 	}
	
		if(s!=max) {
	 		s += 1;
		}
		
		p[i].style.fontSize = s+"px"
	}
}

function decreaseFontSize() {
	
 	var p = document.getElementsByTagName('p');

	for(i=0;i<p.length;i++) {
		
		if(p[i].style.fontSize) {
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		} else {
			var s = 12;
		}
		
		if(s!=min) {
			s -= 1;
		}
		
		p[i].style.fontSize = s+"px"
	}
}

$j(document).ready(function(){
  	highlight_active_sidebar_links();
	
	$j('.ngg-galleryoverview').cycle({
	    fx: 'fade',
	    timeout: 8000,
		next: "#shNext", 
		prev: "#shPrev"
    });

    // $j('.bg-placeholder').hover(
    //  function () {
    //      $j('.ngg-gallery-description').each(function (i) {
    //          $j(this).slideDown();
    //      });
    //      $j('#shPrev').slideDown();
    //      $j('#shNext').slideDown();
    //  },
    //  function () {
    //      $j('.ngg-gallery-description').each(function (i) {
    //          $j(this).slideUp();
    //      });
    //      $j('#shPrev').slideUp();
    //      $j('#shNext').slideUp();
    //  }
    // );
	
	$j('.main-feature').hover(
		function () {
			$j('.ngg-gallery-description').each(function (i) {
				$j(this).slideDown();
			});
		},
		function () {
			$j('.ngg-gallery-description').each(function (i) {
				$j(this).slideUp();
			});
		}
	);
});

function highlight_active_sidebar_links() {
	
	$j("#access ul.sf-menu li").each(function(){
		
    	var current_href = $j("a",this).attr("href");
		var current_cat = $j("a",this).text();

    	if (current_href == request || current_href == (base_url + request) || (current_cat.toLowerCase() == category)) {
	
			if ($j(this).not(".current_page_item")) {
				$j(this).addClass("current_page_item");
			}
			
    	} else if ($j(this).is(".current_page_item")) {
	
			$j(this).removeClass("current_page_item");
			
		}
  	});
}
