// ----------------------------------------------
// defines what a kid is
// kids will be defined from:  
// lto.CHILDREN_FROM to
// lto.CHILDREN_TO  
// ----------------------------------------------
lto.CHILDREN_FROM = 0; 
lto.CHILDREN_TO = 13; 
lto.JUMP_TO_FIRST_AVAILABLE_DATE = 0;

// ----------------------------------------------
// show HTML content in modal way
// ----------------------------------------------
lto.showContentInForeground = function(options){
	//set the content in the modal box
	$('modalBox').innerHTML = options.content; 

	sm('modalBox',options.width|'',options.height|'',options.left?options.left:null,options.top?options.top:null);
}

// ----------------------------------------------
// hide HTML content in modal way
// ----------------------------------------------
lto.hideContentInForeground = function(){
	hm('modalBox');
	$('modalBox').innerHTML = ""; 
}
 
// ----------------------------------------------
// include needed files
// ----------------------------------------------
lto.include = function(fileName){
    document.write('<script type="text/javascript" src="'+fileName+'"></script>');
}

// ==================================================
// MAIN
// ==================================================
var path='..';
var bm='';
var language=lgitp.librariesBaseLanguage!=null?lgitp.librariesBaseLanguage:'fr';
try{
	if(_path){
	    path=_path;
	}
    if(_bm){
        bm=_bm;
    }
    if(_language){
        language=_language;
    }
}catch (Identificateur){
    //Nothing to do
}


lto.libs = [
    'bookingMask.js',
    'modalBox.js',
    'dateUtilities.js',
    'labels.js',
    /*
    'jscalendar/calendar.js',
    'jscalendar/lang/calendar-'+language+'.js',
    'jscalendar/calendar-setup.js'
    */
    
    'calendar/jscalendar/calendar.js',
    'calendar/jscalendar/lang/calendar-'+language+'-utf8.js',
    'calendar/jscalendar/calendar-setup.js',
    'calendar/CalendarHandler.js'
    
];



lto.hotelBookingMasklibs=[
    'date.js',
    '../pages/hotelScriptLabels.faces?language='+language,
    '../dwr/engine.js',
    '../dwr/interface/HotelManager.js',
    'hotelBookingMask.js'
];
lto.carBookingMasklibs=[
    'date.js',
    '../pages/carScriptLabels.faces?language='+language,
    '../dwr/engine.js',
    '../dwr/interface/CarManager.js',
    'carBookingMask.js'
];

//include needed files
for(var i=0; i<lto.libs.length; i++){
    //alert(path+'/' + lto.libs[i]);
    //lto.include(path+'/' + lto.libs[i]);
    lgitp.libraryHandler.include(lto.libs[i]); 
}
if(bm!=''){
    var libs=eval('lto.'+bm+'libs');
    for(var i=0; i<libs.length; i++){
        //lto.include(path+'/' + libs[i]);
        lgitp.libraryHandler.include(libs[i]);
    }
}
