var slidePos = 0;
var slideTimer = 0;
function slide(direction)
{
	slideTimer = setInterval('_slide('+direction+')',50);
}

function stopSlide()
{
	clearTimeout(slideTimer);
}

function _slide(direction)
{
	var l = document.getElementById('innerSlide');
	
	if (direction)
	{
		var thumbHeight = 60;
		var sliderHeight = 300;
		
		if ((slideCount*thumbHeight)-sliderHeight> -slidePos )slidePos-=10;		
	}else{
		if(slidePos<0)	slidePos+=10;
	}
	
	l.style.top=slidePos+'px';

}

function ShowPhotoLarge(num,photo)
{
	_photoIndex = num;
	if (_photos[_photoIndex] != null)
	{
		u=new String(_thumbnailUrl);
		u=u.replace(/\{0\}/g,_photos[_photoIndex].name);
		u=u.replace(/\{1\}/g,'462');
		document.getElementById('propertyDetails__photoSlide__photoIndex').innerHTML = _photoIndex + 1;
		document.getElementById('propertyDetails__photoSlide__photo').title = _photos[_photoIndex].caption;
		document.getElementById('propertyDetails__photoSlide__photo').alt = _photos[_photoIndex].caption;
		document.getElementById('propertyDetails__photoSlide__photo').width= 462;
		document.getElementById('propertyDetails__photoSlide__photo').height = 347;

		document.getElementById('propertyDetails__photoSlide__photo').src =u;
		document.getElementById('photoCaption').innerHTML = _photos[_photoIndex].caption;
	}
}

function makeFade()
{
	if (!fadeTimer)
	{
		fadeTimer = setInterval('fadePhoto()',20);
	}	
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function wopen(url, name, w, h)
{
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url,
    name,
	'width=' + w + ',height=' + h );
  if (window.focus) {win.focus();}
  return false;
}


function popitup(url) {
	newwindow=window.open(url,'name','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
}

function wopenreport(url, name, w, h,rep,prop)
{
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
var win = window.open('/InfocasaEngine/Handlers/ReportPDF.php?report=crLst1Prop_7&properties=' + prop,
    name,
	'width=' + w + ',height=' + h );	
  if (window.focus) {win.focus();}
  return false;
}
