<!--

function popUpImg(URL) {
	var w, h;
	w 	= 700;
	h	= 600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
	childWindow=open(URL, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left ="+LeftPosition+",top="+TopPosition+"");
	if (childWindow.opener == null) childWindow.opener = self;
}
var downStrokeField;
/******************
autojump
******************/
function autojump(fieldName,nextFieldName,fakeMaxLength){
  var myForm=document.forms[document.forms.length - 1];
  var myField=myForm.elements[fieldName];
  myField.nextField=myForm.elements[nextFieldName];
  if (myField.maxLength == null)
    myField.maxLength=fakeMaxLength;
  myField.onkeydown=autojump_keyDown;
  myField.onkeyup=autojump_keyUp;
}

/******************
autojump_keyDown
******************/
function autojump_keyDown(){
  this.beforeLength=this.value.length;
  downStrokeField=this;
}

/******************
autojump_keyUp
******************/
function autojump_keyUp(){
  if (
    (this == downStrokeField) && 
    (this.value.length > this.beforeLength) && 
    (this.value.length >= this.maxLength)
  )
    this.nextField.focus();
  downStrokeField=null;
}

/******************
submitForm
******************/
function submitForm(orderForm){
    document.orderForm.submitBut.disabled = true;
    document.orderForm.submitBut.value = 'Submitting...';
    //document.orderForm.submit();
}


/******************
PopUp
******************/
function popUp(URL){
  props=window.open(URL,'','menubar=1, scrollbars=1, resizable=1, location=0, status=0, width=700, height=500');
}

/******************
popUp300
******************/
function popUp300(URL, item){
  var page = 'blank.php?item=' + item + "&url=" + URL;
  props=window.open(page, '','menubar=0, scrollbars=0, resizable=0, location=0, status=0, width=375, height=400');
}	

/******************
enterSameBillShip
******************/
function enterSameBillShip(){
  if(document.checkout1.bill_ship.checked == true){
    document.checkout1.shp_contact.value = document.checkout1.contact.value;
	document.checkout1.shp_company.value = document.checkout1.company.value;
	document.checkout1.shp_address1.value = document.checkout1.address1.value;
	document.checkout1.shp_address2.value = document.checkout1.address2.value;
	document.checkout1.shp_city.value = document.checkout1.city.value;
	document.checkout1.shp_state.value = document.checkout1.state.value;
	document.checkout1.shp_zip.value = document.checkout1.zip.value;
	document.checkout1.shp_day_phone1.value = document.checkout1.day_phone1.value;
	document.checkout1.shp_day_phone2.value = document.checkout1.day_phone2.value;
	document.checkout1.shp_day_phone3.value = document.checkout1.day_phone3.value;
  }
  else{
	document.checkout1.shp_contact.value = '';
	document.checkout1.shp_company.value = '';
	document.checkout1.shp_address1.value = '';
	document.checkout1.shp_address2.value = '';
	document.checkout1.shp_city.value = '';
	document.checkout1.shp_state.value = '';
	document.checkout1.shp_zip.value = '';
	document.checkout1.shp_day_phone1.value = '';
	document.checkout1.shp_day_phone2.value = '';
	document.checkout1.shp_day_phone3.value = '';
  }
}


/******************
x
******************/
function x () {
return;
}


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


/******************
insertAtCaret
******************/
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



/******************
DoSmilie
******************/
function DoSmilie(addSmilie) {
	var revisedMessage;
	var currentMessage = document.formMPK.descr.value;
	revisedMessage = currentMessage+addSmilie;
	document.formMPK.descr.value=revisedMessage;
	document.formMPK.descr.focus();
	return;
}

/******************
DoPrompt
******************/
	function DoPrompt(action) {
		var currentMessage = document.formMPK.descr.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.formMPK.descr, ' ' + "[URL]" + thisURL + "[/URL][URL_TITLE]" + thisTitle + "[/URL_TITLE]" + ' ');
			document.formMPK.descr.focus();
			return;
		}

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

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

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

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

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

			insertAtCaret(document.formMPK.descr, ' ' + "[I]" + thisItal + "[/I]" + ' ' );
			document.formMPK.descr.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.formMPK.descr, ' ' + "[IMG]" + thisImage + "[/IMG]" + ' ' );
			document.formMPK.descr.focus();
			return;
		}

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

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

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

		if (action == "listend") {
			insertAtCaret(document.formMPK.descr, ' ' + "[/LIST]" + ' ' );
			document.formMPK.descr.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.formMPK.descr, ' ' + "[*]" + thisItem + ' ' );
			document.formMPK.descr.focus();
			return;
		}

	}


// -->