<!--
	// get netscape version number
	function getNNVersionNumber() {
	  if(navigator.appName == "Netscape") {
	  	var appVer = parseFloat(navigator.appVersion);
		if (appVer < 5) {
			return appVer;
	  	} else {
			if (typeof navigator.vendorSub != "undefined") {
				return parseFloat(navigator.vendorSub);
			}
		}
	}
		return 0;
	}
	
	// opening a new window and creating content
	function enlarge( a, b) {
		var id = a; // id of the image
		var info = b; // description of the image
		var output = "";				
		var isNN4 = getNNVersionNumber() == 4;	// set var to netscape version number
		var width = 425;
		var height = 350;
		var swidth = screen.availWidth;
		var sheight = screen.availHeight;
		var hpos = (swidth / 2) - (width / 2);
		var vpos = (sheight / 2) - height;
		if (isNN4) {
			var enlargement = window.open("", "enlarged" , "width=" + width + ",height=" + height + ",toolbars=no,scrollbars=yes,screenX=" + hpos + ",screenY=" + vpos +"");	
		} else {
			var enlargement = window.open("", "enlarged" , "width=" + width + ",height=" + height + ",toolbars=no,scrollbars=yes,left=" + hpos + ",top=" + vpos);
		}
		output += "<html><head><title>Storm Mountain Cottages</title><link rel=\"stylesheet\" type=\"text/css\" href=\"/css/screen.css\" /></head><body>";
		output += "<div style=\"padding:10px; text-align: center;\"><img src=\"/photos/" + id + "\" alt=\"" + id + "\" /><br /><br />";
		output += info + "<br /><br />";
		output += "<a href=\"javascript:window.close();\">close</a></div>";
		output += "</body></html>";
		enlargement.document.write(output);
		enlargement.document.close();
		enlargement.focus();
	}
	
	// opening a new window and creating content
	function enlargePhotoAlbum( a, b) {
		var id = a; // id of the image
		var info = b; // description of the image
		var output = "";				
		var isNN4 = getNNVersionNumber() == 4;	// set var to netscape version number
		var width = 650;
		var height = 500;
		var swidth = screen.availWidth;
		var sheight = screen.availHeight;
		var hpos = (swidth / 2) - (width / 2);
		var vpos = (sheight / 2) - height;
		if (isNN4) {
			var enlargement = window.open("", "enlarged" , "width=" + width + ",height=" + height + ",toolbars=no,scrollbars=yes,screenX=" + hpos + ",screenY=" + vpos +"");	
		} else {
			var enlargement = window.open("", "enlarged" , "width=" + width + ",height=" + height + ",toolbars=no,scrollbars=yes,left=" + hpos + ",top=" + vpos);
		}
		output += "<html><head><title>Storm Mountain Cottages</title><link rel=\"stylesheet\" type=\"text/css\" href=\"/css/screen.css\" /></head><body>";
		output += "<div style=\"padding:10px; text-align: center;\"><img src=\"" + id + "\" alt=\"" + id + "\" /><br /><br />";
		output += info + "<br /><br />";
		output += "<a href=\"javascript:window.close();\">close</a></div>";
		output += "</body></html>";
		enlargement.document.write(output);
		enlargement.document.close();
		enlargement.focus();
	}
	
	/* 
	Open in new window code from http://www.sitepoint.com/article/standards-compliant-world.
	This takes <a> tags with rel="external" attribute and sets target="_blank" attribute. This allows
	page to open links in new window in a "valid" way because target="_blank" is not xhtml-strict.
	*/
	function externalLinks() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
				anchor.target = "_blank";
		}
	}
	window.onload = externalLinks;
	
// -->