jQuery.noConflict();

var homexpo;
var springfest;
var visitor;
var exhibitor;

jQuery(document).ready(function($) {
	$('ul').each(function() {
		$(this).find('> li:first').addClass('first');
		$(this).find('> li:last').addClass('last');
	});

	var path = $.url.attr('path').match(/[^\/]+/g);

	if (path != null) {
		homexpo = $.inArray('homexpo', path) != -1 ? true : false;
		springfest = $.inArray('springfest', path) != -1 ? true : false;
		visitor = $.inArray('visitor', path) != -1 ? true : false;
		exhibitor = $.inArray('exhibitor', path) != -1 ? true : false;
	}
	
	if (homexpo) {
		$('.homexpo').show();	
		$('body').addClass('homexpo');
	}
	if (springfest) {
		$('.springfest').show();
		$('body').addClass('springfest');
	}
	if (visitor) {
		$('.visitor').show();
		$('body').addClass('visitor');
	}
	if (exhibitor) {
		$('.exhibitor').show();	
		$('body').addClass('exhibitor');
	}
	
	if ($('body').hasClass('home')) {
		$('.springfest').show();
		$('.homexpo').show();	
	}
});

function launchPopop(url, windowName, width, height) {
	newWindow = window.open(url, windowName, "width="+width+", height="+height+",scrollbars=yes,toolbar=1");
	newWindow.focus();
};

function getIframe() {
	return $('discountIframe')
}
function backToSection() {
	if (window.location.toString().indexOf('homexpo') != -1) {
		window.location = '/homexpo/visitor/highlights';
	} else if (window.location.toString().indexOf('springfest') != -1) {
		window.location = '/springfest/visitor/highlights';
	}
}
