function positionMainLayers() {
	if (document.layers) {
            document.layer1Welcome.style.top="17px";
            document.layer2VirtualTours.style.top="17px";
            document.layer1Welcome.style.left="17px";
            document.layer2VirtualTours.style.left="17px";
            document.layer1Welcome.style.visibility="visible";
            document.layer1Welcome.style.zIndex="2";
            document.layer2VirtualTours.style.visibility="hidden";
            document.layer2VirtualTours.style.zIndex="1";
        }
        if (document.all) {
             document.all.layer1Welcome.style.top="17px";
             document.all.layer2VirtualTours.style.top="17px";
             document.all.layer1Welcome.style.left="17px";
             document.all.layer2VirtualTours.style.left="17px";
             document.all.layer1Welcome.style.visibility="visible";
             document.all.layer1Welcome.style.zIndex="2";
             document.all.layer2VirtualTours.style.visibility="hidden";
             document.all.layer2VirtualTours.style.zIndex="1";
        }
        if (!document.all && document.getElementById) {
             document.getElementById("layer1Welcome").style.top="17px";
             document.getElementById("layer2VirtualTours").style.top="17px";
             document.getElementById("layer1Welcome").style.left="17px";
             document.getElementById("layer2VirtualTours").style.left="17px";
             document.getElementById("layer1Welcome").style.visibility="visible";
             document.getElementById("layer1Welcome").style.zIndex="2";
             document.getElementById("layer2VirtualTours").style.visibility="hidden";
             document.getElementById("layer2VirtualTours").style.zIndex="1";
    }
}
	
var win= null;
function NewWindow(mypage,myname,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars='+scroll+',';
	settings +='resizable=no';
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}
var win= null;
function NewWindowWithScroll(mypage,myname,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars='+scroll+',';
	settings +='resizable=no';
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}
function MM_openBrWindow(theURL,winName,features) {
	window.open(domain_url,winName,features);
}

function showBrandedInfo () {
	alert ("For more information and to schedule a private \nshowing, contact your realtor. \n\nMention the MLS # or Location listed in the right sidebar.");
}

function showUnBrandedInfo () {
	alert ("For more information and to schedule a private \nshowing, contact your realtor. \n\nMention the MLS # or Location listed in the right sidebar.");
}

function alertExternal(url) {
	 alert('You are now leaving this \nVirtual Home Tour.'); 
	 window.open(url); 
}

function maximize() {
   	window.moveTo(0,0)
   	window.resizeTo(screen.availWidth, screen.availHeight)
}

function PlayFlashAudio()
{
	var flashMovie=getFlashMovieObject("audio");
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}

function RewindFlashAudio()
{
	var flashMovie=getFlashMovieObject("audio");
	flashMovie.Rewind();
}

function StopFlashAudio()
{
	var flashMovie=getFlashMovieObject("audio");
	flashMovie.StopPlay();
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
