// JavaScript Document
//this is a generic ajax function i found online. I provided comments and  moddified the script to write content into a div layer chosen by its id.
var opie = 0;
function rollDown(DivId){
	
	if(opie != 1){
		$('#'+ DivId).slideDown('slow');
		opie = 1;
	}
	else{
		$('#'+ DivId).slideUp('slow');
		opie = 0 ;
	}	
}

function getMenu(Url,DivId,Method, bid)
{
	//create our requst object. We have to try 3 objects, for the different browsers.
 var AJAX;
 try
 {  
  AJAX = new XMLHttpRequest(); 
 }
 catch(e)
 {  
  try
  {    
   AJAX = new ActiveXObject("Msxml2.XMLHTTP");    
  }
  catch(e)
  {    
   try
   {
    AJAX = new ActiveXObject("Microsoft.XMLHTTP");      
   }
   catch(e)
   {      
    alert("Your browser does not support AJAX.");      
    return false;      
   }    
  }  
 }//once the request is sent, check with the server on the requests status. 
 AJAX.onreadystatechange = function()
 {//4 == complete
  if(AJAX.readyState == 4)
  {//200 = complete and ready!
   if(AJAX.status == 200)
   {//print the resulting data into the div layer
    document.getElementById(DivId).innerHTML = AJAX.responseText; 
	document.getElementById(bid).style.color = '#9caeaf'; 

   }
   else
   {//shit the bed
    alert("Error: "+ AJAX.statusText +" "+ AJAX.status);
   }
  }  
 }
 //send the request object
 AJAX.open(Method, Url, true);
 AJAX.send(null);
}


function closeIt(){
	$('#LilBox').slideUp('fast');
	$('#closeIt').slideUp('fast');
	var i = '';
	document.getElementById('LilContent').innerHTML = i;
	
}

//this is a generic ajax function i found online. I provided comments and  moddified the script to write content into a div layer chosen by its id.
function fetch(Url,divId,Method)
{
	//create our requst object. We have to try 3 objects, for the different browsers.
 var AJAX;
 try
 {  
  AJAX = new XMLHttpRequest(); 
 }
 catch(e)
 {  
  try
  {    
   AJAX = new ActiveXObject("Msxml2.XMLHTTP");    
  }
  catch(e)
  {    
   try
   {
    AJAX = new ActiveXObject("Microsoft.XMLHTTP");      
   }
   catch(e)
   {      
    alert("Your browser does not support AJAX.");      
    return false;      
   }    
  }  
 }//once the request is sent, check with the server on the requests status. 
 AJAX.onreadystatechange = function()
 {//4 == complete
  if(AJAX.readyState == 4)
  {
   //200 = complete and ready!
   if(AJAX.status == 200)
   {//print the resulting data into the div layer
  //	document.getElementById(DivId).innerHTML = AJAX.responseText;
	var wow = AJAX.responseText;	
	document.getElementById('LilContent').innerHTML = wow;
	$('#LilBox').slideDown('slow');
	$('#closeIt').slideDown('slow');
   }
   else
   {//shit the bed
    alert("Error: "+ AJAX.statusText +" "+ AJAX.status);
   }
  }  
 };
 //send the request object
 AJAX.open(Method, Url, true);
 AJAX.send(null);
}
/* <center><div id="LilBox"><div id="closeIt" onmouseup="(closeIt())"><img style="cursor:pointer;cursor:hand;" src="http://www.marinavillageresort.com/wp-content/themes/Marina-Village/Images/close.png"/></div><div id="LilContent"></div></div></center> */