/* «  Deer Valley Real Estate Scripts  »  */


if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	window.attachEvent("onload", alphaBackgrounds);
}

function alphaBackgrounds(){
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (i=0; i<document.all.length; i++){
		var bg = document.all[i].currentStyle.backgroundImage;
		if (itsAllGood && bg){
			if (bg.match(/\.png/i) != null){
				var mypng = bg.substring(5,bg.length-2);
				document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
				document.all[i].style.backgroundImage = "url()";
			}
		}
	}
}


/* Open Popup Window */
function openWindow(url) {
	//	determine window dimensions and 
	//  point of window creation.
	var spawnWidth = 940;		// this defines the new window width
	var spawnHeight = 710;		// this defines the new window height
	var spawnLeft = (screen.width / 2) - (spawnWidth / 2);
	var spawnTop = 22;
    tallWin = window.open(url,'AMSF','toolbar=0,location=0,directories=0,status=no,menubar=0,scrollbars=1,resizable=1,width='+spawnWidth+',height='+spawnHeight+',left='+spawnLeft+',top='+spawnTop+',fullscreen=no');
    if (navigator.appName == 'Netscape') {
	    tallWin.focus();
    }
}


/* Close Popup Window */
function closewindow() {
	self.opener = this;
	self.close();
}

function openWindow2(url,spawnWidth,spawnHeight,WinTitle) {
	var spawnLeft = (screen.width / 2) - (spawnWidth / 2);
	var spawnTop = 22;
	var spawnWidthwin = spawnWidth + 20;
	var spawnHeightwin = spawnHeight + 20;
    tallWin = window.open(url,'AMSF','toolbar=0,location=0,directories=0,status=no,menubar=0,scrollbars=1,resizable=1,width='+spawnWidthwin+',height='+spawnHeightwin+',left='+spawnLeft+',top='+spawnTop+',fullscreen=no');
    if (navigator.appName == 'Netscape') {
	    tallWin.focus();
    };
	tallWin.document.open();
	tallWin.document.write("<html><head><title>Deer Valley Real Estate - ");
	tallWin.document.write(WinTitle);
	tallWin.document.write('</title></head><body background="images/new_win.jpg"><a href="javascript:self.close();"><img src="');
	tallWin.document.write(url);
	tallWin.document.write('" alt="" border="0" width="');
	tallWin.document.write(spawnWidth);
	tallWin.document.write('" height="');
	tallWin.document.write(spawnHeight);
	tallWin.document.write('" /></a></body></html>');
	tallWin.document.close();
};