function localeSwitch(locale)
{
document.cookie="locale="+locale+";path=/";
if(locale=='en_PL')
{
if (window.XMLHttpRequest) ajaxLocale = new XMLHttpRequest();
else if (window.ActiveXObject) ajaxLocale = new ActiveXObject("Microsoft.XMLHTTP");
ajaxLocale.open("GET", "/PLGCB/JPS/portal/LocaleSwitch.do?locale="+locale+"", true);
ajaxLocale.onreadystatechange = function() { if (ajaxLocale.readyState == 4) {return true; } }
ajaxLocale.send(null);
}
}

function reg_en(locale)
{
document.cookie="locale="+locale+";path=/";
if(locale=='en_PL')
{
if (window.XMLHttpRequest) ajaxLocale = new XMLHttpRequest();
else if (window.ActiveXObject) ajaxLocale = new ActiveXObject("Microsoft.XMLHTTP");
ajaxLocale.open("GET", "/PLGCB/JPS/portal/LocaleSwitch.do?locale="+locale+"", true);
ajaxLocale.onreadystatechange = function() 
	{ 
		if (ajaxLocale.readyState == 4) 
		{ 
			if ( ajaxLocale.status == 200 ) 
			{ 
				location.href='https://'+location.hostname+'/PLGCB/JSO/reg/Setup.do'; 
				return false; 
			}
		} 
	}
	ajaxLocale.send(null);
	}
}