// Prototype is required
var configGuestComments = new Array();
configGuestComments['pathPHP'] = '/smartreserve/loadGuestComments.php';
configGuestComments['loadingIcon'] = 'Loading....';
configGuestComments['AllReviewBTN'] = '';

function loadGuestComments(HotelID)
{
	// Hide Button first.
	$('btnBlGuest').style.display = "none";
	
	// Call Items
	var url = configGuestComments['pathPHP'];
	var pars = 	'codeSection=preview';
		pars += '&HotelID='	+ escape(HotelID);
	var myAjax = new Ajax.Updater('GuestComments', url, {method: 'get', parameters: pars, onComplete: chkGuestCommentStatus});
}

function chkGuestCommentStatus()
{
	var tmpChk = $('GuestComments').innerHTML;
	if (tmpChk == '') 
	{ 
		$('btnBlGuest').style.display = "none";
	}
	else
	{
		$('btnBlGuest').style.display = "";
	}
}

function loadAllGuestReview(HotelID)
{
	showGuestComments();
	$('showAllGuestComments').innerHTML = configGuestComments['loadingIcon'];
	// Call Items
	var url = configGuestComments['pathPHP'];
	var pars = 	'codeSection=allComments';
		pars += '&HotelID='	+ escape(HotelID);
	var myAjax = new Ajax.Updater('showAllGuestComments', url, {method: 'get', parameters: pars});
}

function hideGuestComments()
{
	$('showAllGuestComments').style.display = "none";
	$('AllReviewBTN').href = 'javascript:showGuestComments()';
	$('AllReviewBTN').innerHTML = configGuestComments['AllReviewBTN'];
}

function showGuestComments()
{
	$('showAllGuestComments').style.display = "";
	configGuestComments['AllReviewBTN'] = $('AllReviewBTN').innerHTML;
	$('AllReviewBTN').href = 'javascript:hideGuestComments()';
	$('AllReviewBTN').innerHTML = 'Hide It';
}
