     function BADenlargePhoto(p,e) {
		newwindow=window.open('gallery_photo.php?p='+p+'&l='+e+'&t=3','name','height=500,width=760,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
	 }

function openCvc2() {
	window.open("cvc2.php","NewWindow","WIDTH=400,HEIGHT=400,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}
function openHelp() {
	window.open("http://perichoresis.org/help.php","NewWindow","WIDTH=600,HEIGHT=500,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function openShipMethods() {
	window.open("shipping_method_p.php","NewWindow","WIDTH=400,HEIGHT=400,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function changeFieldValue(fieldNum,offVar) {
	document.chkfrm[fieldNum].value = offVar;
}

function sameBS() {

	if(document.chkfrm.sameBillingShipping.checked==true) {
		document.chkfrm.s_first_name.value = document.chkfrm.first_name.value;
		document.chkfrm.s_last_name.value = document.chkfrm.last_name.value;
		document.chkfrm.s_address.value = document.chkfrm.address.value;
		document.chkfrm.s_city.value = document.chkfrm.city.value;
		document.chkfrm.s_state.value = document.chkfrm.state.value;
		document.chkfrm.s_zipcode.value = document.chkfrm.zipcode.value;
		document.chkfrm.s_country.selectedIndex = document.chkfrm.country.selectedIndex;
	}
	else {
		document.chkfrm.s_first_name.value = '';
		document.chkfrm.s_last_name.value = '';
		document.chkfrm.s_address.value = '';
		document.chkfrm.s_city.value = '';
		document.chkfrm.s_state.value = '';
		document.chkfrm.s_zipcode.value = '';
		document.chkfrm.s_country.selectedIndex = 'United States';
	}

		setOptions(document.chkfrm.s_country.options[document.chkfrm.s_country.selectedIndex].value);


}

function redirectMe(strURL) {
document.location=strURL;  
}
function UpdateQty(item)
{
	itemId = item.name;
	newQty = item.options[item.selectedIndex].text;
	
	document.location.href = 'store_cart.php?v=2&vc='+itemId+'&vq='+newQty;

}

var DHTML = (document.getElementById || document.all || document.layers);

function swap(flag,lid)
{
	if (!DHTML) return;
	var x = new getLayerObj(lid);
	x.style.visibility = (flag) ? 'visible' : 'hidden';
}

function resizeDiv(lid,amt) {

	var x = new getLayerObj(lid);
	x.style.height = amt + 'px';

}
function getLayerObj(name) {
  if (document.getElementById)  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}


function changeLayerBgColor(lid,col)
{
	if (!DHTML) return;
	var x = new getLayerObj(lid);
	x.style.backgroundColor = col;
}

function updateDivContent(lid,contentHTML) {
document.getElementById(lid).innerHTML=contentHTML;
}
function submitOnce(theform){
if (document.all||document.getElementById){
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
tempobj.disabled=true
}
}
}
function billingUpdateChecked() {
	if(document.chkfrm.update_billing.checked==true) {
		document.chkfrm.first_name.value = '';
		document.chkfrm.last_name.value = '';
		document.chkfrm.address.value = '';
		document.chkfrm.city.value = '';
		document.chkfrm.state.value = '';
		document.chkfrm.zipcode.value = '';
		document.chkfrm.card_code.value = '';
		document.chkfrm.card_number.value = '';
		document.chkfrm.first_name.style.backgroundColor='#FFFFFF';
		document.chkfrm.last_name.style.backgroundColor='#FFFFFF';
		document.chkfrm.address.style.backgroundColor='#FFFFFF';
		document.chkfrm.city.style.backgroundColor='#FFFFFF';
		document.chkfrm.state.style.backgroundColor='#FFFFFF';
		document.chkfrm.zipcode.style.backgroundColor='#FFFFFF';
		document.chkfrm.card_code.style.backgroundColor='#FFFFFF';
		document.chkfrm.card_number.style.backgroundColor='#FFFFFF';

	}

}

function priceCheck(str) {
	var s = str.value;
	allowedValues = "0123456789.";
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++) {
	var c = s.charAt(i);
	if (allowedValues.indexOf(c) > -1) returnString += c;
	}
	str.value = returnString;
}
