function InstaSmilie () {

	return;

}

function AddSmile(SmileCode) {

	//var SmileCode;

	var newPost;

	var oldPost = document.REPLIER.Post.value;

	newPost = oldPost+SmileCode;

	document.REPLIER.Post.value=newPost;

	document.REPLIER.Post.focus();

	return;

}



function PopUp(url, name, width,height,center,resize,scroll,posleft,postop) {

    if (posleft != 0) { x = posleft }

    if (postop  != 0) { y = postop  }



    if (!scroll) { scroll = 1 }

    if (!resize) { resize = 1 }



    if ((parseInt (navigator.appVersion) >= 4 ) && (center)) {

      X = (screen.width  - width ) / 2;

      Y = (screen.height - height) / 2;

    }

    if (scroll != 0) { scroll = 1 }



    var Win = window.open( url, name, 'width='+width+',height='+height+',top='+Y+',left='+X+',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');

}



function jumpMenu(targ,selObj,restore){

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}



function IB_goToURL() {

  var i, args=IB_goToURL.arguments; document.IB_returnValue = false;

  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");

}



function AtMem(mem_name) {

   theMessage = '[b]' + mem_name + '[/b]' + "\n";

   document.REPLIER.Post.value += theMessage;

   document.REPLIER.Post.focus();  

}



function delete_post(theURL) {

       if (confirm(confirm_del)) {

          window.location.href=theURL;

       }

       else {

          alert (alert_del);

       } 

}



var expanded = false;



function toggleName(targetId)

{



	var name1 = show_voters;

	var name2 = close_voters;

  var target = document.getElementById('toggler');

  if(expanded)

  {

  	expanded = false

  	target.innerHTML = name1;

  }

  else

  {

  	expanded = true

  	target.innerHTML = name2;

  }

  

  target = document.getElementById(targetId);

		if (target.style.display == "none")

		{

			target.style.display = "";

		} else

		{

			target.style.display = "none";

		}

}



function CheckLength() {

    MessageLength  = document.REPLIER.Post.value.length;

    message  = "";

        if (MessageMax !=0) {

            message = post + ":\\n" + maxLength + " " + MessageMax + " " + chars;

        } else {

            message = "";

        }

        alert(message + "\\n" + charsUsed + " " + MessageLength + " " + chars);

}

function ValidateForm() {

    MessageLength  = document.REPLIER.Post.value.length;

    errors = "";

    if (MessageLength < 2) {

         errors = noMessage;

    }

    if (MessageMax !=0) {

        if (MessageLength > MessageMax) {

            errors = "Post:\\n" + maxLength + " " + MessageMax + " " + chars + ".\\n" + current + ": " + MessageLength;

        }

    }

    if (errors != "" && Override == "") {

        alert(errors);

        return false;

    } else {

        document.REPLIER.submit.disabled = true;

        return true;

    }

}

function emoticon(theSmilie) {

//    document.REPLIER.Post.value += ' ' + theSmilie + ' ';

//    document.REPLIER.Post.focus();

AddText(' ' + theSmilie + ' ', document.REPLIER);

}

// Code courtesy of antionline.com

var text = "";

AddTxt = "";

function getActiveText(selectedtext) {

       text = (document.all) ? document.selection.createRange().text : document.getSelection();

       if (selectedtext.createTextRange) {

           selectedtext.caretPos = document.selection.createRange().duplicate();

       }

       return true;

}

function AddText(NewCode,theform) {

       if (theform.Post.createTextRange && theform.Post.caretPos) {

               var caretPos = theform.Post.caretPos;

               caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? NewCode + ' ' : NewCode;

       } else {

               theform.Post.value+=NewCode;

       }

       setfocus(theform);

       AddTxt = "";

}

function setfocus(form) {

	form.Post.focus();

}


