/****************************************
 * Neoland
 * Global JavaScript
 ****************************************/

// Start closure to prevent namespace conflicts
;(function($) {

// Perform initial setup tasks when DOM is ready
$(document).ready( function() {

/*	// ----------------------------------------------
	        h__eight = $('div#specificatii').height();
			$(".scroll").css('height', h__eight);
		 oc__height = $('div#opinia-cumparatorilor').height();
    // ----------------------------------------------	*/
	
	$('.calcrata_link').click(function(){
	     
		$(this).delay(500, function(){
		$(window).scrollTo($('#product-tabs'), 800, {axis:'y'});				
								   });
								   });
	
	$('.reviews a').click(function(){
	     
		$(this).delay(800, function(){
		$(window).scrollTo($('#box_movie_comment'), 800, {axis:'y'});				
								   });
								   });
	$('.product-shop p a[href="#opinia-cumparatorilor"]').click(function(){
		$(this).delay(800, function(){
		$(window).scrollTo($('#box_movie_comment'), 800, {axis:'y'});			
									});
     	
								   });
		
	
	// ----------------------------------------------		
	
$(function(){
 $('.hover-star').livequery(function(){ 
    $(this).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-test');
    tip[0].data = tip[0].data || tip.html();
    tip.html(link.title || 'value: '+value);
  },
  blur: function(value, link){
    var tip = $('#hover-test');
    $('#hover-test').html(tip[0].data || '');
  }
 });})
});
	
	
	$('.user_review_comment').livequery('click', function(){
	     $('.comment_area').css('display','none');
		 $('.user_review_comment').css('display','inline');	
        id_comm=$(this).attr('id');
		//console.log(id_comm);								  
		$(this).toggle();	
		$('#com' + id_comm + ' .comment_area' ).toggle();
		

		 $('div#opinia-cumparatorilor').livequery(function(){ 
		 h_eight =$(this).height(); })
		openSlider_y(h_eight);	  

		});
	
	
	
	$('.close_comment_form').livequery('click', function(){
											
		$(this).parents('.comment_area').toggle();
		 $('.user_review_comment').css('display','inline');	
	

		 $('div#opinia-cumparatorilor').livequery(function(){ 
		 h_eight =$(this).height(); })
		openSlider_y(h_eight);	  						
												
	     });
	
	
	// ----------------------------------------------		
		
		
		   $('.product-shop a[tooltip]').each(function()
   {
      $(this).qtip({
         content: $(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
		  position: {
                  corner: {
                     tooltip: 'leftMiddle' // Use the corner...
                  }
		       },
        style: { width: { max: 170 }, name: 'dark' }
      });
   });

 // ----------------------------------------------
 
 
  function openSlider_y(h_eight)
    {
    var open_height = h_eight + "px";
    $(".scroll").animate({"height": open_height}, {duration: 10 });
    }

	
});
 
 $('.comment_area').livequery(function(){ 
  $(this).css('display','none');
									   });


// End closure
})(jQuery);


