searchText = "Search...";

var helvetica = {
	src: '/herbertsmith/js/sifr/helvetica_neue.swf'
};
sIFR.activate(helvetica);

var hsrules = {
	'#sky_fusion_podcast': function(el) {
		swfobject.embedSWF("/herbertsmith/vidPlayer.swf", "sky_fusion_podcast", "346", "279", "9", "#ffffff", {datapath: "/herbertsmith/skyfusionpodcast.flv"});
	},
	'.search_form_search_text': function(el) {
		el.observe('focus', function(e) {
			if ($F(this) == searchText)
			{
				this.value = "";
			}
		}.bindAsEventListener(el));
		el.observe('blur', function(e) {
			if ($F(this) == "")
			{
				this.value = searchText;
			}
		}.bindAsEventListener(el));
	},
	'.main_content_column h1': function(el) {
		$(el.parentNode).setStyle({'paddingBottom': '0px'});
		sIFR.replace(helvetica, { elements: [el] });
	},
	'#left_navigation_content h2': function(el) {
			sIFR.replace(helvetica, {elements: [el] });
	},
	'.home_arrow': function(el) {
		el.observe('click', function(e) {
		}.bindAsEventListener(el));
	},
	'#console_container_heading': function (el)
	{
		var items_shown = true;
		el.observe('dblclick', function(e) {
			if (items_shown)
			{
				Effect.BlindUp('console_items', {afterFinish: function(a){
					$('complete_border_top').hide();
					el.setStyle({borderBottom: '1px solid #aaa'});					
				}
				});
				
				items_shown = false;
			}
			else
			{
				$('complete_border_top').show();
				this.setStyle({borderBottom: 'none'});
				Effect.BlindDown('console_items');
				items_shown = true;
			}
		}.bindAsEventListener(el));
		
		new Draggable('console_container', {handle: 'console_container_heading'});
	},
	'a.other_profile_image': function (el)
	{
		el.observe('mouseover', function(e)
		{
			this.firstDescendant().hide();
		}.bindAsEventListener(el));
		el.observe('mouseout', function(e)
		{
			this.firstDescendant().show();
		}.bindAsEventListener(el));
	},
	'a, a strong': function (el)
	{
		if (!$('sitemap_index'))
		{
			var innerText = el.innerHTML;
			if (innerText.indexOf("<") < 0)
			{
				var innerTextSplit = innerText.split(" ");
				el.innerHTML = "";
				innerTextSplit.each(
					function(arrayEl)
					{
						if (arrayEl == innerTextSplit.last())
						{
							el.innerHTML += "<span>" + arrayEl + "</span>";
						}
						else
						{
							el.innerHTML += arrayEl + " ";	
						}
					}
				);
			}
		}
	}
};
Behaviour.add(hsrules);
