function QueryString(variable) {
	var query = window.location.search.substring(1);
  	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
    	var pair = vars[i].split("=");
    	if (pair[0] == variable) {
      		return pair[1];
      	}
	} 
return "ENG"
}


function SwitchLanguage() {
	var url = window.location.href.toLowerCase();
	
	if (url.indexOf('/en/') > 0) {
		window.open(url.replace('/en/', '/es/'), '_self');
		return
		}

	if (url.indexOf('/es/') > 0) {
		window.open(url.replace('/es/', '/en/'), '_self');
		return
		}

	if (url.indexOf('/eng/') > 0) {
		window.open(url.replace('/eng/', '/esp/'), '_self');
		return
		}

	if (url.indexOf('/esp/') > 0) {
		window.open(url.replace('/esp/', '/eng/'), '_self');
		return
		}

	if (url.indexOf('=eng') > 0) {
		window.open(url.replace('=eng', '=ESP'), '_self');
		return
		}

	if (url.indexOf('=esp') > 0) {
		window.open(url.replace('=esp', '=ENG'), '_self');
		return
		}
}

