function getElementsByClassName(classname, node)  {
    if(!node) node = document.getElementsByTagName("body")[0];
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
}

function resizeViewingField() {
	var photoCount = getElementsByClassName("viewCell").length;
	var width;
	
	width = 457 + (600 * photoCount) + (15 * (photoCount - 1)) + 30;
	
	document.getElementById("viewingField").style.width = width + "px";
}
