// Functions -- prototype functions added by Warren .. Olivos by Design 2008
/*------------------------------------------------------------------------*/
function Blur(elem, opacity) {
	
	var element = $(elem); 
	element.setOpacity(opacity) 
	
}
function SwapBTN(id,type,ext) {
	if (ext == null) { ext='gif'; }
	if (type == 1) {
		$(id).src = 'gfx/'+id+'over.'+ext;
	} else {
		$(id).src = 'gfx/'+id+'.'+ext;
	}
}
/*------------------------------------------------------------------------*/
function SendAmigo() {

	var params = $('enviar').serialize();
	$('enviar').disable();
	$('Error1').hide();
	$('Error2').hide();
	$('Error3').hide();
	$('Error4').hide();
	
	new Ajax.Request('ajax/sendcontact.php', {
		method:'post',
		encoding:'ISO-8859-1',
		parameters: params,
		onSuccess: function(transport){
					var response = transport.responseText || "no response text";
					res = response.split('***');
					errors = res.size();
					if (errors == 1) {
						$('ContactForm').hide();
						$('ThankYou').show();
					}
					res.each(function(s) {
							$('Error'+s).show();
						}); 
					
					},
		onFailure: function(){ 
					alert('There was an error \n Please try again.')
					$('enviar').enable();
					}
	}); 
	$('enviar').enable();

}
/*------------------------------------------------------------------------*/