$.noConflict();
jQuery(function(){
	/*jQuery("ul.sf-menu").superfish({
	    pathLevels: 1,
		autoArrows: false,
		animation:{height:'toggle'}
	});*/
				
	jQuery('ul.level0').each(function(){
		console.log(this);
		var liCounter = 0;
		jQuery(this).find('li.level1').each(function(){
			liCounter++;
			if(liCounter % 6 == 0){
				jQuery('<div class="clear">&nbsp;</div>').insertAfter(this);
			}
		})
	});
	
	jQuery('.footer li a').each(function(){
		if(jQuery(this).html() == 'Sitemap' || jQuery(this).html() == 'Orders and Returns') {
			jQuery(this).hide();
		}
	});
	
	var popupHeight = jQuery(window).height() - 100;
	jQuery('#checkout-agreements a').live('click', function(){
		jQuery('#iframe-popup-background').fadeIn(function(){
			jQuery('#iframe-popup').show();
			jQuery('#iframe-popup-content .iframe').html('<iframe width="100%" height="' + popupHeight + 'px" src="' + jQuery('#checkout-agreements .agree label a').attr('href') +'" frameborder="0"></iframe>');											   
		});
		return false;
	});
	jQuery('#iframe-popup-background, #iframe-popup a.close').live('click', function(){
		jQuery('#iframe-popup').hide(function(){
			jQuery('#iframe-popup-background').fadeOut();
			jQuery('#iframe-popup-content .iframe').html('');											   
		});
		return false;
	});
});
