function attachElementEvents() {
	if(document.getElementById('full-size')) {
		document.getElementById('enlarge').onclick = enlarge;
		document.getElementById('reduce').onclick = enlarge;
		document.getElementById('img-reduce').onclick = enlarge;
		document.getElementById('thumbnail').onclick = enlarge;
	}
}


function init() {
	attachElementEvents();
	setup();
}

function getWindowWidth() {
 	if(window.innerWidth) {
		return window.innerWidth;
	} else if(document.body.clientWidth) { 
		return document.body.clientWidth;
	}
	return null;
}

function setup() {
	var thumb = document.getElementById('thumbnail');
	if(!thumb) return false;
	var container = document.getElementById('main');
	var w = (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
	if(w < 900) w = 900;
	var offset = container.offsetLeft + 100;
			
}

function enlarge() {
	var oFS = document.getElementById('full-size');
	
	if (oFS.style.visibility == "visible")  
	{
		oFS.style.visibility = "hidden";
		newImage = "url(../images/mainBg.gif)";
		document.getElementById('rightCol').style.height = "";
	}
	else
	{
		oFS.style.visibility = "visible";
		newImage = "url(../images/mainBgEnlargeProjectImage.gif)";
		document.getElementById('rightCol').style.height = (document.getElementById('img-reduce').height + 150) + "px";
	}
    document.getElementById('main').style.backgroundImage = newImage;
}

window.onload = init;
window.onresize = setup;

