function img_act(imgName) {
	if (document.images){
    	imgOn = eval(imgName + "on.src");
        document [imgName].src = imgOn;
    }
}

function img_end(imgName) {
	if (document.images){
    	imgOn = eval(imgName + "off.src");
        document [imgName].src = imgOn;
    }
}

function tourWindow(media) {
  window.open('/tampa/virtual-tour/tour-popup/?media='+media,'VirtualTour','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=334,height=334,status');
}

function popWindow(page, width, height){
	window.open(page,null,"height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

function swapDivs(top, bottom)
{
	document.getElementById(top).style.zIndex = "3";
	document.getElementById(bottom).style.zIndex = "2";
}

function runSlideShow()
{
	if (document.all)
	{		
		slideshow.style.filter="blendTrans(duration=2)";
		slideshow.style.filter="blendTrans(duration=crossFadeDuration)";
		slideshow.filters.blendTrans.Apply();
	}
	slideshow.src = preLoad[j].src;
	if (document.all)
	{
      slideshow.filters.blendTrans.Play();
	}
	j = j + 1;
	if (j > (p-1)) j=0;
	t = setTimeout('runSlideShow()', slideShowSpeed);
}


function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('mainimage').src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('zone4').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('zone4').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}

function $(v) {
     return(document.getElementById(v)); 
}
function $S(v) {
     return($(v).style); 
}
function agent(v) {
     return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); 
}
function isset(v) {
     return((typeof(v)=='undefined' || v.length==0)?false:true); 
}
function XYwin(v) {
     var z=agent('msie')?Array(document.body.clientHeight,document.body.clientWidth):Array(window.innerHeight,window.innerWidth); return(isset(v)?z[v]:z); 
}


function closeBox() {
    document.getElementById('tour-bg').style.display='none';
    document.getElementById('virtual-tour').style.display='none';
  
}

function virtual_tour(data_url, v) {
  document.getElementById('tour-bg').style.display='block';
  document.getElementById('virtual-tour').innerHTML=v+'<div class="sexyX">'+"<\/div>";
  
  var so = new SWFObject("/userfiles/flash/virtual_tour.swf", "mymovie", "100%", "100%", "8", "#000");
  so.addParam("wmode", "transparent");
  so.addVariable("data_url", "/medialist.php?folder="+data_url);
  // /userfiles/image/centers/new albany/tour/
  so.write('virtual-tour');
    
  document.getElementById('virtual-tour').style.width='100%';
  document.getElementById('virtual-tour').style.height='100%';
  document.getElementById('virtual-tour').style.left='0';
  document.getElementById('virtual-tour').style.top='0';  
  document.getElementById('virtual-tour').style.display='block';
}

function tour_coming_soon() {
  document.getElementById('tour-bg').style.display='block';
  document.getElementById('virtual-tour').innerHTML='<div onclick="javascript:closeBox();"><center><img src="/userfiles/images/centers/monterey/tour/tour-coming-soon.gif" border=0 /></center></div>';

  document.getElementById('virtual-tour').style.width='100%';
  document.getElementById('virtual-tour').style.height='100%';
  document.getElementById('virtual-tour').style.left='0';
  document.getElementById('virtual-tour').style.top='0';
  document.getElementById('virtual-tour').style.display='block';

}


function GetControlfocus(Control1, len, Control2) {           
   if(document.getElementById(Control1).value.length == len) document.getElementById(Control2).focus(); 
}

