// JavaScript Document
/*
This page handles all Javascript functions for Loading the new Search Resulst while user changing the Search Criteria.
*/

function pagination(page)
{
		document.getElementById('search_results_data').innerHTML	=	'<div id="right_column_2"><div id="loading"><img src="images/ajaxtooltip/ajaxload.gif" alt="site" /></div></div>'; 
		
		var cruiseline_id	 = 	document.getElementById("cruiseline_id").value;
		var dataString 	     = 	'search_ajax2.php?page=' + page + '&cruiseline_id='+cruiseline_id;  
	
		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)
				{
					document.getElementById('search_results_data').innerHTML	=	xmlHttp.responseText;
				}
		}
		xmlHttp.open("GET",dataString,true);
		xmlHttp.send(null);
}

/**
For review pagination in Review tab of Search results Page 2.
*/

function review(page)
{
		document.getElementById('review_tab').innerHTML	=	'<div id="right_column_2"><div id="loading"><img src="images/ajaxtooltip/ajaxload.gif" alt="site" /></div></div>'; 
		var cruise_details_id   = 	document.getElementById("cruise_details_id").value;
		var dataString 	     	= 	'search_ajax_review.php?page=' + page + '&cruise_details_id='+cruise_details_id;  
		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)
				{
					document.getElementById('review_tab').innerHTML	=	xmlHttp.responseText;
				}
		}
		xmlHttp.open("GET",dataString,true);
		xmlHttp.send(null);
}

/**
For Cruisers or Members TAB (Third TAB) pagination in Join-Cruise.php 
*/

function pagination_cruisers_tab(page)
{
		document.getElementById('cruisers_tab_cruisers_list').innerHTML	=	'<div id="right_column_2"><div id="loading"><img src="images/ajaxtooltip/ajaxload.gif" alt="site" /></div></div>'; 
		var cruise_details_id   = 	document.getElementById("cruise_details_id").value;
		var dataString 	     	= 	'search_results2_cruisers_tab_ajax.php?page=' + page + '&cdid='+cruise_details_id;  
		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)
				{
					document.getElementById('cruisers_tab_cruisers_list').innerHTML	=	xmlHttp.responseText;
				}
		}
		xmlHttp.open("GET",dataString,true);
		xmlHttp.send(null);
}


