
	function update_iframe(src) {
		 src.getAttribute('href')
		 src.getAttribute('target')
	}

	function update_Prices() {
			var tbQty					= MM_findObj('orosProductItem:tbQty');
			var tbSinglePrice	= MM_findObj('orosProductItem:tbSinglePrice');
			var tbPrice				= MM_findObj('orosProductItem:tbPrice');
			var hidBasePrice	= MM_findObj('orosProductItem:hidBasePrice');
			var qty					= tbQty.value;
			
			var origQty			= tbQty.value;
			var qty					= parseInt(origQty);
			
			var basePrice		= parseFloat(hidBasePrice.value);
			
			var aCheckRadioControls = new Array();
			var aCheckRadioValues = new Array();
			
			var allControls = document.forms[0].getElementsByTagName("input");
			
			var optionsBasePrice	= 0;
			var optionsAddPrice		= 0;

			for(var i = 0; i < allControls.length; i++) {
				if(allControls[i].type == "checkbox" || allControls[i].type == "radio") {
					if(allControls[i].checked) {
						aCheckRadioControls.push(allControls[i]);
					}
				}
				if(allControls[i].type == "hidden") {
					aCheckRadioValues.push(allControls[i]);
				}
			}
			
		//	alert('allControls['+ allControls.length +'] aCheckRadioControls['+ aCheckRadioControls.length +'] aCheckRadioValues['+ aCheckRadioValues.length +']');

			if(aCheckRadioControls.length > 0) {
				for(var j = 0;j<aCheckRadioControls.length; j++) {
					var ctrl = aCheckRadioControls[j];
					for(var k= 0;k<aCheckRadioValues.length; k++) {
						var hid = aCheckRadioValues[k];
						if(hid.id == (ctrl.id + '_hid')) {
							var optionvals = hid.value.split('|');
					//		alert('found ID:'+ hid.id +' VAL:'+ hid.value +' LEN:'+ optionvals.length);
							if(optionvals.length == 3) {
								if(optionvals[1] == '0') {
									optionsBasePrice += parseFloat(optionvals[2]);
								} else if(optionvals[1] == '1') {
									optionsAddPrice += parseFloat(optionvals[2]);
								}
							} else {
								alert('bad optionvals');
							}
						}
					}
				}
			}
			
			var singlePrice = basePrice + optionsBasePrice + optionsAddPrice;
			
			var divPriceTotal		= document.getElementById('divPriceTotal');
			var divPriceSingle	= document.getElementById('divPriceSingle');

			divPriceTotal.childNodes[0].data	= '$'+ FormatNumber(qty * singlePrice,2,'.');
			divPriceSingle.childNodes[0].data	= '$'+ FormatNumber(singlePrice,2,'.');
			
			tbSinglePrice.value = '$' + FormatNumber(singlePrice,2,'.');
			tbPrice.value = '$' + FormatNumber(qty * singlePrice,2,'.');
		}
		
		function update_Price() {
			var tbQty					= MM_findObj('orosProductItem:tbQty');
			var tbSinglePrice	= MM_findObj('orosProductItem:tbSinglePrice');
			var tbPrice				= MM_findObj('orosProductItem:tbPrice');
			var hidBasePrice	= MM_findObj('orosProductItem:hidBasePrice');
			var qty					= tbQty.value;
			
			var origQty			= tbQty.value;
			var qty					= parseInt(origQty);
			
			var basePrice		= parseFloat(hidBasePrice.value);
			
			var aCheckRadioControls = new Array();
			var aCheckRadioValues = new Array();
			
			var allControls = document.forms[0].getElementsByTagName("input");
			
			var optionsBasePrice	= 0;
			var optionsAddPrice		= 0;

			for(var i = 0; i < allControls.length; i++) {
				if(allControls[i].type == "checkbox" || allControls[i].type == "radio") {
					if(allControls[i].checked) {
						aCheckRadioControls.push(allControls[i]);
					}
				}
				if(allControls[i].type == "hidden") {
					aCheckRadioValues.push(allControls[i]);
				}
			}
			
		//	alert('allControls['+ allControls.length +'] aCheckRadioControls['+ aCheckRadioControls.length +'] aCheckRadioValues['+ aCheckRadioValues.length +']');

			if(aCheckRadioControls.length > 0) {
				for(var j = 0;j<aCheckRadioControls.length; j++) {
					var ctrl = aCheckRadioControls[j];
					for(var k= 0;k<aCheckRadioValues.length; k++) {
						var hid = aCheckRadioValues[k];
						if(hid.id == (ctrl.id + '_hid')) {
							var optionvals = hid.value.split('|');
					//		alert('found ID:'+ hid.id +' VAL:'+ hid.value +' LEN:'+ optionvals.length);
							if(optionvals.length == 3) {
								if(optionvals[1] == '0') {
									optionsBasePrice += parseFloat(optionvals[2]);
								} else if(optionvals[1] == '1') {
									optionsAddPrice += parseFloat(optionvals[2]);
								}
							} else {
								alert('bad optionvals');
							}
						}
					}
				}
			}
			
			var singlePrice = basePrice + optionsBasePrice + optionsAddPrice;
			
			tbSinglePrice.value = '$' + FormatNumber(singlePrice,2,'.');
			tbPrice.value = '$' + FormatNumber(qty * singlePrice,2,'.');
		}

function ProductInfo_ShowHide(divShow,divHide1,divHide2,divHide3){
	MM_findObj(divHide1).style.display = 'none';
	MM_findObj(divHide2).style.display = 'none';
	MM_findObj(divHide3).style.display = 'none';
	MM_findObj(divShow).style.display = 'block';
}

// EMG_UpdatePrice
// idQty = Generated ID for Qty field
// idPrice = Generated ID for Price field
// price1 = price factor 1
// price2 = price factor 2
// price3 = price factor 3
function EMG_UpdatePrice(idQty,idPrice,price1,price2) {
	var tbQty			= MM_findObj(idQty);
	var tbPrice		= MM_findObj(idPrice);
	var qty				= tbQty.value;
	
	var priceFactor;

	if(qty <= 11 && qty > 0) {
		priceFactor = price1;
	} else if(qty >= 12 && qty <= 50) {
		priceFactor = price2;
	} else {
		priceFactor = price1;
		qty = 1;
	}
	
	tbPrice.value = '$' + FormatNumber(qty * priceFactor,2,'.'); 
}

var order_submit_count = 0;
var productdetail_addtocart_count = 0;
var productdetail_savechanges_count = 0;
var checkout_nextstep_count = 0;

function EMG_remove_address() { //v1.0
	var msg = 'Are you sure you want to remove this address from your account? It will be deleted permanently.';
	return EMG_check_confirm(msg);
}

function EMG_remove_creditcard() { //v1.0
	var msg = 'Are you sure you want to remove this credit card from your account? It will be deleted permanently.';
	return EMG_check_confirm(msg);
}

function EMG_remove_employee() { //v1.0
	var msg = 'Are you sure you want to remove this employee from your account? It will be deleted permanently.';
	return EMG_check_confirm(msg);
}

function EMG_order_cancel() { //v1.0
	var msg = 'Are you sure you want to cancel this order? Your shopping basket will be cleared and you will have to start over.';
	return EMG_check_confirm(msg);
}

function EMG_order_signout() { //v1.0
	var msg = 'Are you sure you want to sign out? You have an open order. If you sign out it will be lost and you will have to start over.';
	return EMG_check_confirm(msg);
}

function EMG_check_confirm(msg) { //v1.0
	if(confirm(msg)) {
		return true;
	} else {
		return false;
	}
}

function EMG_Popup_LargerImage(url) {
	  window.open(url,'largerimage','width=300,height=470');
}

function EMG_Popup_ViewInvoice(url) {
	  window.open(url,'customerinvoice','width=700,height=800');
}

function EMG_Popup_ViewAdminInvoice(url) {
	  window.open(url,'admininvoice','width=700,height=800');
}

function EMG_Popup_ViewGiftCard(url) {
	  window.open(url,'giftcard','width=520,height=600');
}

function EMG_Popup_ViewPickSheet(url) {
	  window.open(url,'picksheet','width=700,height=800');
}

function EMG_Popup_ViewThankYouLetter(url) {
	  window.open(url,'picksheet','width=700,height=800');
}

function EMG_Popup_TellAFriend(url) {
	  window.open(url,'tellafriend','width=420,height=570');
}

function EMG_Popup_Recipe(url) {
	  window.open(url,'recipe','width=500,height=600,scrollbar=yes');
}

function EMG_Popup_PromoDetails(url) {
	  window.open(url,'promo','width=400,height=400');
}

function EMG_Popup_CSC(src) {
	  window.open('/marketplace/checkout_csc.aspx','csc','width=400,height=580');
}

function pop_CSC(src) {
	  return link_popup(src,'width=400,height=580');
}

function pop_Survey(src) {
	  return link_popup(src,'width=600,height=580,scrollbars=yes');
}

function pop_GiftCard(src) {
	  return link_popup(src,'width=520,height=600');
}

function pop_AdminGiftCard(src) {
	  return link_popup(src,'width=750,height=450');
}

function pop_PromoDetails(src) {
	  return link_popup(src,'width=400,height=400');
}

function pop_PromoKosher(src) {
	  return link_popup(src,'width=494,height=474');
}

function pop_Recipe(src) {
	  return link_popup(src,'width=500,height=500,scrollbars=yes');
}

function pop_HairDye(src) {
	  return link_popup(src,'width=500,height=500,scrollbars=yes');
}

function pop_Siteseal(src) {
	  return link_popup(src,'height=500,width=515,scrollbars=yes,status=yes');
}

function pop_PageMedia(src) {
	  return link_popup(src,'width=400,height=360');
}

function EMG_ProductDetail_AddToCart_ClickOnce() { //v1.0
	var msg = 'Please click "Add To Cart" only once. It may take a few moments to add this item to your Shopping Cart. Thank you.';

	if(productdetail_addtocart_count == 0) {
		productdetail_addtocart_count++;
		return true;
	} else {
		alert(msg);
		return false;
	}
}

function EMG_ProductDetail_SaveChanges_ClickOnce() { //v1.0
	var msg = 'Please click "Save Changes" only once. It may take a few moments to update this item in your Shopping Cart. Thank you.';

	if(productdetail_savechanges_count == 0) {
		productdetail_savechanges_count++;
		return true;
	} else {
		alert(msg);
		return false;
	}
}

function EMG_Checkout_NextStep_ClickOnce() { //v1.0
	var msg = 'Please click "Next Step" only once. It may take a few moments to process this step. Thank you.';

	if(checkout_nextstep_count == 0) {
		checkout_nextstep_count++;
		return true;
	} else {
		alert(msg);
		return false;
	}
}



function EMG_Checkout_PlaceOrder_ClickOnce() { //v1.0
	var msg = 'Please click "Place Order" only once. It may take a few moments to finish processing your order. Thank you.';
	
	if(order_submit_count == 0) {
		order_submit_count++;
		return true;
	} else {
		alert(msg);
		return false;
	}
}



function EMG_body_onload() { //v1.0
}

