$(document).ready(function(){
	
	$active = window.location.pathname.split("/")[1].split("_")[0].split(".")[0];

	$('#top_navi a').each(function(){
						   
		var $href = $(this).attr('name');
		if ( ($href == $active) || ($href == 'index' && $active =='') ) {
			$(this).parent().addClass("active");
			$(this).addClass("active");
		} else {
			$(this).parent().removeClass("active");
			$(this).removeClass("active");
		}
	}); 
	
	$('#couponList div').each(function(){
				if($(this).attr("name") != 'all'){
					$(this).hide();
								}
				else{
					$("#change option[name='all']").attr('selected', 'selected');
				}
	});
	
	$("#change").change(function(){
								 
		$("#change option:selected").each(function(){
												   
			var $name = $(this).attr('name');
			$('#couponList div').each(function(){
									$(this).hide();
			});
			$('#couponList div').each(function(){
				if($name == $(this).attr('name')){
					$(this).show();
				}
			});
			
		});
								
	});
	
	    $(function(){
        $('.slide-out-div').tabSlideOut({
            tabHandle: '.handle',                     //class of the element that will become your tab
            pathToTabImage: '../../images/facebook.png', //path to the image for the tab //Optionally can be set using css
            imageHeight: '164px',                     //height of tab image           //Optionally can be set using css
            imageWidth: '37px',                       //width of tab image            //Optionally can be set using css
            tabLocation: 'left',                      //side of screen where tab lives, top, right, bottom, or left
            speed: 300,                               //speed of animation
            action: 'click',                          //options: 'click' or 'hover', action to trigger animation
            topPos: '60px',                          //position from the top/ use if tabLocation is left or right
            leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
            fixedPosition: true ,                     //options: true makes it stick(fixed position) on scroll
			name: '1'
        });

    });
	
	$(function(){
        $('.slide-out-div2').tabSlideOut({
            tabHandle: '.handle2',                     //class of the element that will become your tab
            pathToTabImage: '../../images/twitter.png', //path to the image for the tab //Optionally can be set using css
            imageHeight: '139px',                     //height of tab image           //Optionally can be set using css
            imageWidth: '37px',                       //width of tab image            //Optionally can be set using css
            tabLocation: 'left',                      //side of screen where tab lives, top, right, bottom, or left
            speed: 300,                               //speed of animation
            action: 'click',                          //options: 'click' or 'hover', action to trigger animation
            topPos: '250px',                          //position from the top/ use if tabLocation is left or right
            leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
            fixedPosition: true,                      //options: true makes it stick(fixed position) on scroll
			name: '2'
        });
		
    });
	



});
