/* Image Preloading Javascript
 * Also sets highlight if on a main category page
 */
function preLoad() {
	arImageSrc = new Array (
        "images/adventuring_over.gif",
        "images/technology_over.gif",
        "images/the_world_over.gif",
        "images/inspiration_over.gif"
    )

    arImageList = new Array ();

    for (counter in arImageSrc) {
        arImageList[counter] = new Image();
        arImageList[counter].src = arImageSrc[counter];
    }
	
	switch(document.location.href.substring(document.location.href.lastIndexOf("/") + 1, document.location.href.length)) {
		case "adventuring.aspx":
			obj = document.getElementById("adventuring_img");
			if (obj != null)
				obj.src = "http://danc.nomadlife.org/images/adventuring_on.gif";
			break;
		case "technology.aspx":
			obj = document.getElementById("technology_img");
			if (obj != null)
				obj.src = "http://danc.nomadlife.org/images/technology_on.gif";
			break;
		case "the_world.aspx":
			obj = document.getElementById("the_world_img");
			if (obj != null)
				obj.src = "http://danc.nomadlife.org/images/the_world_on.gif";
			break;
		case "inspiration.aspx":
			obj = document.getElementById("inspiration_img");
			if (obj != null)
				obj.src = "http://danc.nomadlife.org/images/inspiration_on.gif";
			break;
	}
}

/* Comment Toggling JavaScript */
function togglecomments (postid, count, create_url) { 

   if (count == 0) {
     document.location = create_url;
   } else {
     var whichpost = document.getElementById(postid); 
   
     if (whichpost.className=="comments") { 
        whichpost.className="commentshidden";
     } 
     else { 
        whichpost.className="comments";
     }
   }
}