// USE ALT STYLE SHEETS
function BrowserInfo() {
	var agent = window.navigator.userAgent;
	if (agent.indexOf("MSIE") != -1) {
			var start = agent.indexOf("MSIE");
			this.name = "MSIE";
			this.version = parseFloat(agent.substring(start + 5, agent.indexOf(";", start)));
	} else if (agent.indexOf("Firefox") != -1) {
			var start = agent.indexOf("Firefox");
			this.name = "Firefox";
			this.version = agent.substring(start + 8, agent.length);
			var firstDec = this.version.indexOf(".") + 1;
			while (this.version.indexOf(".", firstDec) != -1)
				this.version = this.version.substring(0, firstDec) + this.version.substring(firstDec).replace(".", "");
			this.version = parseFloat(this.version);
	} else {
			this.name = "Unknown";
			this.version = 0;
	}
}

var info = new BrowserInfo();
var isIE6 = (info.name == "MSIE" && info.version < 7);


if (info.name == "MSIE" && info.version < 7)
	document.writeln('<link href="stylesIE6.css" rel="stylesheet" type="text/css" />');
else
	document.writeln('<link href="stylesDynamic.css" rel="stylesheet" type="text/css" />');



// RENDERFLASH
function renderFlash(src, width, height, features) {
	document.writeln('<embed src="' + src + '" quality="high" width="' + width + 
					 '" height="' + height + '" align="middle" allowscriptaccess="sameDomain" ' +
					 'type="application/x-shockwave-flash" ' + features + 
  					 'pluginspage="http://www.macromedia.com/go/getflashplayer" />');
}



// WRITE PNG'S
var userAgent = window.navigator.userAgent
var isIE = (window.navigator.userAgent.indexOf("MSIE") != -1);
var isFirefox = (window.navigator.userAgent.indexOf("Firefox") != -1);
var isIE6 = (parseFloat(userAgent.substring(userAgent.indexOf("MSIE ") + 5)) <= 6);
var isSafari = (navigator.userAgent.indexOf("Safari") > 0);

function writePngImage(url, width, height, alt) {
	if (!isIE6)
		document.write("<img alt=\"" + alt + "\" src=\"" + url + "\" style=\"width: " + width + "px; height: " + height + "px;\">");
	else
		document.write("<img src=\"spacer.png\" style=\"width: " + width + "px; height: " + height + 
			"px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "', sizingMethod=scale);\">");
}



// RENDERFLASH OR DISPLAY ALT
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;

function checkFlash(swf, width, height, id) {
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (!hasReqestedVersion) {
		document.write('<div class="photo_flip_alt">' +
					   'This content requires the latest version of Flash.' +
					   '<br />' +
					   '<a href="http://www.adobe.com/shockwave/download/" target="_blank">Click here to download</a>' +
					   '</div>');
	} else {
		renderFlash(swf, width, height, 'wmode="transparent"');
	}
}


// MOUSOVER IMAGES

function PreloadImg(src) {
    var imgPreload = new Image;
    imgPreload.src = src;
}

function swap(img_name, img_src)
   {
		document.getElementById(img_name).src = img_src;   
   }


// RANDOM IMAGES + LINK

function rndImg(num) {
images = new Array(24);
used = new Array(num);

/*if (!isIE6) images[0] = "<a href='images/veranda_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/veranda.png' width='175' height='175' alt='sun-filled veranda' /></a>";
else images[0] = "<a href='images/veranda_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/veranda.png', sizingMethod=scale);\"></a>";*/

if (!isIE6) images[0] = "<a href='images/guest_bedroom3_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/guest_bedroom3.png' width='175' height='175' alt='guest bedroom' /></a>";
else images[0] = "<a href='images/guest_bedroom3_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/guest_bedroom3.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[1] = "<a href='images/pool_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/pool.png' width='175' height='175' alt='the pool &amp; jacuzzi' /></a>";
else images[1] = "<a href='images/pool_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/pool.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[2] = "<a href='images/dock_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/dock.png' width='175' height='175' alt='the canal dock' /></a>";
else images[2] = "<a href='images/dock_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/dock.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[3] = "<a href='images/dining_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/dining.png' width='175' height='175' alt='the dining area' /></a>";
else images[3] = "<a href='images/dining_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/dining.png', sizingMethod=scale);\"></a>";

/*if (!isIE6) images[4] = "<a href='images/bar_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/bar.png' width='175' height='175' alt='the bar' /></a>";
else images[4] = "<a href='images/bar_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bar.png', sizingMethod=scale);\"></a>";*/

if (!isIE6) images[4] = "<a href='images/outside_patio2_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/outside_patio2.png' width='175' height='175' alt='outside patio' /></a>";
else images[4] = "<a href='images/outside_patio2_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/outside_patio2.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[5] = "<a href='images/master_bedroom_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/master_bedroom.png' width='175' height='175' alt='master bedroom' /></a>";
else images[5] = "<a href='images/master_bedroom_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/pool.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[6] = "<a href='images/dock_chairs_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/dock_chairs.png' width='175' height='175' alt='dock chairs' /></a>";
else images[6] = "<a href='images/dock_chairs_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/dock_chairs.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[7] = "<a href='images/grill_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/grill.png' width='175' height='175' alt='the grill' /></a>";
else images[7] = "<a href='images/grill_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/grill.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[8] = "<a href='images/bath_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/bath.png' width='175' height='175' alt='bathroom' /></a>";
else images[8] = "<a href='images/bath_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bath.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[9] = "<a href='images/outside_patio_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/outside_patio.png' width='175' height='175' alt='outside patio' /></a>";
else images[9] = "<a href='images/outside_patio_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/outside_patio.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[10] = "<a href='images/living_room_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/living_room.png' width='175' height='175' alt='living room' /></a>";
else images[10] = "<a href='images/living_room_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/living_room.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[11] = "<a href='images/outside_stairs_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/outside_stairs.png' width='175' height='175' alt='outside stairs' /></a>";
else images[11] = "<a href='images/outside_stairs_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/outside_stairs.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[12] = "<a href='images/guest_bedroom_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/guest_bedroom.png' width='175' height='175' alt='guest bedroom' /></a>";
else images[12] = "<a href='images/guest_bedroom_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/guest_bedroom.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[13] = "<a href='images/koi_pond_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/koi_pond.png' width='175' height='175' alt='koi pond' /></a>";
else images[13] = "<a href='images/koi_pond_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/koi_pond.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[14] = "<a href='images/guest_bedroom2_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/guest_bedroom2.png' width='175' height='175' alt='guest bedroom' /></a>";
else images[14] = "<a href='images/guest_bedroom2_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/guest_bedroom2.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[15] = "<a href='images/kitchen_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/kitchen.png' width='175' height='175' alt='kitchen' /></a>";
else images[15] = "<a href='images/kitchen_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/kitchen.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[16] = "<a href='images/untitled1.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/untitled1.png' width='175' height='175' alt='untitled' /></a>";
else images[16] = "<a href='images/untitled1.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/untitled1.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[17] = "<a href='images/untitled2.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/untitled2.png' width='175' height='175' alt='untitled' /></a>";
else images[17] = "<a href='images/untitled2.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/untitled2.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[18] = "<a href='images/untitled3.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/untitled3.png' width='175' height='175' alt='untitled' /></a>";
else images[18] = "<a href='images/untitled3.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/untitled3.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[19] = "<a href='images/untitled4.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/untitled4.png' width='175' height='175' alt='untitled' /></a>";
else images[19] = "<a href='images/untitled4.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/untitled4.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[20] = "<a href='images/dining_room_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/dining_room.png' width='175' height='175' alt='dining room' /></a>";
else images[20] = "<a href='images/dining_room_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/dining_room.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[21] = "<a href='images/porch_view_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/porch_view.png' width='175' height='175' alt='porch view' /></a>";
else images[21] = "<a href='images/porch_view_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/porch_view.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[22] = "<a href='images/jacuzzi_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/jacuzzi.png' width='175' height='175' alt='jacuzzi' /></a>";
else images[22] = "<a href='images/jacuzzi_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/jacuzzi.png', sizingMethod=scale);\"></a>";

if (!isIE6) images[23] = "<a href='images/porch_view2_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='images/porch_view2.png' width='175' height='175' alt='porch view' /></a>";
else images[23] = "<a href='images/porch_view2_lg.jpg' rel=\"lightbox[]\" title=\"\"><img src='spacer.png' style=\"width: 175px; height: 175px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/porch_view2.png', sizingMethod=scale);\"></a>";

i=0;
img=0;
while (img!=num) {
	usedimg = false;
index = Math.floor(Math.random() * images.length);
	p=0;
	while (p<used.length) {
		if (used[p] == index) {
			usedimg = true;
		}
		p++;
	}
	if (usedimg!=true) {
document.write(images[index]);
used[i] = index;
img++;
	}
i++;
}
}




function submitForm(id) {
	document.getElementById(id).submit();
	return false;
}
