// JavaScript Document
// Created 04nov2009 ktp

	$(document).ready(function(){
					

		   // 1. Set up our new link text.	
		   if(g('changelang').href.indexOf('=en')>0){
				var newLinkText = '（すべてを見る）';
			}else{
				var newLinkText = '(View All)';
			}
			
			
		   
		   // 2. First for the Wine Type.
					
			if(g('changelang').href.indexOf('=en')>0){
				var newWineTypeHeadText = '種類';
			}else{
				var newWineTypeHeadText = 'Type';
			}
			
			
			
			
			
			// Insert our new h2 element right after the opening tag of the parent <div>
                        //karl:ENVCONFIG
                        /*
                         *Siva:  class NewBackground added to original code
			$('#SideWineTypeList .SubcategoryName').parent().prepend('<h2 class="NewBackground">' 
														 + newWineTypeHeadText
														 + ' '
														 + '<a href="/categories/all">' 
														 + newLinkText
														 + '</a></h2>');
                        */

			// Remove the original h2 element
			//$('#SideWineTypeList .SubcategoryName').prev().remove();
			
			
			
			// 3. Next for the Wine Region.
			// Problem here: we are using a non-unique identifier in .SubcategoryName. Need to find
			// a selector that 
					
			if(g('changelang').href.indexOf('=en')>0){
				var newRegionHeadText = '産地';
			}else{
				var newRegionHeadText = 'Region';
			}
			
			
			
		
			
			// Insert our new h2 element right after the opening tag of the parent <div>
                        //karl:ENVCONFIG
                        /*
			$('#RegionList .SubcategoryName').parent().prepend('<h2 class="NewBackground">' 
														 + newRegionHeadText
														 + ' '
														 + '<a href="/categories/region/all">' 
														 + newLinkText
														 + '</a></h2>');
                        */
			// Remove the original h2 element
			//$('#RegionList .SubcategoryName').prev().remove();
			
			
			// 4. Next for the Price Bands. We key off of the PriceBandSelected, which is only available if the user has applied the filter.
					
			if(g('changelang').href.indexOf('=en')>0){
				var newPriceBandHeadText = '価格';
			}else{
				var newPriceBandHeadText = 'Price';
			}
			
			// Put a new h2 with our desired attributes before the current one.
                        /*
			$('.PriceBandSelected').parent().parent().prev().before('<h2 class="NewBackground">' 
														 + newPriceBandHeadText
														 + ' '
														 + '<a href="/categories/sideprice/all">' 
														 + newLinkText
														 + '</a></h2>');
			*/
			// Remove the original h2 element
			//$('.PriceBandSelected').parent().parent().prev().remove();
			
			
			});  // end ready function
	
	
	
