﻿var g_bCityPage;
var g_bSiteMap;

function getQueryVariable(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 "";      //alert('Query Variable ' + variable + ' not found');
}

function ChangeLanguage(oSelect)
{
	var strPage;
	
  if(g_bSiteMap)
      strPage='sesitemap';
  else
      strPage='default';  
      
  if(!g_bCityPage)
  {
      document.location.href=strPage + '.aspx?lang=' + oSelect.options[oSelect.selectedIndex].value;
  }
  else
  {
      var re=/[/|\\]\w{2}[/|\\]/
      var strTest= document.location.href;
      if (re.test(strTest))
      {
         strTest = strTest.replace(re, '/' + oSelect.options[oSelect.selectedIndex].value.substr(0,2).toUpperCase() + '/');
         document.location.replace(strTest);
      }
   }  
}

function PU(url,target,features){
  var Win=window.open(url,target,features);
  Win.focus();
  return false;
}


function URLsave (text) {
   
   return text.substring(0,text.indexOf('(') -1).replace(/(\s)/gi,'-').toLowerCase();
   
}
