
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var is_safari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
	var is_ie6 = false;
	var is_ie7 = false;
	var is_ie8 = false;
	jQuery.each(jQuery.browser, function(i, val){
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="6.0"){is_ie6 = true;}
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="7.0"){is_ie7 = true;}
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="8.0"){is_ie8 = true;}
	});
	var animationCompleted = true;
	

	
	
	// Dropdown
	$(document).ready(function(){
		
		// Visual
		var expanded = false;
		var hovered = false;
		$('div.dropdown div.pos').css({'display':'none'});
		$('div.dropdown').click(function(){
			if ($(this).hasClass('expanded')) {
				if (is_ie7) { $('div.dropdown').css({'position':'static'}); }
				dp = $(this);
				$(this).find('div.pos').slideUp(0, function(){
					dp.removeClass('expanded');
				});
				expanded = false;
			} else {
				if (is_ie7) { $('div.dropdown').css({'position':'static'}); $(this).css({'position':'relative'}); }
				$('div.dropdown').removeClass('expanded');
				$('div.dropdown div.pos').css({'display':'none'});
				$(this).addClass('expanded');
				$(this).find('div.pos').slideDown(150);
				expanded = true;
			}
		});
		$('div.dropdown dl dd').hover(function(){
			$(this).addClass('hovered');
		}, function(){
			$(this).removeClass('hovered');
		});
		$('div.dropdown').hover(function(){
			hovered = true;
		}, function(){
			hovered = false;
		});
		$(document).click(function(){
			if (expanded && !hovered) {
				$('div.dropdown div.pos').slideUp(0, function(){
					$('div.dropdown').removeClass('expanded');
				});
			}
		});
		
		// Click
		$('div.dropdown dl dd').click(function(){
			$('div.expanded p.selected').text($(this).text());
			$('div.expanded input[type=hidden]').val($(this).prev().text());
			// d.babych added
			if ($(this).parent().parent().parent().parent().hasClass('url')) {
				window.location.href = $('div.expanded input[type=hidden]').val();
			}
			// d.babych added
			if ($(this).parent().parent().parent().parent().hasClass('order_filter')) {
				order_process_filters();
			}
		});
		
		// Get Hidden Value on load
		$('div.dropdown').each(function(){
			hidden_value = $(this).find('input[type=hidden]').val();
			selected_text = $(this).find('p.selected').text();
			if (hidden_value != '') {
				$(this).find('dt').each(function(){
					if ($(this).text() == hidden_value) {
						selected_text = $(this).next().text();
					}
				});
			}
			$(this).find('p.selected').text(selected_text);
		});
		
		
		$('li.sub a').click(function(){
			z=0;			
			$('li.sub a').removeClass('sub_active');
			$(this).addClass('sub_active');
			$('div .list_module').hide();
			$('div[data-gr="'+$(this).attr('data-gr')+'"]').show();
			$('div[data-gr="'+$(this).attr('data-gr')+'"]').each(function(){ z++; });
			$('.count_elements').text(z);
			return false;
		});	
	});
	// -
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

