$(document).ready(function() {
$("#box-recomandari").tabs("#box-recomandari div.pane", { tabs: 'h3', effect: 'slide'});						   
$("#produs-container-right").tabs("#produs-container-right div.pane", { tabs: 'h5', effect: 'slide'});
$(".colaboratori_box1").tabs(".contactbox1", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box2").tabs(".contactbox2", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box3").tabs(".contactbox3", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box4").tabs(".contactbox4", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box5").tabs(".contactbox5", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box6").tabs(".contactbox6", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box7").tabs(".contactbox7", {tabs: 'h5', effect: 'slide'});
$(".colaboratori_box8").tabs(".contactbox8", {tabs: 'h5', effect: 'slide'});
$("div.scrollable").scrollable({ size : 1, loop: true, interval: 6000, speed:500});
$("div#alte-produse-recomandate-container").scrollable({ size : 3, loop: true});
$("div#produs-poze-container").scrollable({ size : 1, loop: true});
$("li:last-child") .css({borderBottom:"none"});
$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'light_rounded'});
$('#home-teaser').innerfade({ speed: 'slow', timeout: 5000, type: 'sequence', containerheight: '397px' }); 
$("ul.distributie_harta_meniu").tabs("div.harti > div"); 

$("#box1 .box_right").scrollable({ size : 1, loop: true});
$("#box2 .box_right").scrollable({ size : 1, loop: true});
$("#box1 .img-box").scrollable({ size : 1, loop: true});
$("#box2 .img-box2").scrollable({ size : 1, loop: true});
$(".box-bio .img-box").scrollable({ size : 1, loop: true});
$(".box-stop .img-box").scrollable({ size : 1, loop: true});
$(".box-tratament .img-box").scrollable({ size : 1, loop: true});
$(".box-sun .img-box").scrollable({ size : 1, loop: true});
$(".produse_din_gama_container").scrollable({ size : 1, loop: true});
$(".categorie_carousel_container").scrollable({ size : 6, loop: true});
$("#produs-container-right").tabs("#produs-container-right div.pane", { tabs: 'h5', effect: 'slide'});
});

function checkEnter(e) { //e is event object passed from function invocation
	var characterCode; //literal character code will be stored in this variable

	if(e && e.which) { //if which property of event object is supported (NN4)
		e = e;
		characterCode = e.which; //character code is contained in NN4's which property
	}
	else{
		e = event;
		characterCode = e.keyCode; //character code is contained in IE's keyCode property
	}

	if(characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
		document.forms[0].submit(); //submit the form
		return false;
	} else {
		return true;
	}
}

//meniu
$(function(){
    $("ul#mainmenu li").hover(function(){    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');    
    }, function(){    
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');   
    });
});

//Alege o anumita gama (sidebar)
$(document).ready(function() {
	$("#alege-o-gama").click(function () {
      if ($("div#alege-o-gama_content").is(":hidden")) $("div#alege-o-gama_content").slideDown("fast");
      else $("div#alege-o-gama_content").slideUp("fast");
    });
	$("div#alege-o-gama_content").hover( function() {},
  		function() { $("div#alege-o-gama_content").slideUp("fast");
    });	
});

//Alege tipul de actiune (sidebar)
$(document).ready(function() {
	$("#alege-tipul").click(function () {
      if ($("div#alege-tipul_content").is(":hidden")) $("div#alege-tipul_content").slideDown("fast");
      else $("div#alege-tipul_content").slideUp("fast");
    });
	$("div#alege-tipul_content").hover( function() {},
  		function() { $("div#alege-tipul_content").slideUp("fast");
    });	
});

//descopera gamale farmec (top)
$(document).ready(function() {
	$("#gama_farmec_top").hover(function () {
      if ($("div#gama_farmec_top_content").is(":hidden")) $("div#gama_farmec_top_content").slideDown("fast");
      else $("div#gama_farmec_top_content").slideUp("fast");
    });
	$("div#gama_farmec_top_content").hover( function() {},
  		function() { $("div#gama_farmec_top_content").slideUp("fast");
    });	
});
