function selectStyle(type,id)
{
	var brand_id = 0;
	var style_id = 0;
	var cat_id = $('selected_cat').value;
	var shape_id = $('selected_shape').value;	
	var diamond_id = $('selected_diamond').value;	
	
	
	if ($('selected_style').value && $('style_type').value){
		var old_style_id = $('selected_style').value;
		var old_style_type = $('style_type').value;
		if (old_style_id == id && type == old_style_type){
			id = 0;
		}	
			
	}

	

	
	
	if (type == 's'){
		style_id = id;
	}
	else if (type == 'b')
		brand_id = id;	
	
	$('main_cat_info').innerHTML = '<div style="text-align: center; height: 200px; line-height: 170%; font-weight: bold; color: #ccc; font-size: 18px;"><br />Searching...<br /><img src="/pics/ajax-load-bar.gif" /></div>';
	
	var url = '/ajax.engagement_rings.php';
	var params = 'cat_id='+cat_id+'&brand_id='+brand_id+'&style_id='+style_id+'&shape_id='+shape_id+'&d='+diamond_id;
		
	var ajax = new Ajax.Updater(
		'main_cat_info',
		url,
		{method: 'get', parameters: params});
	
}

function selectCat(id)
{
		
	if (id == $('selected_cat').value){
		if ($("filer_c_options_"+id))
			$("filer_c_options_"+id).className = '';
		id = $('engagement_cat_id').value;
	}
	var diamond_id = $('selected_diamond').value;	
	
	$('main_cat_info').innerHTML = '<div style="text-align: center; height: 200px; line-height: 170%; font-weight: bold; color: #ccc; font-size: 18px;"><br />Searching...<br /><img src="/pics/ajax-load-bar.gif" /></div>';
	
	var url = '/ajax.engagement_rings.php';
	var params = 'cat_id='+id+'&d='+diamond_id;
	var ajax = new Ajax.Updater(
		'main_cat_info',
		url,
		{method: 'get', parameters: params});
}

function changePage(pageNum)
{
	var selected_style_id = $('selected_style').value;
	var selected_style_type = $('style_type').value;
	var brand_id = 0;
	var style_id = 0;
	
	if ($('selected_style').value && $('style_type').value){
		
		var selected_style_id = $('selected_style').value;
		var selected_style_type = $('style_type').value;
		if (selected_style_type == 's')
			style_id = selected_style_id;
		else if (selected_style_type == 'b')
			brand_id = selected_style_id;	
			
	}
	
	var cat_id = $('selected_cat').value;	
	var shape_id = $('selected_shape').value;	
	var diamond_id = $('selected_diamond').value;	

	$('main_cat_info').innerHTML = '<div style="text-align: center; height: 200px; line-height: 170%; font-weight: bold; color: #ccc; font-size: 18px;"><br />Searching...<br /><img src="/pics/ajax-load-bar.gif" /></div>';
	
	var url = '/ajax.engagement_rings.php';
	var params = 'cat_id='+cat_id+'&brand_id='+brand_id+'&style_id='+style_id+'&page='+pageNum+'&shape_id='+shape_id+'&d='+diamond_id;
	var ajax = new Ajax.Updater(
		'main_cat_info',
		url,
		{method: 'get', parameters: params});
}

function changeAmountPerPagePage(amount)
{
	var selected_style_id = $('selected_style').value;
	
	var selected_style_type = $('style_type').value;
	var brand_id = 0;
	var style_id = 0;
	
	if ($('selected_style').value && $('style_type').value){
		
		var selected_style_id = $('selected_style').value;
		var selected_style_type = $('style_type').value;
		if (selected_style_type == 's')
			style_id = selected_style_id;
		else if (selected_style_type == 'b')
			brand_id = selected_style_id;	
			
	}
	
	var cat_id = $('selected_cat').value;	
	var shape_id = $('selected_shape').value;	
	var diamond_id = $('selected_diamond').value;	
	$('main_cat_info').innerHTML = '<div style="text-align: center; height: 200px; line-height: 170%; font-weight: bold; color: #ccc; font-size: 18px;"><br />Searching...<br /><img src="/pics/ajax-load-bar.gif" /></div>';
	
	

	var url = '/ajax.engagement_rings.php';
	var params = 'cat_id='+cat_id+'&brand_id='+brand_id+'&style_id='+style_id+'&setPerPage='+amount+'&shape_id='+shape_id+'&d='+diamond_id;
	var ajax = new Ajax.Updater(
		'main_cat_info',
		url,
		{method: 'get', parameters: params});
}

function changeShape(shape_id)
{

	var selected_style_id = $('selected_style').value;
	
	var selected_style_type = $('style_type').value;
	var brand_id = 0;
	var style_id = 0;
	
	
	if ($('selected_style').value && $('style_type').value){
		
		var selected_style_id = $('selected_style').value;
		var selected_style_type = $('style_type').value;
		if (selected_style_type == 's')
			style_id = selected_style_id;
		else if (selected_style_type == 'b')
			brand_id = selected_style_id;	
			
	}
	
	var cat_id = $('selected_cat').value;	
	var diamond_id = $('selected_diamond').value;	
	$('main_cat_info').innerHTML = '<div style="text-align: center; height: 200px; line-height: 170%; font-weight: bold; color: #ccc; font-size: 18px;"><br />Searching...<br /><img src="/pics/ajax-load-bar.gif" /></div>';
	var url = '/ajax.engagement_rings.php';
	var params = 'cat_id='+cat_id+'&brand_id='+brand_id+'&style_id='+style_id+'&shape_id='+shape_id+'&d='+diamond_id;
	var ajax = new Ajax.Updater(
		'main_cat_info',
		url,
		{method: 'get', parameters: params});
}