
var nonSecureUrl = "http://www-5.dodge.com/vehsuite/dispatch.do";
var secureUrl = "https://www-5.dodge.com/vehsuite/dispatch.do";
var nonSecurePort = "";
var securePort = "";
//This method constructs the url to be used for mainform submission depending
//on whether the form is to be submitted over https or http as determined by
//the isSecure parameter.
function handleSecure(isSecure) {
var actionLocation = new String(document.mainform.action);
var theLocation;
if (actionLocation.indexOf("://", 0) == -1) {
//if the action url does not have a protocol, the complete url is
//determined by correlating the action url with the current location url
//and the appropriate protocol is given based on the isSecure parameter.
var currentLocation = new String(window.location);
if (actionLocation.indexOf("/", 0) == 0) {
var domainend = currentLocation.indexOf("/", currentLocation.indexOf("://", 0) + 3);
theLocation = currentLocation.substring(0, domainend);
theLocation = theLocation + actionLocation;
} else {
var qstrstart = currentLocation.indexOf("?");
if (qstrstart != -1) {
currentLocation = currentLocation.substring(0, qstrstart);
}
var pathend = currentLocation.lastIndexOf("/");
theLocation = currentLocation.substring(0, pathend+1);
theLocation = theLocation + actionLocation;
}
} else {
//if the action url does have a protocol, it is the complete url and
//no need to correlate with current location.
theLocation = actionLocation;
}
var queryString;
if (theLocation.indexOf("?") == -1) {
queryString = "";
} else {
queryString = theLocation.substring(theLocation.indexOf("?"), theLocation.length);
}
if (isSecure) {
theLocation = secureUrl + queryString;
} else {
theLocation = nonSecureUrl + queryString;
}
return theLocation;
}
function doSecureAction(action) {

document.mainform._0.name = action;
if (handleMainformSubmit(true)) {
noESurveyPopup();
document.mainform.submit();
}

}
function doSecureAction2(action, value) {

document.mainform._0.value = value;
document.mainform._0.name = action;
if (handleMainformSubmit(true)) {
noESurveyPopup();
document.mainform.submit();
}

}
function secureMakeTransition(value) {
doSecureAction2("makeTransition",value);
}
