var __isFireFox = navigator.userAgent.match(/gecko/i);  
var flrplan = 1;


function nextLayout() {
	
if (flrplan == 1) {
	
document.getElementById('flrpln_holder').src = "http://www.trimarkproperties.com/the_courtyards_gainesville_apartments/VTs/4BRTOWN/flrpln.jpg";
flrplan++;
document.getElementById('flrpln_text').innerHTML = "Private, Single Room with attached bathroom, kitchen & living area (shared with 3 other private rooms)<Br><span style=\"font-style:italic\">Two-story layout</B>";

}

else if (flrplan == 2) {
	
	document.getElementById('flrpln_holder').src = "http://www.trimarkproperties.com/the_courtyards_gainesville_apartments/VTs/5BRFLAT/flrpln.jpg";
	flrplan++;
	document.getElementById('flrpln_text').innerHTML = "Private, Single Room with attached bathroom, kitchen & living area (shared with 4 other private rooms)<Br><span style=\"font-style:italic\">One-story layout</span>";
	
	
} else if (flrplan == 3) {
	
	document.getElementById('flrpln_holder').src = "http://www.trimarkproperties.com/the_courtyards_gainesville_apartments/VTs/4BRFLAT/flrpln.jpg";
	flrplan = 1;
	document.getElementById('flrpln_text').innerHTML = "Private, Single Room with attached bathroom, kitchen & living area (shared with 3 other private rooms)<Br><span style=\"font-style:italic\">One-story layout</span>";
	
	
}




}


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="VTs/feat/image' + num + '.jpg" />';	
	
	switch (num) {
	
	case 1:
	legit = 'Living Area';
	break;
	
	case 2:
	legit = 'Kitchen';
	break;
	
	case 3:
	legit = 'Single Room Example 1'
	break;
	
	case 4:
	legit = 'Single Room Example 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>';	
	
	
}
