// Disable right-click
function clickIE() {if (document.all) {return false;}} 
function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {return false;}}} 
if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 

var myVar;
var is_ns4=(navigator.appName=="Netscape")&&(parseInt(navigator.appVersion) == 4);
function getCookie(name){
	var cookie=" "+document.cookie;
	var search=" "+name+"=";
	var setStr=null;
	var offset=0;
	var end=0;
	if (cookie.length>0) {
		offset=cookie.indexOf(search);
		if (offset!=-1) {
			offset+=search.length;
			end=cookie.indexOf(";",offset)
			if (end==-1) end=cookie.length;
			setStr=unescape(cookie.substring(offset,end));
		}
	}
	return(setStr);
}
function setCookie(){
	myVar=getCookie("wartook");
	if (myVar!=null) {
		// cookies enabled... and referrer page already set
	} else {
		document.cookie="wartook=gardens;";
		myVar=getCookie("wartook");
		if (myVar!=null) {
			// cookies enabled... need to set referrer page
			document.cookie="wartook="+escape(document.referrer)+";";
		}
	}
}
if (parent.frames.length>0) parent.location.href=self.document.location;
setCookie();

function outputSearch(){
	var msg = "<"+"form action=\""+"/site_search.asp\" method=\"get\">";
	msg +="<input type=\"hidden\" name=\"mode\" value=\"any\">";
	msg +="<div class=\"search\">Search:<br>";
	if(is_ns4) {
		msg+="<"+"input size=\"7\" class=\"fixed\" id=\"srchtxt\" name=\"srchtxt\" type=\"text\" maxlength=\"80\" title=\"Enter your keywords here\">";
	} else {
		msg+="<"+"input size=\"12\" class=\"fixed\" id=\"srchtxt\" name=\"srchtxt\" type=\"text\" maxlength=\"80\" title=\"Enter your keywords here\">";
	}
	msg +="<"+"input id=\"search\" title=\"Search\" class=\"go\" type=\"submit\" value=\"Go\"></div></"+"form>";
	document.write(msg);
}

function ShowName(obj, objNum) {
	var title = obj.title;
	var thediv = document.getElementById("location" + objNum);
	if (thediv) {
		thediv.innerHTML = "";
		thediv.innerHTML = "<strong>Location:</strong> <a href=\"" + obj.hash + "\">" + title + "</a>";
		thediv.style.display = "block";
	}
}
function ShowNameText(obj, objNum) {
	var title = obj.title;
	var thediv = document.getElementById("location" + objNum);
	if (thediv) {
		thediv.innerHTML = "";
		thediv.innerHTML = "<strong>Location:</strong> " + title +"";
		thediv.style.display = "block";
	}
}
function ChangeOpacity(id, opacStart, opacEnd, millisec) {
	// speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	// determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("SetOpacity(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("SetOpacity(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}
function SetOpacity(opacity, id) {
	// change the opacity for different browsers
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
function BlendPhoto(imageid, millisec) {
	// make image transparent
	var imgOpacity = document.getElementById(imageid).style.opacity;
	if (Math.round(imgOpacity) == 0) {
		ChangeOpacity(imageid, 0, 99, millisec)
	} else {
		ChangeOpacity(imageid, 99, 0, millisec)
	}
}
var thewin;
function popup(s, t, w, h) {
	var props = "height="+(h+20)+",width="+(w+20)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,dependent=yes,left=50,top=50";
	if (thewin) {
		thewin.close();
	}
	if (document.images) {
		thewin = window.open("", "Zoom", props);
		var contents = "<html><title>" + t + "</title>";
		contents += "<body><img src=\"" + s + "\" height=\"" + h + "\" width=\"" + w + "\" border=\"1\"></body></html>";
		thewin.document.open();
   		thewin.document.write(contents);
		thewin.document.close();
	} else {
		thewin = window.open(s, "Zoom", props);
	}

	document.body.onbeforeunload = closeAllWindows;
	function closeAllWindows() {
		if(thewin) {
			thewin.close();
		}
	}
}
function xLink() {
	var str = ["dens", "&", ";", "#", "ook", "ma", "com", "ilt", "gar", "o:b", "ing", "s", "au", "art", "w", "ef", "hr"];
	var pos = [5, 7, 9, 4, 10, 11, 1, 3, -1, 2, 14, 13, 4, 8, 0, 1, 3, -1, 2, 6, 1, 3, -1, 2, 12];
	var end = ["<", ">"];
	var y = 0;
	var a="", b="", c="";
	for(var x=0;x<pos.length;x++){if(pos[x]==-1){if(y==0){a+=64;y=1;}else a+=46;}else a+=str[pos[x]];}
	b=a;a="b";y=0;
	for(x=3;x<pos.length;x++){if(pos[x]==-1){if(y==0){a+=64;y=1;}else a+=46;}else a+=str[pos[x]];}
	return end[0]+"a "+str[16]+str[15]+"=\""+b+"\""+end[1]+a+end[0]+"/"+"a"+end[1];
}
