var oky1,oky2,okx1,okx2;
var the_string,ss_wid,ss_hih,the_frm,the_detail,the_mainpage;

function page_init()
{
	// preload the contact form
	ta_fb.preload_images('http://'+window.location.hostname+'/images/ta_str_size.png');

	// fix external links
	ta_fb.fix_ext_links();

	// show load time
	ta_fb.show_page_load_time();

	// indicate good
	return false;
}

function show_position()
{
	// only respond if over a ruler
	if ((ta_fb._dmy>=oky1)&&(ta_fb._dmy<=oky2)&&(ta_fb._dmx>=okx1)&&(ta_fb._dmx<=okx2))
	{
		ss_wid.innerHTML = (ta_fb._dmx-okx1)+'&nbsp;';
		ss_hih.innerHTML = (ta_fb._dmy-oky1)+'&nbsp;';
	}
}

function start_string_tool()
{
	// get local object
	the_string = ta_fb.get_object('the_string');
	ss_wid = ta_fb.get_object('ss_wid');
	ss_hih = ta_fb.get_object('ss_hih');
	the_detail = ta_fb.get_object('detail');
	the_mainpage = ta_fb.get_object('mainpage');

	// get the ruler edges
	oky1 = the_string.offsetTop+ the_detail.offsetTop + the_mainpage.offsetTop + 6;
	oky2 = oky1 + the_string.clientHeight;
	okx1 = the_string.offsetLeft + the_detail.offsetLeft + the_mainpage.offsetLeft + 1;
	okx2 = okx1 + the_string.clientWidth;

	// set up to catch mouse events
	ta_fb.catch_the_mouse_function(show_position);

	// grab the form
	the_frm = document.str_frm;

	// set the focus
	the_frm.tst_str.focus();
	the_frm.tst_str.select();
}

function set_the_string()
{
	the_string.innerHTML = '<span style="border:#000000 dotted 1px;font-family:'+the_frm.tst_ff.value+';font-size:'+the_frm.tst_fs.value+';font-weight:'+the_frm.tst_fw.value+';font-style:'+the_frm.tst_fst.value+';">'+the_frm.tst_str.value+'</span>';
	return false;
}

