	// Check if browser is IE
	// This check is needed because IE does not support events added with DOM. so
	// if the browser is not IE we will use the DOM to add events otherwise we will
	// use the standard JS to perform the same operation

	var is_ie/*@cc_on = {
		// quirksmode : (document.compatMode=="BackCompat"),
		version : parseFloat(navigator.appVersion.match(/MSIE (.+?);/)[1])
	}@*/;

	var num_attendees = 1;

	window.onload = function()
	{
		Nifty("div#header","top fixed-height");
		Nifty("div#sidebar","tl bl transparent fixed-height");
		Nifty("div#bookBanner","top bottom fixed-height");
	
		pngfix();
	}





	/*
	==============================================
		Controls and functions for the booking
	==============================================
	*/

	// Check if browser support DOM
	var is_dom_capable = (document.createElement && document.getElementsByTagName);

	function addAttendee()
	{
		// If browser does not support DOM quit
		if(!is_dom_capable)
			return;

		// Next value
		var new_index = num_attendees + 1;

		// Add the attendee form info
		var firstAttendee = $('attendee_' + num_attendees);

		// Clone the form data
		var list = firstAttendee.cloneNode(true);

		// Change all ids
		if(list.hasChildNodes())
		// So, first we check if the object is not empty, if the object has child nodes
		{
			var children = list.childNodes;
			for(var index = 0; index < children.length; index++)
			{
				var child = children[index];
				if(child.tagName == 'DT')
				{
					// The tag in this case is the label
					var label = child.firstChild;
					if(label.attributes.length > 0)
					{
						// Get the value of the for attribute
						var id_reference = label.attributes['for'].nodeValue;

						// Look for the underscore and buil the prefix
						var joint_point = id_reference.lastIndexOf('_');
						var id_prefix = id_reference.slice(0,id_reference.indexOf("_") + 1);

						// Set the for value
						if(is_ie)
							label.setAttribute('htmlFor',id_prefix + new_index);
						else
							label.setAttribute('for',id_prefix + new_index);
					}
				}

				if(child.tagName == 'DD')
				{
					if(child.firstChild.attributes != null)
					{
						// Update the id of the select
						child.firstChild.setAttribute('id',id_prefix + new_index);
					}
				}
			}
		}

		// Set the new id for the block of inputs and hide it
		list.setAttribute('id','attendee_' + new_index);
		list.hide();

		var parent = $('bookForm');
		var buttonDiv = $('sendButton');
		parent.insertBefore(list,buttonDiv);

		// Clean the content of the cloned elements
		for(index = 1; index < 6; index++)
		{
			var element_to_be_cleaned = document.getElementById('fd' + index + '_' + new_index);
			if(element_to_be_cleaned != null)
			{
				element_to_be_cleaned.value = '';
			}
		}

		new Effect.SlideDown('attendee_' + new_index);
		num_attendees++;
	}

	function validateAttendees()
	{
		for(index = 1; index <= num_attendees; index++)
		{
			var name = 'fd2_' + index;
			if($F(name) == '')
			{
				alert('The name cannot be empty');
				$(name).focus();
				return(false);
			}

			var email = 'fd3_' + index;
			if($F(email) == '')
			{
				alert('The email address cannot be empty');
				$(email).focus();
				return(false);
			}

			var email_filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
			if(!email_filter.test($F(email)))
			{
				alert('The email address is invalid');
				$(email).focus();
				return(false);
			}
		}
		return(true);
	}

	function validatePayer()
	{
		if($F('fd2_1') == '')
		{
			alert('The name cannot be empty');
			$('fd2_1').focus();
			return(false);
		}

		if($F('fd3_1') == '')
		{
			alert('The email address cannot be empty');
			$('fd3_1').focus();
			return(false);
		}

		var email_filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		if(!email_filter.test($F('fd3_1')))
		{
			alert('The email address is invalid');
			$('fd3_1').focus();
			return(false);
		}

		if($F('fd4_1') == '')
		{
			alert('The phone number cannot be empty');
			$('fd4_1').focus();
			return(false);
		}


		if($F('fd5_1') == '')
		{
			alert('The address cannot be empty');
			$('fd5_1').focus();
			return(false);
		}

		return(true);
	}

	var num_days_seminar = 0;
	function validateSeminars()
	{
		for(sem_days = 1; sem_days <= num_days_seminar; sem_days++)
		{
			for(index = 1; index < 20; index++)
			{
				if($('seminar_' + sem_days + '_' + index))
				{
					var seminar_element = $('seminar_' + sem_days + '_' + index);
					if(seminar_element.checked)
						return(true)
				}
			}
		}
		alert('You need to select at least one seminar!');
		return(false);
	}