var req;
var imgs;
var slide;
var nr;
var Album = new Array();
//AJAX based function to retrive list of images from server using callback
function GetSlides()
{
req=false;

//if (window.XMLHttpRequest)
//{
	try
	{
		
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e1)
		{
		req = false;
		}
	}
//}
	if(req)
	{
	var path=''+document.location;
	
	path=path.substring((path.indexOf('?'))+3);
	if (path=="")
	path="1968_custom_Dodge_Charger"; //first folder available, please correct for your case.
	//alert(path);
	req.onreadystatechange = ProcessResponse;
	req.open("GET", "ThumbGen.ashx?Dir="+path, true);  //http://localhost/CatalogView/
//document.getElementById("DropDownList1").value,  true);
	req.send("");         
	}
}

////////////////////////
function ProcessResponse()
{
//	if(req.readyState == 4)
//	{
//	if(req.status == 200)  //analog "OK", 
//		{
//		//here we are processing result,////////////////////////
//		//
//		var p=req.responseXML.documentElement;
//		
////		alert(req.responseXML);  //-testing purpose
//		var ddlTest = document.getElementById("ctl00_ContentPlaceHolder1_test");
//		//var limg=document.getElementById("listImg");
//		
//		for (var count = ddlTest.options.length-1;count >-1; count--)
//		{
//			ddlTest.options[count] = null;
//		}
//	var photos = p.getElementsByTagName('ctl00_ContentPlaceHolder1_photos');
//	var text; 
//	//here we are trying to create array in memory
//	
//	//this example just to show how we can fill selection box from callback result.
//	//After callback we got XMl document-table and we can use it to fill table/select/list etc.
//	var listItem;
//	var l=photos.length;
//	for (var count = 0; count < photos.length; count++)
//		{
//	text = (photos[count].textContent || 
//	photos[count].innerText || photos[count].text);
//	listItem = new Option(text, text,  false, false);
//	ddlTest.options[ddlTest.length] = listItem;
//		}
//		}
//	else
//		{
//		alert("Error retrieving data!" );
//		}
//	
//	////// this script responsible to fill Album array by data returned from client in our case 
//	// it is a images pathes. 
//	
//	for (i = 0; i<l; i++)
//	{
//	text2 = (photos[i].textContent || 
//	photos[i].innerText || photos[i].text);
//	Album[i]= new Image();
//	Album[i].src = text2;
//	}
//	//now we have array with images. call slide show
//	slide=0;
//	//call slide show and show menu on top of image
//	AjaxSlideShow();
//	SlideMenu();

}


