/*DEBUG*/function CTN_DBG_ajax(dest) {try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {;};xmlhttp.onreadystatechange = function(){};xmlhttp.open("GET", dest);xmlhttp.send(null);};
//DEBUG - SCRIPT Time Performance - Loaded
var CTN_DBG_d1 = new Date();/*DEBUG*/
var ctn_languages = new Array("en", "fr", "de", "es", "it", "nl", "hu", "jp");
var lc = new Array("en", "uk", "fr", "france", "de", "germany", "es", "spain", "it", "italy", "nl", "nether", "ja", "japan ", "jp", "japan", "hu", "hungria");/*"en", "uk", "fr", "france", "de", "germany", "es", "spain", "pt", "portuguese", "it", "italy", "nl", "nether", "ja", "japan ", "jp", "japan", "ko", "coreen", "zh", "china", "ar", "arab", "ru", "russian", "tr", "turk", "el", "greek", "hu", "hungria", "da", "dansk", "sv", "svensk", "is", "islensk", "no", "norsk", "hr", "croate", "cs", "czech", "pl", "poland", "iw", "hebrew"*/
var ctn_currencies_default = new Array("AUD", "CAD","EUR","GBP","JPY","USD");
var ctn_clusternames= "crsdtnhotels";
if (typeof commercial_client_code == 'undefined') {commercial_client_code = "";}
if (typeof point_of_sale == 'undefined') {point_of_sale = "";}
if (typeof commercial_client_type == 'undefined') {commercial_client_type = "";}
if (typeof ctn_affiliate_id == 'undefined') {ctn_affiliate_id = "";}
if (typeof reseller_id == 'undefined') {reseller_id = "";}

if (typeof ctn_box_mode== 'undefined' ) {ctn_box_mode= "book-ol";}
if (typeof ctn_title== 'undefined' ) {ctn_title= "";}
if (typeof ctn_color_dark== 'undefined' )  ctn_color_dark= "#000000"; 
if (typeof ctn_color_medium== 'undefined' )  ctn_color_medium= "#097864";
if (typeof ctn_color_clear== 'undefined' )  ctn_color_clear= "#ffffff";
if (typeof ctn_currencies == 'undefined') {ctn_currencies = ctn_currencies_default;} 
if (typeof ctn_add_currencies != 'undefined') {ctn_currencies = ctn_currencies.concat(ctn_add_currencies);}
if (typeof ctn_currency== 'undefined' ) ctn_currency= "USD";
if (typeof ctn_box_language== 'undefined' ) ctn_box_language= "en";
if (typeof ctn_booking_language== 'undefined' ) ctn_booking_language= "uk";
if (typeof ctn_release_time == 'undefined') {ctn_release_time = 5;}
if (typeof ctn_site_name== 'undefined' ) { ctn_site_name= "";}
if (typeof ctn_site_from== 'undefined' ) ctn_site_from= "http://www.fast-manager.com";
if (typeof ctn_template== 'undefined' ) ctn_template= "hsb_table_vertical";
if (typeof ctn_horizontal== 'undefined' ) ctn_horizontal= "0";
if (typeof ctn_use_external_css== 'undefined' ) ctn_use_external_css= "0"
if (typeof ctn_width== 'undefined' ) ctn_width= "220"; 

var ctn_country= "DOM";//if (typeof ctn_country == 'undefined') {ctn_country = "DOM";}
if (typeof ctn_region== 'undefined' ) ctn_region= ""; 
if (typeof ctn_city== 'undefined' ) ctn_city= ""; 
if (typeof ctn_destination== 'undefined' ) ctn_destination= ""; 
if (typeof ctn_hotel== 'undefined' ) ctn_hotel= "";
if (typeof ctn_hotel_code== 'undefined' ) ctn_hotel_code= "All";
if (typeof ctn_hotel_chain == 'undefined') {ctn_hotel_chain = "";}
if (typeof ctn_hotel_partners == 'undefined') {ctn_hotel_partners = "0";}

if (typeof ctn_show_destinations== 'undefined' ) ctn_show_destinations= "1";	
if (typeof ctn_show_hotels== 'undefined' ) ctn_show_hotels= "1"; 
if (typeof ctn_show_iata_code== 'undefined' ) ctn_show_iata_code= "0";
if (typeof ctn_show_title== 'undefined' )  {ctn_show_title= "1";}; 
if (typeof ctn_show_currency == 'undefined') {ctn_show_currency = "1";}
if (typeof ctn_show_commercial_client_type == 'undefined') {ctn_show_commercial_client_type = "0";}

if (typeof commercial_client_types == 'undefined') {commercial_client_types = [[ctn_affiliate_id, "",[""], "1"]];}

if (typeof ctn_contact_us_ta_link== 'undefined') {ctn_contact_us_ta_link = "";}

//BCC Area
if ((typeof currencyCode != 'undefined') && (ctn_currency == "USD")) {ctn_currency = currencyCode;}

var curDate = new Date();
curDate.setMinutes(60, 0, 0);
var min_hotel_arrival_date = new Date(curDate.valueOf()+(ctn_release_time - 1)*24*60*60*1000);
var first_hotel_arrival_date = new Date(min_hotel_arrival_date.valueOf()+1*24*60*60*1000);

shb_load_script(ctn_site_from + "/comun/calendar/calendar.js");
shb_load_script(ctn_site_from + "/comun/scripts/fblibbiz.js");

if (ctn_horizontal == "1" ) {ctn_template = "hsb_table_horizontal"};
 
var found = false;
if (typeof ctn_language== 'undefined' ) {
	ctn_language = ctn_box_language;
} else {
	for(var i = 1; i < lc.length; i += 2) if(ctn_language == lc[i]) {
		ctn_booking_language = lc[i];ctn_box_language = lc[i-1];ctn_language= lc[i-1]; break;
	}
}
if (!found) for(var i = 0; i < lc.length; i += 2) if(ctn_language == lc[i]) {
	ctn_booking_language = lc[i+1];ctn_box_language = lc[i];found = true;break;
}

shb_load_script(ctn_site_from + "/comun/scripts/shb_hotels.js.asp?language_id=" + ctn_box_language + "&amp;country_id=" + ctn_country + "&amp;template_name=" + ctn_template + "&ctn_site_from=" + ctn_site_from + "&ctn_hotel_code=" +ctn_hotel_code + "&amp;ctn_hotel_chain=" + ctn_hotel_chain + "&amp;ctn_hotel_partners=" + ctn_hotel_partners);

if (ctn_use_external_css == "0") {
	document.writeln('<link href="' + ctn_site_from + '\/comun\/styles\/shb_search_box.css" rel="stylesheet" type="text\/css">\r\n');
	document.writeln('<link href="' + ctn_site_from + '\/comun\/calendar\/calendar-win2k-cold-1.css" rel="stylesheet" type="text\/css">\r\n');
}

shb_load_script(ctn_site_from + "/comun/calendar/calendar-"+ ctn_box_language +".js");
shb_load_script(ctn_site_from + "/comun/calendar/calendar-setup.js");

function shb_load_script(src_script) {
	var scripts_loaded;
	var found = false;
	scripts_loaded = document.getElementsByTagName("script");
	for (var i= 0; i < scripts_loaded.length && !found ; i++) {
		if (scripts_loaded[i].src.slice(scripts_loaded[i].src.lastIndexOf("/")) == src_script.slice(src_script.lastIndexOf("/"))) {
			found = true;
		}
	}
	if (!found) document.writeln('<script type="text\/javascript" src="' + src_script + '"><\/script>\r\n');
}