function doAjax(inDivName,inGroupingID,inImageID,inCategoryID,dir) {
var starter = new Date();	
var ajaxRequest = null;  // The variable that makes Ajax possible!
var outCategoryID = "";

if (inCategoryID != "") {
	outCategoryID = inCategoryID;
}


if (inGroupingID.indexOf("|") > -1 ) { 
 var GroupingInfo = inGroupingID.split("|");
 	inGroupingID = GroupingInfo[0];
 	inCategoryID = GroupingInfo[1];
} 
 

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Please use the site with a recent browser.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function thisone(){
		if(ajaxRequest.readyState == 4){

            var vtInfo = ajaxRequest.responseText.split("|");

				 //15|Category RS - Royal Suite<br>Royal Suite|/imgs/vt/2/54491/54491_RS_01/_flash/pw.swf|12|13

			

    	document.getElementById('ModalFlash').src = vtInfo[2];
			document.getElementById('ModalCaption').innerHTML = vtInfo[1];

           imgID = vtInfo[0];
  				imgPrev =  vtInfo[3];
          imgNext =  vtInfo[4];

		inCategoryID =  vtInfo[5];



    if (imgPrev != "-") {

    document.getElementById('linkPrev').innerHTML = "<a class=\"modalText\" href=\"Javascript: doAjax('" + inDivName + "','" + inGroupingID + "','" + imgID + "','" + outCategoryID + "','prev');\">< Previous</a>";


    } else {

    document.getElementById('linkPrev').innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }


    if (imgNext != "-") {

    document.getElementById('linkNext').innerHTML = "<a class=\"modalText\" href=\"Javascript: doAjax('" + inDivName + "','" + inGroupingID + "','" + imgID + "','" + outCategoryID + "','next');\">Next ></a>";

    } else {

    document.getElementById('linkNext').innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }



        }

    }

	ajaxRequest.open("GET", "/common_library/ajaxvt.php?dir=" + dir + "&CurrentImageID=" + inImageID + "&CategoryCode=" + inCategoryID + "&timer=" + starter.getTime() + "&GroupingID=" + inGroupingID, true);
	ajaxRequest.send(null);


}