Event.observe(window, 'load', init, false);
Event.observe(window, 'load', init2, false);
Event.observe(window, 'load', initComments, false);

function init() {
//	Event.observe('elsewhereopener', 'click', elsewhere, false);
//	Event.observe('elsewhereopener', 'blur', elsewhere, false);
	Event.observe('elsewhereopener', 'click', elsewhere, false);
	 $('elsewhereopener').onclick = function() {return false;};
	 
//	Event.observe('otherplacesopener', 'click', otherPlaces, false);
//	Event.observe('otherplacesopener', 'blur', otherPlaces, false); 
	Event.observe('otherplacesopener', 'click', otherPlaces, false);
	 $('otherplacesopener').onclick = function() {return false;};
	 
/*							Event.observe('search', 'submit', search, false);
							Event.observe('search_input', 'click', live.Clear, false);
							 $('search').onsubmit = function() {return false;};
***** SEARCH *****							 
							Event.observe('closeresults', 'click', live.Close, false);
							 $('closeresults').onclick = function() {return false;};
*/ 
	Event.observe('scroll', 'click', scroll, false);
	 $('scroll').onclick = function() {return false;};
	/* 
 	Event.observe('headera', 'mouseover', w00tOpen, false);
	Event.observe('w00t', 'mouseover', w00tOpen, false);
	Event.observe('headera', 'mouseout', w00tClose, false);
	Event.observe('w00t', 'mouseout', w00tClose, false);
	 */
	Event.observe('document.body', 'scroll', windowScroll, false);
}

function init2() {
	Event.observe('emailfeed', 'click', emailfeed, false);
	 $('emailfeed').onclick = function() {return false;};
}

function initComments() {
	Event.observe('comment', 'focus', commentBox, false);
	Event.observe('comment', 'blur', commentAdd, false);
}

function windowScroll() {
	alert('bla');
	var scrollAmount = document.body.scrollTop;
	if(scrollAmount >= 100) {alert('You scrolled down'+scrollAmount+'pixels.'); }
}

//email thing

function emailfeed() {
Effect.toggle('emailfeed2', 'blind');
}

//scroll

function scroll() {
  new Effect.ScrollTo('dropdowns', {offset: -24});
}

//search 

// ************** other file ****************8

//Clear Comment Box

function commentBox() {
var commentText = $('comment').innerHTML;
var firstText = "Remember in kindergarden when you were taught to share? Neither do I, but please, share your thoughts anyways.\n\nPlease keep in mind that I hate the following: Jerks, trolls, and viagra ads. Don't make me angry, you wouldn't like me when I'm angry.";
if (commentText == firstText) {$('comment').innerHTML = "";}
}

function commentAdd() {
var commentText = $('comment').innerHTML;
var firstText = "Remember in kindergarden when you were taught to share? Neither do I, but please, share your thoughts anyways.\n\nPlease keep in mind that I hate the following: Jerks, trolls, and viagra ads. Don't make me angry, you wouldn't like me when I'm angry.";
if (commentText == "") {$('comment').innerHTML = firstText;}
}

function elsewhere(e) {
//ES.down('elsewhere', e);
Effect.toggle('elsewhere', 'blind', {duration: .5});
}

function otherPlaces(e) {
//ES.down('otherplaces', e);
Effect.toggle('otherplaces', 'blind', {duration: .5});
}

//Elsewhere bar
var ES = {

	stop	:	function(target, e)	{
				var target = $(target);
				var e = e;

			testing = function() {return false;};
				},

	down	:	function(target, e) {
				var target = $(target);
				var e = e;
					if (target.style.display != 'none') {
						Effect.BlindUp(target, {duration: .7});
					}

					else if (e != 'blur' && target.style.display == 'none') {
						Effect.BlindDown(target, {duration: .7});
					}
				
				}
}