 function fnArrow(button, tmpId){
  if(document.getElementById(button).src=="http://covemountaincounseling.com/images/arrow_down.gif"){
   document.getElementById(button).src="http://covemountaincounseling.com/images/arrow_side.gif";
   document.getElementById('idMenu_'+tmpId).style.display="none";
	} else {
   document.getElementById(button).src="http://covemountaincounseling.com/images/arrow_down.gif";
   ajaxGetMenu(tmpId);
	}	
 }
 
 function fnIframeReload(){
  var iframe=document.getElementById('idIframe');
  if (iframe.contentDocument) { // For NS6
    iframeDocument = iframe.contentDocument; 
  } else if (iframe.contentWindow) { // For IE5.5 and IE6
    iframeDocument = iframe.contentWindow.document;
  } else if (iframe.document) { // For IE5
    iframeDocument = iframe.document;
  } else { // We got nothin.
    alert("Error: could not find IFRAME document");
  }
  document.getElementById('idMiddle').innerHTML=iframeDocument.body.innerHTML +'<br/><br/>';
 }

//-- IFRAME

 function fnIframeLoaded(){
  var iframe=document.getElementById('idIframe');
  if (iframe.contentDocument) { // For NS6
    iframeDocument = iframe.contentDocument; 
  } else if (iframe.contentWindow) { // For IE5.5 and IE6
    iframeDocument = iframe.contentWindow.document;
  } else if (iframe.document) { // For IE5
    iframeDocument = iframe.document;
  } else { // We got nothin.
    alert("Error: could not find IFRAME document");
  }
  document.getElementById('idMiddle').innerHTML=iframeDocument.body.innerHTML +'<br/><br/>';
	//alert(iframeDocument.body.innerHTML);
 }
 
function fnMenuSelection(selection){
   document.getElementById('idIframe').src='admin/cms/display/'+ selection;
   ajaxBreadCrumbs(selection); 
} 

//-- AJAX FOR GET MENU --//
function ajaxGetMenu(tmpId)
{
//alert('ajaxShowPrompt');

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;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {

			 //alert(xmlHttp.responseText);
			 document.getElementById('idMenu_'+tmpId).innerHTML=xmlHttp.responseText;
			 document.getElementById('idMenu_'+tmpId).style.display="block";			 
			 
      }
    }
	xmlHttp.open("GET","xml/xml_get_menu.php?id="+tmpId,true);
	
  xmlHttp.send(null);
  }
//-- AJAX FOR GET MENU END --//


//-- AJAX FOR GET MENU --//
function ajaxBreadCrumbs(tmpFilename)
{
//alert('ajaxShowPrompt');

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;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
			 //alert(xmlHttp.responseText);
       document.getElementById('idBreadCrumbs').innerHTML=xmlHttp.responseText;

    	 if(document.getElementById('idBreadCrumbsOn').value==1){
          document.getElementById('idBreadCrumbsWrap').style.display="block";
    	 } else {
    	  document.getElementById('idBreadCrumbsWrap').style.display="none";			 
    	 }			 
			 
      }
    }
	xmlHttp.open("GET","xml/xml_bread_crumbs.php?id="+tmpFilename,true);
	
  xmlHttp.send(null);
  }
//-- AJAX FOR GET MENU END --//
