function doubleFunc()
{
	window.open("http://store.schiffvitamins.com");
	window.location.replace("http://www.movefree.com/where_to_buy.asp");
//	alert("Testing! Testing! Is this thing on? Hello?");
}

function afMessage()
{
	var response = confirm("Proud Sponsors play an invaluable role in furthering the mission of Arthritis Foundation. These premier sponsors make it possible for the Foundation to continue investing in critical areas of advocacy, research and public health. Together, with Proud Sponsors like Schiff Nutrition, the Arthritis Foundation will realize its vision of a world free of arthritis pain.\n\nClick OK to visit www.Arthritis.org or CANCEL to return to the Move Free Advanced website.");
	if (response==true)
	{
		window.location.assign("http://www.arthritis.org/");
	}
	else
	{
	}
}


//DJ - Use the other section for the SuppFacts.
//function showProductSuppFacts(id,productid)
//{
//	var url = '/product_suppfacts.asp?id=' + id + '&productid=' + productid;
//	var win = window.open(url,'','menubar=no,scrollbars=yes');
//	win.document.close();
//	if (window.focus) { win.focus(); }
//}


//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 = "";
}





