$(document).ready(function(){

    	//Hide (Collapse) the toggle containers on load
	    $(".toggle_container").hide(); 

	   //Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	  $("a.trigger").click(function(){
    		$(this).toggleClass("active").next().slideToggle("slow");
    		return false; //Prevent the browser jump to the link anchor
   	});
	     
	  // category tooltip
		$("#description").hover(
		  function () {
		    //$('#category-tooltip').css('filter', 'alpha(opacity=100)');
        $('#category-tooltip').fadeIn(300);
		  }, 
		  function () {
		    $('#category-tooltip').fadeOut(300);
		  }
		);
// product tooltip
$('.product-tooltip').hover(
	  function () {
			productid = $(this).attr('id');
			if (productid==null) {
				return;
			}        
			$('#product-tooltip-'+productid).show();
	  }, 
	  function () {
			productid = $(this).attr('id');
			if (productid==null) {
				return;
			}        
			$('#product-tooltip-'+productid).hide();			
	  }
	);	 
	    
	$("a[href='#delete']").click(function(e) {   
		product = $(this).attr('id').replace('delete-', '');      
		$('#qty-product-'+product).val(0);   
		$("form[name='frmCart']").submit(); 
	});                                          
      
})

$(function() {
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});

function numonly(root){
    var reet = root.value;    
    var arr1=reet.length;      
    var ruut = reet.charAt(arr1-1);   
        if (reet.length > 0){   
        var regex = /[0-9]|\./;   
            if (!ruut.match(regex)){   
            var reet = reet.slice(0, -1);   
            $(root).val(reet);   
            }   
        }  
 }



