if (document.addEventListener)
{
	// Mozilla based browsers
	document.addEventListener("DOMContentLoaded", assignBackground, false);
}
else if(window.attachEvent)
{
	// IE based browsers
	window.attachEvent("onload", assignBackground);
}
else
{
	// Other browsers
	window.onload = assignBackground;
}

function assignBackground()
{
	/* Get dimensions */
	var sw = screen.width;
	var sh = screen.height;
	var dimW;
	var dimH;

	/* Conditionals */
	if(sw == 1920 && sh == 1200) { dimW="332px"; dimH="1033px";}       // PC
	else if(sw == 1920 && sh == 1080) { dimW="299x"; dimH="930px";}    // PC
	else if(sw == 1680 && sh == 1050) { dimW="299px"; dimH="930px";}   // MAC/PC
	else if(sw == 1600 && sh == 1200) { dimW="332px"; dimH="1033px";}  // PC
	else if(sw == 1600 && sh == 1024) { dimW="280px"; dimH="871px";}   // PC
	else if(sw == 1600 && sh == 1000) { dimW="280px"; dimH="871px";}   // MAC ---
	else if(sw == 1600 && sh == 900) { dimW="235px"; dimH="736px";}    // PC
	else if(sw == 1440 && sh == 900) { dimW="235px"; dimH="736px";}    // MAC ---
	else if(sw == 1360 && sh == 768) { dimW="190px"; dimH="591px";}    // PC
	else if(sw == 1280 && sh == 1024) { dimW="280px"; dimH="871px";}   // PC
	else if(sw == 1280 && sh == 960) { dimW="257px"; dimH="800px";}    // PC
	else if(sw == 1280 && sh == 800) { dimW="202px"; dimH="629px";}    // PC
	else if(sw == 1280 && sh == 768) { dimW="190px"; dimH="591px";}    // PC
	else if(sw == 1280 && sh == 720) { dimW="173px"; dimH="538px";}    // PC
	else if(sw == 1152 && sh == 864) { dimW="223px"; dimH="694px";}    // PC
	else if(sw == 1152 && sh == 720) { dimW="168px"; dimH="523px";}    // MAC ---
	else if(sw == 1024 && sh == 768) { dimW="190px"; dimH="591px";}    // PC
	else if(sw == 1024 && sh == 640) { dimW="168px"; dimH="523px";}    // MAC ---
	else if(sw == 800 && sh == 600) { dimW="190px"; dimH="591px";}     // PC
		
	// Assign new image width.
	document.getElementById("model").style.width=dimW;
	
	// Assign new image height.
	document.getElementById("model").style.height=dimH;
}
