	// constants/configuration
		// widths
		var strWidthResizeId = 'canvas0';
		var intWidthMax = 1024;
		var strWidthMed = '100%';
		var intWidthMin = 800;
		var intWidthOff = 75;
	
	// primary functions - functionality
		// guess/measure the width of the document
		function getDocWidth(){
			// choose the biggest value for the width
			var intMaxWidth = (document.body.scrollWidth>document.body.offsetWidth) ? document.body.scrollWidth : document.body.offsetWidth;
			// pass the value back
			return intMaxWidth;
		}
		// handle resize event
		function handleResize(){
			var strWidth;
			// set the target element's width if the window width passes a treshold
			if(getDocWidth()>intWidthMax){
				strWidth = (intWidthMax-intWidthOff) + 'px';
			}else if(getDocWidth()<intWidthMin){
				strWidth = (intWidthMin-intWidthOff) + 'px';
			}else{
				strWidth = strWidthMed;
			}
			document.getElementById(strWidthResizeId).style.width = strWidth;
		}

	// secondary function - construction


	// ternary function - operation 


	// executed inline
		//  if there's DOM support capture the resize event
		if(typeof(document.getElementById)!='undefined'){
			handleResize();
			onload = handleResize;
			onresize = handleResize;
		}
