function Default_Selects()
{
	var Shipping_Country_Select_Element = document.getElementById("Shipping_Country_Select");
	var Shipping_Country_Elements = document.getElementsByName("Shipping_Country");
	var Shipping_Country_Element = Shipping_Country_Elements[0];
	for (Option_Index = 0; Option_Index < Shipping_Country_Select_Element.options.length; Option_Index++)
		if (Shipping_Country_Select_Element.options[Option_Index].value == Shipping_Country_Element.value)
			Shipping_Country_Select_Element.selectedIndex = Option_Index;
			
	var Billing_Country_Select_Element = document.getElementById("Billing_Country_Select");
	var Billing_Country_Elements = document.getElementsByName("Billing_Country");
	var Billing_Country_Element = Billing_Country_Elements[0];
	for (Option_Index = 0; Option_Index < Billing_Country_Select_Element.options.length; Option_Index++)
		if (Billing_Country_Select_Element.options[Option_Index].value == Billing_Country_Element.value)
			Billing_Country_Select_Element.selectedIndex = Option_Index;
	
	var Shipping_State_Select_Div_Element = document.getElementById("Shipping_State_Select_Div");
	var Shipping_State_Field_Div_Element = document.getElementById("Shipping_State_Field_Div");
	if (Shipping_Country_Element.value == "United States")
	{
		Shipping_State_Select_Div_Element.style.display = "block";
		Shipping_State_Field_Div_Element.style.display = "none";
		
		var Shipping_State_Select_Element = document.getElementById("Shipping_State_Select");
		var Shipping_State_Elements = document.getElementsByName("Shipping_State");
		var Shipping_State_Element = Shipping_State_Elements[0];
		for (Option_Index = 0; Option_Index < Shipping_State_Select_Element.options.length; Option_Index++)
			if (Shipping_State_Select_Element.options[Option_Index].value == Shipping_State_Element.value)
				Shipping_State_Select_Element.selectedIndex = Option_Index;
	}
	else
	{
		Shipping_State_Select_Div_Element.style.display = "none";
		Shipping_State_Field_Div_Element.style.display = "block";
	}
	
	var Billing_State_Select_Div_Element = document.getElementById("Billing_State_Select_Div");
	var Billing_State_Field_Div_Element = document.getElementById("Billing_State_Field_Div");
	if (Billing_Country_Element.value == "United States")
	{
		Billing_State_Select_Div_Element.style.display = "block";
		Billing_State_Field_Div_Element.style.display = "none";
		
		var Billing_State_Select_Element = document.getElementById("Billing_State_Select");
		var Billing_State_Elements = document.getElementsByName("Billing_State");
		var Billing_State_Element = Billing_State_Elements[0];
		for (Option_Index = 0; Option_Index < Billing_State_Select_Element.options.length; Option_Index++)
			if (Billing_State_Select_Element.options[Option_Index].value == Billing_State_Element.value)
				Billing_State_Select_Element.selectedIndex = Option_Index;
	}
	else
	{
		Billing_State_Select_Div_Element.style.display = "none";
		Billing_State_Field_Div_Element.style.display = "block";
	}
}

function Default_Cart_Selects(ID)
{
	var Quantity_Select_Element = document.getElementById("Quantity_Select_" + ID);
	var Quantity_Elements = document.getElementsByName("Quantity_" + ID);
	var Quantity_Element = Quantity_Elements[0];
	
	for (Option_Index = 0; Option_Index < Quantity_Select_Element.options.length; Option_Index++)
		if (Quantity_Select_Element.options[Option_Index].value == Quantity_Element.value)
			Quantity_Select_Element.selectedIndex = Option_Index;
}

function Update_Addresses()
{
	// Define copied inputs
	var Inputs = ["First_Name", "Last_Name", "Address", "Address_Line_Two", "City", "State", "Postal_Code", "Country"];
	
	// Get HTML elements
	var Billing_Same_As_Shipping_Checkbox_Elements = document.getElementsByName("Billing_Same_As_Shipping");
	var Billing_Same_As_Shipping_Checkbox_Element = Billing_Same_As_Shipping_Checkbox_Elements[0];
	var Billing_Details_Element = document.getElementById("Billing_Details");
	
	var Shipping_Country_Select_Element = document.getElementById("Shipping_Country_Select");
	var Shipping_Country_Elements = document.getElementsByName("Shipping_Country");
	var Shipping_Country_Element = Shipping_Country_Elements[0];
	Shipping_Country_Element.value = Shipping_Country_Select_Element.options[Shipping_Country_Select_Element.selectedIndex].value;
	
	var Billing_Country_Select_Element = document.getElementById("Billing_Country_Select");
	var Billing_Country_Elements = document.getElementsByName("Billing_Country");
	var Billing_Country_Element = Billing_Country_Elements[0];
	Billing_Country_Element.value = Billing_Country_Select_Element.options[Billing_Country_Select_Element.selectedIndex].value;
	
	var Shipping_State_Select_Div_Element = document.getElementById("Shipping_State_Select_Div");
	var Shipping_State_Field_Div_Element = document.getElementById("Shipping_State_Field_Div");
	if (Shipping_Country_Element.value == "United States")
	{
		Shipping_State_Select_Div_Element.style.display = "block";
		Shipping_State_Field_Div_Element.style.display = "none";
		
		var Shipping_State_Select_Element = document.getElementById("Shipping_State_Select");
		var Shipping_State_Elements = document.getElementsByName("Shipping_State");
		var Shipping_State_Element = Shipping_State_Elements[0];
		Shipping_State_Element.value = Shipping_State_Select_Element.options[Shipping_State_Select_Element.selectedIndex].value;
	}
	else
	{
		Shipping_State_Select_Div_Element.style.display = "none";
		Shipping_State_Field_Div_Element.style.display = "block";
	}
	
	var Billing_State_Select_Div_Element = document.getElementById("Billing_State_Select_Div");
	var Billing_State_Field_Div_Element = document.getElementById("Billing_State_Field_Div");
	if (Billing_Country_Element.value == "United States")
	{
		Billing_State_Select_Div_Element.style.display = "block";
		Billing_State_Field_Div_Element.style.display = "none";
		
		var Billing_State_Select_Element = document.getElementById("Billing_State_Select");
		var Billing_State_Elements = document.getElementsByName("Billing_State");
		var Billing_State_Element = Billing_State_Elements[0];
		Billing_State_Element.value = Billing_State_Select_Element.options[Billing_State_Select_Element.selectedIndex].value;
	}
	else
	{
		Billing_State_Select_Div_Element.style.display = "none";
		Billing_State_Field_Div_Element.style.display = "block";
	}
	
	// Check if checkbox is checked
	if (Billing_Same_As_Shipping_Checkbox_Element.checked)
	{
		// Hide Billing Section
		Billing_Details_Element.style.display = 'none';
		
		// CANCEL REMAINING
		return;
		
		// Copy values
		for (Input_Index = 0; Input_Index < Inputs.length; Input_Index++)
		{
			Input_Alias = Inputs[Input_Index];
			var Shipping_Elements = document.getElementsByName("Shipping_" + Input_Alias);
			var Shipping_Element = Shipping_Elements[0];
			var Billing_Elements = document.getElementsByName("Billing_" + Input_Alias);
			var Billing_Element = Billing_Elements[0];
			Billing_Element.value = Shipping_Element.value;
		}
	}
	else
	{
		// Show Billing Section
		Billing_Details_Element.style.display = 'block';
	}
}

function Update_Quantity(ID)
{
	var Quantity_Select_Element = document.getElementById("Quantity_Select_" + ID);
	var Quantity_Elements = document.getElementsByName("Quantity_" + ID);
	var Quantity_Element = Quantity_Elements[0];
	Quantity_Element.value = Quantity_Select_Element.options[Quantity_Select_Element.selectedIndex].value;
}


function Focus_Header_Link(Target)
{
	document.getElementById("Header_Title_Link_Active").style.display = "none";
	document.getElementById("Header_Title_Link_Inactive").style.display = "block";
	document.getElementById("Header_Tristan_Perich_Link_Active").style.display = "none";
	document.getElementById("Header_Tristan_Perich_Link_Inactive").style.display = "block";
	document.getElementById("Header_Lesley_Flanigan_Link_Active").style.display = "none";
	document.getElementById("Header_Lesley_Flanigan_Link_Inactive").style.display = "block";
	document.getElementById("Header_About_Link_Active").style.display = "none";
	document.getElementById("Header_About_Link_Inactive").style.display = "block";
	document.getElementById("Header_Account_Link_Active").style.display = "none";
	document.getElementById("Header_Account_Link_Inactive").style.display = "block";
	document.getElementById("Header_Checkout_Link_Active").style.display = "none";
	document.getElementById("Header_Checkout_Link_Inactive").style.display = "block";
	document.getElementById("Header_Cart_Link_Active").style.display = "none";
	document.getElementById("Header_Cart_Link_Inactive").style.display = "block";
	
	if (Target)
	{
		document.getElementById("Header_" + Target + "_Link_Active").style.display = "block";
		document.getElementById("Header_" + Target + "_Link_Inactive").style.display = "none";
	}
}

function Require_SSL()
{
	// Require SSL
	if (window.location.protocol != "https:")
		window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);
}

function Require_WWW()
{
	// Require www host prefix
	if (window.location.host.substr(0, 4) != "www.")
	{
		window.location = window.location.protocol + "//" + "www." + window.location.host + window.location.pathname;
	}
}