function ViewEnlarge(image_id, cur_page)
{
	window.location.href = "what_we_do.php?pid="+image_id+"&pg="+cur_page;
}

function ViewPhoto(sLarge)
{
	var view_image = document.getElementById("gallery_image");
	view_image.src = sLarge;
}


var tip_state;
function ShowEnlarge()
{
	//clearTimeout(tip_state);
	var show_tip = document.getElementById("enlarge_tip");
	show_tip.style.display = 'block';
	tip_state = setTimeout("CloseEnlarge()",1000);
}

function CloseEnlarge()
{
	show_tip = document.getElementById("enlarge_tip").style.display = 'none';
}


function EnlargePic(sPicURL) { 
		window.open("enlarge.php?"+sPicURL, "", "resizable=1,scrollbars=1,HEIGHT=200,WIDTH=200,top=20,left=20");
	} 
	
function GrabGallery(page_number) {
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	var ajaxDisplay = document.getElementById("gallery_stuff");
	ajaxDisplay.innerHTML = "<img src=\"images/loading.gif\" />";
	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("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	var queryString = "?pid="+page_number;
	ajaxRequest.open("GET", "gallery_grab.php" + queryString, true);
	ajaxRequest.send(null);

}


