function rollover(img)
{
	document.images[img].src = "images/nav_" + img + "_over.gif";
}
function rollout(img)
{
	document.images[img].src = "images/nav_" + img + ".gif";
}
i1 = new Image(); i1.src = "images/nav_home_over.gif";
i2 = new Image(); i2.src = "images/nav_aboutus_over.gif";
i3 = new Image(); i3.src = "images/nav_ourphilosophy_over.gif";
i4 = new Image(); i4.src = "images/nav_ourestates_over.gif";
i5 = new Image(); i5.src = "images/nav_topurchase_over.gif";
i6 = new Image(); i6.src = "images/nav_tosell_over.gif";
i7 = new Image(); i7.src = "images/nav_findus_over.gif";
i8 = new Image(); i8.src = "images/nav_contactus_over.gif";

function openTerms()
{
	newwin = window.open("terms.html","terms","width=405,height=400,scrollbars=yes,resizable=no");
}

function openPrivacy()
{
	newwin = window.open("privacy.html","privacy","width=405,height=400,scrollbars=yes,resizable=no");
}
function openMap()
{
	newwin = window.open("map.html","map","width=611,height=626,scrollbars=no,resizable=no");
}
function openEnquiryForm(url)
{
	newwin = window.open(url,"enquiry","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=540,height=450,left =100,top=100");
}

// FLASH DETECTION
var isDOM = (document.getElementById) ? true : false;
var isIE = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isNetscape = (!isOpera && (navigator.appName.indexOf("Netscape") != -1 && navigator.userAgent.indexOf("4.") != -1)) ? true : false;
var isMac = (navigator.userAgent.indexOf("Mac") != -1) ? true : false;

var bUsedHTML = ((isDOM || isIE || isNetscape) && !isMac) ? true : false
var iLatestFlashVersion = 6;
var iMinimumFlashVersion = 5;
var iFlashVersion = -1;

// Variable must be global for VBScript to work correctly.
var thisFlashVersion;
function flash_getIEVersion() {

	var thisMaxVersion = false;
	for(var currentVersion=iMinimumFlashVersion; currentVersion<=iLatestFlashVersion; currentVersion++) {
		document.write('<SCR'+'IPT LANGUAGE="VBScript">\n');
		document.write('on error resume next\n');
		document.write('thisFlashVersion = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+currentVersion+'")))\n');
		document.write('</SCR'+'IPT>\n');

		if(thisFlashVersion) {
			thisMaxVersion = currentVersion;
		}
	}
	return thisMaxVersion;
}

function flash_setVersion() {
	if (navigator.plugins.length > 0) {
		// Plugin detect, no VBScript support
		navigator.plugins.refresh(false);
		numPlugins = navigator.plugins.length;
		for(var i=0; i<numPlugins; i++)	{
			plugDesc = navigator.plugins[i].description;
			iFlashVersion = (plugDesc.indexOf("Flash") != -1) ? parseInt(plugDesc.charAt(parseInt(plugDesc.indexOf("Flash"))+6)) : 0;
			if(iFlashVersion > 0) {
				return;
			}
		}
	} else if(!isMac && (isIE || isOpera)) {
		// No plugin detect, VBScript support
		iFlashVersion = flash_getIEVersion();
	} else {
		// No plugin detect, no VBScript support
		iFlashVersion = iLatestFlashVersion;
	}
}

// Set Flash Version
flash_setVersion();

function printFlash(flashSRC, imageSRC, width, height)
{
	var pntStr;
	if(iFlashVersion >= iMinimumFlashVersion)
	{
		pntStr = "<object width=" + width + " height=" + height + " VIEWASTEXT>";
		pntStr += "<param name='movie' value='" + flashSRC + "'>";
		pntStr += "<param name='quality' value='high'>";
		pntStr += "<param name='wmode' value='transparent' />";
		pntStr += "<embed src='" + flashSRC + "' quality='high' wmode='transparent' ";
		pntStr += "type='application/x-shockwave-flash' width=" + width + " height=" + height + ">";
		pntStr += "</embed></object>";
	}
	else
	{
		pntStr = "<img src='" + imageSRC + "' width=" + width + " height=" + height + " alt='' border=0>";
	}
	document.write(pntStr);
}
