function getXMLHttpRequest(){
	if(window.ActiveXObject) {
		try{
		return new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e1) { return null; }
		}
	} else if(window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else {
		return null;
	}
}

function ajaxRequest(pageUrl, params, afterFunction, requestMethod)
{
	var xmlRequest = getXMLHttpRequest();

	if (requestMethod == null) {
		xmlRequest.open("GET",pageUrl,true);
	} else if(requestMethod == "POST") {
		xmlRequest.open("POST",pageUrl,true);
	}
	xmlRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlRequest.setRequestHeader("Cache-Control","no-cache, must-revalidate");
	xmlRequest.setRequestHeader("Pragma","no-cache");
	if (afterFunction != null)
	{
		xmlRequest.onreadystatechange = function() {CallBack(xmlRequest,afterFunction);};
	}
 
	xmlRequest.send(params);
}

function CallBack(xmlRequest,afterFunction)
{
	if (xmlRequest == null || xmlRequest.readyState != 4) return;
	var xmlStr = xmlRequest.responseText
	if (afterFunction != null)
	{
		afterFunction(xmlStr);
	}
}

function movie_photo_gal(ptitle,idx)
{
	if(screen.availWidth<1024)
	{
		width=screen.availWidth;
		height=screen.availHeight;
	}
	else
	{
		width=765;
		height=665;
	}
	window.open('/movieslide_'+ptitle+'_'+idx+'/','movie_slide','width='+width+',height='+height);
}

function drama_photo_gal(ptitle,idx)
{
	if(screen.availWidth<1024)
	{
		width=screen.availWidth;
		height=screen.availHeight;
	}
	else
	{
		width=765;
		height=665;
	}
	window.open('/dramaslide_'+ptitle+'_'+idx+'/','drama_slide','width='+width+',height='+height);
}

function gallery_photo_gal(ptitle,idx)
{
	if(screen.availWidth<1024)
	{
		width=screen.availWidth;
		height=screen.availHeight;
	}
	else
	{
		width=765;
		height=665;
	}
	window.open('/galleryslide_'+ptitle+'_'+idx+'/','gallery_slide','width='+width+',height='+height);
}

function celebs_photo_gal(ptitle,idx)
{
	if(screen.availWidth<1024)
	{
		width=screen.availWidth;
		height=screen.availHeight;
	}
	else
	{
		width=765;
		height=665;
	}
	window.open('/celebsslide_'+ptitle+'_'+idx+'/','celebs_slide','width='+width+',height='+height);
}