var thisForm;

function Visible(id){
	if(document.all)
		OBJ = document.all(id).style;
	else if(document.getElementById)
		OBJ = document.getElementById(id).style;
	if(OBJ)
		OBJ.display='';
}
function Hidden(id){
	if(document.all)
		OBJ = document.all(id).style;
	else if(document.getElementById)
		OBJ = document.getElementById(id).style;
	if(OBJ)
		OBJ.display='none';
}

function getMozSelection(txtarea) {
	var selLength = txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	if (selEnd==1 || selEnd==2) selEnd=selLength;
	return (txtarea.value).substring(selStart, selEnd);
}

function mozWrap(txtarea, lft, rgt) {
	var selLength = txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	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 + lft + s2 + rgt + s3;
}

function IEWrap(txtarea,lft, rgt) {
	strSelection = document.selection.createRange().text;
	if (strSelection != "") {
		document.selection.createRange().text = lft + strSelection + rgt;
   	}else{
		rTxt = txtarea.createTextRange();
		var Inputted = rTxt.text;
		if (Inputted != ""){
			rTxt.text = Inputted + lft + rgt;
		}else{
			rTxt.text = lft + rgt;
		}
	}
}

function addtext(txtarea, lft, rgt) {
	if (document.all) {IEWrap(txtarea,lft, rgt);}
	else if (document.getElementById) {mozWrap(txtarea, lft, rgt);}
}

function cVisible(id){
	if(document.all)
		OBJ = document.all(id).style;
	else if(document.getElementById)
		OBJ = document.getElementById(id).style;
	if(OBJ)
		OBJ.display=='none'?OBJ.display='':OBJ.display='none';
}