/**
 * This file is in an isolated JavaScript file so it can be updated
 * via Net Storage.
 */
window.location = (function(){
	// define variables
	var search = window.location.search,
	    arr = search.substring(1,search.length).split('&'),
	    o = {}, i, l, temp, u, p;

    // turn query string into a dictionary
	for (i = 0, l = arr.length; i < l; i++) {
		temp = arr[i].split('=');
		o[temp[0]] = temp[1] || temp[0];
	}

	// remember the user
	u = o['user_id'];

	// if no user, go to fans 
	if (arr.length === 0 || (! u)) { return '/fans'; }

	// remember the default profile url
	p = '/registration/profile/' + u;

	// return a url based on the pluck page
	switch(o.plckPersonaPage) {
	case 'PersonaProfile':
		return '/registration/settings';
	}

	// otherwise go to the profile page.
	return p;
}());
