function toggle_box(id) // This Function Hides/Shows an element using jQuery
{
	// Animation Choices(Appearing): 
	//		show
	//		fadeIn
	//		slideDown
	//		fadeTo(opacity	
	//		Custom(you can make your own jQuery Effects, too).
	// Animation Choices(For Disappearing): 
	//		hide
	//		fadeOut
	//		slideUp
	//		fadeTo(opacity
	//		Custom(you can make your own jQuery Effects, too).
	 var transition_time = 400 // transition time in ms 
	 element = document.getElementById(id)
	 if(element.style.display == "none") // The Element is currently Hidden
		 $(element).slideDown(transition_time) // toggle box using jquery
 	 else // The Element is currently Visible	 
 		 $(element).slideUp(transition_time) // toggle box using jquery
}

function toggle_box_old(id) // Dave: toggles css property of a box between display:none and display:block
{
	
	if (document.getElementById(id).style.display == "block")
	{
	   document.getElementById(id).style.display = "none"
	}	
	else if(document.getElementById(id).style.display == "none")
	{
	   document.getElementById(id).style.display = "block"
	}	
}

function show_loading(id) // shows loading icon inside id
{
	//alert('loading')
	element = document.getElementById(id)
	element.innerHTML='<div class="loading"><img src="/themes/factory_2nd_gen/images/loading.gif></div>'		
}

function replace_box(id_to_hide, id_to_show) // This function hides the first element and shows the second(which should already be hidden)
{
	// Animation Choices(Appearing): 
	//		show
	//		fadeIn
	//		slideDown
	//		fadeTo(opacity	
	//		Custom(you can make your own jQuery Effects, too).
	// Animation Choices(For Disappearing): 
	//		hide
	//		fadeOut
	//		slideUp
	//		fadeTo(opacity
	//		Custom(you can make your own jQuery Effects, too).
	element_to_hide = document.getElementById(id_to_hide)
	element_to_show = document.getElementById(id_to_show)
	var transition_time = 400 // transition time in ms 
	$(element_to_hide).slideUp(transition_time) // toggle box using jquery
	$(element_to_show).slideDown(transition_time) // toggle box using jquery
}