da_image = new Image();
da_image.src="favicon.ico";

newtopicup = new Image()
newtopicup.src = "images/newtopic_button.gif"
newtopicdn = new Image()
newtopicdn.src = "images/newtopic_button_dn.gif"
     
newreplyup = new Image()
newreplyup.src = "images/newreply_button.gif"
newreplydn = new Image()
newreplydn.src = "images/newreply_button_dn.gif"

reportup = new Image()
reportup.src = "images/report.gif"
reportdn = new Image()
reportdn.src = "images/reportdn.gif"
     
quoteup = new Image()
quoteup.src = "images/quote.gif"
quotedn = new Image()
quotedn.src = "images/quotedn.gif"

editup = new Image()
editup.src = "images/edit.jpg"
editdn = new Image()
editdn.src = "images/editdn.jpg"
     
deleteup = new Image()
deleteup.src = "images/delete.jpg"
deletedn = new Image()
deletedn.src = "images/deletedn.jpg"

aim = new Image()
aim.src = "images/aim.gif"
aim_over = new Image()
aim_over.src = "images/aim_over.gif"

yim = new Image()
yim.src = "images/yim.gif"
yim_over = new Image()
yim_over.src = "images/yim_over.gif"

msn = new Image()
msn.src = "images/msn.gif"
msn_over = new Image()
msn_over.src = "images/msn_over.gif"

icq = new Image()
icq.src = "images/icq.gif"
icq_over = new Image()
icq_over.src = "images/icq_over.gif"

email_button = new Image()
email_button.src = "images/email_button.gif"
email_button_over = new Image()
email_button_over.src = "images/email_button_over.gif"

profile_icon = new Image()
profile_icon.src = "images/profile_icon.gif"
profile_icon_over = new Image()
profile_icon_over.src = "images/profile_icon_over.gif"

plus_mark_up = new Image()
plus_mark_up.src = "images/plus_mark.gif"
plus_mark_dn = new Image()
plus_mark_dn.src = "images/plus_mark_HL.gif"

edit_hp_up = new Image()
edit_hp_up.src = "images/edit_hp.gif"
edit_hp_dn = new Image()
edit_hp_dn.src = "images/edit_hp_dn.gif"

function MakeUploadBox(url) 
{
 upload = window.open(url, 'upload','width=452, height=182, resizable=yes, scrollbars=yes');
 if (upload.opener == null) upload.opener = window; 
 upload.opener.parent.name = "hello";
}
function insertsmilie(smilieface) {
                      		if (document.PostTopic.replybody.createTextRange && document.PostTopic.replybody.caretPos) {
                      			var caretPos = document.PostTopic.replybody.caretPos;
                      			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smilieface + ' ' : smilieface;
                      			document.PostTopic.replybody.focus();
                      		} else {
                      			document.PostTopic.replybody.value+=smilieface;
                      			document.PostTopic.replybody.focus();
                      		}
                      }
    function insertfont(font) {
	var text = getText();
 	 {
 	  AddTxt="[font="+font+"]" + text + "[/font="+font+"]";
	  AddText(AddTxt);
	 }
    }
    function insertsize(size) {
	var text = getText();
	 {
	  AddTxt="[size="+size+"]" + text + "[/size="+size+"]";
	  AddText(AddTxt);
	 }
	}
	function insertcolor(color) {
	var text = getText();
	 {
	  AddTxt="[color="+color+"]" + text + "[/color="+color+"]";
	  AddText(AddTxt);
	 } 
	}
    function bold() {
	var text = getText();
	 {
			AddTxt="[b]"+text+"[/b]";
			AddText(AddTxt);
		}
	}
	function email() {
	var text = getText();
	 {
			AddTxt="[EMAIL]"+text+"[/EMAIL]";
			AddText(AddTxt);
		}
	}
	function list() {
	var text = getText();
	 {
			AddTxt=text+"[LIST] [~]    [/~] [~]    [/~] [~]    [/~] [/LIST]";
			AddText(AddTxt);
		}
	}
	function quote() {
	var text = getText();
	 {
			AddTxt="[QUOTE]"+text+"[/QUOTE]";
			AddText(AddTxt);
		}
	}
	function hr() {
	var text = getText();
	 {
			AddTxt="[hr]"+text;
			AddText(AddTxt);
		}
	}
	function link() {
	var text = getText();
	 {
			AddTxt="[URL]"+text+"[/URL]";
			AddText(AddTxt);
		}
	}
	function image() {
	var text = getText();
	 {
			AddTxt="[IMG]"+text+"[/IMG]";
			AddText(AddTxt);
		}
	}
	function left() {
	var text = getText();
	 {
			AddTxt="[left]"+text+"[/left]";
			AddText(AddTxt);
		}
	}
	function center() {
	var text = getText();
	 {
			AddTxt="[center]"+text+"[/center]";
			AddText(AddTxt);
		}
	}
	function right() {
	var text = getText();
	 {
			AddTxt="[right]"+text+"[/right]";
			AddText(AddTxt);
		}
	}
	function strike() {
	var text = getText();
	 {
			AddTxt="[s]"+text+"[/s]";
			AddText(AddTxt);
		}
	}
    function italic() {
	var text = getText();
	 {
			AddTxt="[i]"+text+"[/i]";
			AddText(AddTxt);
		}
	}
	function underline() {
	var text = getText();
	 {
			AddTxt="[u]"+text+"[/u]";
			AddText(AddTxt);
		}
	}
	function quoteSelection() {

		theSelection = false;
		theSelection = document.selection.createRange().text; // Get text selection

		if (theSelection) {
			// Add tags around selection
			AddTxt="[quote]"+theSelection+"[/quote]";
			AddText(AddTxt);
			document.PostTopic.replybody.focus();
			theSelection = '';
			return;
		}else{
			alert('Select a text anywhere on a page and try again');
		}
	}
    function getText() {
	if (document.PostTopic.replybody.createTextRange && document.PostTopic.replybody.caretPos) {
		return document.PostTopic.replybody.caretPos.text;
	} else {
		return '';
	}
    }
    function AddText(NewCode) {
	if (document.PostTopic.replybody.createTextRange && document.PostTopic.replybody.caretPos) {
		var caretPos = document.PostTopic.replybody.caretPos;
		caretPos.text = NewCode;
	} else {
		document.PostTopic.replybody.value+=NewCode;
	}
	document.PostTopic.replybody.focus();
}
    function storeCaret(ftext) {
	 if (ftext.createTextRange) {
	 	ftext.caretPos = document.selection.createRange().duplicate();
	 }
    }
    function VerifyBoN()
    {
     if (document.PostTopic.replybody.value.length < 1)
     {
      alert ("You must enter something in 'Word From Pastor Body'");
      return false;
     }
     else
     if (document.PostTopic.author.value.length < 1)
     {
      alert ("You must enter something in 'Author'");
      return false;
     }
     else
     if (document.PostTopic.image.value.length < 1)
     {
      alert ("You must enter something in 'Image'");
      return false;
     }
     else
      return true;
    }
function VerifyLogin()
    {
     if (document.login.Username.value.length < 1)
     {
      alert ("You must enter a 'Username'");
      return false;
     }
     else
     if (document.login.Password.value.length < 1)
     {
      alert ("You must enter a 'Password'");
      return false;
     }
     else
      return true;
    }

    function VerifyNR()
    {
     if (document.PostTopic.replybody.value.length < 1)
     {
      alert ("You must enter a reply in the 'Reply Box'");
      return false;
     }
     else
      return true;
    }
function quoteSelection() {

		theSelection = false;
		theSelection = document.selection.createRange().text; // Get text selection

		if (theSelection) {
			// Add tags around selection
			AddTxt="[quote]"+theSelection+"[/quote]";
			AddText(AddTxt);
			document.PostTopic.replybody.focus();
			theSelection = '';
			return;
		}else{
			alert('Select a text anywhere on a page and try again');
		}
	}
function VerifyP()
    {
     if (document.register2.password.value != document.register2.vpassword.value)
     {
      alert ("Your passwords do not match - Please Re-Enter them");
      return false;
     }
     else if (document.register2.username.value != document.register2.vusername.value)
      {
       alert ("Your usernames do not match - Please Re-Enter them");
       return false;
      }
      else if (document.register2.password.value.length < 1)
      {
       alert ("You Must Enter a Password");
       return false;
      }
      else if (document.register2.username.value.length < 1)
      {
       alert ("You Must Enter a Username");
       return false;
      }
      else if (document.register2.eml.value.length < 1)
      {
       alert ("You Must Enter an E-Mail Address");
       return false;
      }
      else if (document.register2.state.value.length < 1)
      {
       alert ("You Must Enter a State/Province");
       return false;
      }
      else if (document.register2.coun.selectedIndex < 1)
      {
       alert ("You Must Select a Country");
       return false;
      }
     else
      return true;
    }