//<![CDATA[

var stories = new Array();

function storyMouseOver(id,path)
{
  var img = $('thumb_' + id);
  img.src = path;
  img.style.cursor = 'pointer'
  /*var text = $('text_' + id);
  
  var offset = img.positionedOffset();
  text.style.top = (offset[1] + img.getHeight() - text.getHeight() + 2) + "px";
  text.style.left = offset[0] + "px";
  */
  //Element.show('text_' + id);
  Element.show('story_title_' + id);
}

function storyMouseOut(id,path)
{
  var img = $('thumb_' + id);
  img.src = path;
  //Element.hide('text_' + id);
  Element.hide('story_title_' + id);
}

function showStory(id,event)
{
  var story = stories[id];
  var box = $('story_box');
  box.style.background = "url(/media/" + story.image + ".jpg)";
  box.style.top = f_scrollTop()  + "px";
  $('story_title').innerHTML = story.title;
  $('story_text').innerHTML = story.body;
  $('link_text').innerHTML = story.link;
  $('link_text').href = story.link_href;
  Effect.Appear('story_box',{duration: .6});
  //Event.stop(event);
}


function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

//]]>
