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



//SET UP the scrolling functions
		var nS8 = new noobSlide({
			box: $('box8'),
			items: $$('#box8 div'),
			size: 500

		});
		//more "previous" and "next" buttons
		nS8.addActionButtons('next',$$('.submitter'));
		//more handle buttons
		//walk to item 3 witouth fx
                // end the section for the  survey


               // cookie experiment: var myCookie = Cookie.write('username', 'Harald');


var form_1 = new FormCheck('survey_1');
var form_2 = new FormCheck('survey_2');
var form_3 = new FormCheck('survey_3');

var form_4 = new FormCheck('survey_4');
var form_5 = new FormCheck('survey_5');
var form_6 = new FormCheck('survey_6');
var form_7 = new FormCheck('survey_7');
var form_8 = new FormCheck('survey_8');
var form_9 = new FormCheck('survey_9');
var form_10 = new FormCheck('survey_10');


var form_11 = new FormCheck('survey_11');


// I think there is a way to collect all of these forms and assign the
// action to them. Don't know it yet


$('survey_1').addEvent('submit', function(e) {

                // this is a bit hacky, but IE doesn't recoginze the form_1.form.isValid in real time
                // basically jonesy is a seperate evalutor (I added some return statements in the onSubmit function
                // so it is unfortunately running onSubmit twice [once for the object, once for the evaluation]
                // I do not understand how to meld these two objects very well, my apologies
                // to get the slider object to walk, I think it would have to be passe into
                // the formcheck object as a variable.... a little confusing. but from there, a simple
                // .next(); could take the place of these evaluations, cutting downt he time and removing
                // the redundancey of it all
                e.stop();
                jonesy = form_1.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();

                }

               
    }); // end addevent


$('survey_2').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_2.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();
                }

    }); // end addevent

$('survey_3').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_3.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    $('tweener').tween('height', '890px');

                    nS8.next();
                } // end form_2.form.isValid

    }); // end addevent




$('survey_4').addEvent('submit', function(e) {
                e.stop();
                jonesy = form_4.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    $('tweener').tween('height', '1450px');
                    nS8.next();
                } // end form_4.form.isValid

                }); // end addevent


$('survey_5').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_5.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    $('tweener').tween('height', '900px');
                    nS8.next();
                } // end form_5.form.isValid

                 }); // end addevent


$('survey_6').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_6.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();
                } // end form_6.form.isValid

                 }); // end addevent


$('survey_7').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_7.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();
                } // end form_7.form.isValid

                }); // end addevent


$('survey_8').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_8.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();
                } // end form_8.form.isValid

                 }); // end addevent


$('survey_9').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_9.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();
                } // end form_9.form.isValid


                 }); // end addevent


$('survey_10').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_10.onSubmit(e);
                if (jonesy == true) {
                    this.set('send', {method: 'get', url: 'survey_response.php', link:'chain', onComplete: function(response) { }});
                    this.send();
                    nS8.next();
                } // end form_10.form.isValid


                 }); // end addevent


$('survey_11').addEvent('submit', function(e) {
		e.stop();
                jonesy = form_11.onSubmit(e);
               
                if (jonesy == true) {
                    if(typeof(isFrench) == 'undefined'){this.set('send', {method: 'get', url: 'survey_response.php', onComplete: function(response) {location.href = 'index.php?survey=true&survey_lang=en'; }});} // end if
                    else {this.set('send', {method: 'get', url: 'survey_response.php', onComplete: function(response) {location.href = 'index.php?survey=true&survey_lang=fr'; }});} // end else
                    this.send();
                } // end if statement



                
                
               
                 }); // end addevent



}); // end major addEvent


