function init(event) {
	init_ranch_nav()
}

function init_ranch_nav() {
	$('top').insert('<div id="ranch-tip" style="display:none"><i class="call" id="ranch-tip-slash">&nbsp;</i><p id="ranch-tip-text">&nbsp;</p></div>')
	$('ranch-nav').observe('mouseover', show_ranch_tip)
	$('ranch-nav').observe('mouseout', hide_ranch_tip)
	$$('#ranch-nav a').each(function(a){
		a.observe('mousemove', move_ranch_tip)
	})
}
function show_ranch_tip(event) {
	$('ranch-tip').setStyle('display:block')
}
function hide_ranch_tip(event) {
	$('ranch-tip').setStyle('display:none')
}


function move_ranch_tip(event) {
	right = '' + (612 - this.positionedOffset()[0]) + 'px'
	left = 	(this.up().className.gsub(' reduced','').gsub('ranch-', '')-1) * -176 
	this.up().hasClassName('reduced') ? $('ranch-tip-slash').addClassName('reduced') : $('ranch-tip-slash').removeClassName('reduced')
	$('ranch-tip').setStyle('right:' + right)
	$('ranch-tip-text').setStyle('background-position:' + left + 'px bottom')
	$('ranch-tip-text').innerHTML= this.innerHTML
}

function insert_flash_map(swf) {
	$('main').insert('<div id="flashmap">&nbsp;</div>')
	var so = new SWFObject("/swfs/"+swf, "map", "784", "942", "8");
	so.addParam("wmode", "transparent");
	so.addVariable("isProduction", true);
	so.write("flashmap");
}

document.observe("dom:loaded", init)
