// antispam for email

function antispam(user,domain) {
	var locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

// generic photo switcher

function load_photo(filename) {
	if (document.getElementById) {
	document.getElementById("photo_frame").style.display = "block";
	document.getElementById("photo_frame").innerHTML = "";
	document.getElementById("photo_frame").innerHTML = "<img src=\"" + filename + "\" alt=\"photo\" />";
	}
	if (document.all) {
	document.photo_frame.innerHTML = "";
	document.photo_frame.innerHTML = "<img src=\"" + filename + "\" alt=\"photo\" />";
	}
}

// photo switcher for Harvest lots

function update(image) {
	document.getElementById("current_photo").src = "http://wieler.com/graphics/inline/harvest-properties/405px/" + image + "-405px.jpg";
	document.getElementById("lot_minimap").src = "http://wieler.com/graphics/inline/harvest-properties/maps/" + image + "-map.jpg";
	document.getElementById("large_img_link").href = "http://wieler.com/viewer.php?image=http://wieler.com/graphics/inline/harvest-properties/800px/" + image + "-800px.jpg";
}

function updateWithoutMap(image) {
	document.getElementById("current_photo").src = "http://wieler.com/graphics/inline/harvest-properties/405px/" + image + "-405px.jpg";
//	document.getElementById("lot_minimap").src = "http://wieler.com/graphics/inline/harvest-properties/maps/" + image + "-map.jpg";
	document.getElementById("large_img_link").href = "http://wieler.com/viewer.php?image=http://wieler.com/graphics/inline/harvest-properties/800px/" + image + "-800px.jpg";
}

// small-size popup

function popup(mypage,myname) {
	LeftPosition = (screen.width) ? (screen.width-400)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
	settings = 'height=400,width=400,top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable';
	window.open(mypage,myname,settings);
}

// big popup (800px images, etc)

var popWin = "";

function bigPopup(url){
var strWidth = 800;
var strHeight = 532;
if (popWin != ""){popWin.close()}
leftStr = (screen.width-strWidth)/2;
topStr = (screen.height-strHeight)/2;
windowProperties = "toolbar=no,menubar=no,scrollbars=no,stausbar=no,resizable=yes,height="+strHeight+",width="+strWidth+",left="+leftStr+",top="+topStr+"";
popWin = window.open(url,'newWin',windowProperties);
}