var xmlHttp,gbTopic;
function swtchTransfer(obj)
{
	var dir;
	for(var i=0;i<obj.length;i++) {
		if(obj.options[i].selected) {
			dir=obj.options[i].value;
			gbTopic=obj.options[i].title;
			//alert(dir+"---"+gbTopic);
		}
	}

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url;
	
	//alert(document.getElementById("domainTP").value);
	url="./include/AJAX_photo_list_query.php?dir="+dir+"&r="+Math.random()+"&strd="+ new Date().getTime();
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
	
function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{
		//alert(xmlHttp.responseText);
		document.getElementById("box_b_title").innerHTML=gbTopic;
		document.getElementById("ngg-image-1").innerHTML=xmlHttp.responseText;
		window.addEvent('domready',Lightbox.init.bind(Lightbox));
	}
}
	
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
