function displayflash(src, w, h) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+w+'" height="'+h+'"><param name="movie" value="interfloors/'+src+'"><param name="quality" value="high"><param name="bgcolor" value="#a1895b"><embed src="interfloors/'+src+'" quality="high" bgcolor="#a1895b" width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
}
function updatesuburbs(frm) {
	var x,y,src=frm['updatedetails[state]'],dst=frm['updatedetails[suburb]'];
	var sel = dst.options[dst.selectedIndex].value, n;
	for (x = dst.options.length - 1; x >= 0; x --) {
		dst.options[x] = null;
	}
	for (x = 0; x < suburbstates.length; x ++) {
		if (suburbstates[x] == src.options[src.selectedIndex].value) {
			break;
		}
	}
	if (x == suburbstates.length) {
		return;
	}
	for (y = 0; y < suburbids[x].length; y ++) {
		n = new Option(suburbnames[x][y], suburbids[x][y]);
		dst.options[y] = n;
		if (suburbids[x][y] == sel) {
			dst.selectedIndex = y;
		}
	}
}
function initmenu() {
	if (document.getElementById) {
		var obj = this;
		this.levels = new Array();
		this.timer = null;
		this.req = null;

		function showallselects() {
			var sel = document.getElementsByTagName('select');
			var x;
			for (x = 0; x < sel.length; x ++) {
				sel[x].style.visibility = 'visible';
			}
		}
		function hideallselects() {
			var sel = document.getElementsByTagName('select');
			var x;
			for (x = 0; x < sel.length; x ++) {
				sel[x].style.visibility = 'hidden';
			}
		}

		this.hideall = function(level) {
			var x;
			for (x = level; x < this.levels.length; x ++) {
				if (this.levels[x]) {
					this.levels[x].hidepopup();
					this.levels[x] = null;
				}
			}
		}

		function diediedie() {
			obj.hideall(0);
			//showallselects();
		}

		function actualtop(ele) {
			var node = ele;
			var top = 0;
			while (node) {
				top += node.offsetTop;
				node = node.offsetParent;
			}
			return top;
		}
		function actualleft(ele) {
			var node = ele;
			var left = 0;
			while (node) {
				left += node.offsetLeft;
				node = node.offsetParent;
			}
			return left;
		}

		function showpopup() {
			if (obj.levels[this.level] != this) {
				this.popup.style.visibility='visible';
				obj.levels[this.level] = this;
				//if (this.level == 0) {
					//hideallselects();
				//}
			}
		}

		function hidepopup() {
			this.popup.style.visibility='hidden';
		}

		function fixwidths() {
			// fixer for ie
			var fix = 30;
			var start;
			if ((start = navigator.userAgent.indexOf("MSIE")) != -1) {
				fix = Number(navigator.userAgent.substring(start+5,start+6));
				if (fix >= 6) {
					fix = 30;
				} else {
					fix = 0;
				}
			}
			var a = this.popup.getElementsByTagName('a');
			var x;
			var max = 0;
			if (this.sidebar) {
				max = 180;
			}
			for (x = 0; x < a.length; x ++) {
				if (a[x].offsetWidth > max) {
					max = a[x].offsetWidth;
				}
			}
			for (x = 0; x < a.length; x ++) {
				a[x].style.width = (max - fix) + 'px';
			}
		}

		function createpopup(ele) {
			var x, entry;
			ele.showpopup = showpopup;
			ele.fixwidths = fixwidths;
			ele.hidepopup = hidepopup;
			ele.popup = document.createElement('div');
			ele.popup.className='menupopup';
			ele.popup.level = ele.level;
			ele.popup.move = false;
			ele.sidebar = false;
			if (ele.level == 0) {
				var topish = ele.parentNode;
				while (topish.nodeName != 'DIV') { topish = topish.parentNode; }
				if (topish.id == 'footer') {
					ele.popup.style.left = actualleft(ele)+'px';
					var at = actualtop(ele);
					ele.popup.style.top = at+'px';
					ele.popup.move = at;
				} else if (ele.tagName == 'DIV') {
					ele.popup.style.left = (42 + actualleft(ele))+'px';
					ele.popup.style.top = (1 + actualtop(ele))+'px';
					ele.sidebar = true;
				} else {
					ele.popup.style.left = actualleft(ele)+'px';
					ele.popup.style.top = (28 + actualtop(ele))+'px';
				}
			} else {
				ele.popup.style.left = (actualleft(ele) + ele.offsetWidth - 4)+'px';
				ele.popup.style.top = actualtop(ele)+'px';
			}
			for (x = 0; x < ele.tree.length; x += 4) {
				entry = document.createElement('a');
				entry.innerHTML = ele.tree[x];
				if (ele.tree[x+2] == 1) {
					entry.href=(ele.tree[x+1]?ele.tree[x+1]:'#');
					entry.target = '_blank';
				} else if (ele.tree[x+2] == 2) {
					entry.href="#";
					entry.index = x;
					entry.onclick = function() {
						return viewimage(this, ele.tree[this.index + 1], ele.tree[this.index + 1], 0, 0);
					}
				} else {
					entry.href=(ele.tree[x+1]?ele.tree[x+1]:'#');
				}
				entry.tree = ele.tree[x+3];
				entry.level = ele.level + 1;
				entry.onmouseover = over;
				entry.onmouseout = out;
				if (entry.tree) {
					entry.style.backgroundImage = 'url(/interfloors/style/images/more.gif)';
				}
				ele.popup.appendChild(entry);
				if (ele.popup.move) {
					setTimeout(function() {
						var offset = ele.popup.move - ele.popup.offsetHeight;
						ele.popup.style.top = offset+'px';
					}, 100);
				}
			}
			document.body.appendChild(ele.popup);
			setTimeout(function() {
				ele.fixwidths();
				if (obj.req == ele) {
					obj.hideall(ele.level);
					ele.showpopup();
				}
			}, 50);
		}

		function over() {
			obj.req = this;
			if (obj.timer != null) {
				clearTimeout(obj.timer);
			}
			if (obj.levels[this.level] != this) {
				obj.hideall(this.level);
			}
			if (typeof(this.tree) == 'undefined') {
				this.tree = eval(this.getAttribute('submenu'));
				if (typeof(this.tree) == 'object') {
					createpopup(this);
				}
			} else {
				if (typeof(this.tree) == 'object') {
					if (typeof(this.popup) == 'undefined') {
						createpopup(this);
					}
					this.showpopup();
				}
			}
		}

		function out() {
			if (obj.timer != null) {
				clearTimeout(obj.timer);
			}
			obj.timer = setTimeout(diediedie, 700);
		}

		function hookup(a) {
			var x;
			for (x = 0; x < a.length; x ++) {
				a[x].onmouseover = over;
				a[x].onmouseout = out;
				a[x].level = 0;
			}
		}
		
		var menu = document.getElementById('menu');
		var a = menu.getElementsByTagName('a');
		hookup(a);

		menu = document.getElementById('footer');
		a = menu.getElementsByTagName('a');
		hookup(a);

		var x;

		menu = document.getElementById('leftmenu');
		for (x = 0; x < menu.childNodes.length; x ++) {
			if ((menu.childNodes[x].tagName == 'DIV') && (menu.childNodes[x].className == 'leftmenuitem')) {
				menu.childNodes[x].onmouseover = over;
				menu.childNodes[x].onmouseout = out;
				menu.childNodes[x].level = 0;
			}
		}
	}
}
function viewimage(ele, id, cat, cx, cy, detail) {
	if (document.getElementById) {
		var output, outputtext;
		if (ele.className == 'cur') {
			return false;
		}
		if (output = document.getElementById('output')) {
			outputtext = document.getElementById('outputtext');
			outputtext.innerHTML = detail;
			if (detail) {
				outputtext.style.borderWidth='1px';
			} else {
				outputtext.style.borderWidth='0px';
			}
			var p = ele.parentNode.parentNode.getElementsByTagName('a');
			var x;
			for (x = 0; x < p.length; x ++) {
				if (p[x].className == 'cur') {
					p[x].className = '';
					break;
				}
			}
			var img = document.createElement('img');
			img.src=sselfqs+'nb%5Bop%5D=image&nb%5Bsize%5D=3&nb%5Bid%5D='+id;
			img.style.paddingTop = '0px';
			img.style.paddingLeft = '0px';
			output.replaceChild(img, output.childNodes[0]);
			var clip = document.getElementById('clip');
			if (clip) {
				if (cx > 1) {
					clip.style.left = (cx + 29)+'px';
					clip.style.top = (cy + 67)+'px';
					clip.style.width = (500 - cx)+'px';
					clip.style.height = (375 - cy)+'px';
					clip.style.visibility='visible';
				} else {
					clip.style.visibility='hidden';
				}
			}
			ele.className='cur';
		} else {
			window.open('/collection.nb?collection%5Bcat%5D='+cat+'&collection%5Bid%5D='+id, '', 'scrollbars=no,width=812,height=656');
		}
		return false;
	} else {
		return true;
	}
}
function images() {
	this.scroller = document.getElementById('gallery');
	this.scrollee = this.scroller.childNodes[0];
	if (this.scroller.offsetWidth < this.scrollee.offsetWidth) {
		var obj = this;
		function scroll() {
			if (this.id == 'left') {
				obj.scrollee.pos -= 700;
				if (obj.scrollee.pos < 0) {
					obj.scrollee.pos = 0;
				}
			} else if (this.id == 'right') {
				obj.scrollee.pos += 700;
				if (obj.scrollee.pos > obj.scrollee.max) {
					obj.scrollee.pos = obj.scrollee.max;
				}
			}
			obj.move();
			return false;
		}
		this.left = document.getElementById('left');
		this.right = document.getElementById('right');
		this.scrollee.pos = 0;
		this.scrollee.cur = 0;
		this.scrollee.max = this.scrollee.offsetWidth - this.scroller.offsetWidth;
		this.interval = null;
		this.left.onclick = scroll;
		this.right.onclick = scroll;
	}
}
images.prototype.move = function() {
	if (this.scrollee.pos != this.scrollee.cur) {
		if (this.interval == null) {
			var obj = this;
			this.interval = setInterval(function() {
				var delta = Math.ceil((obj.scrollee.pos - obj.scrollee.cur) / 2);
				obj.scrollee.cur += delta;
				obj.scrollee.style.left = (0 - obj.scrollee.cur) + 'px';
				if (Math.abs(delta) <= 0) {
					clearInterval(obj.interval);
					obj.interval = null;
				}
			}, 40);
		}
	}
}
function selectminmax(ele) {
	var outer = document.getElementById('preview');
	var inner = document.getElementById('product');
	var id = ele.options[ele.selectedIndex].value;
	var x,iid='',cx='',cy='',st=0;
	for (x = 0; x < id.length; x ++) {
		if (id.substr(x,1) == ',') {
			st ++;
		} else {
			switch(st) {
				case 0: iid += id.substr(x,1); break;
				case 1: cx += id.substr(x,1); break;
				case 2: cy += id.substr(x,1); break;
			}
		}
	}
	iid = Number(iid);
	cx = Number(cx);
	cy = Number(cy);
	if ((cx > 1) || (cy > 1)) {
		//cx = Math.floor(cx * 90 / 500);
		//cy = Math.floor(cy * 67 / 375);
		cx = Math.floor(cx * 280 / 500);
		cy = Math.floor(cy * 210 / 375);
		outer.style.backgroundImage = 'url('+sselfqs+'nb%5Bop%5D=image&nb%5Bid%5D='+iid+'&nb%5Bsize%5D=4)';
		inner.style.top = cy + 'px';
		inner.style.left = cx + 'px';
		inner.style.backgroundPosition = '-'+cx+'px -'+cy+'px';
	} else {
		inner.style.backgroundImage = 'url('+sselfqs+'nb%5Bop%5D=image&nb%5Bid%5D='+iid+'&nb%5Bsize%5D=4)';
	}
}
function updateminmax(ele,dst) {
	var x, search, y, noption;
	for (x = dst.options.length - 1; x >= 0; x --) {
		dst.options[x] = null;
	}
	search = ele.options[ele.selectedIndex].value;
	for (x = 0; x < dump.length; x += 2) {
		if (dump[x] == search) {
			x ++;
			for (y = 0; y < dump[x].length; y ++) {
				var noption = new Option(dump[x][y][1],dump[x][y][0]);
				dst.options[y] = noption;
			}
			dst.selectedIndex = 0;
			selectminmax(dst);
			break;
		}
	}
}
function showfull() {
	var one,two,frm,x;
	frm = document.forms[0];
	one = frm.choice14.options[frm.choice14.selectedIndex].value;
	two = frm.choice15.options[frm.choice15.selectedIndex].value;
	for (x = 0; x < one.length; x ++) {
		if (one.substr(x,1) == ',') {
			one = one.substr(0,x);
			break;
		}
	}
	for (x = 0; x < two.length; x ++) {
		if (two.substr(x,1) == ',') {
			two = two.substr(0,x);
			break;
		}
	}
	window.open(sselfqs+'display='+one+','+two, 'full', 'scrollbars=no,width=800,height=570');
}

