$(document).ready(function(){

	/****** action form for quicklink*******/
   $('.form_quickLink select').bind('selectAction',function(){ /* binder en funktion p� ett custom-event */
    
	   	var URL = this.value; // valt <option>'s v�rde    
		if(this.selectedIndex != 0)
		{
			if(URL.charAt(URL.length - 1) == '#')
          	{
	          	//ends with a '#'. Open in a new window
	          	window.open(URL.substring(0, URL.length - 1));
         	}
         	else
         	{
	          	//open in the same window
	          	window.location = URL;
         	}
        }
   });
   
   /****** action form for store selector*******/
   $('#storeSelector select').bind('selectAction',function(){ /* binder en funktion p� ett custom-event */
   
        var URL = this.value; // valt <option>'s v�rde
        $('#storeSelector').attr('action', decodeURI(URL)); // s�tt v�rdet i <form>ens action-parameter
         
        if(this.selectedIndex != 0)
		{
        	$('#storeSelector').submit(); // posta formul�ret
        }
   });
   
   $('#storeSelector2 select').bind('selectAction',function(){ /* binder en funktion p� ett custom-event */
   
         var URL = this.value; // valt <option>'s v�rde
         $('#storeSelector2').attr('action', decodeURI(URL)); // s�tt v�rdet i <form>ens action-parameter
         
         if(this.selectedIndex != 0)
		 {
         	$('#storeSelector2').submit(); // posta formul�ret
         }
   });

});

