// New routines to keep!
function checkValidEmail(email) {
	return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/i.test(email)
}


window.addEvent('domready', function() { init2(); });


function init2() {
	FancyForm.start( 0, {
		onSelect: function(chk){
			//alert('select');
		},
		onDeselect: function(chk) {
			//alert('de-select');
		}
	});
	if($chk($('links'))) {
		// Previous Button
		$('container').addEvents({ 
			'mouseover' : function(event){ 
			},
			'mouseout' : function(event){ 
			}
		});		
				
	}
	if($chk($('collapse-left-tabs'))) {
		// Previous Button
		$('collapse-left-tabs').addEvents({ 
			'click' : function(event){ 
				if ($('left-pane').getStyle('visibility') == 'visible') {
					$('left-pane').setStyle('visibility','hidden');
					$('collapse-left-tabs').setStyle('background-image','url(adminimages/expand-right.png)');	
					$('adminright').setStyle('left','0px');
				} else {
					$('left-pane').setStyle('visibility','visible');
					$('collapse-left-tabs').setStyle('background-image','url(adminimages/expand-left.png)');
					$('adminright').setStyle('left','200px');		
				}
			}
		});		
				
	}
	if($chk($('previewPage'))) {
		$('adminright').style.margin = "0px";
		$('collapse-left-tabs').fireEvent('click',$('collapse-left-tabs'));	
		$('previewPage').setStyle('height', $('adminright').getSize().y + "px");
	}
	if($chk($('compatibility'))) {
		if(Browser.Engine.trident) {
			$('compatibility').set('html',"Warning: You are using Internet Explorer. Please read the compatibility message on the right.");
		} else if(Browser.Engine.gecko ) {
		} else if(Browser.Engine.webkit) {
		}
	}
	new DatePicker('.datepicker', { pickerClass: 'datepicker_vista', inputOutputFormat: 'Y-m-d', format: 'd/m/Y' });
}
