function showSpinner(spinType)
{
    document.getElementById("page").style.display = 'none';
    
    if (document.getElementById("calendar-container-iframe") != null) {
      document.getElementById("calendar-container-iframe").style.display = 'none';
    }
    if (document.getElementById("calendar-container") != null) {
      document.getElementById("calendar-container").style.display = 'none';
    }

    window.scrollTo(0,0);
    document.getElementById("spinner").style.display = 'block';
    document.getElementById("spinner").style.width = '100%';
    document.getElementById("spinner").style.height = '100%';
    
    if(spinType == 'pagination') {
      if(document.getElementById("displayPagination")){
        document.getElementById("displayPagination").style.display = 'block';
      }        
    }
    if(spinType == 'sortBy') {
      if(document.getElementById("sortBy")) {
        document.getElementById("sortBy").style.display = 'block';
      }          
    }
}

function changeCountry(countryOption)
{
  var split = countryOption.options[countryOption.selectedIndex].id.split('_');
  window.location.href= " ../common/changeCountry.do" + "?posID=" + countryOption.value + "&CurrencyCode=" + split[0] + "&language=" + split[1];
}

function openPopupNoBars(url,id,height,width,resizable) {
	var WindowObjectReference;
	
	if (url.length > 0){
		newWindow(url,id,width,height,false,(resizable=='yes')||(resizable=='true'),false,false, false,false,false);
	}
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}
function displayAllLoyaltyTransactions () 
{    
    document.getElementById("loyaltyBooking").style.display = 'block';
    document.getElementById("allBooking").style.display = 'none';
    document.getElementById("headerNoLoyaltyTransactions").style.color = 'black';
    document.getElementById("headerAllLoyaltyTransactions").style.color = 'white';
} 

function displayNoLoyaltyTransactions ()
{
    document.getElementById("loyaltyBooking").style.display = 'none';
    document.getElementById("allBooking").style.display = 'block';
    document.getElementById("headerAllLoyaltyTransactions").style.color = 'black';
    document.getElementById("headerNoLoyaltyTransactions").style.color = 'white';
   
}

function displayByDefault () {
  document.getElementById("loyaltyBooking").style.display = 'none';
  document.getElementById("allBooking").style.display = 'block';
}

/* Switches a form action to one passed in, submits and switches back to original */
function switchFormActionAndSubmit (formName, action) {
  // Save off orig action
  var origAction = document.forms[formName].action;
  // Update with new action and submit
  document.forms[formName].action=action;
  document.forms[formName].submit()
  // Switch back to original action
  document.forms[formName].action=origAction;
}

