// javascript document

var picpath = new Array;
picpath[3911358] = "https://www.purepointgolf.com/store/productimages/standard/2562230.jpg";
picpath[3911335] = "https://www.purepointgolf.com/store/productimages/standard/2685065.jpg";
picpath[3911303] = "https://www.purepointgolf.com/store/productimages/standard/2899914.jpg";
picpath[3911332] = "https://www.purepointgolf.com/store/productimages/standard/3252599.jpg";
picpath[3911326] = "https://www.purepointgolf.com/store/productimages/standard/3477971.jpg";
picpath[3911344] = "https://www.purepointgolf.com/store/productimages/standard/3731143.jpg";
picpath[4030934] = "https://www.purepointgolf.com/store/productimages/standard/pitching.jpg";
picpath[4164421] = "https://www.purepointgolf.com/store/productimages/standard/trouble.jpg";
picpath[4247477] = "https://www.purepointgolf.com/store/productimages/standard/MaxDistance.jpg";
picpath[5063815] = "https://www.purepointgolf.com/store/productimages/standard/impact.jpg";
picpath[5182282] = "https://www.purepointgolf.com/store/productimages/standard/swingplane.jpg";
picpath[5343996] = "https://www.purepointgolf.com/store/productimages/standard/precisionputting.jpg";
picpath[5435910] = "https://www.purepointgolf.com/store/productimages/standard/fsdrills.jpg";
picpath[5528898] = "https://www.purepointgolf.com/store/productimages/standard/fslessons.jpg";

function unlock2 () {
	var prod1 = document.special.prod1.value;
	if ( prod1 == "" || prod1 == " " || prod1 == false || prod1 == null ) {
		alert('Sorry, you need to select a DVD from the first drop down menu.');
		exit();
	} else { // success!! unlock the second drop down
		document.pic1.src = picpath[ prod1 ];
		document.special.prod2.disabled = false;
	} 
} // end of the unlock 2 function


function unlock3 () {
	var prod2 = document.special.prod2.value;
	if ( prod2 == "" || prod2 == " " || prod2 == false || prod2 == null ) {
		alert('Sorry, you need to select a DVD from the second drop down menu.');
		exit();
	} else { // success!! unlock the second drop down
		document.pic2.src = picpath[ prod2 ];
		document.special.prod3.disabled = false;
	} 
} // end of the unlock 3 function

function unlockSubmit () {
	var prod3 = document.special.prod3.value;
	if ( prod3 == "" || prod3 == " " || prod3 == false || prod3 == null ) {
		alert('Sorry, you need to select a DVD from the third drop down menu.');
		exit();
	} else { // success!! unlock the second drop down
		document.pic3.src = picpath[ prod3 ];
		document.special.sb.disabled = false;
		document.getElementById('subtotal').innerHTML = "<strong>Sub-Total: &#36; 66.00</strong>";
		document.getElementById('shipping').innerHTML = "<strong>Shipping: &#36; 7.95</strong>";
		document.getElementById('total').innerHTML = "<h2>Total: &#36; 73.95</h2>";
	} 
} // end of the unlock submit function



function validateSummer () {
	
	var actionURL = 'https://www.purepointgolf.com/special-thanks.php';
	var fname = document.special.name_f.value;
	var lname = document.special.name_l.value;
	var email = document.special.email.value;
	var address = document.special.address.value;
	var city = document.special.city.value;
	var zip = document.special.zip.value;
	var country = document.special.country.value;
	var state = document.special.state.value;
	var statefill = document.special.statefill.value;
	var phone = document.special.phone.value;
	var ccnum = document.special.cc_number.value;
	var ccmon = document.special.cc_month.value;
	var ccyr = document.special.cc_year.value;
	var choice1 = document.special.prod1.value;
	var choice2 = document.special.prod2.value;
	var choice3 = document.special.prod3.value;
	
	if ( fname == "" || lname == "" || fname == null || lname == null ) {
		alert("Please provide a first name and last name to sign up.");
		return;
	}
	
	if ( email.search("@") == -1 || email.search(".") == -1 ) {
		alert("You MUST add a valid email address to complete the form.");
		return;
	}
	
	if ( ccmon == "" || ccmon == null || ccyr == "" || ccyr == null || ccnum == "" || ccnum == null ) {
		alert("You MUST enter all credit card information to complete the form.");
		return;
	}
	
	if ( address == "" || address == null || city == "" || city == null || zip == "" || zip == null ) {
		alert("You MUST enter all address information for your DVDs to be shipped to you.");
		return;
	}
	
	if ( country != "CA" && country != "UK" && country != "GB" ) {
		if ( ( state == "" || state == null ) && ( statefill == "" || statefill == null ) ) {
			alert("You MUST select or fill in a State/Province for your DVDs to be shipped to you.");
			return;
		}
	}

	if ( country == "" || country == null ) {
		alert("You MUST select a Country for your DVDs to be shipped to you.");
		return;
	}
	
	if ( phone == "" || phone == null ) {
		alert("To ensure delivery to you, we require that you enter a phone number. Your phone number will only be called by the shipping company. We DO NOT place unsolicited calls and we DO NOT share any of your information with third parties. Your phone number is required by the shipping company in case of delivery issues.");
		return;
	}
	
	//if ( choice == "" || choice == null || choice == "Select a DVD" ) {
		//alert("You MUST select which DVD you would like for FREE to proceed.");
		//return;
	//}
	
	document.special.action = actionURL;
	document.special.submit();
	
}


// JavaScript Document
function showLayer ( whichLayer ) {
	var elem, vis;
	if ( document.getElementById ) 
		elem = document.getElementById( whichLayer );
	else if ( document.all ) 
		elem = document.all[whichLayer];
	else if ( document.layers ) 
		elem = document.layers[whichLayer];
	vis = elem.style;
	vis.display = 'block';
}

function hideLayer ( whichLayer ) {
	var elem, vis;
	if ( document.getElementById ) 
		elem = document.getElementById( whichLayer );
	else if ( document.all ) 
		elem = document.all[whichLayer];
	else if ( document.layers ) 
		elem = document.layers[whichLayer];
	vis = elem.style;
	vis.display = 'none';
}

function setOptions ( chosen ) {
	
	var selbox  = document.special.state;
	
	selbox.options.length = 0;
	
	if ( chosen == "" || chosen == " " ) {
		selbox.options[selbox.options.length] = new Option('Select &nbsp; &nbsp;');
	}
	
	if ( chosen == "US" ) {
		selbox.options[selbox.options.length] = new Option('Alabama','AL');
		selbox.options[selbox.options.length] = new Option('Alaska','AK');
		selbox.options[selbox.options.length] = new Option('American Samoa','AS');
		selbox.options[selbox.options.length] = new Option('Arizona','AZ');
		selbox.options[selbox.options.length] = new Option('Arkansas','AR');
		selbox.options[selbox.options.length] = new Option('California','CA');
		selbox.options[selbox.options.length] = new Option('Colorado','CO');
		selbox.options[selbox.options.length] = new Option('Connecticut','CT');
		selbox.options[selbox.options.length] = new Option('Delaware','DE');
		selbox.options[selbox.options.length] = new Option('District of Columbia','DC');
		selbox.options[selbox.options.length] = new Option('Fed. St. Micronesia','FM');
		selbox.options[selbox.options.length] = new Option('Florida','FL');
		selbox.options[selbox.options.length] = new Option('Georgia','GA');
		selbox.options[selbox.options.length] = new Option('Guam','GU');
		selbox.options[selbox.options.length] = new Option('Hawaii','HI');
		selbox.options[selbox.options.length] = new Option('Idaho','ID');
		selbox.options[selbox.options.length] = new Option('Illinois','IL');
		selbox.options[selbox.options.length] = new Option('Indiana','IN');
		selbox.options[selbox.options.length] = new Option('Iowa','IA');
		selbox.options[selbox.options.length] = new Option('Kansas','KS');
		selbox.options[selbox.options.length] = new Option('Kentucky','KY');
		selbox.options[selbox.options.length] = new Option('Louisiana','LA');
		selbox.options[selbox.options.length] = new Option('Maine','ME');
		selbox.options[selbox.options.length] = new Option('Marshall Islands','MH');
		selbox.options[selbox.options.length] = new Option('Maryland','MD');
		selbox.options[selbox.options.length] = new Option('Massachusetts','MA');
		selbox.options[selbox.options.length] = new Option('Michigan','MI');
		selbox.options[selbox.options.length] = new Option('Minnesota','MN');
		selbox.options[selbox.options.length] = new Option('Mississippi','MS');
		selbox.options[selbox.options.length] = new Option('Missouri','MO');
		selbox.options[selbox.options.length] = new Option('Montana','MT');
		selbox.options[selbox.options.length] = new Option('Nebraska','NE');
		selbox.options[selbox.options.length] = new Option('Nevada','NV');
		selbox.options[selbox.options.length] = new Option('New Hampshire','NH');
		selbox.options[selbox.options.length] = new Option('New Jersey','NJ');
		selbox.options[selbox.options.length] = new Option('New Mexico','NM');
		selbox.options[selbox.options.length] = new Option('New York','NY');
		selbox.options[selbox.options.length] = new Option('North Carolina','NC');
		selbox.options[selbox.options.length] = new Option('North Dakota','ND');
		selbox.options[selbox.options.length] = new Option('Northern Mariana Islands','MP');
		selbox.options[selbox.options.length] = new Option('Ohio','OH');
		selbox.options[selbox.options.length] = new Option('Oklahoma','OK');
		selbox.options[selbox.options.length] = new Option('Oregon','OR');
		selbox.options[selbox.options.length] = new Option('Palau','PW');
		selbox.options[selbox.options.length] = new Option('Pennsylvania','PA');
		selbox.options[selbox.options.length] = new Option('Puerto Rico','PR');
		selbox.options[selbox.options.length] = new Option('Rhode Island','RI');
		selbox.options[selbox.options.length] = new Option('South Carolina','SC');
		selbox.options[selbox.options.length] = new Option('South Dakota','SD');
		selbox.options[selbox.options.length] = new Option('Tennessee','TN');
		selbox.options[selbox.options.length] = new Option('Texas','TX');
		selbox.options[selbox.options.length] = new Option('Utah','UT');
		selbox.options[selbox.options.length] = new Option('Vermont','VT');
		selbox.options[selbox.options.length] = new Option('Virginia','VA');
		selbox.options[selbox.options.length] = new Option('Virgin Islands','VI');
		selbox.options[selbox.options.length] = new Option('Washington','WA');
		selbox.options[selbox.options.length] = new Option('West Virginia','WV');
		selbox.options[selbox.options.length] = new Option('Wisconsin','WI');
		selbox.options[selbox.options.length] = new Option('Wyoming','WY');
		selbox.options[selbox.options.length] = new Option('Armed Forces Africa','AE');
		selbox.options[selbox.options.length] = new Option('AF Americas (except Canada)','AA');
		selbox.options[selbox.options.length] = new Option('Armed Forces Canada','AE');
		selbox.options[selbox.options.length] = new Option('Armed Forces Europe','AE');
		selbox.options[selbox.options.length] = new Option('Armed Forces Middle East','AE');
		selbox.options[selbox.options.length] = new Option('Armed Forces Pacific','AP');
		showLayer('stateselect');
		hideLayer('statefillin');
		document.special.statefill.value = "";
	}
	
	if ( chosen == "GB" ) {
		selbox.options[selbox.options.length] = new Option('Bristol and Avon');
		selbox.options[selbox.options.length] = new Option('Bedfordshire');
		selbox.options[selbox.options.length] = new Option('Berkshire');
		selbox.options[selbox.options.length] = new Option('Buckinghamshire');
		selbox.options[selbox.options.length] = new Option('Cambridgeshire');
		selbox.options[selbox.options.length] = new Option('Cheshire');
		selbox.options[selbox.options.length] = new Option('Cleveland');
		selbox.options[selbox.options.length] = new Option('Cornwall');
		selbox.options[selbox.options.length] = new Option('Cumbria');
		selbox.options[selbox.options.length] = new Option('Derbyshire');
		selbox.options[selbox.options.length] = new Option('Devon');
		selbox.options[selbox.options.length] = new Option('Dorset');
		selbox.options[selbox.options.length] = new Option('Essex');
		selbox.options[selbox.options.length] = new Option('Gloucs');
		selbox.options[selbox.options.length] = new Option('Guernsey');
		selbox.options[selbox.options.length] = new Option('Hampshire');
		selbox.options[selbox.options.length] = new Option('Herts');
		selbox.options[selbox.options.length] = new Option('Jersey');
		selbox.options[selbox.options.length] = new Option('Kent');
		selbox.options[selbox.options.length] = new Option('Lancashire');
		selbox.options[selbox.options.length] = new Option('Leicstershire');
		selbox.options[selbox.options.length] = new Option('Lincolnshire');
		selbox.options[selbox.options.length] = new Option('London');
		selbox.options[selbox.options.length] = new Option('Merseyside');
		selbox.options[selbox.options.length] = new Option('Middlesex');
		selbox.options[selbox.options.length] = new Option('Norfolk');
		selbox.options[selbox.options.length] = new Option('Northamptonshire');
		selbox.options[selbox.options.length] = new Option('Northern Ireland');
		selbox.options[selbox.options.length] = new Option('Northumberland');
		selbox.options[selbox.options.length] = new Option('Notts');
		selbox.options[selbox.options.length] = new Option('Oxfordshire');
		selbox.options[selbox.options.length] = new Option('Scotland');
		selbox.options[selbox.options.length] = new Option('Shropshire');
		selbox.options[selbox.options.length] = new Option('Somerset');
		selbox.options[selbox.options.length] = new Option('Staffordshire');
		selbox.options[selbox.options.length] = new Option('Suffolk');
		selbox.options[selbox.options.length] = new Option('Surrey');
		selbox.options[selbox.options.length] = new Option('SussexTyne and WearWales');
		selbox.options[selbox.options.length] = new Option('Warwickshire');
		selbox.options[selbox.options.length] = new Option('West Midlands');
		selbox.options[selbox.options.length] = new Option('Wiltshire');
		selbox.options[selbox.options.length] = new Option('West Yorkshire');
		selbox.options[selbox.options.length] = new Option('Worcs');
		selbox.options[selbox.options.length] = new Option('South Yorkshire');
		selbox.options[selbox.options.length] = new Option('North Yorkshire');
		selbox.options[selbox.options.length] = new Option('East Yorkshire');	
		showLayer('stateselect');
		hideLayer('statefillin');
		document.special.statefill.value = "";
	}
	
	if ( chosen == "CA" ) {
		selbox.options[selbox.options.length] = new Option('Alberta');
		selbox.options[selbox.options.length] = new Option('British Columbia');
		selbox.options[selbox.options.length] = new Option('Manitoba');
		selbox.options[selbox.options.length] = new Option('New Brunswick');
		selbox.options[selbox.options.length] = new Option('Newfoundland Labrador');
		selbox.options[selbox.options.length] = new Option('Nova Scotia');
		selbox.options[selbox.options.length] = new Option('Ontario');
		selbox.options[selbox.options.length] = new Option('Prince Edward Island');
		selbox.options[selbox.options.length] = new Option('Quebec');
		selbox.options[selbox.options.length] = new Option('Saskatchewan');
		selbox.options[selbox.options.length] = new Option('Northwest Territory');
		selbox.options[selbox.options.length] = new Option('Nunavut');
		selbox.options[selbox.options.length] = new Option('Yukon');	
		showLayer('stateselect');
		hideLayer('statefillin');
		document.special.statefill.value = "";
	}

	if ( chosen != "US" && chosen != "GB" && chosen != "CA" ) {
			hideLayer('stateselect');
			showLayer('statefillin');
	}
}
