function changeHeader(headerGraphic, locPrefix)
{
	var backimage = locPrefix + "images/header_images/" + headerGraphic + imgWidthSuffix() + ".jpg";
	var backheight = imgHeight() + 'px';
		
	document.getElementById("headerimg").style.backgroundImage = "url('" + backimage + "')";
	document.getElementById("headerimg").style.height = backheight;
	
}

function randomizeHeader(headerGraphic, maxNum, locPrefix)
{	
	var backheight = imgHeight() + 'px';
	var randnum = (Math.floor(Math.random() * maxNum + 1));
	var backimage = locPrefix + "images/header_images/" + headerGraphic + "_" + randnum + imgWidthSuffix() + ".jpg";
	var backimageURL = "url(" + backimage + ")";
	
	document.getElementById("headerimg").style.backgroundImage = backimageURL;
	document.getElementById("headerimg").style.height = backheight;
}

// -------------------------------------------------------------------------------------------------------



function pageWidth() 
{
	//Not called directly by the page
	return window.innerWidth != null? window.innerWidth :
	document.documentElement && document.documentElement.clientWidth ?
	document.documentElement.clientWidth : document.body != null ?
	document.body.clientWidth : null;
}


function imgWidthSuffix()
{
	//Not called directly by the page
	
	var Pref = '';
	var getPageWidth = pageWidth();
	if (getPageWidth < 1250) {return '_750';}
	if ((getPageWidth < 1410) && (getPageWidth >= 1250)) {return '_1005';}
	if (getPageWidth >= 1410) {return '';}
	return Pref;
}


function imgHeight()
{
	//Not called directly by the page
	var heightNumber = 0;
	var widthPref = imgWidthSuffix();
	if (imgWidthSuffix() == '_750') {return 130;}
	if (imgWidthSuffix() == '_1005') {return 175;}
	if (imgWidthSuffix() == '') {return 205;}
	return 0;
}

