//Adjust styles applied to HTML body based on iPhone's current orientation.
function iPhoneOrientationAdjustment() {
	var currBodyClassName = document.body.className;
	var currIphoneOrientation = window.orientation;
	var newBodyClassName = "portraitOrientation";
	/*
	if (console) {
		//console.log('currIphoneOrientation = ' + currIphoneOrientation);  
	}
	*/
	
	// Get only the content area and exclude the template wrapper.
	if (document.getElementById('mainContentContainer')) {
		var mainContentOnly = '';
		
		// Replace all HTML within the body with only the HTML from the main content area.
		mainContentOnly += '<img width="1" height="10" border="0" alt="" src="/images/clear.gif"/><br />';
		mainContentOnly += '&nbsp;&nbsp;<a href="/">Home</a><br /><br />';
		mainContentOnly += '<a href="/index.php/6.html"><img width="484" height="28" border="0" alt="Partner" src="/partner/images/partn_title.gif"/></a><br /><br />';
		mainContentOnly += document.getElementById('mainContentContainer').innerHTML;		
		document.body.innerHTML = mainContentOnly;
	}
	
	switch(currIphoneOrientation) {
		case -90: // Landscape-right orientation
			newBodyClassName = "landscapeRightOrientation";
			break;
		case 0: // Portrait orientation
			newBodyClassName = "portraitOrientation";
			break;	
		case 90: // Landscape-left orientation
			newBodyClassName = "landscapeLeftOrientation";
			break;
	}
	
	if (currBodyClassName == '') {
		currBodyClassName = newBodyClassName;
	}
	else {
		currBodyClassName = currBodyClassName.replace(/landscapeRightOrientation|portraitOrientation|landscapeLeftOrientation/, newBodyClassName);
	}
	
	document.body.className = currBodyClassName
	
	/*
	if (console) {
		console.log('document.body.className = ' + document.body.className);
		//console.log('document.body.innerHTML = ' + document.body.innerHTML); 
	}
	*/
}
