
$(document).ready(function(){
	$('ul.accordion').accordion({
		active: ".selected",
		autoHeight: false,
		header: ".opener",
		collapsible: true,
		event: "click"
	});

	$('ul.accordion2').accordion({
		autoHeight: false,
		header: ".opener",
		collapsible: true,
		fillSpace: true,
		event: "click"
	});
	
	
	//initPopup();
});
function initPopup(){
	var change_speed = 1000; 
	var _fader = $('<div id="jquery-overlay"></div>');
	var _box = $('<div class="lightbox"><a href="http://www.elwoodjeans.com/backstager.htm"><img src="images/lightbox_aussiebbq.gif" alt="image" /></a><a class="btn-close" href="#">close</a></div>');
	$('body').append(_fader);
	$('body').append(_box);
	if($.browser.msie && $.browser.version < 7) _box.hide();
	else _box.css('opacity','0');
	var _height = 0;
	var _width = 0;
	var _page = $('body > div:eq(0)');
	var _minWidth = _page.outerWidth();
	if (window.innerHeight) {
		_height = window.innerHeight;
		_width = window.innerWidth;
	}
	else {
		_height = document.documentElement.clientHeight;
		_width = document.documentElement.clientWidth;
	}
	if (_width < _minWidth) {_fader.css('width',_minWidth);} else {_fader.css('width','100%');}
	if (_height > _page.innerHeight()) _fader.css('height',_height); else _fader.css('height',_page.innerHeight());
	_fader.css({
		'position':'absolute',
		'top':0,
		'left':0,
		'backgroundColor':'#000',
		'zIndex':'100',
		'opacity':'0'
	 });
	 _fader.animate({opacity: 0.6}, {queue:false, duration:change_speed});
	 if($.browser.msie && $.browser.version < 7) _box.show();
	 else _box.animate({opacity: 1}, {queue:false, duration:change_speed});
	 $(window).resize(function(){
	 	if (window.innerHeight) {
			_height = window.innerHeight;
			_width = window.innerWidth;
		}
		else {
			_height = document.documentElement.clientHeight;
			_width = document.documentElement.clientWidth;
		}
		if (_width < _minWidth) {_fader.css('width',_minWidth);} else {_fader.css('width','100%');}
		if (_height > _page.innerHeight()) _fader.css('height',_height); else _fader.css('height',_page.innerHeight());
	 });
	var _closer = $('a.btn-close');
	_closer.click(function(){
		_fader.fadeOut();
		_box.fadeOut();	
		return false;	
	});
	_box.mouseover(function(){
		$(this).addClass('over');
	}).mouseout(function(){
		$(this).removeClass('over');
	});
	$('body').click(function(){
		if (!_box.hasClass('over')) {
			_fader.fadeOut();
			_box.fadeOut();	
		}
	});
}


