// JavaScript Document

var request = null;

   try {
     request = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         request = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         request = null;
       }
     }
   }

   if (request == null)
     alert("Error creating request object!");

function Josue()
	{

		this.showVideos = showVideos();
		this.sold = sold();
		}
	 
function showVideos()
	{
		
				
			
				this.sold;
				
				
		}
		
		
 


function sold()
	{
		
		request.open("GET", "test.php", true);
		
		request.onreadystatechange =  updatesold;
		
		//request.onreadystatechange = GetAllInventory;
 		request.send(null);
		
		}
		
function updatesold() {
 if (request.readyState == 4) {
  if (request.status == 200) {
    //alert('step one works'); 
	//alert(responseText);
	//alert( request.responseText);
	var b = document.getElementById("banner").style.display = 'none';
	

	var m = document.getElementById("main");
	// loop all the divs that it contains
	
	
		var x = document.getElementById("video").innerHTML = request.responseText;
		
	}
	}

}

function A(id, toclear)
	{
		//id to slect
		var areaImput = document.getElementById(id);
		var clear = document.getElementById(toclear);
		var img = areaImput.getElementsByTagName('img');
		//to do when id is selected
		areaImput.style.display = 'block';
		clear.value = '';
		for( var i = 0; i<img.length; i++)
			{
				//alert(img[i].src);
				var n = img[i].alt;
				img[i].setAttribute("onclick", "selectArea('"+n+"')");
				
				}
				
		}
function selectArea(n)
		{
			//alert(n);
			var clear = document.getElementById('AREAOFPARK');
			clear.value = n;
			var areaImput = document.getElementById('area');
			areaImput.style.display = 'none';
			//alert(img[i].alt);
			}
	
