function checkQuantity() {
    if (eval(document.cart.pr1.value) < 2 && eval(document.cart.itemlist.value)==1) {
        var str = "Did you know that the shipping price for one bottle is usually the same as for two bottles?\r\n";
	str = str + "Click [Ok] if you would like to add add one more bottle to your order, click [Cancel] to leave your order as is.";
        var where_to = confirm(str);
	if (where_to == true) {
	    document.cart.pr1.value = 2;
	    document.cart.submit();
	}
    } else {documtn.cart.submit(); }
}

function delete_record(url,string) {
	var where_to = confirm("Do you really want to delete this record?\r\n" + string);
	if (where_to == true) {
		window.location = url;
	}
}


function required_fields (formID,fields_string,submit_page) {
	fields = fields_string.split(",");
	var re = /^(\w|[^_]\.|[\-])+((\@){1}([^_]))(([a-z]|[\d]|[\-]|\.)+|([^_]\.[^_])*)+\.[a-z]{2,6}$/;	
	submit_form = true;

	for (var i=0;i < fields.length;i++) {
		
		field_name = fields[i];
		if (field_name=="email") {
			if (!re.test(document.forms[formID].elements[field_name].value)) {
				submit_form = false;
				message ="\nWrong email address!";
			}
		} else {
			if (document.forms[formID].elements[field_name].value==""){
				submit_form = false;
				message ="Please fill out required fields!";
			}
		}
	}

	if (submit_form == true) {
		document.forms[formID].action = submit_page;
		document.forms[formID].submit();
	} else {
		alert(message);
	}
	

}



function Go_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function New_Window(name,url,scrollbars,toolbar,location,status,menubar,resizable,width,height,left,top) {
	var properties = "scrollbars=" + scrollbars + ",toolbar=" + toolbar + ",location=" + location + ",status=" + status + ",menubar=" + menubar + ",resizable=" + resizable + ",width=" + width + ",height=" + height + ",left=" + left + ",top=" + top;
 window.open(url,name,properties);
}

 
function media(url) {
     url = "media.php?media=" + url;
         window.open(url,"media","toolbar=0,location=0,status=0, menubar=0,scrollbars=1,resizable=1,width=400,height=200");
}
	 