var Pics = new Array(
			"JC_Chomitz.jpg",
			"Chomitz1409_JCP0639a v3.jpg",
            "JCnew2.jpg",
            "jchead.jpg",
            "cohlerbbc.jpg",
            "Chomitz1409_JCP0622p.jpg",
            "Chomitz1409_JCP0638p.jpg",
            "Chomitz1409_JCP0595p.jpg",
            "Chomitz1409_JCP0606p.jpg",
            "Chomitz1409_JCP0486p.jpg",
            "Chomitz1409_JCP0513p.jpg",
            "Chomitz1409_JCP0514p.jpg",
            "Chomitz1409_JCP0527p.jpg",
            "Chomitz1409_JCP0425p.jpg",
            "Chomitz1409_JCP0528p.jpg"
			);

Pics.sort(function () { return (Math.round(Math.random())- 0.5)});

Pic_time = 15000;
Pics_index = 0;
Layer = 0;
isLoaded = new Array();
function display_pic() {
	oldnum = Layer;
	Layer = (Layer + 1) % 2;
	pic = Pics[Pics_index];
	Pics_index = (Pics_index + 1) % Pics.length;
	fade('Pic'+oldnum);
	newimg = $('Pic'+Layer+'IMG');
	newdiv = $('Pic'+Layer);
	newimg.src = 'HeadShots/HeadShots-100dpi/' + pic;
	newdiv.style.opacity = 0;
	newdiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
	newdiv.FadeState = -2;
	fade('Pic'+Layer);
	if (!isLoaded[Pics[Pics_index]]) load_pic(Pics_index);	
}

function load_pic(i) {
	isLoaded[Pics[i]] = new Image()
	isLoaded[Pics[i]].src = 'HeadShots/HeadShots-100dpi/' + Pics[i];
}

var w = 0;
var myWidth = 0, myHeight = 0;
function resize() {
	if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
	}
	pic0 = $('Pic0IMG');
	pic1 = $('Pic1IMG');
	w = Math.max(Math.min(myWidth-1230+493, 493),150);
	pic0.width = w;
	if (pic1) pic1.width = w;
	if ($('scrollingDiv')) $('scrollingDiv').style.width = (w-20) + 'px';
}
