var featured = 169;

var cats = new Array();
cats.push(
"Avatars",
"Signatures",
"Templates",
"Banners",
"Large Pieces",
"Misc",
"Photo Manipulations"
);	

// images[0] = ["",""];
var images = new Array();
images.push(
["http://andrew.mcgivery.com/portfolio/avatars/1.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/2.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/3.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/4.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/5.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/6.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/7.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/8.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/9.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/10.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/11.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/12.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/13.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/14.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/15.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/16.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/17.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/18.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/19.png","0"],
["http://andrew.mcgivery.com/portfolio/avatars/20.png","0"],
["http://andrew.mcgivery.com/portfolio/banners/1.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/2.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/3.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/4.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/5.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/6.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/7.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/8.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/9.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/10.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/11.png","3"],
["http://andrew.mcgivery.com/portfolio/banners/12.png","3"],
["http://andrew.mcgivery.com/portfolio/lps/1.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/2.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/3.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/4.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/5.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/6.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/7.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/8.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/9.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/10.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/11.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/12.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/13.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/14.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/15.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/16.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/17.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/18.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/19.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/20.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/21.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/22.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/23.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/24.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/25.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/26.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/27.png","4"],
["http://andrew.mcgivery.com/portfolio/misc/1.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/2.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/3.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/4.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/5.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/6.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/7.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/8.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/9.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/10.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/11.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/12.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/13.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/14.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/15.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/16.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/17.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/18.png","5"],
["http://andrew.mcgivery.com/portfolio/sigs/1.gif","1"],
["http://andrew.mcgivery.com/portfolio/sigs/2.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/3.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/4.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/5.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/6.gif","1"],
["http://andrew.mcgivery.com/portfolio/sigs/7.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/8.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/9.png","1"],
["http://andrew.mcgivery.com/portfolio/sigs/10.gif","1"],
["http://andrew.mcgivery.com/portfolio/sigs/11.png","1"],
["http://andrew.mcgivery.com/portfolio/templates/1.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/2.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/3.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/4.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/5.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/6.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/7.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/8.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/9.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/10.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/11.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/12.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/13.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/14.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/15.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/16.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/17.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/18.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/19.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/20.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/21.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/22.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/23.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/24.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/25.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/26.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/27.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/28.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/29.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/30.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/31.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/32.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/33.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/34.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/35.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/36.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/37.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/38.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/39.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/40.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/41.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/42.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/43.png","2"],
["http://andrew.mcgivery.com/portfolio/templates/45.png","2"],
["http://andrew.mcgivery.com/portfolio/manips/1.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/2.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/3.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/4.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/5.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/6.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/7.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/8.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/9.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/10.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/11.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/12.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/13.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/14.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/15.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/16.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/17.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/18.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/24.png","6"],
["http://andrew.mcgivery.com/portfolio/misc/19.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/20.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/21.png","5"],
["http://andrew.mcgivery.com/portfolio/misc/22.png","5"],
["http://andrew.mcgivery.com/portfolio/manips/19.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/20.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/21.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/22.png","6"],
["http://andrew.mcgivery.com/portfolio/lps/28.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/29.png","4"],
["http://andrew.mcgivery.com/portfolio/templates/44.png","2"],
["http://andrew.mcgivery.com/portfolio/manips/23.png","6"],
["http://andrew.mcgivery.com/portfolio/banners/13.png","3"],
["http://andrew.mcgivery.com/portfolio/templates/46.png","2"],
["http://andrew.mcgivery.com/portfolio/manips/24.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/25.png","6"],
["http://andrew.mcgivery.com/portfolio/manips/26.png","6"],
["http://andrew.mcgivery.com/portfolio/lps/30.png","4"],
["http://andrew.mcgivery.com/portfolio/lps/31.png","4"],
["http://andrew.mcgivery.com/portfolio/templates/47.png","2"]
);

function setOpacity(eID, opacityLevel) {
    var eStyle = document.getElementById(eID).style;
    eStyle.opacity = opacityLevel / 100;
    eStyle.filter = 'alpha(opacity='+opacityLevel+')';
}

function getElm(eID) {
    return document.getElementById(eID);
}

function show(eID) {
    getElm(eID).style.display='block';
}

function hide(eID) {
    getElm(eID).style.display='none';
}

function fadeOut() {
    var timer = 0;
    for (var i=75; i>=1; i--) {
        setTimeout("setOpacity('darkBackgroundLayer',"+i+")", timer * 3);
        timer++;
    }
    setTimeout("hide('darkBackgroundLayer')", 310);
    hide('imagediv');
}

function showImage(id){
	var content = '<div class="floatright"><a href="javascript:void(0)" onClick="fadeOut()">X</a></div><strong>View Image</strong><br>';
	content += '<img src="'+images[id][0]+'" id="disimg">';
	document.getElementById('imagediv').innerHTML = content;
	var disimg = document.getElementById('disimg');
	if(disimg.width>screen.width){
	document.getElementById('imagediv').style.position = 'absolute';
	document.getElementById('imagediv').style.top = 25;
	document.getElementById('imagediv').style.left = 25;
	} else {
	document.getElementById('imagediv').style.position = 'absolute';
	document.getElementById('imagediv').style.top = 25;
	document.getElementById('imagediv').style.left = (screen.width/2)-(445/2);
	}
	if(disimg.height>screen.height){
	document.getElementById('darkBackgroundLayer').style.height = disimg.height + 100;
	}
	setOpacity('darkBackgroundLayer', 0); show('darkBackgroundLayer'); var timer = 0;
    for (var i=1; i<=75; i++) {
        setTimeout("setOpacity('darkBackgroundLayer',"+i+")", timer * 5);
        timer++;
    }
	setTimeout("show('imagediv')", 310);
}

function showCat(id){
var content = '<br><strong>'+cats[id]+'</strong><hr><br>';
	for(i=0;i<images.length;i++){
		if(images[i][1] == id)
		content += '<a href="javascript:void(0);" onClick="showImage('+i+')"><img src="'+images[i][0]+'" class="portthumb"></a>';
	}
	document.getElementById('content').innerHTML = content;	
}

function showRecent(){
	var content = '<br><strong>Most Recent Work</strong><hr><br>';
	for(i=images.length-1;i>images.length-13;i--){
		content += '<a href="javascript:void(0);" onClick="showImage('+i+')"><img src="'+images[i][0]+'" class="portthumb"></a>';
	}
	document.getElementById('content').innerHTML = content;
}

function Portfolio(){
	//Featured Image
	document.getElementById('featured').innerHTML = '<a href="javascript:void(0);" onClick="showImage('+featured+')"><img src="'+images[featured][0]+'" class="featured"></a>';
	
	//Display Categories
	var catdiv = document.getElementById('catdiv');
	catdiv.innerHTML = ' ';
	for(i=0;i<cats.length;i++){
		catdiv.innerHTML += '<a href="javascript:void(0);" onClick="showCat('+i+')">'+cats[i]+'</a><br>';
	}
	
	//Show Recent
	showRecent();
}