//var $ = jQuery.noConflict();
$(document).ready(function(){						   
	
	$("#Nav > li").hover(function() {
		$(this).find("ul").animate({opacity: "show"}, "fast");			
	}, function() {
		$(this).find("ul").animate({opacity: "hide"}, "fast");
	});	
	
	$("div#slideshow").slideContainer({
		currentPosition : 0,
		slideWidth      : 560,
		slideLeght      : $('.slide').length,
		slides          : $('.slide'),
		slidesContainer : '#slidesContainer',
		slideshow       : '#slideshow',
		speed           : 700,
		showControl     : false,
		leftControl     : 'leftControl',
		rightControl    : 'rightControl',
		control         : 'control', 
		wrapDiv         : 'slideInner'
	});
	
	$("div#slideshowSell").slideContainer({
		currentPosition : 0,
		slideWidth      : 560,
		slideLeght      : $('.slideSell').length,
		slides          : $('.slideSell'),
		slidesContainer : '#slidesContainerSell',
		slideshow       : '#slideshowSell',
		speed           : 700,
		showControl     : false,
		leftControl     : 'leftControlOrange',
		rightControl    : 'rightControlOrange',
		control         : 'controlOrange',
		wrapDiv         : null
	});
	
	$("div#slideSpecial").innerfade({
		animationtype: 'slide',
		speed: 1000,
		timeout: 4000,
		type: 'random_start'
	});
	
	$("div#promo").innerfade({
		animationtype: 'slide',
		speed: 1000,
		timeout: 5000,
		type: 'random_start'
	});
	
	$("#pj").click( function () {
		$("#juridica").show();	
		$("#fizica").hide();
	}),
	$("#pf").click( function () {
		$("#juridica").hide();
		$("#fizica").show();
	});
	
	if ($("#pf").is(":checked") || !$("#pj").is(":checked")) {
		$("#juridica").hide();
	} else if($("#pj").is(":checked")) {
		$("#juridica").show();	
		$("#fizica").hide();
	}
	
	$(".hover").hover(
		function() {
			$(this).css('background-color', '#d9e5e9');	
		},
		function() {
			$(this).css('background-color', '#f7fafb');		
		}
	);
	
	$(".userLogat").hover(
		function () {
			$(".boxProfil").show();	
		},
		function () {
			$(".boxProfil").hide();	
		}
	);
		
	$('a.warning, a.subcat, a.delete, a.search, a.email, a.basket, a.userLogin, a.userReg, a.product, a.tooltip').tooltip({
		background: '#ffffff' 
	});	
	
	$("li.cat:last").removeClass('bBorder');
	$("li.subcat:last").removeClass('bBorderSubcat');
	
	$("li.subcat").hover(function () {
		$(this).css('background-color', '#393939');						   
	}, function () {
		$(this).css('background-color', '#333333');	
	});
	

	$(".button").click(function(){
		$(".slideSubcat").slideToggle("slow");
		$(this).toggleClass("active");
	});	
		
	function formatText(index, panel) {
		  return index + "";
	};
	$(function () {
	
		$('.anythingSlider').anythingSlider({
			easing: "swing",        	    // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 7000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 600,             // How long the slide transition takes
			hashTags: true,                 // Should links change the hashtag in the URL?
			buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
				pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
				startText: false,                // Start text
				stopText: false,               // Stop text
				navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
		});
				
	});
	$(function () {
		if ($.browser.msie && $.browser.version < 7) {
			$('#myGallery').hide();	
		}
	});
	$(".gallery a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'facebook'	,
		opacity: '0.5',
		showTitle: false
	});
});