// JavaScript Document
var sitePath	=	"http://www.myblankees.com/";
function changeStore(store_name,store_id)
{
	url				=	sitePath+"change_store.php?store="+store_name+"&store_id="+store_id;
	var result		= 	ajaxRequest(url);
	
	if(result == "success"){
		if(store_name == 'outlet'){
			window.location.href=sitePath;
		} else {
			window.location.href=sitePath+store_name;
		}
	} else if(result == "fail"){
		return false;
	}
}

function ajaxRequest(urlController)
{
	jQuery.ajax({
	type: "POST",
	url: urlController,
	async: false,
	data: jQuery("form"),
	success:
		function(result) 
		{
			returnValue=result;
			return
		},
	error:
		function(errorThrown) {
			returnValue="error";
			return;
		}
	});	
	return returnValue;
}
