//link is http://studiosuite.3dcartstores.com/add_cart.asp?out=1&quick=1&item_id=16
var version = "None";
function hideVersions(chosen) {
	switch(chosen) {
		case "solo":
			//hide other version choices
			document.getElementById('tablePro').style.display = 'none';
			document.getElementById('tableNetwork').style.display = 'none';
			document.getElementById('tableInternet').style.display = 'none';
			version = "Solo";
			break;
		case "pro":
			//hide other version choices
			document.getElementById('tableSolo').style.display = 'none';
			document.getElementById('tableNetwork').style.display = 'none';
			document.getElementById('tableInternet').style.display = 'none';
			//show "Do you have FM" questions
			document.getElementById('haveFMQuestionPro').style.display = 'block';
			version = "Pro";
			break;
		case "network":
			//hide other version choices
			document.getElementById('tableSolo').style.display = 'none';
			document.getElementById('tablePro').style.display = 'none';
			document.getElementById('tableInternet').style.display = 'none';
			//show "Do you have FM" question
			document.getElementById('haveFMQuestionNetwork').style.display = 'block';
			version = "Network";
			break;
		case "internet":
			//hide other version choices
			document.getElementById('tableSolo').style.display = 'none';
			document.getElementById('tablePro').style.display = 'none';
			document.getElementById('tableNetwork').style.display = 'none';
			//show "Do you have FM" questions
			document.getElementById('haveFMQuestionInternet').style.display = 'block';
			version = "Internet";
			break;
		default:
			document.getElementById('tableSolo').style.display = 'block';
			document.getElementById('tablePro').style.display = 'block';
			document.getElementById('tableNetwork').style.display = 'block';
			document.getElementById('tableInternet').style.display = 'block';
			document.getElementById('haveFMQuestion').style.display = 'none';
			document.getElementById('haveFMQuestion1').style.display = 'none';
			document.getElementById('haveFMQuestion2').style.display = 'none';
			document.getElementById('haveFMQuestion3').style.display = 'none';
			break;
	}
}

var loc = "http://studiosuite.3dcartstores.com/add_cart.asp?out=1&quick=1&item_id=16&item_id=17";
function FMChoice(choice) {
	switch(choice) {
		case "no":
			if (version == "Pro"){
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=7";
				var inp = confirm("So you're a new user, without FileMaker, and would like to purchase Studio Suite 9 Pro?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Network") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=8";
				var inp = confirm("So you're a new user, without FileMaker, and would like to purchase Studio Suite 9 Network?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Internet") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=12";
				var inp = confirm("So you're a new user, without FileMaker, and would like to purchase Studio Suite 9 Internet?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else{
				alert("Something went horribly wrong!\nDon't panic, PM is on the case!");
				history.go(0);
			}
			break;
		case "yes":
			if (version == "Pro") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=1";
				var inp = confirm("So you're a new user with FileMaker 10 or greater, and you would like to purchase Studio Suite 9 Pro?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Network") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=9";
				var inp = confirm("So you're a new user with FileMaker 10 or greater, and you would like to purchase Studio Suite 9 Network?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Internet") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=13";
				var inp = confirm("So you're a new user with FileMaker 10 or greater, and you would like to purchase Studio Suite 9 Internet?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else{
				alert("Something went terribly wrong! Oh no!\nBut never fear, PM is here!");
				history.go(0);
			}
			break;
		case "other":
			alert("It looks like you have a unique case which cannot be handled by the online cart. Please give us a call:\n1 (800) 450-5740\n\nIf you are outside the United States, please use this number:\n1 (818) 752-3900");
			break;
		default:
			alert("Error! Please try again.");
			break;
	}
}
function FMChoiceUpg(choice) {
	switch(choice) {
		case "no":
			if (version == "Pro"){
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=14";
				var inp = confirm("So you're a current Studio Suite user with an older version of FileMaker, and you would like to upgrade to Studio Suite 9 Pro?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Network") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=16";
				var inp = confirm("So you're a current Studio Suite user with an older version of FileMaker, and you would like to upgrade to Studio Suite 9 Network?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Internet") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=18";
				var inp = confirm("So you're a current Studio Suite user with an older version of FileMaker, and you would like to upgrade to Studio Suite 9 Internet?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else{
				alert("Something went horribly wrong!\nDon't panic, PM is on the case!");
				history.go(0);
			}
			break;
		case "yes":
			if (version == "Pro") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=15";
				var inp = confirm("So you're a current Studio Suite user, already have FileMaker Pro 10 or greater, and you would like to upgrade to Studio Suite 9 Pro?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Network") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=17";
				var inp = confirm("So you're a current Studio Suite user, already have FileMaker Pro and Server 10 or greater, and you would like to upgrade to Studio Suite 9 Network?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else if (version == "Internet") {
				loc = "http://studiosuite.3dcartstores.com/view_category.asp?cat=19";
				var inp = confirm("So you're a current Studio Suite user, already have FileMaker Server ADVANCED 10 or greater, and you would like to upgrade to Studio Suite 9 Internet?\nIf this is correct, click OK to continue to our online cart system.");
				if (inp) {
					retrieveLink();
				}
			}else{
				alert("Something went terribly wrong! Oh no!\nBut never fear, PM is here!");
				history.go(0);
			}
			break;
		case "other":
			alert("It looks like you have a unique case which cannot be handled by the online cart. Please give us a call:\n1 (800) 450-5740\n\nIf you are outside the United States, please use this number:\n1 (818) 752-3900");
			break;
		default:
			alert("Error! Please try again.");
			break;
	}
}

function seats(seat) {
	var temp = 0;
	switch(seat) {
		case "1":
			temp = 1;
		default:
			temp = 1;
	}
}

function buildLink(parameters){
	
}
function retrieveLink(){
	window.location.href = loc;
}
