var __isFireFox = navigator.userAgent.match(/gecko/i);  

function absPos(element) {  
     var res = new Object();  
     res.x = 0; res.y = 0;  
     if (element !== null) {  
         res.x = element.offsetLeft;   
         res.y = element.offsetTop;   
           
         var offsetParent = element.offsetParent;  
         var parentNode = element.parentNode;  
   
         while (offsetParent !== null) {  
             res.x += offsetParent.offsetLeft;  
             res.y += offsetParent.offsetTop;  
   
             if (offsetParent != document.body && offsetParent != document.documentElement) {  
                res.x -= offsetParent.scrollLeft;  
                 res.y -= offsetParent.scrollTop;  
             }  
            //next lines are necessary to support FireFox problem with offsetParent  
            if (__isFireFox) {  
                while (offsetParent != parentNode && parentNode !== null) {  
                    res.x -= parentNode.scrollLeft;  
                     res.y -= parentNode.scrollTop;  
                      
                     parentNode = parentNode.parentNode;  
                }      
            }  
           parentNode = offsetParent.parentNode;  
           offsetParent = offsetParent.offsetParent;  
         }  
     }  
    return res;  
}  


function menuTip (theId, idForMenu) {
	
	var thePos = absPos(theId);
var me = idForMenu.style;
var she = idForMenu.offsetWidth;
me.display = "block";
me.left = -120+"px";
/*me.left = thePos.x-she+"px";
me.top = thePos.y-5+"px";*/
	
}

function hideMenu (theId) {
	
	var skeee = theId.style;
	
	skeee.display = "none";
}


function changeVT (num) {
	
	
document.getElementById('showPhotos').style.display = 'none';
document.getElementById('showVTs').style.display = 'block';

//document.getElementById('moreWhat').innerHTML = 'More Virtual Tours';	

document.getElementById('theRealVT').innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="485" height="341"><param name="movie" value="/the_courtyards_gainesville_apartments/VTs/2BRTOWN/' + num + '.swf"><param name="quality" value="high"><param name="WMODE" value="transparent"><embed src="/the_courtyards_gainesville_apartments/VTs/2BRTOWN/' + num + '.swf" width="485" height="341" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';	
	
	switch (num) {
	
	case 1:
	legit = 'Living Area';
	break;
	
	case 2:
	legit = 'Kitchen';
	break;
	
	case 3:
	legit = 'Bedroom'
	break;
	
	case 4:
	legit = 'Bathroom'
	break;
		
	}
	
	//document.getElementById('hoverdItem').innerHTML = legit;
	

}


function changeIMG(num) {
	
	
	document.getElementById('showPhotos').style.display = 'block';
	document.getElementById('showVTs').style.display = 'none';
	
	
	//document.getElementById('moreWhat').innerHTML = 'More Photos';
	document.getElementById('theRealVT').innerHTML = '<img src="/the_courtyards_gainesville_apartments/VTs/feat/image' + num + '.jpg" />';	
	
	switch (num) {
	
	case 1:
	legit = 'Living Area';
	break;
	
	case 2:
	legit = 'Kitchen';
	break;
	
	case 3:
	legit = 'Bedroom 1'
	break;
	
	case 4:
	legit = 'Bedroom 2'
	break;
		
	}
	
	document.getElementById('hoverdItem2').innerHTML = legit;
	
	
}

function showDaMovie() {
	
	
document.getElementById('howlongittakes').innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="720" height="360"><param name="movie" value="/the_courtyards_gainesville_apartments/_flash/fla_map3.swf"><param name="quality" value="high"><embed src="/the_courtyards_gainesville_apartments/_flash/fla_map3.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="360"></embed></object>';	
	
	
}
