function demo_window() {
	var allcookies = document.cookie;
	var pos = allcookies.indexOf("state=");
	
	// If we find the state cookie
	if ( pos != -1 ) {
		var start = pos + 6;
		var end = allcookies.indexOf(";",start);
		if (end == -1) end = allcookies.length;
		var value = allcookies.substring( start,end );
		value = unescape(value);
		
		if ( value == 'CA' ) {
			var demo_url = 'http://' + location.host + '/onlinebanking/demo2/detect-ca.cfm';
			var win = window.open(demo_url, 'preWin','width=695,height=530,scrollbars=yes,resizable=1')
		} else {
			var demo_url = 'http://' + location.host + '/onlinebanking/demo2/detect-smallbiz.cfm';
			var win = window.open(demo_url, 'preWin','width=695,height=530,scrollbars=yes,resizable=1')
		}
	}
}

function open_window(url) {
	var win = window.open(url,'preWin','width=695,height=507,scrollbars=yes,resizable=1')
}
