﻿// JScript File

	function swapImage(imgName,src) {

		var img = findImage(imgName);

		if(img != null) {
			img.src = src;
		}
	}

	function findImage(strName) {

		var img = null;

		if(img == null && document.images) {
			img = document.images[strName];
		}

		if(img == null && document.all) {
			img = document.all[strName];
		}

		if(img == null && document.getElementById) {
			img = document.getElementById(strName);
		}

		return img;
	}

	function ssab() {
	
		if (document.profile.ShipSameAsBill.checked) {
	
			document.profile.ShipFirstName.value = document.profile.FirstName.value;
			document.profile.ShipLastName.value = document.profile.LastName.value;
			document.profile.ShipAddress1.value = document.profile.Address1.value;
			document.profile.ShipAddress2.value = document.profile.Address2.value;
			document.profile.ShipCity.value = document.profile.City.value;
			document.profile.ShipState.value = document.profile.State.value;
			document.profile.ShipZipCode.value = document.profile.ZipCode.value;
			//document.profile.ShipZipPlus.value = document.profile.ZipPlus.value;
			document.profile.ShipCountry.value = document.profile.CountryCode.value;

		}
	
	}
	
	function resetShip() {
	
		if (document.profile.ShipSameAsBill) {
		
			document.profile.ShipSameAsBill.checked = false;
			
			document.profile.ShipFirstName.value = "";
			document.profile.ShipLastName.value = "";
			document.profile.ShipAddress1.value = "";
			document.profile.ShipAddress2.value = "";
			document.profile.ShipCity.value = "";
			document.profile.ShipState.value = "";
			document.profile.ShipZipCode.value = "";
			//document.profile.ShipZipPlus.value = "";
			document.profile.ShipCountry.value = "USA|1";
		
		}
	
	}
	
	function popUpNoScroll(filename, width, height) {
		var page = filename;
		var windowprops = "height=" + height + ",width=" + width + ",location=no,scrollbars=no,menubar=no,toolbar=no,resizable=yes";
		var popup = window.open(page, "PopUp", windowprops);
	}
	
	function popUp(filename, width, height) {
		var page = filename;
		var windowprops = "height=" + height + ",width=" + width + ",location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=yes";
		var popup = window.open(page, "PopUp", windowprops);
	}
	function ck() {
        	
		        var msg = "";
        		
		        if (document.login.EmailAddress.value == "") {
			        msg = "Please enter your campclubusa.com registered email address.";
		        }
        		
		        if (document.login.Password.value == "") {
			        msg = msg + "\nPlease enter your campclubusa.com password.";
		        }
        	
		        if (msg != "") {
			        alert(msg);
			        return false;
		        }
		        else {
			        return true;
		        }
	        }
function help() {
    var page = "help.htm";
    if (screen) { 
        leftPos = screen.width - 400;
        height = screen.height / 2; 
    }
    var windowprops = "height=" + height + ",width=375,location=no,left=" + leftPos + ",top=0,scrollbars=yes,menubars=no,toolbars=no,resizable=yes";
    helpWin = window.open(page, "help", windowprops); 
}