$(document).ready(function(){
	$('.price_filter').click(function(){
		var price = $(this).attr("value");
		var page_name = document.getElementById('page_name').value;
		//alert(page_name);
		
		if(page_name == 'festival_product_list.php'){
			var festival_id = document.getElementById('festival_id').value;
			//var str = "&price="+price"&festival_id="+festival_id;
			var  str = "&price="+price+"&festival_id="+festival_id+"&page_name="+page_name;
		} 
		else if(page_name == 'occasion_product_list.php'){
			var occasion_id = document.getElementById('occasion_id').value;
			var  str = "&price="+price+"&occasion_id="+occasion_id+"&page_name="+page_name;
		} 
		else if(page_name == 'categories.php'){
			var category_id = document.getElementById('category_id').value;
			var  str = "&price="+price+"&category_id="+category_id+"&page_name="+page_name;
		}
		else if(page_name == 'subcat_list.php'){
			var category_id = document.getElementById('category_id').value;
			var subcat_id = document.getElementById('subcat_id').value;
			var  str = "&price="+price+"&category_id="+category_id+"&subcat_id="+subcat_id+"&page_name="+page_name;
		}
		
		else if(page_name == 'index.php' || page_name == "calender.php" || page_name == "calender_detail.php" || page_name == "subcat_document.php"){
			
			var str = "&price="+price+"&page_name="+page_name; 	
		}
		
		else if(page_name == "search_product.php"){
			var search_keyword = document.getElementById('keyword').value;
			var  str = "&price="+price+"&search_keyword="+search_keyword+"&page_name="+page_name;
		}
		
		//alert(str);
		//return false;
		
		$.ajax({
			type: 'POST',   
			url: 'ajax/filter.php',
			data: 'action=price_filter'+str,
			dataType: 'html',
			success: function(responseText){
				//alert("hiiii");
				document.getElementById('product_by_price').innerHTML = responseText;
				
			}
		});
		
	});
	
	// For see more occasion 
	
	$('#see_more_occasion').click(function(){
		var page = $('#occasion_page_id').attr("value");
		//alert(page);
		$.ajax({
			type: 'GET',
			url: 'ajax/show_all.php',
			data: 'action=ShowOccasion&page='+ page,
			dataType: 'html',      
			success: function(responseText){
				//alert(responseText);
				/*$('#occasion').append(responseText);*/ // For append the data
				$('#occasion').html(responseText);			// For replace the inner html
				$('#show_more_occasion').hide();						// For hide the more link
				
			}
		});		 
	});
	
	
	// For see more festival 
	
	$('#see_more_festival').click(function(){
		var page = $('#festival_page_id').attr("value");
		$.ajax({
			type: 'GET',
			url: 'ajax/show_all.php',
			data: 'action=ShowFestival&page='+ page,
			dataType: 'html',      
			success: function(responseText){
				//alert(responseText);
				/*$('#occasion').append(responseText);*/ // For append the data
				$('#festival').html(responseText);			// For replace the inner html
				$('#show_more_festival').hide();						// For hide the more link
				
			}
		});		 
	});
	
	
	// For see more top category 
	
	$('#see_more_topcategory').click(function(){
		var page = $('#topcategory_page_id').attr("value");
		$.ajax({
			type: 'GET',
			url: 'ajax/show_all.php',
			data: 'action=ShowTopCategory&page='+ page,
			dataType: 'html',      
			success: function(responseText){
				//alert(responseText);
				/*$('#occasion').append(responseText);*/ // For append the data
				$('#Top_Categories').html(responseText);			// For replace the inner html
				$('#show_more_topcategory').hide();						// For hide the more link
				
			}
		});		 
	});
	
	
	// For see more category 
	
	$('#see_more_category').click(function(){
		var page = $('#category_page_id').attr("value");
		
		$.ajax({
			type: 'GET',
			url: 'ajax/show_all.php',
			data: 'action=ShowCategory&page='+ page,
			dataType: 'html',      
			success: function(responseText){
				//alert(responseText);
				/*$('#occasion').append(responseText);*/ // For append the data
				/*$('#category').html(responseText);*/			// For replace the inner html
				$('#replace').html(responseText);
				$('#show_more_category').hide();						// For hide the more link
				
			}
		});		 
	});
	
	
	// For see more Send Flowers & Gifts Abroad 
	
	$('#see_more_country').click(function(){
		var page = $('#country_page_id').attr("value");
		//alert(page);
		$.ajax({
			type:	'GET',
			url:	'ajax/show_all.php',
			data:	'action=ShowDetail&page='+page,
			dataType:	'html',
			success:	function(responseText){
						//alert(responseText);
						$('#send_abroad').html(responseText);			// For replace the inner html
						$('#show_more_country').hide();					// For hide the more link
			}
		});
	});
	
});

function jumpScroll() {
   	window.scroll(0,400); // horizontal and vertical scroll targets
}



