function popIt(url,width, height,scrollbars){
            if(!width) width = "295";
            if(!height) height = "500";
            if(!scrollbars) scrollbars = 0;

            var windowString = 'width=' + width + ',height=' + height + ',resizable=0,status=0,toolbar=no,scrollbars=' + scrollbars + ',scrolling=auto';
            var popItWindow = window.open(url, 'popIt', windowString);
}

// alert(document.location);

window.addEvent('domready', function(){
	
	var obj = new Swiff('_swf/logo_apess.swf', {
	    width: 716,
	    height: 100,
		container: $('Header')
	});

	var LOCATION = document.location.href;
	if(LOCATION.contains('#')){
		var ArrayLoc = LOCATION.split('#');
		LOCATION = ArrayLoc[0];
	}
	
	function slideBanner(i){
		myMenu.show(i);
		if (i<2){
			i++;
			(function(){ slideBanner(i); }).delay(500);
		}
	}

	if ($('Banner')){
		var myMenu = new ImageMenu($$('#Banner .BannerItem'),{openWidth:695, border:0,open:0});
		(function(){ slideBanner(0); }).delay(20);
	}

	if ($('Accordion')){
		
		var elements = $$('h4.toggler');
		
//
		var accordion_id = 0;
		var url = document.location.href.split('#');
		if(url.length>1){
			var params = url[1].split('/');
			accordion_id = params[1];
		}
		
//
		
		var myAccordion = new Accordion($('Accordion'), 'h4.toggler', 'div.AccordionContent', {
			display: accordion_id,
			opacity: false,
			alwaysHide: true,
			onActive: function(toggler, element){
				if(document.location != LOCATION+'#/'+elements.indexOf(toggler)+'/'+toggler.get('text')){
					document.location.href = LOCATION+'#/'+elements.indexOf(toggler);
				}
			}
		});
		
		function PromptMe() {
			this.historyListener = function(historyHash) {
				stateVar = historyHash;
				if (historyHash != ''){	
					var url = document.location.href.split('#');
					if(url.length>1){
						var params = url[1].split('/');
						accordion_id = params[1];
						myAccordion.display(accordion_id);
					}
				}
			};
			unFocus.History.addEventListener('historyChange', this.historyListener);
			this.historyListener(unFocus.History.getCurrent());
		};
		var demoApp;

		demoApp = new PromptMe();
		
		
	}
	
});


