// JavaScript Document

/*
function places a select box that allows a customer to choose a state associated
with a particular address
destID is the ID of the <div> or other tag into which the HTML for the select box will be placed
procID is the ID of the iframe where the HTML will be first created
*/

if(typeof(parent.jsSecurePath)!='undefined') {
	jsSecurePath = parent.jsSecurePath;
}
if(typeof(parent.jsRootPath)!='undefined') {
	jsRootPath = parent.jsRootPath;
}

function getStates(addressType,countryID,destID,procID,stateID,procType,secure) {
	if(arguments.length==4) {
		procType="proxy";
		secure=true;
		stateID="";
	}
	if(typeof(secure)=='string') {
		if(secure=='true') {
			secure = true;
		} else {
			secure = false;
		}
	}
	if(secure==true) {
		theRoot = jsSecurePath;
	} else {
		theRoot = jsRootPath;
	}

	theFrame = window.frames[procID].window;	
	theFrame.location.href = theRoot + "e-Store/Cart/StatesHTML.cfm?AType=" + addressType + "&CountryID=" + countryID + "&DestID=" + destID + "&ProcType=" + procType + "&StateID=" + stateID;
}

