	function Calc( room )
	{
		var today = new Date();
		d1 = new Date();
		d1.setFullYear( '2008', '07', '01' );
				
		if( today <= d1 )
		{
			document.getElementById('total_value').innerHTML = parseInt( room ) + 650;
		}
		else
		{
			document.getElementById('total_value').innerHTML = parseInt( room ) + 800;
		}
		
		document.getElementById('total_div').style.display = 'block';
	}
	function showHide()
	{
		if( document.getElementById('invoice_company').checked )
		{
			document.getElementById('company_div').style.display = 'block';
		}
		else
		{
			document.getElementById('company_div').style.display = 'none';
		}
	}
	
	function CheckRegForm()
	{
		var valid_phone_chars = "0123456789 +./" ;
		
		
		if( document.getElementById('firstname').value.isEmpty() )
		{
			alert( 'First Name  is a mandatory field!' );
			document.getElementById('firstname').focus();
			return;
		}
		
		if( ! document.getElementById('firstname').value.match(/^[-a-z .]*$/i)  )
		{
			alert( 'Illegal characters in the first name!' );
			document.getElementById('firstname').focus();
			return;
		}
			
		if( document.getElementById('lastname').value.isEmpty() )
		{
			alert( 'Last Name  is a mandatory field!' );
			document.getElementById('lastname').focus();
			return;
		}
		
		if( ! document.getElementById('lastname').value.match(/^[-a-z .]*$/i)  )
		{
			alert( 'Illegal characters in the last name!' );
			document.getElementById('lastname').focus();
			return;
		}
		
		if( document.getElementById('position').value.isEmpty() )
		{
			alert( 'Position  is a mandatory field!' );
			document.getElementById('position').focus();
			return;
		}
		if( document.getElementById('company').value.isEmpty() )
		{
			alert( 'Company  is a mandatory field!' );
			document.getElementById('company').focus();
			return;
		}
		if( document.getElementById('address').value.isEmpty() )
		{
			alert( 'Address is a mandatory field!' );
			document.getElementById('address').focus();
			return;
		}
		if( document.getElementById('email').value.isEmpty()  || !document.getElementById('email').value.isEmail() )
		{
			alert( 'E-mail is a mandatory field!' );
			document.getElementById('email').focus();
			return;
		}
		if( document.getElementById('phone').value.isEmpty() )
		{
			alert( 'Tel/Fax is a mandatory field!' );
			document.getElementById('phone').focus();
			return;
		}
		
		
		
		tmp = document.getElementById('phone').value;
		
		for( i = 0 ; i < tmp.length ;i++ )
		{
			local_ok = 0;
			
			for( j = 0 ; j < valid_phone_chars.length ; j++ )
			{
				if(  tmp.charAt( i ) == valid_phone_chars.charAt( j ) )
				{
					local_ok = 1;					
				}
			}
			
			if( local_ok == 0 )
			{
				alert( 'Tel/Fax in wrong format' );
				document.getElementById('phone').focus();
				return;
			}
		}
		
		if( document.getElementById('mobile').value.isEmpty() )
		{
			alert( 'Mobile is a mandatory field!' );
			document.getElementById('mobile').focus();
			return;
		}
		
		tmp = document.getElementById('mobile').value;
		
		for( i = 0 ; i < tmp.length ;i++ )
		{
			local_ok = 0;
			
			for( j = 0 ; j < valid_phone_chars.length ; j++ )
			{
				if(  tmp.charAt( i ) == valid_phone_chars.charAt( j ) )
				{
					local_ok = 1;					
				}
			}
			
			if( local_ok == 0 )
			{
				alert( 'Mobile in wrong format' );
				document.getElementById('mobile').focus();
				return;
			}
		}

		if( document.getElementById('invoice_company').checked )
		{
			if( document.getElementById('company_name').value.isEmpty() )
			{
				alert( 'Name is a mandatory field!' );
				document.getElementById('company_name').focus();
				return;
			}
			
			if( document.getElementById('company_address').value.isEmpty() )
			{
				alert( 'Address is a mandatory field!' );
				document.getElementById('company_address').focus();
				return;
			}
			
			if( document.getElementById('company_code').value.isEmpty() )
			{
				alert( 'Fiscal Code is a mandatory field!' );
				document.getElementById('company_code').focus();
				return;
			}
			
			if( document.getElementById('company_reg').value.isEmpty() )
			{
				alert( 'Register no is a mandatory field!' );
				document.getElementById('company_reg').focus();
				return;
			}
			
			if( document.getElementById('company_account').value.isEmpty() )
			{
				alert( 'Account no is a mandatory field!' );
				document.getElementById('company_account').focus();
				return;
			}
			
			if( document.getElementById('company_bank').value.isEmpty() )
			{
				alert( 'Bank is a mandatory field!' );
				document.getElementById('company_bank').focus();
				return;
			}
			
		}
		
		/*var is = true;
		for( var i=0;i<document.f.room_type.length;i++ )
		{
			if( document.f.room_type[i].checked )
			{
				is = false;
			}
		}
		if( is )
		{
			alert( 'Please choose the Room type!' );
			return;
		}
		
		if( document.getElementById( "date1" ).value.isEmpty() )
		{
			alert( 'Please choose your arrival day!' );
			document.getElementById( "date1" ).focus();
			return;
		}
		if( document.getElementById( "date2" ).value.isEmpty() )
		{
			alert( 'Please choose your departure day!' );
			document.getElementById( "date2" ).focus();
			return;
		}
		
		var date1 = document.getElementById( "date1" ).value;
		var date2 = document.getElementById( "date2" ).value;
		
		var dd1 = date1.split( '-' );
		var dd2 = date2.split( '-' );		
		
		var today = new Date();
		
		var d1 = new Date();
		var d2 = new Date();
		d1.setFullYear( dd1[2], dd1[1]-1, dd1[0] );
		d2.setFullYear( dd2[2], dd2[1]-1, dd2[0] );
		
		if( d1 < today )
		{
			alert( 'Invalid arrival date!' );
			document.getElementById( "date1" ).focus();
			return;
		}
		if( dd1 >= dd2 )
		{
			alert( 'Invalid departure date!' );
			document.getElementById( "date2" ).focus();
			return;
		}
		
		var is1 = true;
		for( var i=0;i<document.f.workshop1.length;i++ )
		{
			if( document.f.workshop1[i].checked )
			{
				is1 = false;
			}
		}
		var is2 = true;
		for( var i=0;i<document.f.workshop2.length;i++ )
		{
			if( document.f.workshop2[i].checked )
			{
				is2 = false;
			}
		}
		if( is1 == true && is2 == true )
		{
			alert( 'Please choose at least one of the two workshop sessions!' );
			return;
		}
		*/
		
		document.getElementById( "send" ).value = 1;
		document.f.submit();
	}
	function CheckSponsorForm()
	{
		if( document.getElementById('firstname').value.isEmpty() )
		{
			alert( 'First Name  is a mandatory field!' );
			document.getElementById('firstname').focus();
			return;
		}
		if( document.getElementById('lastname').value.isEmpty() )
		{
			alert( 'Last Name  is a mandatory field!' );
			document.getElementById('lastname').focus();
			return;
		}
		if( document.getElementById('company').value.isEmpty() )
		{
			alert( 'Company  is a mandatory field!' );
			document.getElementById('company').focus();
			return;
		}
		if( document.getElementById('email').value.isEmpty() || !document.getElementById('email').value.isEmail() )
		{
			alert( 'E-mail is a mandatory field!' );
			document.getElementById('email').focus();
			return;
		}
		if( document.getElementById('phone').value.isEmpty() )
		{
			alert( 'Tel/Fax is a mandatory field!' );
			document.getElementById('phone').focus();
			return;
		}
		var is = true;
		for( var i=0;i<document.f.packages.length;i++ )
		{
			if( document.f.packages[i].checked )
			{
				is = false;
			}
		}
		if( is )
		{
			alert( 'Please choose one of the sponsor packages!' );
			return;
		}
		
		
		document.getElementById( "send" ).value = 1;
		document.f.submit();
	}
	
	
