<!--

function resetRegForm(register){
    document.register.resetBut.disabled = true;
    document.register.resetBut.value = 'Resetting fields...';
    window.location.href = "index.php?action=register";
}
function submitRegForm(register){
    document.register.submitBut.disabled = true;
    document.register.submitBut.value 	 = 'Submitting...';
    document.register.submit();
}
function resetLogForm(login){
    document.login.resetBut.disabled = true;
    document.login.resetBut.value = 'Resetting fields...';
    window.location.href = "index.php?action=login";
}
function submitLogForm(login){
    document.login.submitBut.disabled = true;
    document.login.submitBut.value 	 = 'Submitting...';
    document.login.submit();
}

function submitForm(addPhoto){
  document.addPhoto.submitBut.disabled = true;
  document.addPhoto.submitBut.value = "Please Wait...";

    if(document.addPhoto.photo.value == ""){
      document.addPhoto.giveText1.value = "Updating entry . . . Please wait. . .";
       
    }
    else{
      document.addPhoto.giveText1.value = "Loading image. . . Please wait. . .";
    }
    document.addPhoto.submit();
}


function popUp(URL, width, height){
  if(!width)
    width = 750;
  else
    width = width + 15;
  if(!height)
    height = 525;
  else
    height = height + 30;

  props=window.open(URL,'','scrollbars=0, resizable=0, location=0, status=0, width=' + width + ', height=' + height + '');  
}

function profileWindow(URL){
  props=window.open(URL,'','menubar=1, scrollbars=1, resizable=1, location=0, status=1, width=700, height=450');
}

function printPhoto(URL, width, height){
  if(!width)
    width = 750;
  else
    width = width + 15;
  if(!height)
    height = 525;
  else
    height = height + 30;

  props=window.open(URL,'','scrollbars=0, resizable=0, menubar=1, location=0, status=0, width=' + width + ', height=' + height + '');

  if (props.opener == null) { // for Nav 2.0x 
   props.opener = self // this creates and sets a new property 
  }
  props.window.print();
  
}

function goUrl(URL){
  window.location.href = URL;
}

function goBack(movePhoto){
  document.movePhoto.a.value = 'Move';
  document.movePhoto.sub.value = '';
  document.movePhoto.submitBut.value = 'Returning';
  document.movePhoto.returnBut.value = 'Returning';
  document.movePhoto.submitBut.disabled = true;
  document.movePhoto.returnBut.disabled = true;
  document.movePhoto.submit();
}

function Preview () {

	var message   = document.replier.message.value;
        message = message.replace(/\n+/g, "<P>");
        //message = message.replace(/\n/g, "<BR>");
	//var user_cookie = getCookie('ubber2452706.2115');
	//if( ('' == user_cookie) || (null == user_cookie) ) {
	//	alert("Sorry, you must be registered and logged in to preview your post.");
	//	return true;
	//}

	//if(document.replier.opt_icons.checked) {
	//	var disabled = "yes";
	//} else {
		var disabled = "no";
	//}

	//if(document.replier.opt_sig) {
	//	if(document.replier.opt_sig.checked) {
			var siggy = "yes";
	//	} else {
	//		var siggy = "no";
	//	}
	//}

	var earl = "http://www.bmgamble.com/board/index.php?action=preview_post&message=" + message;
	earl = earl + "&opt_icons=" + disabled + ";opt_sig=" + siggy;

	preview = window.open(
		earl,
		"preview",
		"width=700,height=400,toolbar=no,location=no,directories=no,status,menubar=no,scrollbars,resizable,copyhistory=no"
		);
	window.preview.focus();
	return preview;
} // end

function ClosePreviewWindow () {
	if(window.preview) {
		window.preview.close();
	} //
} // end

function x () {
return;
}

function storeCaret (textEl) {
	if (textEl.createTextRange)
		textEl.caretPos = document.selection.createRange().duplicate();
} // end fn

function insertAtCaret (textEl, text) {
	if (textEl.createTextRange && textEl.caretPos) {
		var caretPos = textEl.caretPos;
		caretPos.text =
			caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
			text + ' ' : text;
	} else {
		textEl.value  = textEl.value + text; // for non MSIE browsers just append it
	}

	return true;
}// fn




function DoSmilie(addSmilie) {
	var revisedMessage;
	var currentMessage = document.replier.message.value;
	revisedMessage = currentMessage+addSmilie;
	document.replier.message.value=revisedMessage;
	document.replier.message.focus();
	return;
}

	function DoPrompt(action) {
		var currentMessage = document.replier.message.value;

		if (action == "url") {
			var thisURL = prompt("Enter the complete URL for the link you wish to add.", "http://");
			if (thisURL == null){return;}

			var thisTitle = prompt("Now enter the title of the web page you wish to reference.  For instance, if you are linking to the URL for Infopop, you might use the title Infopop Homepage.", "web page");
			if (thisTitle == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[URL]" + thisURL + "[/URL][URL_TITLE]" + thisTitle + "[/URL_TITLE]" + ' ');
			document.replier.message.focus();
			return;
		}

		if (action == "email") {
			var thisEmail = prompt("Enter the complete email address that you wish to add.", "");
			if (thisEmail == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[A_EMAIL]" + thisEmail + "[/A_EMAIL][EMAIL]" + thisEmail + "[/EMAIL]" + ' ');
			document.replier.message.focus();
			return;
		}

		if (action == "bold") {
			var thisBold = prompt("Enter the text that you wish to make bold.", "");
			if (thisBold == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[B]" + thisBold + "[/B]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "italics") {
			var thisItal = prompt("Enter the text that you wish to italicize.", "");
			if (thisItal == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[I]" + thisItal + "[/I]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "image") {
			var thisImage = prompt("Enter the complete URL for the image you wish to display.", "http://");
			if (thisImage == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[IMG]" + thisImage + "[/IMG]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "quote") {
			insertAtCaret(document.replier.message, ' ' + "[QUOTE]  [/QUOTE]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "code") {
			insertAtCaret(document.replier.message, ' ' + "[CODE]  [/CODE]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "liststart") {
			insertAtCaret(document.replier.message, ' ' + "[LIST]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "listend") {
			insertAtCaret(document.replier.message, ' ' + "[/LIST]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "listitem") {
			var thisItem = prompt("Enter the new list item.  Note that each list group must be preceded by a List Start and the entire list group must end with a List End (in order to display properly).", "");
			if (thisItem == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[*]" + thisItem + ' ' );
			document.replier.message.focus();
			return;
		}

	}
//-->