window.addEvent('domready', function(){

	new OverText($('Fname'), {textOverride: 'First'});
	new OverText($('Lname'), {textOverride: 'Last / Family'});


	var otherSlide = new Fx.Slide('other');
	otherSlide.hide();

	var featureSlide = new Fx.Slide('features');
	featureSlide.hide();


	
	var wScroll = new Fx.Scroll('bodyWrapper', {
		//transition: 'quart:out'		
	});
	


	$$('.fillMore').addEvent('click', function(e){
				
		if(this.checked == true){
			wScroll.toElement($('body3'));
		}else{
			wScroll.toElement($('body1'));
		}
		
	});
	
	
	$('formUse').addEvent('change', function(){
		if(this.value == 'other'){
			otherSlide.slideIn();
			$('other').focus();
		}else{
			otherSlide.slideOut();
			$('formUse').focus();		
		}
	});
	
	
	$('formInterest').addEvent('change', function(){
		
		if(this.value == "Q" || this.value == "both"){
			featureSlide.slideIn();
		}else{
			featureSlide.slideOut();		
		}
		
	});
	
	 //new FormCheck('contactForm');
	
	
	
	new Form.Validator($('contactForm'), {'stopOnFailure': true,
		onElementFail: function(e){
			e.highlight('#f00');
		}
	});
	
	
	/*
	var JSON = new Request.JSON({
		url: 'php/responce.php',
		
		onRequest: function(txt){
	
		},	
		
		onSuccess: function(obj){
		
			if(obj['type'] == 0){
				
								
			
				$('contact').set('html', obj['responce']);
				wScroll.toElement($('body1'));
			}else if(obj['type'] == 1){
			
				$('Fname').highlight('#f00');
				$('Lname').highlight('#f00');
				$('formEmail').highlight('#f00');
				
				//$('#body3 h2').set('html', obj['responce'])
			}else if(obj['type'] == 2){
				$('formEmail').highlight('#f00');
				
				//$('#body3 h2').set('html', obj['responce'])
			}else if(obj['type'] == 3){
				$('Fname').highlight('#f00');
				$('Lname').highlight('#f00');
				//$('#body3 h2').set('html', obj['responce'])
			}

		}	
	
	
	
	
	});
		
	
	
	$('submit').addEvent('click', function(e){
		
		
		
	Fname = $('Fname').get('value');
	Lname = $('Lname').get('value');
	email = $('formEmail').get('value');
	interest = $('formInterest').get('value');
	how = $('formHow').get('value');
	purchase = $('formPurchase').get('value');
	use = $('formUse').get('value');
	other = $('other').get('value');
	features = $('formFeatures').get('value');
			
	
	//alert(Fname +' '+Lname +' '+email +' '+interest +' '+how +' '+purchase +' '+use +' '+other +' '+features );
								
	JSON.post({'Fname': Fname, 'Lname': Lname, 'email': email, 'interest': interest, 'how': how, 'purchase': purchase, 'use': use, 'other': other, 'features': features });
	e.stop();
		
		
	});
	
	
	*/

});





