/**
 * Copyright (C) 2009 Drumbit - www.drumbit.com
 * 
 * This file is part of ExperienceGifts
 *
 * ExperienceGifts is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ExperienceGifts is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with ExperienceGifts.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
 

$(document).ready(function() {
	
	$('.select_light').sSelect({ddMaxHeight: '153px'});
	
	$('#filter_state').change(function(){
		var state = '';
		var order = '';
		if ($(this).val() != '')
		{
			 state = '/state/'+$(this).val();
		}
		if (CURRENT_ORDER)
		{
			order = '/order/'+CURRENT_ORDER;
		}
	  window.location = PAGE_URL +'/1'+ state + order; 
	})
	
	$('#switch_order').change(function(){
    var state = '';
    var order = '';
    if ($(this).val() != '')
    {
       order = '/order/'+$(this).val();
    }
    if (CURRENT_STATE)
    {
      state = '/state/'+CURRENT_STATE;
    }
    window.location = PAGE_URL +'/'+CURRENT_PAGE+ state + order; 
  })
  
    
});


