version=0; if (navigator.appVersion.indexOf("MSIE")!=-1){ temp=navigator.appVersion.split("MSIE"); version=parseFloat(temp[1]); } Event.observe(window, "resize", scaleContent); //Event.observe(window, "load", scaleContent); function wWidth() { var windowWidth= 0; if( typeof( window.innerWidth ) == 'number' ) { windowWidth = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth ) ) { windowWidth = document.documentElement.clientWidth; } else if( document.body && ( document.body.clientWidth ) ) { windowWidth = document.body.clientWidth; } return windowWidth; } function wHeight() { var windowHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { windowHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { windowHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { windowHeight = document.body.clientHeight; } return windowHeight; } function scaleContent(isFirstLoad) { Event.stopObserving(window, "resize", scaleContent); var mainWrapperWidth, mainWrapperHeight; var contentDivHeight; var mapDivWidth, mapDivHeight, oldListWidth, oldInterfaceWidth, oldRatio,newListWidth,newMapWidth; mainWrapperWidth = wWidth() - 16; // #COMAND mainWrapperHeight = wHeight() - 16; // #COMAND if (version >= 5.5) { mainWrapperWidth = mainWrapperWidth - 3; mainWrapperHeight = mainWrapperHeight; } if (mainWrapperWidth <= 849) { mainWrapperWidth = 850; } contentDivHeight = mainWrapperHeight - Element.getHeight('Header') - Element.getHeight('Footer') - 20; // InterfaceWrapper if(contentDivHeight<200){ contentDivHeight=200; } mapDivHeight = contentDivHeight - 20; //Lisr Wrapper and MapWrapper oldListWidth = Element.getWidth('ListWrapper'); oldInterfaceWidth = Element.getWidth('InterfaceWrapper'); oldRatio = oldListWidth/(oldInterfaceWidth-36); newListWidth = (mainWrapperWidth-33)*oldRatio; if (newListWidth < 480) { newListWidth = 480; } if(mapDivHeight <300){ mapDivHeight=300; } newMapWidth = mainWrapperWidth - newListWidth - 24; if (newMapWidth <= 450) { newMapWidth = 450 + 1; newListWidth = mainWrapperWidth - 27 - newMapWidth; } $('COMAND').setStyle({ 'width': mainWrapperWidth - 2 + 'px', 'height': mainWrapperHeight + 'px' }); $('InterfaceWrapper').setStyle({ 'height': contentDivHeight + 'px', 'z-index': 1 }); $('ListWrapper').setStyle({ 'height': mapDivHeight + 'px', 'width': newListWidth + 'px', 'z-index': 1 }); $('MapWrapper').setStyle({ 'height': mapDivHeight + 'px', 'width': newMapWidth + 'px', 'z-index': 1, 'float' : 'left' }); $('Map').setStyle({ 'width': newMapWidth - 73 + 'px', 'height': mapDivHeight - Element.getHeight('MapLock') - 23 + 'px', 'z-index': 1 }); // 30 for lock button, 20 for buttons if($('SplitPaneDivider')) { var el = $('ListWrapper'); var el2 = $('MapWrapper'); var parent = $('ContentWrapper'); var parentWidth = getWidth(parent); var div1_right = getX(el) + getWidth(el); var l = (((getX(el2)- div1_right - 10)/2 + div1_right) * 100.0 / parentWidth) + "%"; $('SplitPaneDivider').style.left = Math.round(div1_right)-73 +"px"; $('SplitPaneDivider').setStyle({ 'height': mapDivHeight + 'px' }); var InitialWrapperHeight = $('SplitPanelLeft').scrollHeight; if(InitialWrapperHeight object').setStyle({ 'height': newHeight + 'px', 'width':newWidth+'px','margin': '0px 0px 0px 76px'}); } var leftWrapperOffset = realLeftOffset($('SearchWrapper')); $('DropDownWrapper').style.left = leftWrapperOffset + 'px'; var largeImage; if ($('ModalPicture')) { if (mainWrapperWidth > 799) { mainWrapperWidth = mainWrapperWidth + 16; } else { mainWrapperWidth = mainWrapperWidth - 16; } largeImage = $('ModalPicture'); $('ImageModalOverlay').setStyle({ 'width': mainWrapperWidth + 'px', 'height': mainWrapperHeight + 16 + 'px'}); $('ImageModalWrapper').setStyle({ 'top': mainWrapperHeight/2 - largeImage.height/2 + 'px', 'left': mainWrapperWidth/2 - largeImage.width/2 + 'px' }); } $('ListContent').setStyle({ 'height': Element.getHeight('ListWrapper') - Element.getHeight('ListLock') - 23 + 'px' }); if(version > 5.5) { var currentWidth = Element.getWidth($('ListContent')); if (document.getElementById('ListContent').scrollHeight > document.getElementById('ListContent').clientHeight) { if ($('DivForIE')) { $('DivForIE').style.width = newListWidth - 86 + 'px'; } } else { if ($('DivForIE')) { $('DivForIE').style.width = newListWidth + 'px'; } } $('ListContent').style.width = newListWidth-70 + 'px'; if(Element.getWidth($('ListContent')) <= 480) { if($('DivForIE')) { $('DivForIE').style.width = '480px'; } $('ListContent').style.overflowX = 'auto'; } else { $('ListContent').style.overflowX = 'hidden'; } } Event.observe(window, "resize", scaleContent); if(map) { map.checkResize(); } } function getWidth(el) { return el.offsetWidth; } function getX(el) { return el.x ? el.x : el.offsetLeft; } function realLeftOffset(obj) { var curleft = 0; if (obj.offsetParent) { do { curleft += obj.offsetLeft; } while (obj = obj.offsetParent); } return curleft; }