function doubleFunc()
{
	window.open("http://store.schiffvitamins.com");
	window.location.replace("http://www.schiffmegared.com/where_to_buy.asp");
}

function showPopup(url) //DJ - This is used on some pages. 111024
{
	newwindow=window.open(url,"_blank",'height=350,width=320,resizable=no,location=no,menubar=no,scrollbars=no');
	if (window.focus) {newwindow.focus()}
}


function open_large_a_win() //DJ - This is used on a PRO page. 111024
{
	window.open("http://www.schiffmegared.com/professional/large_a.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=990, height=840");
}


function close_this_win() //DJ - This is used on some pages. 111024
{
	this.close();
}


//DJ - START SuppFacts popup code (From Peter Curtis)
var newwindow = "";

function suppFactsPopUp(url,h,w) {
	//DJ - Make sure you have added 20px to height and width in the call.
	
	if (newwindow.location && !newwindow.closed) {
		newwindow.location.href = url;
		newwindow.focus();
	}
	else {
//		newwindow=window.open(url,"Supplement Facts","height="+h+"px,left=200px,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,width="+w+"px");
		newwindow=(window.open(url, "_blank", "height="+h+"px, left=200px, location=0, menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, toolbar=0, width="+w+"px"));
	}
}

function tidy() {
	if (newwindow.location && !newwindow.closed) {
		newwindow.close();
	}
}

//DJ - IE8 "window.open" issue. Per thread at "http://stackoverflow.com/questions/710756/ie8-var-w-window-open-message-invalid-argument" it could be:
// 1. Need to wrap var assignments in parentheses - NOPE
// 2. Do not use spaces after commas in attribute assignments - NOPE
// 3. May not be able to use "/" or "+" in the attribute assignments - (I hope not!)
// 4. Must use a TARGET assignment for 2nd attribute - YEP
// 5. IE is an annoying nuisance - YEP

//DJ - END SuppFacts popup code


function validate_form() {
	//DJ - Let's see what they entered for "Quantity".
	
	var intQuantity;
	
	intQuantity = (document.getElementById("Quantity").value);
	
	intQuantity = parseInt(intQuantity,10);
	
	if (isNaN(intQuantity)) {
		//DJ - They entered a non-number.
		alert("Please enter a quantity from 1 to 12.");
		document.getElementById("Quantity").focus();
//				document.getElementById("Quantity").value="";
		document.getElementById("Quantity").select();
		return(false);
	}
	else if (intQuantity < 1 || intQuantity > 12) {
		//DJ - They entered an out-of-bounds amount.
		alert("Please enter a quantity from 1 to 12.");
		document.getElementById("Quantity").focus();
//				document.getElementById("Quantity").value="";
		document.getElementById("Quantity").select();
		return(false);
	}
	else {
		//DJ - Proceed normally.
		return(true);
	}
	
}

function prepToSearch() {
//	document.getElementById("q").select();
	document.getElementById("q").value = "";
}





