// Definizione dell'oggetto Work che gestisce
// la sezione Work

var Work = {
	
	empty: true,

	Opened: function()
	{
		this.Open = true;
	},
	
	Closed: function(message)
	{
		this.Open = false;
		this.mnt_message = message;
	},
		
	StartWork: function()
	{
		Sito.StopHoverTitoli();
		if (this.empty)
			{
			$('Q1').empty();
			$('Q2').empty();
			$('Q3').empty();
			$('Q1').removeEvents('mouseenter');
			$('Q1').removeEvents('mouseleave');
			$('Q2').removeEvents('mouseenter');
			$('Q2').removeEvents('mouseleave');
			$('Q3').removeEvents('mouseenter');
			$('Q3').removeEvents('mouseleave');
			$('Q1').set('styles',{'top':'21px','height':'417px','width':'836px'});
			$('Q2').set('styles',{'top':'21px','height':'417px','width':'272px'});
			$('Q3').set('styles',{'top':'21px','height':'417px','width':'272px'});
			$('Q1').setStyle('display', 'inline');
			$('Q2').setStyle('display', 'none');
			$('Q3').setStyle('display', 'none');
			$('Q4').setStyle('display', 'none');
			$('body').setStyles({'overflow' : 'auto'});
			$('piva').setStyles({'visibility' : 'visible'});
			
		  //Sito.CambiaColore();		  
		  
		  /* Inserisco le cose che mi servono */
		    
		  var under = new Element('div',{'id':'under','text':'UNDER CONSTRUCTION'});
		  under.inject('Q1');
		  
		  $('under').set('morph', {duration: 1000});
		  $('under').get('morph').addEvents({
				'complete': function() {
										Sito.StartHoverTitoli();
									   }
									});
		  $('under').get('morph').start({
								'opacity': [0,1]
								});
		  }
		  
		  this.empty = false;
	},
	
	CloseWork: function()
	{
		if (!this.empty)
			{
			try
				{
				$('workwithus').removeClass('titoloblu');
				$('workwithus').addClass('titolonero');
				$('Q1').setStyles({'width' : '272px'});
				$('Q2').setStyles({'width' : '272px', 'left':'369px','display':'inline'});
				this.empty = true;
				}
			catch(e)
				{
				alert(e.message);
				}
			}
	}
};
