var staticServer = "http://static.goa.com?";
//var staticServer = "http://www.goa.com?";

var aURL = location.href.split("/#/");
if(aURL.length > 1) // Redirection type /#/truc/
{
	var aQuery = aURL[1].split("?");
	var sAction = aQuery[0];
	if(sAction.charAt(sAction.length-1) == "/") sAction = sAction.substr(0, sAction.length - 1);
	if(aURL[1].indexOf("pangya"))
	{
		location.href = staticServer + "action=" + sAction + "&" + aQuery[1];
	}
	if(aURL[1].indexOf("kartncrazy"))
	{
		location.href = staticServer + "action=" + sAction + "&" + aQuery[1];			
	}
}
else if(location.href.indexOf("?action=pangya") != -1 || location.href.indexOf("?action=kartncrazy") != -1) // Redirection type ?action=truc
{
	var aURL = location.href.split("?");	
	location.href = staticServer + aURL[1];		
}

if(location.href.indexOf("?action=error") != -1)
{
	var aURL = location.href.split("?");	
	aURL = aURL[1].split("&");
	for(var i = 0; i < aURL.length; i++)
	{
		var t = aURL[i].split("=");
		if(t[0] == 'error')
		{
			location.href = '/error/'+t[1]+'/';
		}
	}
}
else if(location.href.indexOf("?action=help") != -1)
{
	var aURL = location.href.split("?");	
	location.href = staticServer + aURL[1];		
}
else if(location.href.indexOf("?action=credit") != -1)
{
	var aURL = location.href.split("?");	
	location.href =  '/mywallet/?' + String(aURL[1]).substring(14);		
}
else if(location.href.indexOf("credit&points=") != -1)
{
	var aURL = location.href.split("credit");	
	location.href =  '/mywallet/?' + String(aURL[1]);		
}