<!--script by: SK updated January 2005 -->
<!--begin
//functions to change images
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
	
		tMenu_over = newImage("images/tMenu_over.gif");
		rMenuEnd_over = newImage("images/rMenuEnd_over.gif");
		tMenu_over = newImage("images/tMenu_over.gif");
		rMenuEnd_over = newImage("images/rMenuEnd_over.gif");
		preloadFlag = true;
	}
}

//function to open separate window 
	function openWindow(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1, location=1, resizable=1, width=950, height=600, left = 200, top = 40');");
	}

//function to open separate window 
	function openWindow2(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1, location=1, resizable=1, width=800, height=600, left = 200, top = 40');");
	}
//function to open separate smaller window 
	function openW(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1, location=1, resizable=1, width=450, height=250, left = 200, top = 40');");
	}

//function to open a pop-up window
	var count=0;
   //function to open window with link to contest entry and information
	function popupPage()
	{	
		//alert("count="+count);
		var page = "popUp.html";
		windowprops = "height=290,width=375,location=no,top=0,left=0,scrollbars=no,menubars=no,toolbars=no,resizable=yes";
	
		if(count==0)
		{	
			window.open(page, "Popup", windowprops);
			count++;
		}
		
	}
	

//function to bookmark the site
function addbookmark()
	  {
	      var bookmarkURL="http://www.barriereal-estate.com"
          var bookmarkTitle="Max Viskovich--Sutton Group Sales Representative, Barrie, Ontario"
      
         if (document.all)
		 {
             window.external.AddFavorite(bookmarkURL,bookmarkTitle)
         }

        if (document.layers)
		{
            window.alert('Please hit CTRL-D to bookmark this page.')
        }
	 }

//functions to rotate properties for sale with link to appropriate mls.ca listing

if (document.images)
{
    // First create an array with images to display  
    propertyImages=new Array("images/houses/1008635.jpg","images/houses/1100179.jpg","images/houses/1101170.jpg","images/houses/1100992.jpg","images/houses/1101004.jpg");

    // create another array with a list of URLs. Keep the order the same as images.
    adURLs=new Array("www.mls.ca/propertyresults.aspx?id=1008635&mode=5",
		"www.mls.ca/propertyresults.aspx?id=1100179&mode=5",
		"www.mls.ca/propertyresults.aspx?id=1101170&mode=5",
		"www.mls.ca/propertyresults.aspx?id=1100992&mode=5",
		"www.mls.ca/propertyresults.aspx?id=1101004&mode=5");

	thisAd=0;
}

//The following function cycles through each image.
function cycleAds()
{
    if (document.images)
   {
        if (document.adBanner.complete)
       {
            if (++thisAd==propertyImages.length)
                thisAd=0;

            document.adBanner.src=propertyImages[thisAd];
        }
    }

    // change to next banner every 15 seconds
    setTimeout("cycleAds()", 2000);
}

// This function is used to direct the user to the property info at mls.ca

function gotoAd()
{
    document.location.href="javascript:openWindow('http://' + adURLs[thisAd])";
}

//function to scroll information on featured property on scroll bar.
var speed = 50
var pause = 2000
var timerID = null
var bannerRunning = false
var ar = new Array()
ar[0] = "Featured Property - Call Max to view! "
 
//Change variable bannerRunning message
var currentMessage = 0
var offset = 0
function stopBanner() {
	if (bannerRunning)
	clearTimeout (timerID)
	bannerRunning = false
}
function startBanner() {	stopBanner()
	showBanner()

}
function showBanner() {
	var text = ar[currentMessage]
	if (offset < text.length) {
	if (text.charAt(offset) == " ")
		offset++
		var partialMessage = text.substring(0, offset + 1)
		window.status = partialMessage
		offset++
		timerID = setTimeout("showBanner()", speed)
		bannerRunning = true
	} else {
		offset = 0
		currentMessage++
		if (currentMessage == ar.length)
			currentMessage = 0
		timerID = setTimeout("showBanner()", pause)
		bannerRunning = true
	}
}


//disable the view source right click function
var message="Function Disabled";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
else if (document.layers||document.getElementById) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

//slide show code
newImg = new Array (
"images/houses/11011701.jpg",
"images/houses/11011702.jpg",
"images/houses/11011703.jpg",
"images/houses/11011704.jpg",
"images/houses/11011705.jpg",
"images/houses/11011706.jpg",
"images/houses/11011707.jpg");



var imgNum = 0;
var imgLength = newImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 1500;

var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
imgNum = imgNum + direction;
if (imgNum > imgLength) {
imgNum = 0;
}
if (imgNum < 0) {
imgNum = imgLength;
}
document.slideshow.src = newImg[imgNum];
   }
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
   }
}
//End-->

