// JavaScript Document function resizeScreen(){ var errTrace = 'No trace\n'; try{ if( !isPopUp() ) { reopenThis(); } else { var stdwidth=800; var stdheight=600; var offsetWidth=100; var offsetHeight=100; if( navigator.appVersion.search('MSIE')>0 ) { errTrace = 'Nav is MSIE\n'; top.window.resizeTo(stdwidth,stdheight); top.window.scrollBy(stdwidth,stdheight); offsetWidth=document.body.scrollLeft; offsetHeight=document.body.scrollTop; } else { errTrace = 'Nav is not MSIE\n'; offsetWidth=window.outerWidth - window.innerWidth; offsetHeight=window.outerHeight - window.innerHeight; top.window.resizeTo(stdwidth,stdheight); top.window.scrollBy(stdwidth,stdheight); offsetWidth=window.pageXOffset; offsetHeight=window.pageYOffset; } var maxWidth = screen.availWidth - offsetWidth; var maxHeight = screen.availHeight - offsetHeight; var wdwWidth=document.body.clientWidth; var wdwHeight=document.body.clientHeight; var newWidth=maxWidth; var newHeight=maxHeight; errTrace = 'Getting main object\n'; var objX = document.getElementById('main'); var objY = document.getElementById('main'); errTrace = 'Got main object NOT\n'; if( objY ){ errTrace = 'Got main object. width: '+ objY.width +'\n'; }else{ var objY = document.getElementsByTagName('main'); errTrace = 'Got main object. width: '+ objY.length +'\n'; //alert( errTrace ); } if( newWidth != wdwWidth || newHeight != wdwHeight ) { wdwWidth=maxWidth; wdwHeight=maxHeight; errTrace = 'Recalc h and w\n'; if(wdwWidth > (wdwHeight / 400 * 550 ) ) { errTrace = 'Recalc width\n'; wdwWidth = Math.floor(wdwHeight / 400 * 550); } else { errTrace = 'Recalc height\n'; wdwHeight = Math.floor(wdwWidth / 550 * 400); } if( navigator.appVersion.search('MSIE')>0 ) { errTrace = 'Resize MSIE window\n'; top.resizeTo(newWidth + offsetWidth,newHeight + offsetHeight); top.moveTo(0,0); objX.width = wdwWidth; objX.height = wdwHeight; } else { errTrace = 'Resize non-MSIE window\n'; window.innerWidth = newWidth; window.innerHeight = newHeight; errTrace = 'Move non-MSIE window\n'; top.moveTo(0,0); errTrace = 'Set width non-MSIE window from '+ objY.width +' to '+ wdwWidth +'\n'; objY.width = wdwWidth; errTrace = 'Set height non-MSIE window\n'; objY.height = wdwHeight; } } } } catch(e){ // alert("Error: " + errTrace + e.number +': '+ e.description ); } } function isPopUp() { if( navigator.appVersion.search('MSIE')>0 ) { if( window.name == "roadshow" ) { return true; } else { return false; } } else { if( window.menubar.visible || window.toolbar.visible ||window.personalbar.visible || window.scrollbars.visible ) { return false; } else { return true; } } } function reopenThis() { var wdwRoadShow = ''; if( window.name == "roadshow" ) { wdwRoadShow = window.open( window.location.href, "sideshow", "width=725,height=600,left=100,top=100,resizable=yes", true); wdwRoadShow.focus(); window.close(); } else { wdwRoadShow = window.open( window.location.href, "roadshow", "width=725,height=600,left=100,top=100,resizable=yes", true); window.location.replace( "http://philipyoung.ca/html4/gallery2.htm" ); wdwRoadShow.focus(); } }