<!--

function fade_box(id) {
	if (document.getElementById(id).className == '_fb_appear') {
		change(id,'_fb_disappear');
		new Effect.Appear(id, {duration:1, from:1.0, to:0});
	} else {
		change(id,'_fb_appear'); 
		new Effect.Appear(id, {duration:1, from:0, to:1.0});
	}
	
	return false;
}


function slide_box(id, base) {
	if (document.getElementById(id).className == '_sb_up') {
		if (document.getElementById(id+'_arrow')) {
			change(id+'_arrow','arrow_img_down');
		}
		change(id,'_sb_down');
		new Effect.SlideDown(id, {duration:1});		
		
	} else {
		if (document.getElementById(id+'_arrow')) {
			change(id+'_arrow','arrow_img_left');
		}
		change(id,'_sb_up');
		new Effect.SlideUp(id, {duration:1});
	}
	
	return false;
}

/* --------------------------------------------------- */

function ajaxObj()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
catch (e)
  {
  try
	{
	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
  catch (e)
	{
	alert("Your browser does not support AJAX!");
	return false;
	}
  }
}
return xmlHttp;
}// end function

function ajaxUpdate(obj,ref) {
	// AJAX
	var htmlObj = document.getElementById(obj);
	var xmlHttp = ajaxObj();
	var params = '';
	if (typeof(xmlHttp) != undefined) {
		xmlHttp.onreadystatechange=function()
		  {
		  if(xmlHttp.readyState==4)
			{
				var rval = xmlHttp.responseText;
				htmlObj.innerHTML = rval;
				//if (obj == 'smenu') {
					//$(htmlObj).show(); // display content
					//Effect.BlindDown(htmlObj); // display content with animation
				//}
			}
		}
		xmlHttp.open("post",ref,true);
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(params);
	} // end if
}


function slideMenu(linkObj) {
	
	var identity = 'sm_1';
	var identity2 = 'sm_2';	
	var content = 'smc_1';
	var content2 = 'smc_2';	
	var nav = 'smenu_nav';	
	
	var iObj = document.getElementById(content);
	var iObj2 = document.getElementById(content2);
	
	// str_replace() - defined in jsFathom.js
	ajaxUpdate(content2,linkObj.href+'/true'); // + true for ajax call
	ajaxUpdate(nav,str_replace('ajax_left_menu_','ajax_left_menu_nav_',linkObj.href));

	new Effect.Appear(identity2, {duration: 0.5, queue: {position: 'start', scope: 'item'}}); 
	new Effect.SlideUp(identity, {queue: {position: 'parallel', scope: 'item'}, afterFinish: 
		function() { 
			iObj.innerHTML = iObj2.innerHTML;
			iObj2.innerHTML = '';
			$(identity).show();
			$(identity2).hide();
		}
	});
	
} // end function
//-->
