function getXMLHTTP1() { //fuction to return the xml http object

		var xmlhttp1=false;	

		try{

			xmlhttp1=new XMLHttpRequest();

		}

		catch(e)	{		

			try{			

				xmlhttp1= new ActiveXObject("Microsoft.XMLHTTP");

			}

			catch(e){

				try{

					req1 = new ActiveXObject("Msxml2.XMLHTTP");

				}

				catch(e1){

					xmlhttp1=false;

				}

			}

		}

		 	

		return xmlhttp1;

    }

	function shownextImages(galleryId) {
			
			var strURL="gallery-boys-populate.php?arr="+galleryId; //change herte
			//alert(strURL);
		var req1 = getXMLHTTP1();

		

		if (req1) {

			

			req1.onreadystatechange = function() {

				if (req1.readyState == 4) {

					// only if "OK"

					if (req1.status == 200) {
						//alert(req1.responseText);
						var response_split = req1.responseText;
						 document.getElementById('overwrite').innerHTML = response_split; //change herte
						 
					} else {

						//alert("There was a problem while using XMLHTTP:\n" + req1.statusText);

						//document.getElementById('row_login_id').style.display=''
 

					}

				}				

			}			

			req1.open("GET", strURL, true);

			req1.send(null);

		}		

	}
	
function trim(s)
{
	var l=0; var r=s.length -1;
	while(l < s.length && s[l] == ' ')
	{	l++; }
	while(r > l && s[r] == ' ')
	{	r-=1;	}
	return s.substring(l, r+1);
}


function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}
