
			
			
			function toggledisplay(nr)
			{	
				if (document.layers)
				{
					current = (document.layers[nr].display == 'none') ? 'block' : 'none';
					document.layers[nr].display = current;
				}
				else if (document.getElementById)
				{
					vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
					document.getElementById(nr).style.display = vista;
				}
				else if (document.all)
				{
					current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
					document.all[nr].style.display = current;
				}
			}
			function setdisplay(nr,display)
			{	
				if (document.layers)
				{
					document.layers[nr].display = display;
				}
				else if (document.getElementById)
				{
					document.getElementById(nr).style.display = display;
				}
				else if (document.all)
				{
					document.all[nr].style.display = display;
				}
			}
			function openpopup(href)
			{
				window.open(href,'mywindow','width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=no');
			}
			
			function showimageattachment(id)
			{
				window.open('showImage.php?openinwindow=true&table=image_attachment&row_id='+id,'preview','width=600,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=no');
			}
			
			
			
					
		
		function MM_preloadImages() { //v3.0
		
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		
		}
		
		
		
		function MM_swapImgRestore() { //v3.0
		
		  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
		
		}
		
		
		
		function MM_findObj(n, d) { //v4.01
		
		  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		
		  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		
		  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		
		  if(!x && d.getElementById) x=d.getElementById(n); return x;
		
		}
		
		
		
		function MM_swapImage() { //v3.0
		
		  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		
		   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
		
		}
		
	/*==================================================================*\
	| AJAX Stuff 
	\*==================================================================*/
			
		function ajaxloading()
		{
			$('load').style.display = 'block';
			/*$('results').style.display = 'none';*/
		}
		function ajaxfailed()
		{
			alert('ajax failed');	
		}
		
		/*==================================================================*\
		| Find-Photographers
		\*==================================================================*/
		function findServices (pagenum) {
			var url = 'index.php?url=youth-services-directory&ajax=true&pagenum='+pagenum;
			var pars = Form.serialize('form_services_directory');
			var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: ajaxloading, onComplete: findServicesResponse, onFailure: ajaxfailed} );
		}
		function findServicesResponse (originalRequest) {
			var newData = originalRequest.responseText;
			$('results').innerHTML = newData;
			$('results').style.display = 'block';
			$('load').style.display = 'none';
			setTimeout("$('load').style.display = 'none'; $('results').style.display = 'block';",100);
		}
		function showAllServices() {
			$('use_name').value=0;
			$('use_suburb').value=0;
			$('use_service').value=0;
			setdisplay('org_name','none');
			setdisplay('location','none');
			setdisplay('service','none');
			MM_swapImage('tab_service_left','','gfx/tab_off_left.jpg',1); 
			MM_swapImage('tab_service_icon','','gfx/tab_off_icon.jpg',1); 
			MM_swapImage('tab_service_right','','gfx/tab_off_right.jpg',1); 
			MM_swapImage('tab_location_left','','gfx/tab_off_left.jpg',1); 
			MM_swapImage('tab_location_icon','','gfx/tab_off_icon.jpg',1); 
			MM_swapImage('tab_location_right','','gfx/tab_off_right.jpg',1); 
			MM_swapImage('tab_org_name_left','','gfx/tab_off_left.jpg',1); 
			MM_swapImage('tab_org_name_icon','','gfx/tab_off_icon.jpg',1); 
			MM_swapImage('tab_org_name_right','','gfx/tab_off_right.jpg',1); 
			$('tab_service_middle').style.background='url(gfx/tab_off_mid.jpg)';
			$('tab_location_middle').style.background='url(gfx/tab_off_mid.jpg)';
			$('tab_org_name_middle').style.background='url(gfx/tab_off_mid.jpg)';
			findServices(1);
		}
		
		function getArticles(article_category) {
			var url = 'index.php?url=resources-and-information&ajax_articles=true&article_category='+article_category;
			/*var pars = Form.serialize('form_article_date');
			var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: articlesLoading, onComplete: getArticlesResponse, onFailure: ajaxfailed} );*/
			var myAjax = new Ajax.Request( url, {method: 'get', onLoading: articlesLoading, onComplete: getArticlesResponse, onFailure: ajaxfailed} );
			return false;
		}
		function getArticleCategories() {
			var url = 'index.php?url=resources-and-information&ajax_articles=true';
			var myAjax = new Ajax.Request( url, {method: 'get', onLoading: articlesLoading, onComplete: getArticlesResponse, onFailure: ajaxfailed} );
			return false;
		}
		function articlesLoading()
		{
			$('load').style.display = 'block';
			$('div_resource_articles').style.display = 'none';
		}
		
		function getArticlesResponse (originalRequest) {
			var newData = originalRequest.responseText;
			$('div_resource_articles').innerHTML = newData;
			Effect.Appear('div_resource_articles',{duration:0.4});
			$('load').style.display = 'none';
			setTimeout("$('load').style.display = 'none'; $('div_resource_articles').style.display = 'block';",100);
		}
		
		function getResources() {
			var url = 'index.php?url=resources-and-information&ajax_resources=true';
			var pars = Form.serialize('form_resource_date');
			var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: resourcesLoading, onComplete: getResourcesResponse, onFailure: ajaxfailed} );
			return false;
		}
		function resourcesLoading()
		{
			$('resource_load').style.display = 'block';
			$('div_media_resources').style.display = 'none';
		}
		
		function getResourcesResponse (originalRequest) {
			var newData = originalRequest.responseText;
			$('div_media_resources').innerHTML = newData;
			Effect.Appear('div_media_resources',{duration:0.4});
			$('resource_load').style.display = 'none';
			setTimeout("$('resource_load').style.display = 'none'; $('div_media_resources').style.display = 'block';",100);
		}
