function init() {
	document.getElementById("cardtype").value = "";
	document.getElementById("features").value = "";
	document.getElementById("rewards1").value = "";
	document.getElementById("rewards2").value = "";
	document.getElementById("rewards3").value = "";
	document.getElementById("rewards4").value = "";
	document.getElementById("rewards5").value = "";
}
function toggleLayer(Layer2,state) {
	var style2;
	var stateswitch;
	if (state == "on") stateswitch = "visible"
	else stateswitch = "hidden"
	if (document.getElementById) {
		// this is the way the standards work
		style2 = document.getElementById(Layer2).style;
		style2.visibility = stateswitch;
	} else if (document.all) {
		// this is the way old msie versions work
		style2 = document.all[Layer2].style;
		style2.visibility = stateswitch;
	} else if (document.layers) {
		// this is the way nn4 works
		style2 = document.layers[Layer2].style;
		style2.visibility = stateswitch;
	}
};			

function q1process(idname) {
	if (idname == "q1per") {
		//type radio button - 4 choices
		document.getElementById("q1per").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("cardtype").value = "Personal Visa";
		document.getElementById("q1bus").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		q1featprocess("on");
		}
	if (idname == "q1bus") {
		//type radio button - 4 choices
		document.getElementById("q1bus").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("cardtype").value = "Business Visa";
		document.getElementById("q1per").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		q1featprocess("off");
		}
	if (idname == "q1a") {
		//type radio button - 4 choices
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("features").value = "Rewards";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";			
		q1rbcrprocess("on");
		}
	if (idname == "q1b") {
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("features").value = "No Annual Fee";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";			
		q1rbcrprocess("off");
	}
	if (idname == "q1c") {
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("features").value = "Student Benefits";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";				
		q1rbcrprocess("off");
	}
	if (idname == "q1d") {
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";				
		document.getElementById("features").value = "Low Annual Interest Rate";
		q1rbcrprocess("off");
	}
	if (idname == "q1e") {
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";	
		document.getElementById("features").value = "Comprehensive Insurance Coverage";
		q1rbcrprocess("off");
	}
	if (idname == "q1f") {
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";	
		document.getElementById("features").value = "US Dollar Transactions";
		q1rbcrprocess("off");
	}		

	if (idname == "q1rewa" && document.getElementById("features").value == "Rewards") {
		//type checkbox
		if (document.getElementById("rewards1").value == "") {
			document.getElementById("q1rewa").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
			document.getElementById("rewards1").value = "yes";
			document.getElementById("nextbutton").style.display = '';
			//Uncheck Others
			document.getElementById("q1rewb").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
			document.getElementById("rewards2").value = "";
			document.getElementById("q1rewc").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
			document.getElementById("rewards3").value = "";
		}
	}
	if (idname == "q1rewb" && document.getElementById("features").value == "Rewards") {
		if (document.getElementById("rewards2").value == "") {
			document.getElementById("q1rewb").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
			document.getElementById("rewards2").value = "yes";
			document.getElementById("nextbutton").style.display = '';
			//Uncheck Others
			document.getElementById("q1rewa").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
			document.getElementById("rewards1").value = "";
			document.getElementById("q1rewc").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
			document.getElementById("rewards3").value = "";
		}
	}
	if (idname == "q1rewc" && document.getElementById("features").value == "Rewards") {
		if (document.getElementById("rewards3").value == "") {
			document.getElementById("q1rewc").style.backgroundImage = "url('/cartes/visaselect/images/q1-checked.gif')";
			document.getElementById("rewards3").value = "yes";
			document.getElementById("nextbutton").style.display = '';
			//Uncheck Others
			document.getElementById("q1rewb").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
			document.getElementById("rewards2").value = "";
			document.getElementById("q1rewa").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
			document.getElementById("rewards1").value = "";
		}
	}
	/*
	if (idname == "q1rbcre" && document.getElementById("features").value == "RBC Rewards") {
		if (document.getElementById("rewards5").value == "") {
			document.getElementById("q1rbcre").style.backgroundImage = "url('/cartes/visaselect/images/q2-checked.gif')";
			document.getElementById("rewards5").value = "yes";
		} else {
			document.getElementById("q1rbcre").style.backgroundImage = "url('/cartes/visaselect/images/q2-unchecked.gif')";
			document.getElementById("rewards5").value = "";
		}
	}
	*/
}

function q1featprocess(state) {
	if (state == "on") {
		// toggles feature box on or off
		document.getElementById("featurebox").style.display = '';
		document.getElementById("rewardsbox").style.display = 'none';
		document.getElementById("nextbutton").style.display = 'none';
		document.getElementById("q1a").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1b").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1c").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1d").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1e").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("q1f").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";			
		document.getElementById("q1rewa").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards1").value = "";
		document.getElementById("q1rewb").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards2").value = "";
		document.getElementById("q1rewc").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards3").value = "";
	}else{
		document.getElementById("featurebox").style.display = 'none';
		document.getElementById("nextbutton").style.display = '';
		document.getElementById("rewardsbox").style.display = 'none';
		document.getElementById("q1rewa").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards1").value = "";
		document.getElementById("q1rewb").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards2").value = "";
		document.getElementById("q1rewc").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards3").value = "";
	}				
}


function q1rbcrprocess(state) {
	if (state == "on") {
		// toggles rbc rewards option on and off             
		document.getElementById("rewardsbox").style.display = '';
		document.getElementById("nextbutton").style.display = 'none';
	}else{
		document.getElementById("rewardsbox").style.display = 'none';
		document.getElementById("nextbutton").style.display = '';
		document.getElementById("q1rewa").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards1").value = "";
		document.getElementById("q1rewb").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards2").value = "";
		document.getElementById("q1rewc").style.backgroundImage = "url('/cartes/visaselect/images/q1-unchecked.gif')";
		document.getElementById("rewards3").value = "";
	}				
}
function to_old_win(url)
{
	window.opener.focus(); 
	window.opener.location.href = url;
}	
