// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function init_status(){
	if(box = $("comment_html")){
		box.hide();
		var toggler = $('box_toggler');
		Event.observe(toggler,'click',function() { toggleTextileBox(); return false; } );
	}
}

function toggleTextileBox(){
	var box = $("comment_html");
	if (box.visible()){
		new Effect.BlindUp(box);
	}
	else {
		new Effect.BlindDown(box);
	}
	return false;
}


function makeEntryParentClickable(){
	var entries = $$(".entrylist li");
	for(i=0; i < entries.length; i++){
    	Event.observe(entries[i], 'click', function(){
        	window.location = this.select('a').first().href;return false;
    })
	}
}

Event.observe(window,'load',init_status);
Event.observe(window,'load',makeEntryParentClickable);

Event.observe(window,'load',function(){
	var field = $('q');
	Event.observe(field,'focus',	function(){
		if (field.defaultValue == field.value)
			field.value = ""
	});
	Event.observe(field,'blur',function(){
		if (field.value == '')
			field.value = field.defaultValue
	});
});
