

var xmlHttp
var url, viewCounter
viewCounter = 1


//Setup the portfolio switching/viewing
function showPortfolio(theTag,theType) { 

	url="/data/showportfolio.asp?";
	url=url+"tag="+theTag;
	url=url+"&type="+theType;
	//if (viewCounter>1) {
		Effect.Fade('designPortfolio', { duration: 0.5 });
		setTimeout("serverAccess()",600);
	//} else {
	//	serverAccess();
	//}
	viewCounter+=1;
	
}		

//Call server side scripting
function serverAccess() {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Our apologies, An error was encountered./n Please email us directly with your inquiry.");
		return;
	} 	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

//when xmlhttp shows "loaded"
//write the response to the object in the page
function stateChanged() { 
	if (xmlHttp.readyState==4) { 
		if (xmlHttp.status==200) {	

			//Grab the response and display it
			document.getElementById("designPortfolio").innerHTML=xmlHttp.responseText;	
			Effect.Appear('designPortfolio', { duration: 0.5 });
			
		}
		else {
			alert ("Our apologies, An error was encountered./n Please email us directly with your inquiry.");
		}				
	}
}