
/* News Slider */
var first = 1;
var last = 3;
var current = 1;

function nextPicture() {
   // Hide current picture
   object = document.getElementById('slide' + current);
   object.style.display = 'none';
   
   // Show next picture, if last, loop back to front
   if (current == last) { current = 1; }
   else { current++ }
   object = document.getElementById('slide' + current);
   object.style.display = 'block';
}

function previousPicture() {
   // Hide current picture
   object = document.getElementById('slide' + current);
   object.style.display = 'none';
   
   if (current == first) { current = last; }
   else { current--; }
   object = document.getElementById('slide' + current);
   object.style.display = 'block';
}

function show_hide(element){
	var content = document.getElementById(element);
	if(content.style.display==""){
		content.style.display = "none";
	} else {
		content.style.display = "";
	}
}

function show_locations(){
  var locations = document.getElementById("locations");
  var xmlHttp=GetXmlHttpObject();
  var url = "../../../../_designs/bdo_com_au/nested_content/global/international-locations"
  var params = "status=ok";
  xmlHttp.open("POST", url, true);

  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", params.length);
  xmlHttp.setRequestHeader("Connection", "close");
	
  xmlHttp.onreadystatechange = function() {
    if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
      var response = xmlHttp.responseText;
      var container = document.getElementById("international_locations");
      container.innerHTML = response;
      if(locations.style.display == "none"){
        locations.style.display = "";
      } else {
        locations.style.display = "none";
      }
    }
  }
  xmlHttp.send(params);	
}

function GetXmlHttpObject(){
  var xmlHttp=null;
  try{
  	xmlHttp=new XMLHttpRequest();
  } catch (e){
  try{
  	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e){
  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
}
return xmlHttp;
}


