//xmlhttp.js
//Function to create an XMLHttp Object.
function getxmlhttp (){
//Create a boolean variable to check for a valid Microsoft ActiveX instance.
var xmlhttp = false;
//Check if we are using Internet Explorer.
try {
//If the JavaScript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older ActiveX object.
try {
//If we are using Internet Explorer.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-Internet Explorer browser.
xmlhttp = false;
}
}
// If we are not using IE, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

return xmlhttp;
}

///////////////////////////// Location ////////////////////////////////


function getdata(x) {
//	alert(x);

	xmlhttp = getxmlhttp ();
	xmlhttp.open("GET", "data.php?id="+x);	

//	document.getElementById('loadingImage').style.display="block";

	xmlhttp.onreadystatechange = handleFunction;
	xmlhttp.send(null);
	
}

function handleFunction() {

    if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
		
        // Text returned FROM the PHP script
        var response = xmlhttp.responseText;
		
        if(response) {
			//alert(response);

		//	document.getElementById('loadingImage').style.display="none";
				document.getElementById('light').style.display='block';
			document.getElementById('fade').style.display='block';
			document.getElementById('light').innerHTML = response;
						
		}
	}
}


////////////////////////////////// Showreeel /////////////////////

function getdata(x) {
//alert(x);
	window.abc =x;
	xmlhttp = getxmlhttp ();
	xmlhttp.open("GET", "data_video.php?id="+x);	

//	document.getElementById('loadingImage').style.display="block";

	xmlhttp.onreadystatechange = handleFunction_showreel;
	xmlhttp.send(null);
	
}

function handleFunction_showreel() {

    if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
		
        // Text returned FROM the PHP script
        var response = xmlhttp.responseText;

        if(response) {
		//alert(window.abc);
			//alert(response);
/*			for(var test=1; test < 100 ; test ++)
			{
				
				if(document.getElementById(test).style.display = 'block')
				{
				document.getElementById(test).style.display = 'none';
				}

			}*/

			document.getElementById('result').innerHTML = response;
						
		}
	}
}


