window.addEvent('domready',function() {
	//slider variables for making things easier below
	var itemsHolder = $('aboutus_container');
	var myItems = $$(itemsHolder.getElements('.item'));
	//create instance of the slider, and start it up 
	var mySlider = new SL_Slider({
		slideTimer: 8000,
		orientation: 'horizontal',
		fade: true,
		isPaused: false,
		container: itemsHolder,
		items: myItems,
		fade: false,
		nextBtn: $('aboutUsBtnNext'),
		prevBtn: $('aboutUsBtnPrev')
	});
	mySlider.start();
});
/*
slideTimer: 8000,
//Time between slides (1 second = 1000), a.k.a. the interval duration
orientation: 'horizontal',
//vertical, horizontal, or none: None will create a fading in/out transition.
fade: false,
//if true will fade the outgoing slide - only used if orientation is != None
isPaused: false,
 //flag for paused state
transitionTime: 1100,  //Transition time (1 second = 1000)
transitionType: 'cubic:out',    //Transition type
container: null,
//container element
items:  null,
   //Array of elements for sliding
itemNum: 0,
     //Current item number
numNavActive: false,  //Whether or not the number navigation will be used
numNavHolder: null,   //Element that holds the number navigation
playBtn: null,
  //Play (and pause) button element
prevBtn: null,
  //Previous button element
nextBtn: null
   //Next button element
*/



function send_mail(e) {
	$('offer_loading_icon').toggle();
	if ($('offer_element_id'))
		$('offer_element_id').destroy();
	
	r = new Request.JSON({
			url : 'index.php?element_run='+e+'&output_format=json&mode=send_ajax',
			data : '',
			onSuccess : function (r) {
				$('offer_loading_icon').toggle();
				
				if ($('offer_captcha_public_key_image') && r.new_public_key) {
					$('offer_captcha_public_key_image').src = "cimage.php?cpublic_key="
							+ r.new_public_key + "";
					$('offer_captcha_public_key_input').value = r.new_public_key;
				}
				if (r.success) {
					for ( var i in r.success) {
						$('error_line').innerHTML = r.success[i];
					}
					$('error_line').removeClass('hide');
					$('error_line').addClass.delay(2000,$('error_line'),'hide');
				} else if (r.error) {
					for ( var i in r.error) {
						$('error_line').innerHTML = r.error[i];
					}
					$('error_line').removeClass('hide');
					$('error_line').addClass.delay(2000,$('error_line'),'hide');
				}
				
				
			}
	}).send($('offer_form'));
	
	/*if(!$('offer_output_format'))
	{
		var om = new Element('input',{'type' : 'hidden', 'name' : 'output_format', 'id' : 'offer_output_format', 'value' : 'json'});
		$('offer_form').appendChild(om);
	}

	$('offer_form').set('send',{
		onComplete : function(r) {
			alert(r);
		}
	}).send();*/
	

	/*$('myForm').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();

		this.set('send', {
			onComplete: function(response) { 
			
			}
		});
		//Send the form.
		this.send();
	});*/
	/*
	$('offer_form').request(
			{
				evalJSON : true,
				parameters : {
					'element_run' : e,
					'element_id' : '',
					'mode' : 'send_ajax'
				},
				onComplete : function(xhr) {
					$('offer_loading_icon').toggle();
					r = xhr.responseText.evalJSON(true);
					if (r.new_public_key && $('offer_captcha_public_key_image')) {
						$('offer_captcha_public_key_image').src = "cimage.php?cpublic_key="
								+ r.new_public_key + "";
						$('offer_captcha_public_key_input').value = r.new_public_key;
					}
					if (r.success) {
						for ( var i in r.success) {
							$('error_line').innerHTML = r.success[i];
						}
						$('error_line').removeClassName('hide');
						Element.addClassName.delay(5, 'error_line', 'hide');
					} else if (r.error) {
						for ( var i in r.error) {
							$('error_line').innerHTML = r.error[i];
						}
						$('error_line').removeClassName('hide');
						Element.addClassName.delay(5, 'error_line', 'hide');
					}
				}
			});
			*/
	return false;
}
