/**
 * This function displays the submit button for an order if the terms have been accepted
 * @param string strChecked Whether or not the terms checkbox has been checked
 * 
 */
function acceptTerms (strChecked) {
	if (strChecked == 1) {
		$("#submit_order").show();
		$("#submit_order_disabled").hide();
	} else {
		$("#submit_order").hide();
		$("#submit_order_disabled").show();
	}
}

/**
 * This function displays a video file in a popup
 * @param string strURL The URL (with parameters) that is used to initiate the AJAX request
 * 
 */
function returnVideo (strURL) {
	// Request the AJAX data
	$.ajax({
		cache: false,
		url: strURL,
		beforeSend: function (){
			$('#TB_ajaxContent').html("");
			$('#video_modal').html("<p style=\"text-align: center;\"><img src=\"/assets/images/search/loading.gif\" width=\"16px\" height=\"16px\" border=\"0\" alt=\"Loading\" /></p>");
			tb_show('','#TB_inline?height=400&width=420&inlineId=video_modal&modal=true','');
		},
		success: function(html){
			$('#TB_ajaxContent').html(html);
		},
		error: function() {
			$('#TB_ajaxContent').html("<p>An error occurred retreiving this data.</p>");
		}
	});
}

/**
 * This function send a logging request to the logging functions from an in-page click
 * @param string strURL The URL (with parameters) that is used to initiate the AJAX request
 * 
 */
function sendLogRequest (root_url,linkType,referringPage,qsid,lang,op_id) {
	// Request the AJAX data
	$.ajax({
		cache: false,
		url: root_url + "LoggingSearchClick/linkType/" + linkType + "/referringPage/" + referringPage + "/qsid/" + qsid + "/lang/" + lang + "/op_id/" + op_id + "/",
		beforeSend: function (){
		},
		success: function(html){
		},
		error: function() {
		}
	});
}

/**
 * This function displays the room type availability calendar in search
 * @param string strURL The URL (with parameters) that is used to initiate the AJAX request
 * 
 */
function returnRoomTypeCalendar (strURL) {
	// Request the AJAX data
	$.ajax({
		cache: false,
		url: strURL,
		beforeSend: function (){
			$('#TB_ajaxContent').html("");
			$('#product_modal').html("<p style=\"text-align: center;\"><img src=\"/assets/images/search/loading.gif\" width=\"16px\" height=\"16px\" border=\"0\" alt=\"Loading\" /></p>");
			tb_show('','#TB_inline?height=560&width=660&inlineId=product_modal&modal=true','');
		},
		success: function(html){
			$('#TB_ajaxContent').html(html);
		},
		error: function() {
			$('#TB_ajaxContent').html("<p>An error occurred retreiving this data.</p>");
		}
	});
}
