	function is_int(value){ 
	  if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
	      return true;
	  } else { 
	      return false;
	  } 
	}

	function displayID(divID){
		var nodes = document.getElementById('subcontent').childNodes;
		for(i=0; i<nodes.length; i++) {
		    if (nodes[i].nodeType == 1){document.getElementById(nodes[i].id).style.display="none";}
		}
		document.getElementById(divID).style.display='block';
	}
	function bold(divID){
			document.getElementById(divID).style.fontWeight = 'bold';
			document.getElementById(divID).onmouseover();
	}

	$(document).ready(function(){
        $('#content > ul#menu > li a[href]').filter(function() {return this.pathname === window.location.pathname && !(/^#/.test(this.getAttribute('href')))}).css('font-weight','bold');
        $('#content > ul#menu > li a[href]').filter(function() {return this.pathname === window.location.pathname && !(/^#/.test(this.getAttribute('href')))}).trigger('mouseover');  
        $('ul.sub > li a[href]').filter(function() {return this.pathname === window.location.pathname && !(/^#/.test(this.getAttribute('href')))}).css('font-weight','bold');
        $('ul.sub > li a[href]').filter(function() {return this.pathname === window.location.pathname && !(/^#/.test(this.getAttribute('href')))}).trigger('click');

        var totalPages = 1;
        if (is_int($('#page-count').text())) {totalPages = parseInt($('#page-count').text())};
	   	for ( pageCount=2; pageCount<=totalPages;pageCount++) {
	      	$.get('page/' + pageCount, function(data){
		      	new_posts = data.split('<!-- posts-start -->')[1].split('<!-- posts-end -->')[0];
				$('#gallery-row').find('td:last').after(new_posts);
	      	});
	    }
    });
