// ************************************************************************************************
// EMAIL THIS STORY

function story_email(bool_state){
	
	document.getElementById('story_email_box').style.display = bool_state ? 'block' : 'none';
	
	// show/hide swfs
	arr_obj = document.getElementsByTagName('object');
	for(var x = 0; x < arr_obj.length; x++){
		arr_obj[x].style.visibility = bool_state ? 'hidden' : 'visible';
	}
	
	arr_emb = document.getElementsByTagName('embed');
	for(var x = 0; x < arr_emb.length; x++){
		arr_emb[x].style.visibility = bool_state ? 'hidden' : 'visible';
	}
	
	return false;
}

function story_imgfix(){
//*
	
	if(document.getElementById('storyphoto')){
		var obj_img = document.getElementById('storyphoto');
		obj_img.onload = function(){
			var num_width_max = obj_img.width;
			var num_height_max;
			switch(num_width_max){
				case 614:
					num_height_max = 414;
					break;
				case 404:
					num_height_max = 272;
					break;
				case 194:
					num_height_max = 131;
					break;
				case 124:
					num_height_max = 84;
					break;
			}
			obj_img.removeAttribute('width');
			var num_width = obj_img.offsetWidth;
			var num_height = obj_img.offsetHeight;
			var num_scale = Math.min(1, Math.min(num_width_max / num_width, num_height_max / num_height));
			obj_img.width = Math.round(num_scale * num_width);
			obj_img.height = Math.round(num_scale * num_height);
			obj_img.style.display = 'block';
			obj_img.style.marginRight = 'auto';
			obj_img.style.marginLeft = 'auto';
		};
	}
//*/
}

