﻿function GetXmlHttpObject(){  
	var xmlHttp=null;
	try{  
		// Firefox, Opera 8.0+, Safari  
		xmlHttp=new XMLHttpRequest();  
	}  
	catch(e){  
		// Internet Explorer  
		try{  
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");  
		}  
		catch(e){  
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  
		}  
	}  
	return xmlHttp;  
}  
	
function XmlPost(QueryString, ResponsePage){  
	var xmlRequest = GetXmlHttpObject();
	xmlRequest.open("POST", ResponsePage, false);  
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlRequest.send(QueryString);
	return xmlRequest.responseText;
  }

function encode(uri){  
    if (encodeURIComponent){  
        return encodeURIComponent(uri);  
    }  
  
    if (escape){  
        return escape(uri);  
    }  
}  

function showIllustrations() {
	var ethumbs = document.getElementById("thumbs");
	var ework = document.getElementById("work");
	
	ework.style.display = 'none';
	ethumbs.style.width ='100%';
	ethumbs.innerHTML = XmlPost("","/portfolio/thumbs/1");
	
	return true;
}

function showWebsites() {
	var ethumbs = document.getElementById("thumbs");
	var ework = document.getElementById("work");
	
	ework.style.display = 'none';
	ethumbs.style.width ='100%';
	ethumbs.innerHTML = XmlPost("","/portfolio/thumbs/3");
	
	return true;
}

function showBrands() {
	var ethumbs = document.getElementById("thumbs");
	var ework = document.getElementById("work");
	
	ework.style.display = 'none';
	ethumbs.style.width ='100%';
	ethumbs.innerHTML = XmlPost("","/portfolio/thumbs/4");
	
	
	return true;
}

function showPrint() {
	var ethumbs = document.getElementById("thumbs");
	var ework = document.getElementById("work");
	
	ework.style.display = 'none';
	ethumbs.style.width ='100%';
	ethumbs.innerHTML = XmlPost("","/portfolio/thumbs/5");
	
	return true;
}


function navOn(aElement) {
	new Effect.Appear(aElement);
}

function navOff(aElement) {
	aElement.style.display = "block";
}

function showWork(aWorkURL) {

	var ethumbs = document.getElementById("thumbs");
	ethumbs.style.width ='50%';
	var ework = document.getElementById("work");
	ework.innerHTML = XmlPost("", aWorkURL);
	new Effect.Appear(ework);
	
	return true;
}