var Browser = {
	IE : !!(window.attachEvent && !window.opera)
}

function wopen(src, width, height) {
	if(!width) width = 150;
	if(!height) height = 150;

	width = width + 'px';
	height = height + 'px';
	w = window.open('', '', "location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=no,width=" + width+",height=" + height);
	w.document.open();
	w.document.write('<html><head><style>body {margin: 0; padding: 0; }</style></head><body><img src="'+src+'" /></body></html>');
	w.document.close();
}

images = {
	project_1 : {
		image_1 : { width : '600',	height: '434' },
		image_2 : { width : '600',	height: '399' },
		image_3 : { width : '399',	height: '600' },
		image_4 : { width : '399',	height: '600' }
	},
	project_2 : {
		image_1 : { width : '400',	height: '600' },
		image_2 : { width : '400',	height: '600' },
		image_3 : { width : '400',	height: '600' },
		image_4 : { width : '399',	height: '600' }
	},
	project_3 : {
		image_1 : { width : '600',	height: '399' },
		image_2 : { width : '399',	height: '600' },
		image_3 : { width : '600',	height: '399' },
		image_4 : { width : '399',	height: '600' }
	},
	project_4 : {
		image_1 : { width : '600',	height: '414' },
		image_2 : { width : '600',	height: '399' },
		image_3 : { width : '399',	height: '600' }
	},
	project_5 : {
		image_1 : { width : '600',	height: '391' },
		image_2 : { width : '600',	height: '400' },
		image_3 : { width : '400',	height: '600' },
		image_4 : { width : '600',	height: '400' }
	},
	project_6 : {
		image_1 : { width : '400',	height: '600' },
		image_2 : { width : '400',	height: '600' },
		image_3 : { width : '400',	height: '600' },
		image_4 : { width : '400',	height: '600' }
	},
	project_7 : {
		image_1 : { width : '600',	height: '399' },
		image_2 : { width : '600',	height: '399' },
		image_3 : { width : '600',	height: '399' }
	},
	project_8 : {
		image_1 : { width : '600',	height: '399' },
		image_2 : { width : '399',	height: '600' },
		image_3 : { width : '600',	height: '358' },
		image_4 : { width : '600',	height: '463' }
	}
};

/* Shows full images from the 'Projects' page */
function show(p, i){
	w = images['project_'+p]['image_'+i]['width'];
	h = images['project_'+p]['image_'+i]['height'];
	src = '/img/photos/'+p+'/'+i+'.jpg';
	wopen(src, w, h);
}
