// set defaults var nRateStartTime = 0; var nPanTimer = ''; var nPanPhotoTypeID = 0; var nPanMouseIn = false; var nPanX = 0; var nPanY = 0; var nPanWidth = 0; var nPanHeight = 0; document.nCacheScene = null; function buildDhtmlPan(sImagePath, nPhotoTypeID, nWidth, nHeight) { if(document.getElementById) { nPanPhotoTypeID = nPhotoTypeID; nPanX = 0; nPanY = 0; nPanMotionX = ((nPanPhotoTypeID==4)?0:1); nPanMotionY = ((nPanPhotoTypeID==4)?1:0); nPanWidth = nWidth; nPanHeight = nHeight; nPanTimer = window.setTimeout('panMove();', 30); return '
' + '
' + '' + ((nPhotoTypeID==3)?'':'') + '
' + '
' + '
'; } else { return panBlockFlash(sImagePath + ((nPhotoTypeID==3)?'&n360Mode=1':'')); } } function cacheNext() { if(document.nCacheScene!=null) { if(document.nCacheScene String(str).length) return str; else return String(str).substring(0,n); } function loadDescriptions(sBlob, nTabNumber, nTabCount, sGraphicName, TabName) { var sString; var i; // if there are subtabs if(sBlob.indexOf('~')!=-1) { sString = '
'; var aBlob = sBlob.split('~'); for (i = 1; i < aBlob.length; i++) { var aBlob2 = aBlob[i].split('|'); sString += '
Additional Scenes:
  • ' + aBlob2[1] + '
  • '; } var aBlob2 = aBlob[0].split('|'); if((aBlob2[6] == '') || (aBlob2[6].indexOf('For more information and a personal tour of this home please contact:') != -1)) { if(document.fUserPhotoExists=='True') { aBlob2[6] = '
    '; } aBlob2[6] += '' + document.sUserName + '
    '; if((lcase(document.sUserName) != lcase(document.sTourOfficeName)) && (document.fDisplayOffice == 'True')) { aBlob2[6] += document.sTourOfficeName + '
    '; } aBlob2[6] += document.sUserPhoneNumber + '
    '; if(document.sEmailAddress.indexOf('@') != -1) { aBlob2[6] += 'Send Email
    '; } else { if(document.sEmailAddress != '') { aBlob2[6] += 'Click Here
    '; } } } sString += '


    '+aBlob2[6]+'

    '; } // no subtabs else { var aBlob2 = sBlob.split('|'); if((aBlob2[6] == '') || (aBlob2[6].indexOf('For more information and a personal tour of this home please contact:') != -1)) { aBlob2[6] = 'For more information on this property, please contact:

    '; if(document.fUserPhotoExists=='True') { aBlob2[6] += '
    '; } aBlob2[6] += '' + document.sUserName + '
    '; if((lcase(document.sUserName) != lcase(document.sTourOfficeName)) && (document.fDisplayOffice == 'True')) { aBlob2[6] += document.sTourOfficeName + '
    '; } aBlob2[6] += document.sUserPhoneNumber + '
    '; if(document.sEmailAddress.indexOf('@') != -1) { aBlob2[6] += 'Send Email
    '; } else { if(document.sEmailAddress != '') { aBlob2[6] += 'Click Here
    '; } } } sString = ''+aBlob2[6]+'

    '; } // write new description document.getElementById('sSceneDescription').innerHTML = sString; // write new Description2 document.getElementById('sSceneDescription2').innerHTML = aBlob2[7]; } function loadImage(sBlob, nTabNumber) { var sString; var i; var nViewDegrees; var sImagePathFinal; // clear dhtml timer and hide mouse capture layer if(nPanTimer!='') { window.clearTimeout(nPanTimer); } if(document.getElementById) { document.getElementById('panEventCapture').style.display = 'none'; } // split out subtab data (not needed for image) if(sBlob.indexOf('~')!=-1) { var aBlob = sBlob.split('~'); // split variable data var aBlob2 = aBlob[0].split('|'); } else { // split variable data var aBlob2 = sBlob.split('|'); } // if standard image if(aBlob2[3] == '1') { sString = ' 
    '; sString += ''; sString += '

    '; } else { sString = 'TIP: Move your mouse over the photo to control the motion.
    '; if((document.DefsViewer == 'java') || (document.DefsViewer == 'bubble' && aBlob2[3] == '4')) { // java viewer sString += ''; } else { if(document.DefsViewer == 'bubble') { // java bubble viewer (ptviewer) nViewDegrees = 360 * ((aBlob2[4] / aBlob2[5]) / 6); if(nViewDegrees > 360) { nViewDegrees = 330; } if(aBlob2[3] == '3') { nViewDegrees = 360; } sString += ''; } else { if(document.DefsViewer == 'flash') { // flash viewer if(aBlob2[4] > 2880) { sImagePathFinal = document.sMediaRoot + '/flashsize.asp%3fp=scene/big/' + photoPath(aBlob2[2]) + '/' + aBlob2[2] + '.jpg%26w=2880%26h=272%26b=000000%26f=0'; } else { sImagePathFinal = document.sMediaRoot + '/Scene/Big/' + photoPath(aBlob2[2]) + '/' + aBlob2[2] + '.jpg?aol'; } sString += ''; } else { sString += ''; } } } sString += '
    ' + '
    ' + '' + '' + '' + '
    ' + '
    ' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
    ' + '
    ' + panBlockFlash(sImagePathFinal + ((aBlob2[3]==3)?'&n360Mode=1':'')) + '' + buildDhtmlPan(document.sMediaRoot + '/Scene/Big/' + photoPath(aBlob2[2]) + '/' + aBlob2[2] + '.jpg?aol', aBlob2[3], aBlob2[4], aBlob2[5]) + '
    '; var sSafeBlob = sBlob.replace(/'/g, '\\\'').replace(/"/g, '"e;') // dhtml viewer button if((document.DefsViewer != 'flash') && (document.DefsViewer != 'java') && (document.DefsViewer != 'bubble')) { sString += ''; } else { sString += ''; } // flash viewer button if((document.DefsViewer == 'flash')) { sString += ''; } else { sString += ''; } // java viewer button if(document.DefsViewer == 'java') { sString += ''; } else { sString += ''; } // bubble viewer button if(document.DefsViewer == 'bubble') { sString += ''; } else { sString += ''; } sString += '

    '; } // write new photo document.getElementById('sImage').innerHTML = sString; } function logHit(sBlob) { var aBlob2 = sBlob.split('|'); var oImage = new Image; oImage.src = 'Log.asp?s=' + aBlob2[2] + '&r=' + document.sReferer + '&rnd=' + Math.random(); } function mid(str, start, len) { // Make sure start and len are within proper bounds if (start <= 0 || len < 0) return ""; var iEnd, iLen = String(str).length; if (start + len > iLen) iEnd = iLen; else iEnd = (start - 1) + len; return String(str).substring(start - 1,iEnd); } function min(Num1, Num2) { if(Num1<=Num2) { return Num1; } else { return Num2; } } function panBlockFlash(sImagePath) { return '' + '' + '' + '' + '' + ''; } function panMouseMove(e) { nPanMouseIn = true; nPanMouseX = ((e.clientX - document.getElementById('divPanoramaShell').offsetLeft) - 225); nPanMouseY = ((e.clientY - document.getElementById('divPanoramaShell').offsetTop) - 135); nPanDefaultX = (nPanMouseX==0?0:(Math.abs(nPanMouseX) / nPanMouseX)); nPanDefaultY = (nPanMouseY==0?0:(Math.abs(nPanMouseY) / nPanMouseY)); nPanMotionX = Math.pow((Math.abs(nPanMouseX) / 50), 2.5) * nPanDefaultX * 0.5; nPanMotionY = Math.pow((Math.abs(nPanMouseY) / 50), 3.5) * nPanDefaultY * 0.5; } function panMouseOut() { nPanMouseIn = false; if(nPanPhotoTypeID==4) { nPanMotionX = 0; nPanMotionY = (nPanMotionY==0?1:Math.abs(nPanMotionY)/nPanMotionY); } else { nPanMotionX = (nPanMotionX==0?1:Math.abs(nPanMotionX)/nPanMotionX); nPanMotionY = 0; } } function panMove() { if(document.getElementById('panEventCapture')) { if(document.getElementById('panEventCapture').style.left!=document.getElementById('divPanoramaShell').offsetLeft) { document.getElementById('panEventCapture').style.left = document.getElementById('divPanoramaShell').offsetLeft; document.getElementById('panEventCapture').style.top = document.getElementById('divPanoramaShell').offsetTop; document.getElementById('panEventCapture').style.width = 450; document.getElementById('panEventCapture').style.height = 270; document.getElementById('panEventCapture').style.display = ''; } } if(document.getElementById('divPanorama')) { nPanX -= nPanMotionX; nPanY -= nPanMotionY; if(nPanPhotoTypeID==4) { if(nPanX > 0) { nPanX = 0; nPanMotionX = 0; } if(nPanX < -(nPanWidth - 450)) { nPanX = -(nPanWidth - 450); nPanMotionX = 0; } if(nPanY > 0) { nPanY = 0; nPanMotionY = (nPanMouseIn?0:Math.abs(nPanMotionY)); } if(nPanY < -(nPanHeight - 270)) { nPanY = -(nPanHeight - 270); nPanMotionY = (nPanMouseIn?0:-Math.abs(nPanMotionY)); } } else { if(nPanPhotoTypeID==3) { if(nPanX > 0) { nPanX -= nPanWidth; } if(nPanX < -nPanWidth) { nPanX += Number(nPanWidth); } } else { if(nPanX > 0) { nPanX = 0; nPanMotionX = (nPanMouseIn?0:Math.abs(nPanMotionX)); } if(nPanX < -(nPanWidth - 450)) { nPanX = -(nPanWidth - 450); nPanMotionX = (nPanMouseIn?0:-Math.abs(nPanMotionX)); } } if(nPanY > 0) { nPanY = 0; nPanMotionY = 0; } if(nPanY < -(nPanHeight - 270)) { nPanY = -(nPanHeight - 270); nPanMotionY = 0; } } document.getElementById('divPanorama').style.left = nPanX; document.getElementById('divPanorama').style.top = nPanY; } nPanTimer = window.setTimeout('panMove();', 30); } function photoPath(sID) { var sFullString; // get full string sFullString = right('0000000000' + sID, 10); // return string return left(sFullString, 2) + '/' + mid(sFullString, 3, 2) + '/' + mid(sFullString, 5, 2) + '/' + mid(sFullString, 7, 2); } function photoPathExtend(sID) { var sFullString; // get full string sFullString = right('0000000000' + sID, 10); // return string return left(sFullString, 2) + '/' + mid(sFullString, 3, 2) + '/' + mid(sFullString, 5, 2) + '/' + mid(sFullString, 7, 2) + '/' + mid(sFullString, 9, 2); } function reloadTabs(nTabNumber, nTabCount, sGraphicName, TabName) { if(document.DefTabNumber!=nTabNumber) { document.images['Tab' + nTabNumber].src = 'art/pixel.gif'; document.images['Tab' + document.DefTabNumber].src = 'art/pixel.gif'; document.images['Tab' + nTabNumber].src = 'http://' + document.ThemeTourfactoryCom + '/tab' + min(((nTabCount - nTabNumber) + 1), 6)+'/' + document.sFolderColor + '/' + document.sTabFaceColor + '/' + document.sTabColor + '/' + document.sTabTextAltColor + '/' + sGraphicName + '.gif?' + escape(TabName); document.images['Tab' + document.DefTabNumber].src = 'http://' + document.ThemeTourfactoryCom + '/tab' + min(((nTabCount - document.DefTabNumber) + 1), 6)+'/' + document.sTabFaceColor + '/' + document.sTabFaceColor + '/' + document.sTabColor + '/' + document.sTabTextColor + '/' + document.DefGraphicName + '.gif?' + escape(document.DefTabName); document.DefGraphicName = sGraphicName; document.DefTabNumber = nTabNumber; document.DefTabName = TabName; } } function right(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function sceneLoaded() { var sCookies = '; ' + document.cookie + ';'; if(sCookies.indexOf('; downloadrate=')>-1) { checkRate(Number(sCookies.split('; downloadrate=')[1].split(';')[0])); } else { nRateStartTime = Number(new Date()) document.images.imgLoadTime.src = 'http://www.tourfactory.com/LoadTimeCalc.asp' } } function setButtonColor(sObject, sColor) { document.images['img' + sObject].src='http://' + document.ThemeTourfactoryCom + '/art/' + sColor + '/btn' + sObject + '.gif'; document.getElementById('td' + sObject).style.background = 'url(http://' + document.ThemeTourfactoryCom + '/art/' + sColor + '/' + document.sFolderColor + '/btnBackground.gif)'; } function setTitle(sBlob) { // split out subtab data (not needed for image) if(sBlob.indexOf('~')!=-1) { var aBlob = sBlob.split('~'); // split variable data var aBlob2 = aBlob[0].split('|'); } else { // split variable data var aBlob2 = sBlob.split('|'); } document.getElementById('sTitle').innerHTML = '' + aBlob2[1] + '
    '; } function testRate() { if(nRateStartTime>0) { var nLoadTime = Number(new Date()) - nRateStartTime; var nRate = Math.floor(20001 / nLoadTime) document.cookie = 'downloadrate=' + nRate; checkRate(nRate) } } function ucase(string) { return string.toUpperCase(); } function updateMiniPage(sBlob, nTabNumber) { if(!(document.getElementById)) { return true; } if(!(document.body.innerHTML)) { return true; } setTitle(sBlob); loadImage(sBlob, nTabNumber); return false; } function updatePage(sBlob, nTabNumber, nTabCount, sGraphicName, TabName) { if(!(document.getElementById)) { return true; } if(!(document.body.innerHTML)) { return true; } loadDescriptions(sBlob, nTabNumber, nTabCount, sGraphicName, TabName); reloadTabs(nTabNumber, nTabCount, sGraphicName, TabName); loadImage(sBlob, nTabNumber); logHit(sBlob); return false; } function updateViewer(sBlob, nTabNumber, sViewer) { if(!(document.getElementById)) { return true; } if(!(document.body.innerHTML)) { return true; } document.DefsViewer = sViewer; var ckyDate = new Date; ckyDate.setDate(ckyDate.getDate( ) + 365); document.cookie = 'sViewer=' + sViewer + '; expires=' + ckyDate.toGMTString( ) + ';'; loadImage(sBlob, nTabNumber); return false; }