/*Drop Down Site Menu. Used in Edit page of Image Galleries*/
function go(form) 
{
location=form.selectmenu.value
}

/* Confirm delete actions */
function disp_confirm()
{
	var result = confirm("You are about to delete this from the database. Would you like to continue?");
	if (result == true) {
		return true;
	}
	else {
		return false;
	}
}
/* Confirm delete actions */
function disp_confirm_clear()
{
	var result = confirm("You are about to clear responses from the database. Would you like to continue?");
	if (result == true) {
		return true;
	}
	else {
		return false;
	}
}
/* activate() and inactivate() used in Polls */
function activate()
{
  var x = window.document.form_1.radio_1;
  if (x.checked == true) 
  {
    window.document.form_1.radio_2.checked = false;
  }

}
function inactivate()
{
  var x = window.document.form_1.radio_2;
  if (x.checked == true) {
    window.document.form_1.radio_1.checked = false;
  }
}
/* use CSS for visibility */
var flag_1=false;
var flag_2=false;
function visibilityOn(i) {
	var x=document.getElementById(i).style.visibility = "hidden";
}
function visibilityOff(i) {
	var x=document.getElementById(i).style.visibility = "hidden";
}

// grey out text fields
function disableTextField (field) {
  if (document.all || document.getElementById) {
    field.disabled = true;
  }
  else {
    field.oldOnFocus = field.onfocus;
    field.onfocus = skip();
  }
}
function enableTextField (field) {
  if (document.all || document.getElementById) {
    field.disabled = false;
  }
  else {
    field.onfocus = field.oldOnFocus;
  }
}
function skip () { this.blur(); }

/* update subtotal and total based on drop-down selections */
function updateTotals(i) {if (i==1) {
var subtotal = 1060;}
if (i==10) {
var subtotal = 10600;}
if (i==0.1) {
var subtotal = 140;}
if (i==0.25) {
var subtotal = 268;}
if (i==0.5) {
var subtotal = 530;}
if (i==0.75) {
var subtotal = 795;}
if (i==2) {
var subtotal = 2120;}
if (i==3) {
var subtotal = 3180;}
if (i==4) {
var subtotal = 4240;}
if (i==5) {
var subtotal = 5300;}
	var payment = document.getElementById('payment');
	var pay_method = payment.options[payment.selectedIndex].value;
	
	if (pay_method==5) { /* if C.O.D. is selected */
		var total = parseInt(subtotal) + 24;
		subtotal = formatCurrency(subtotal);
		total = formatCurrency(total);
		document.getElementById('subtotal').cells[1].innerHTML = subtotal;
		document.getElementById('shipping').cells[1].innerHTML = "$"+24+".00";
		document.getElementById('total').cells[1].innerHTML = total;
	}
	else {
		var total = parseInt(subtotal);
		total = formatCurrency(total);
		subtotal = formatCurrency(subtotal);
		document.getElementById('subtotal').cells[1].innerHTML = subtotal;
		document.getElementById('shipping').cells[1].innerHTML = "Included";
		document.getElementById('total').cells[1].innerHTML = total;
	}
}

<!-- Original:  Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site:  http://www7.ewebcity.com/cyanide7 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function formatCurrency(numvar) {
	var num = numvar.toString().replace(/$|\,/g,'');
	if(isNaN(num)) {
		num = "0";
	}
	var sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	var cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10) {
		cents = "0" + cents;
	}
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) {
		num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
	}
	return (((sign)?'':'-') + '$' + num + '.' + cents);
}

// pop-up window
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=750,height=550,left = 585,top = 325');");
}