document.observe("dom:loaded",function(){
		/*
		new PeriodicalExecuter(function() {
			new Effect.Opacity($('logo'), { from: 1.0, to: 0.3, duration: 0.5, queue: 'end' });
  			new Effect.Opacity($('logo'), { from: 0.3, to: 1.0, duration: 0.5, queue: 'end' });
		}, 1);
		
		Sortable.create('content',{
			tag: 'div', overlap: 'horizontal', constraint: false
		});
		*/
		
		if ($('box_large_welcome')){
			$('box_large_welcome').observe('click',function(){
				pop.contact("pop_contact.asp");
			});
		}
		
		$$('.highlight').each(function(obj){
			new Effect.Opacity(obj, { from: 1.0, to: 0.5, duration: 0.1 });
			
			obj.observe('mouseover',function(e){
				new Effect.Opacity(Event.element(e), { from: 0.5, to: 1.0, duration: 0.1,queue: 'end' });
			});
			
			obj.observe('mouseout',function(e){
				new Effect.Opacity(Event.element(e), { from: 1.0, to: 0.5, duration: 0.1,queue: 'end' });
			});
		});
		
		$$('.highlight2').each(function(obj){
			new Effect.Opacity(obj, { from: 1.0, to: 0.4, duration: 0.1 });
			
			obj.observe('click',function(){
				pop.contact("/pop_map.asp");
			});
		});
	});
	
	function check_form(){
		var obj = $('form');
		var valid = true;
		var not_valid = false;
		
		obj.select('.must').each(function(s){ s.remove(); });
		
		obj.select('[rel="text"]').each(function(s){
			if ($F(s).length < 3) {
				var must = Builder.node('span', { className: 'must' },' *')
				valid = false;
				s.insert({after:must});
			}
		});
		
		obj.select('[rel="email"]').each(function(s){
			if (!$F(s).include('@')) 	not_valid = true;
			if (!$F(s).include('.')) 	not_valid = true;
			if ($F(s).length < 7) 		not_valid = true;
			
			if (not_valid){
				var must = Builder.node('span', { className: 'must' },' *')
				valid = false;
				s.insert({after:must});
			}
		});
		
		if (valid){
			obj.submit();
		}else{
			$('notify').update("Obs! Fint om du fyller ut alle felter.")
		}
	};
