function toggleDiv(objDiv){
   var myElement = document.getElementById(objDiv); 
   if (myElement.style.display == "none" || myElement.style.display == ""){
		if (navigator.appName=="Microsoft Internet Explorer") { // if IE
			try {myElement.filters[0].Apply(); } catch (ex) {}
		}
       myElement.style.display = "block";
		if (navigator.appName=="Microsoft Internet Explorer") { // if IE
		   try {myElement.filters[0].Play(); } catch (ex) {}
		}
   }
   else {
       myElement.style.display = "none";
   }
}


/* Make objects the same height 
------------------------------------*/
function equalHeight(cols) {
	tallest = 0;
	cols.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	cols.height(tallest);
}

/* Auto Breadcrumbs 
------------------------------------*/
function breadcrumbs(){
	sURL = new String;
	bits = new Object;
	var x = 0;
	var stop = 0;
	var output = "<a href='/' class='home'>Home</a> &raquo; ";
	
	sURL = location.href;
	sURL = sURL.slice(8,sURL.length);
	chunkStart = sURL.indexOf("/");
	sURL = sURL.slice(chunkStart+1,sURL.length)
	
	while(!stop){
	  chunkStart = sURL.indexOf("/");
	  if (chunkStart != -1){
		bits[x] = sURL.slice(0,chunkStart)
		sURL = sURL.slice(chunkStart+1,sURL.length);
	  }
	  else{
		stop = 1;
	  }
	  x++;
	}
	
	for(var i in bits){
		output += "<a href=\"";
		for(y=1; y<x-i; y++){
			output += "../";
		}
	
		/* old basic output	
		output += bits[i] + "/\">" + bits[i] + "</a> &raquo; ";
		*/
		
		// lets convert the text "this-is-my-string" to "This Is My String"		
		output += bits[i] + "/\">" + bits[i].toLowerCase().replace(/\b[a-z]/g, cnvrt).split("-").join(" ") + "</a> &raquo; ";
		
	}
	function cnvrt() {
		return arguments[0].toUpperCase();
	}
	
	document.write(output + document.title);
}


/* jQuery stuff
------------------------------------- */
$(document).ready(function(){

	/* Toggle tophat dropDown menu
	----------------------------------------- */
	$('.morelinks').hover(
		function() { 
			$(this).addClass('hover');	
			$('.submenu').fadeIn(250);
		},
		function() { 
			$('.submenu', this).css('display', 'none'); 
			$(this).removeClass('hover');	
		}
	);

	/* toggle login form
	-----------------------------------------
	$('.actions .login').toggle(
		function(){ $('.logindiv').slideDown("fast");},
		function(){ $('.logindiv').slideUp("fast"); }
	);
	 */
	
	/* swap login form with lost password
	----------------------------------------- */
	$('.lostpass').toggle(
		function(){ 
			$('.loginform').fadeOut("fast");
			$('.lostpassform').fadeIn("fast");
			$(this).html("Back to Login");
		},
		function(){ 
			$('.loginform').fadeIn("fast");
			$('.lostpassform').fadeOut("fast");
			$(this).html("Forgot Password");
		}
	);


	/* Tabs
	----------------------------------------- */
	//Initially hide all panes if javascript is enabled, Otherwise if javascript is disabled, all the panes will be displayed
	$(".panes .pane").css('display', 'none');
	
	// activate the tabs
	$("ul.tabs").tabs("div.panes > .pane");


	/* initialize scripts
	----------------------------------------- */
});

