// JavaScript Document
function filterPageBy( filterObject ){
	for( var i = 0; i < filterObject.filters.length; i++ )
	{
		//---
		filterObject.filters[i].id;
		//---
	}
	var filter = ($.toJSON(filterObject));
	var thepage = window.location.pathname;
	//var doyourworst = ($.base64.encode(filter));
	//alert(window.location.pathname);
	//alert(thepage);
	window.location.href = "?thejdata=" + $.base64.encode(filter);
	//window.location = "http://www.highperformancesport.co.nz" + thepage + "?thejdata=" + filter + "";
	$.getJSON("js/requestApplySuccess.json", function(data){
															   thisMovie('filters_replace').serverToActionScript( $.toJSON(data) ); 
															   });
}
//---
function saveShowHide( filterShowHide ){
	$.ajax({
				type: "POST", url: "http://www.highperformancesport.co.nz/ajax_files/saveShowHide.php", data: "mode=" + filterShowHide,
				complete: function(data){
			
				}
			 });
	
}
//---
function saveFilterMode( filterMode ){
			$.ajax({
				type: "POST", url: "http://www.highperformancesport.co.nz/ajax_files/saveFilterMode.php", data: "mode=" + filterMode,
				complete: function(data){
			
				}
			 });
	

}
//---
function saveFilterSet( filterObject ){
	for( var i = 0; i < filterObject.filters.length; i++ )
	{
		//---
		filterObject.filters[i].id;
		//---
	}
	var filter = ($.toJSON(filterObject));
	window.location.href = "?thejdata=" + $.base64.encode(filter);

	$.getJSON("js/requestSaveSuccess.json", function(data){ 
															   //$('#dump').html($.toJSON(data));
															   //$('#dump').html($.toJSON(filterObject));
															   thisMovie('filters_replace').serverToActionScript( $.toJSON(data) ); 
															   });
}
//---
function echoContent( stringObject )
{
	stringObject;
}
//---
function filterByCustomPreset( presetName )
{
	$.getJSON("js/requestApplySuccess.json", function(data){
															   thisMovie('filters_replace').serverToActionScript( $.toJSON(data) ); 
															   });

}
//---
function filterByBasicPreset( filterObject ){
	//---
	for( var i = 0; i < filterObject.nameArray.length; i++ )
	{
		//---
			filterObject.nameArray[i];
		//---
	}
	var filter = ($.toJSON(filterObject));
	window.location.href = "?basicFilter=" + $.base64.encode(filter);
	$.getJSON("js/examples/presets/medical-filters.json", function(data){ 
																		   $('#dump').html($.toJSON(data));
																		   thisMovie('filters_replace').serverToActionScript( $.toJSON(data) ); 
																		   });
	
}
//---