var arrayTypeColors = new Array('#ffffff', '#eeffee', '#eeff88', '#7ed959', '#bbbbff', '#ffaa99', '#aaff88');

var arrayType = new Array('blank', 'nonbookable', 'bookable', 'booked', 'subscribe', 'full', 'reserv');

var arrayDays = new Array('Söndag', 'Måndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lördag');

function oSchedule() {
	var o = new Object();
	this.week = '';
	this.monday = '';
	// save = 0, doesn't need to be saved. Save = 1, a change has been made. 
	this.save = '0';
	this.jobbid = '';
	this.user = '';
	this.userid = '';
	// schedule mode switches between booking-mode and drawing-mode. 
	this.mode = '';
}

function oDay() {
	var o = new Object();
	this.date = '';
	this.text = '';

	// morning, day, afternoon, evening
	this.block_type_id = '';
	this.block_start = '';
	this.block_end = '';
	
	this.colspan = 1; // used when setting colspan

	return o;
}

function oWeek() {
	var o = new Object();
	this.block_type_id = '';
	return o;
}

function oTime() {
	var o = new Object();
	this.time_from = '';
	this.time_from_text = '';
	this.time_to = '';
	this.time_to_text = '';
	this.type = '';
	this.nrofbookings = ''; // defines number of bookings

	return o;
}

function oBooking() {
	var o = new Object();
	
	this.type = '';
	this.type_id = '';
	this.history_type_id = '';
	this.ignore = '';
	
	return o;
}

function oBookingInfo() {
	var o = new Object();
	
	this.time_from = '';
	this.time_to = '';
	this.descr = '';
	this.jobbnamn = '';
	this.type_id = '';
	this.duration = '';
	this.status = '';
	this.mappingid = '';
	this.scheduleid = '';
	
	return o;
}

function oPreferences() {
	var o = new Object();
	
	this.workday_start = 0;
	this.workday_end = 0;
	this.workday_interval = 0;
	this.workday_exclude = 0;
	
	return o;
}

// Contains basic information about the schedule; monday, weeknumber and save-flag
var oSchedule = new oSchedule();

// Contains the users preferences
var oPreferences = new oPreferences();

// Array containing the whole schedule
var oSarray = new Array();

// Array containing all the booking information
var oBarray = new Array();

// Array containing the bookings
var oCheckBookingArray = new Array();