
	//ZIONLAN JAVASCRIPT FUNNY BUSINESS 
	//NO TOUCHIE PLEASE <3
	//THANKS I LOVE YOU BYE
	//CAUSE ©2006 Kevin M. Fitzgerald. YO!
	
	//  == GLOBALS ==
	var sidebar_is = "on";
	var sidebar_temp;
	
	var zl_ajax_status = "on";
	var zl_sidebar_toggling_enabled = true;
	
	// == client size getter :: UNUSED -- HERE FOR POSSIBLE FUTURE USE
	// from: http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html	
	/*function f_clientWidth() 
	{
		return f_filterResults (
			window.innerWidth ? window.innerWidth : 0,
			document.documentElement ? document.documentElement.clientWidth : 0,
			document.body ? document.body.clientWidth : 0
		);
	}	
	function f_clientHeight() 
	{
		return f_filterResults (
			window.innerHeight ? window.innerHeight : 0,
			document.documentElement ? document.documentElement.clientHeight : 0,
			document.body ? document.body.clientHeight : 0
		);
	}	
	function f_filterResults(n_win, n_docel, n_body) 
	{
		var n_result = n_win ? n_win : 0;
		if (n_docel && (!n_result || (n_result > n_docel)))
			n_result = n_docel;
		return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
	}*/
	
	
	//  == TOGGLE SIDE BAR ==
	function ZL_ToggleSideBar()
	{
		//if the sidebar toggle functionality is disabled, abort
		if( zl_sidebar_toggling_enabled != true )
			return;
			
		if( sidebar_is == "on" )
		{
			//remove the sidebar			
			var sidebar_row = document.getElementById( "funRow" );					//get the content/sidebar row
			var sidebar_cell = document.getElementById( "sidebar" );				//get the sidebar cell
			sidebar_temp = document.getElementById( "sidebar" ).cloneNode( true );	//copy to temp object
			var content_cell = document.getElementById( "content" );				//get the content cell
			
			//new sponsor bar deal
			var sponsors_cell = document.getElementById( "sponsorbar" );				//get the sponsorbar
			
			//make the sidebar go away
			sidebar_row.removeChild( sidebar_cell );
			
			//fudge the colspan of the content cell
			sponsors_cell.colSpan += 1;
			
			//finish
			sidebar_is = "off";
		}
		 else
		{
			//insert the sidebar
			var sidebar_row = document.getElementById( "funRow" );					//get the content/sidebar row
			var content_cell = document.getElementById( "content" );				//get the content cell
			
			//new sponsor bar deal
			var sponsors_cell = document.getElementById( "sponsorbar" );				//get the sponsorbar
			
			//make the sidebar come back
			sidebar_row.insertBefore( sidebar_temp, content_cell );
			
			//fudge the colspan of the content cell
			sponsors_cell.colSpan -= 1;
			
			//finish
			sidebar_is = "on";
		}
	}
	
	function ZL_HandleMenuToggler( cEvent )
	{
		//if the sidebar toggle functionality is disabled, abort
		if( zl_sidebar_toggling_enabled != true )
			return;
			
		if( sidebar_is == "on" )
		{
			if( (cEvent.clientX >= 159) && (cEvent.clientX <= 180) && (cEvent.clientY >=78))
			{
				ZL_ToggleSideBar();
				document.getElementById( 'content' ).className = "contentSpace";
			}		
		}
		 else
		{
			if( (cEvent.clientX >= 0) && (cEvent.clientX <= 24) && (cEvent.clientY >=78))
			{
				ZL_ToggleSideBar();
				document.getElementById( 'content' ).className = "contentSpace";
			}	
		}
	}
	
	function ZL_HandleMenuHover( cEvent )
	{
		//if the sidebar toggle functionality is disabled, abort
		if( zl_sidebar_toggling_enabled != true )
			return;
			
		if( sidebar_is == "on" )
		{
			if( (cEvent.clientX >= 159) && (cEvent.clientX <= 180) && (cEvent.clientY >=78))
			{
				//show hand
				if( document.getElementById( 'content' ).className != "contentSpaceHover")
					document.getElementById( 'content' ).className = "contentSpaceHover";
			}
			 else
			{
				if( document.getElementById( 'content' ).className != "contentSpace" )
					document.getElementById( 'content' ).className = "contentSpace";
			}
		}
		 else
		{
			if( (cEvent.clientX >= 0) && (cEvent.clientX <= 24) && (cEvent.clientY >=78))
			{
				//show hand
				if( document.getElementById( 'content' ).className != "contentSpaceHover")
					document.getElementById( 'content' ).className = "contentSpaceHover";
			}
			 else
			{
				if( document.getElementById( 'content' ).className != "contentSpace" )
					document.getElementById( 'content' ).className = "contentSpace";
			}
		}
	}
	
	function ZL_HideBalloon( balloon )
	{
		document.getElementById( balloon ).className = "balloonHidden";
		document.getElementById( balloon + "_text").className = "balloonHidden";
	}
	
	function ZL_Toggle_Menu_Block( block_name )
	{
		//origional method got scrapped cause xslt rendering was too damn hard
		//the new plan is to attempt to toggle document id's with the 'block_name' appended with '_#' for a range of numbers (hardcoded maximum)
		//as soon as the first element is hit that fails the try clause, abort the toggleing
		
		var max_subitem_count = 100;	//fudge this if you ever need more (who knows why)
		var set_ajax_preference_to = "";
		for( var i=1; i <= max_subitem_count; i++)
		{
			try
			{
				if( document.getElementById( block_name + "_" + i ).className == "menuHidden")
				{
					document.getElementById( block_name + "_" + i ).className = "menuShown";
					document.getElementById( block_name + "_pointer").src = "/img/gen_layout/arrow_down.jpg";
					set_ajax_preference_to = "open";
				}
				else
				{
					//hide the menu item
					document.getElementById( block_name + "_" + i ).className = "menuHidden";
					document.getElementById( block_name + "_pointer").src = "/img/gen_layout/arrow.jpg";					
					set_ajax_preference_to = "closed";
				}
			} catch ( e )
			{
				//alert( e );
				if( zl_ajax_status == "on")
					makeRequest( "/preferences/?setmenu" + set_ajax_preference_to + "=" + block_name, zl_handle_menu_set );	
				return;
			}
		}
		
		
	}
	
	
	function ZL_COD_Petition_Validation( )
	{
		//check for all valid inputs before going
		if( (document.getElementById( "chkOnlySubmission" ).value != "") && 
			(document.getElementById( "chkHacking" ).value != "") && 
			(document.getElementById( "chkIWannaPlay" ).value != "") && 
			(document.getElementById( "chkWillingToPay" ).value != "") && 
			//(document.getElementById( "chkIWillAttend" ).value != "") && 
			(document.getElementById( "txtRealName" ).value != "") )
		{
			return true;
		}
		 else
		{
			alert( "You must agree to all of the terms and conditions and sign your name to continue. \nIf you do not, please leave this document." );
			return false;
		}
	}
	
	function ZL_deleteGroup( gid )
	{
		var result = confirm( "Are you sure you want to delete this group and abandon any group members?" );
		
		if( !result )
		{
			return false;
		} else
		{
			//yeah actully delete this beast
			return true;
		}
	}