var rat1=1; function res(){ window.onresize = function(event) { clearTimeout(t); var viewportWidth = alertSize(); try{ $('.launchprototype').remove(); //$('.prototype').removeClass('prototype').css('height','390px'); //$('.eight-half').removeClass('eight-half'); //$('.columns').removeClass('columns'); }catch(e){} //$('.eight-half').removeClass('eight-half'); //$('.columns').removeClass('columns'); //if(viewportWidth<685){ if(viewportWidth<1143 && (viewportWidth>723 || (browserName=="Microsoft Internet Explorer" && viewportWidth>767))){ zoomerrr(((viewportWidth )/1143 )); send(); }else{ if(viewportWidth<=723 || (browserName=="Microsoft Internet Explorer" && viewportWidth<=767)){ send(); zoomerrr(((viewportWidth )/685 )); }else{ send(); zoomerrr(1);} } t=setTimeout(function(){checksize();},160); } } var divTag1 = document.getElementById("3dpVR340728"); // INITIALIZE EMBED IN EITHER BUTTON OR IFRAME var viewportWidth = document.documentElement.clientWidth , viewportHeight = document.documentElement.clientHeight; //HOVER EFFECT FOR EMBED BUTTON AS SPECIFIED FROM INVENTION HOME function hover(asd,id){ if(asd==1){ document.getElementById(id).src="//inventionhome.web3d.co.uk/components/com_web3d/w3d_core/w3d_images/virtualButton_UP.jpg"; }else{ document.getElementById(id).src="//inventionhome.web3d.co.uk/components/com_web3d/w3d_core/w3d_images/virtualButton_OVER.jpg"; } } //MOBILE RESTRICTIONS //LIGHTBOX IFRAME COMMAND FUNCTION TO CHANGE POPULATION OF DIV divTag1.style.display='block'; divTag1.innerHTML=''; var increment=0; function x(){ increment++; if(increment>10000){return;} if(typeof(jQuery)!='undefined'){ try{ res(); jQuery(window).trigger('resize'); }catch(e){ increment-=100; setTimeout(function(){x();},100); } }else{ setTimeout(function(){x();},100); } }; document.addEventListener('DOMContentLoaded',function(){x();},false); document.onready=function(){ x();}; window.onload=function(){ x();}; function alertSize() { var myWidth = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; } else if( document.body && ( document.body.clientWidth ) ) { //IE 4 compatible myWidth = document.body.clientWidth; } return myWidth; } window.onload=function(){ send(); } function send(){ try{var iframe = document.getElementById("3dpiVR340728").contentWindow; iframe.postMessage({ orientation: window.orientation }, '//inventionhome.web3d.co.uk'); }catch(e){ } } //console.log=Function.prototype.bind.call(console.log,console); function checksize(){ var viewportWidth = alertSize(); if(viewportWidth<1143 && (viewportWidth>723 || ((browserName=="Microsoft Internet Explorer"|| navigator.userAgent.indexOf("Firefox")!=-1) && viewportWidth>767))){ zoomerrr(((viewportWidth )/1143 )); }else{ if(viewportWidth<=723 || ((browserName=="Microsoft Internet Explorer"|| navigator.userAgent.indexOf("Firefox")!=-1) && viewportWidth<=767)){ zoomerrr(((viewportWidth )/685 )); } }//console.log(alertSize()); } //checksize(); var browserName=navigator.appName; var t=setTimeout(function(){checksize();},500); t; try{ $('.launchprototype').remove(); $('.prototype').removeClass('prototype');//.css('height','390px'); //$('.eight-half').removeClass('eight-half'); //$('.columns').removeClass('columns'); }catch(e){} window.onresize = function(event) { clearTimeout(t); var viewportWidth = alertSize(); try{ $('.launchprototype').remove(); //$('.prototype').removeClass('prototype').css('height','390px'); //$('.eight-half').removeClass('eight-half'); //$('.columns').removeClass('columns'); }catch(e){} //$('.eight-half').removeClass('eight-half'); //$('.columns').removeClass('columns'); //if(viewportWidth<685){ if(viewportWidth<1143 && (viewportWidth>723 || (browserName=="Microsoft Internet Explorer" && viewportWidth>767))){ send(); zoomerrr(((viewportWidth )/1143 )); }else{ if(viewportWidth<=723 || (browserName=="Microsoft Internet Explorer" && viewportWidth<=767)){ send(); zoomerrr(((viewportWidth )/685 )); }else{ send(); zoomerrr(1);} } t=setTimeout(function(){checksize();},160); } function GetHeight() { var oDiv = document.getElementById("3dpVR340728"); var sOriginalOverflow = oDiv.style.overflow; var sOriginalHeight = oDiv.style.height; oDiv.style.overflow = ""; oDiv.style.height = ""; var height = oDiv.offsetHeight; oDiv.style.height = sOriginalHeight; oDiv.style.overflow = sOriginalOverflow; return height; } var orientation; var resizeinprogress=0; function zoomerrr(rat){ var error_correction=0; //origin try{ widthToUseForRatio = document.querySelector('.box.gallery').getBoundingClientRect().width }catch(e){ widthToUseForRatio = $("#thumbs").width() } var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/i) ? true : false ); try{ baseRatioEl = $("#3dpiVR340728").width() rat=(widthToUseForRatio)/($("#3dpiVR340728").width()+16*2);}catch(e){ error_correction=1; } //rat1=rat; //dalert(document.getElementById("thumbs").style.width/(document.getElementById("3dpiVR340728").style.width+16)); //console.log((); /* if(resizeinprogress==1){}else{ resizeinprogress=1;*/ if(true){ var qq=document.getElementById("3dpiVR340728").style; var browserName=navigator.appName; if (browserName=="Microsoft Internet Explorer" ) { if (document.documentMode< 8) { qq.zoom=rat;}else{ if(document.documentMode> 8){ qq.msTransformOrigin="0 0"; qq['msTransform']= "scale("+rat+","+rat+")";}else{document.getElementById("3dpVR340728").style.zoom=rat;}} } qq.msTransformOrigin="0 0"; qq.webkitTransformOrigin="0 0"; qq.webkitTransform = "scale("+rat+","+rat+")"; qq.transform="scale("+rat+","+rat+")"; qq.MozTransformOrigin="0 0"; qq.MozTransform="scale("+rat+")"; qq.OTransformOrigin="0 0"; qq.OTransform ="scale("+rat+")"; document.getElementById("3dpVR340728").style.height=GetHeight()*rat+"px"; } send(); //setTimeout(function(){resizeinprogress=0;},150); //} } //Google Analytics Tracking Code (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-46632982-1', 'auto'); ga('send', 'pageview');