      var pressMorph;
      var newsMorph;
      var productMorph;
      var imageMorph;
      var pulseMorph;
      var socialMorph;
            var newsPageCount = 11;            var pressPageCount = 10;      window.addEvent('domready', function() {
        pulse();
        $('whiteout').setStyle('opacity', 0);
        $('lightbox').setStyle('opacity', 0);
        $('social_icons').setStyle('opacity', 0);
        socialMorph = new Fx.Morph('social_icons', { 'link' : 'cancel' });
        stopLinks($('main_inner').getElements('a'));
      });
      function pulse() {
        if($$('.right_arrow').length > 0) {
          if($$('.right_arrow')[0].getStyle('opacity') <= 0.5)
            pulseMorph = new Fx.Morph($$('.right_arrow')[0], { duration: 1000 }).start({ opacity : 1 }).chain(function() {pulse();});
          else
            pulseMorph = new Fx.Morph($$('.right_arrow')[0], { duration: 1000 }).start({ opacity : 0 }).chain(function() {pulse();});
        } else {
          setTimeout("pulse()", 2000);
        }
      }
      function next() {
        if($('social_icons').getStyle('opacity') != 1)
          socialMorph.start({ 'opacity' : 1});
        if(enabled && productIndex == 7) {
          changePage(base_url2);
          return;
        }
        if(enabled && productIndex < 7) {
          var leftValues = Array(388, -582, -1552, -2522, -3492, -4462, -5432, -6402);
          productIndex++;
/*          if(productIndex == 8)
            productIndex = 0;*/
if(productIndex == 7)
  $$('.right_arrow')[0].setStyle('visibility', 'hidden');
if(productIndex == 1)
  $$('.left_arrow')[0].setStyle('visibility', 'visible');
          if(productMorph != null)
            productMorph.cancel();
          productMorph = new Fx.Morph($$('div.content_right')[0], {transition : Fx.Transitions.Quint.easeOut,duration: 1500}).start({ left : leftValues[productIndex] });
          if(productIndex == 1) {
            if(imageMorph != null)
              imageMorph .cancel();
            imageMorph = new Fx.Morph($$('div.content_left')[0], {transition : Fx.Transitions.Quint.easeOut,duration: 1500}).start({ left : -388 });
          } else if(productIndex == 0) {
            if(imageMorph != null)
              imageMorph .cancel();
            imageMorph = new Fx.Morph($$('div.content_left')[0], {transition : Fx.Transitions.Quint.easeOut,duration: 1500}).start({ left : 0 });
          }
        }
      }
      function previous() {
        if(enabled) {
          var leftValues = Array(388, -582, -1552, -2522, -3492, -4462, -5432, -6402);
          productIndex--;
/*          if(productIndex == -1)
            productIndex = 7;*/
if(productIndex == 0)
  $$('.left_arrow')[0].setStyle('visibility', 'hidden');
if(productIndex == 6)
  $$('.right_arrow')[0].setStyle('visibility', 'visible');
          if(productMorph != null)
            productMorph.cancel();
          productMorph = new Fx.Morph($$('div.content_right')[0], {transition : Fx.Transitions.Quint.easeOut,duration: 1500}).start({ left : leftValues[productIndex] });
          if(productIndex == 7) {
            if(imageMorph != null)
              imageMorph .cancel();
            imageMorph = new Fx.Morph($$('div.content_left')[0], {transition : Fx.Transitions.Quint.easeOut,duration: 1500}).start({ left : -388 });
          } else if(productIndex == 0) {
            if(imageMorph != null)
              imageMorph .cancel();
            imageMorph = new Fx.Morph($$('div.content_left')[0], {transition : Fx.Transitions.Quint.easeOut,duration: 1500}).start({ left : 0 });
          }
        }
      }

      function newsNext() {
         if(enabled && newsIndex < newsPageCount - 1) {
          newsIndex++;
          if(newsIndex == newsPageCount - 1)
            $$('.right_arrow')[0].setStyle('visibility', 'hidden');
          if(newsIndex == 1)
            $$('.left_arrow')[0].setStyle('visibility', 'visible');
          if(newsMorph != null)
            newsMorph.cancel();
          newsMorph = new Fx.Morph($$('div.media_sightings')[0], {transition : Fx.Transitions.Quint.easeOut, duration: 1500}).start({ left : newsIndex * -900 });
        }
      }
      function newsPrevious() {
         if(enabled && newsIndex > 0) {
          newsIndex--;
          if(newsIndex == 0)
            $$('.left_arrow')[0].setStyle('visibility', 'hidden');
          if(newsIndex == newsPageCount - 2)
            $$('.right_arrow')[0].setStyle('visibility', 'visible');
          if(newsMorph != null)
            newsMorph.cancel();
          newsMorph = new Fx.Morph($$('div.media_sightings')[0], {transition : Fx.Transitions.Quint.easeOut, duration: 1500}).start({ left : newsIndex * -900 });
        }
      }

      function pressNext() {
         if(enabled && pressIndex < pressPageCount - 1) {
          pressIndex++;
          if(pressIndex == pressPageCount - 1)
            $$('.right_arrow')[0].setStyle('visibility', 'hidden');
          if(pressIndex == 1)
            $$('.left_arrow')[0].setStyle('visibility', 'visible');
          if(pressMorph != null)
            pressMorph.cancel();
          pressMorph = new Fx.Morph($$('div.media_sightings')[0], {transition : Fx.Transitions.Quint.easeOut, duration: 1500}).start({ left : pressIndex * -900 });
        }
      }
      function pressPrevious() {
         if(enabled && pressIndex > 0) {
          pressIndex--;
          if(pressIndex == 0)
            $$('.left_arrow')[0].setStyle('visibility', 'hidden');
          if(pressIndex == pressPageCount - 2)
            $$('.right_arrow')[0].setStyle('visibility', 'visible');
          if(pressMorph != null)
            pressMorph.cancel();
          pressMorph = new Fx.Morph($$('div.media_sightings')[0], {transition : Fx.Transitions.Quint.easeOut, duration: 1500}).start({ left : pressIndex * -900 });
        }
      }

/*
var emailform;
function email_validate(form) {
  var query_string;
  emailform = form;
  if(form.elements[0].value.length > 0) {
    query_string = 'ajax=true&email='+form.elements[0].value;
    new Request({
      url: "addemail.php",
      method: "post",
      onSuccess: function(responseText, responseXML) {
        if(responseText == "success")
          form.innerHTML = 'Submission Successful';
        else {
          alert('An error has occurred with your submission');
          if(emailform && emailform.elements[0] != null)
            emailform.elements[0].focus();
        }
      },
      onFailure: function() {
        alert('An error has occurred with your submission');
          if(emailform && emailform.elements[0] != null)
            emailform.elements[0].focus();
      }
    }).send(query_string);

  } else {
    alert('Invalid Email');
    form.elements[0].focus();
  }

  return false;
}*/
var emailform;
function email_validate(form) {
  var query_string;
  emailform = form;
  if(form.elements[0].value.length > 0) {
    query_string = 'ajax=true&email='+form.elements[0].value;
    new Request({
      url: "http://www.elementbyfuego.com/addemail.php",
      method: "post",
      onSuccess: function(responseText, responseXML) {
        if(responseText == "success")
          form.innerHTML = '<strong>Join Our Mailing List!</strong><br />Submission Successful';
        else {
          alert('An error has occurred with your submission');
          if(emailform && emailform.elements[0] != null)
            emailform.elements[0].focus();
        }
      },
      onFailure: function() {
        alert('An error has occurred with your submission');
          if(emailform && emailform.elements[0] != null)
            emailform.elements[0].focus();
      }
    }).send(query_string);

  } else {
    alert('Invalid Email');
    form.elements[0].focus();
  }

  return false;
}
function validate(form) {
	var query_string = "";
	for(var i=0; i<form.elements.length; i++) {
		if(form.elements[i].type == "radio") {
			if(form.elements[i].checked) {
				query_string += form.elements[i].name + "=" + form.elements[i].value + "&";
			}
		} else {
			query_string += form.elements[i].name + "=" + form.elements[i].value + "&";
		}
	}
	new Request({
		url: "backend.php",
		method: "post",
		onSuccess: function(responseText, responseXML) {
			if(responseText == "success")
				form.innerHTML = '<div style="text-align: center">Submission Successful!</div>'
			else
				form.innerHTML = '<div style="text-align: center">Submission Failed.<br />Response: '+responseText+'</div>'
		},
		onFailure: function(instance) {
				form.innerHTML = '<div style="text-align: center">Internal Error - Check Security Settings.</div>'
}
}).send(query_string);
return false;
}