/*VIGNETTE HOSTED VERSION PASSING BANK AND TS VALUES AS QUERY STRINGS*/

end_opacity = 50; //end opacity, 25 = 25%, 50 = 50%, 100 = 100%, etc.

win = document.getElementById('thewindow');
winbackground = document.getElementById('thewindowbackground');
wincontent = document.getElementById('thewindowcontent');
cur_opacity = 0;

var timer = null;

function showWindow() {
	/*window.location.replace("http://web.sa.mapquest.com/peoplesbank/advantage.adp?transaction=search&tempSet=chittenden&searchQuantifier=AND&country=US&county=&mapstyle=european&iconid=201&maxsearchresults=50&pageResults=50&proxiconid=403&srchiconid=&search9=&search10=&search11=0&search12=&search13=0&search14=0&search15=0&search16=0&search17=0&address=&city=Burlington&stateProvince=VT&postalCode=05401&radius=300&b12=&x=64&y=13");*/
	window.scrollTo(0,0);
	winbackground.style.opacity = end_opacity / 100;
	winbackground.style.filter = "alpha(opacity=" + end_opacity + ")";
	win.style.display = 'block';
	wincontent.style.display = 'block';
	//supply bank value according to the bank that should be check by default on the branch locator popup.
	//supply ts value according to the bank look and feel that the result page should be displayed in, default is peoples united bank.
	new Ajax.Request('/blpop?bank=cht&ts=chittenden', 
		{
		method:'get',    
		onSuccess: function(transport){
			var response = transport.responseText || "no response text";       
			document.getElementById('thewindowcontent').innerHTML = response;   
		},
		onFailure: function(){		window.location.replace("http://web.sa.mapquest.com/peoplesbank/advantage.adp?transaction=search&tempSet=chittenden&searchQuantifier=AND&country=US&county=&mapstyle=european&iconid=201&maxsearchresults=20&pageResults=20&proxiconid=403&srchiconid=&search9=&search10=&search11=0&search12=&search13=0&search14=0&search15=0&search16=0&search17=0&address=&city=&stateProvince=&postalCode=&radius=300&b12=&x=41&y=13");
		}
	});
}

function hideWindow() {
	win.style.display = 'none';
}

function MQ_BLSubmit(blform) {
	if (blform.b11.checked)
		blform.search11.value = "";
	if (blform.b12.checked)
		blform.search12.value = "";
	if (blform.b13.checked)
		blform.search13.value = "";
	if (blform.b14.checked)
		blform.search14.value = "";
	if (blform.b15.checked)
		blform.search15.value = "";
	if (blform.b16.checked)
		blform.search16.value = "";
	if (blform.b17.checked) 
		blform.search17.value = "";			
	blform.submit();
}