// JavaScript Document

function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

///// another function

// Ride the carousel...
jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
		start: 3,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});

///// another function

jQuery().ready(function(){
	jQuery('#accordion-list').accordion({
		header: 'h3.title',
		active: '.selected',
		alwaysOpen: false,
		animated: "bounceslide",
		autoheight: false
	});

	var accordions = jQuery('#accordion-list');
	
	jQuery('#switch select').change(function() {
		accordions.accordion("activate", this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		accordions.accordion("activate", -1);
	});
	jQuery('#switch2').change(function() {
		accordions.accordion("activate", this.value);
	});
	jQuery('#enable').click(function() {
		accordions.accordion("enable");
	});
	jQuery('#disable').click(function() {
		accordions.accordion("disable");
	});
	jQuery('#remove').click(function() {
		accordions.accordion("destroy");
		wizardButtons.unbind("click");
	});
});

///// another function

$(function(){
	 $('.hover-star').rating({
	  focus: function(value, link){
		// 'this' is the hidden form element holding the current value
		// 'value' is the value selected
		// 'element' points to the link element that received the click.
		var tip = $('#hover-results');
		tip[0].data = tip[0].data || tip.html();
		tip.html(link.title || 'value: '+value);
	  },
	  blur: function(value, link){
		var tip = $('#hover-results');
		$('#hover-results').html(tip[0].data || '');
	  }
	 });
});

///// another function

$(function() {
            
      $("input.data-field-file").filestyle({ 
          image: "../images/btn-file.gif",
          imageheight : 22,
          imagewidth : 90,
          width : 240
      });
	  // continuare pt restul inputurilor daca este cazul //
      //$("input.file_2").filestyle({  //
      //    image: "choose-file.gif", //
      //    imageheight : 22, //
      //    imagewidth : 82, //
      //    width : 200  //
      // }); //     
});


