function popRoom(docsrc) {

var docwidth = 350, docheight = 350, docleft = ((screen.width/2) - 250), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Room', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popDisclaimer(docsrc) {

var docwidth = 350, docheight = 350, docleft = ((screen.width/2) - 150), doctop = ((screen.height/2) - 150);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Enrichment', 'toolbars=no,scrollbars=no,location=no,statusbars=no,menubars=no,resizable=yes,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popFriend(docsrc) {

var docwidth = 500, docheight = 450, docleft = ((screen.width/2) - 250), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Friend', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popShortList(docsrc) {

var docwidth = 400, docheight = 350, docleft = ((screen.width/2) - 200), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'ShortList', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popGallery(docsrc) {

var docwidth = 450, docheight = 450, docleft = ((screen.width/2) - 225), doctop = ((screen.height/2) - 225);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'ShortList', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popOnShow(docsrc) {

var docwidth = 450, docheight = 350, docleft = ((screen.width/2) - 250), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Enrichment', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popDirections(docsrc) {

var docwidth = 500, docheight = 400, docleft = ((screen.width/2) - 250), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Enrichment', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popVTour(docsrc) {

var docwidth = 395, docheight = 260, docleft = ((screen.width/2) - 200), doctop = ((screen.height/2) - 130);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Enrichment', 'toolbars=no,scrollbars=no,location=no,statusbars=no,menubars=no,resizable=yes,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popPassword(docsrc) {

var docwidth = 400, docheight = 350, docleft = ((screen.width/2) - 200), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Password', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popMailList(docsrc) {

var docwidth = 350, docheight = 250, docleft = ((screen.width/2) - 250), doctop = ((screen.height/2) - 200);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'MailList', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}

function popBrochure(docsrc) {

var docwidth = 650, docheight = 450, docleft = ((screen.width/2) - 300), doctop = ((screen.height/2) - 300);
	if (window.winR && window.winR.open && !window.winR.closed){
		winR.focus();
	}
	else
	{
	winR = window.open(docsrc, 'Brochure', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popMap(docsrc) {

var docwidth = 650, docheight = 450, docleft = ((screen.width/2) - 325), doctop = ((screen.height/2) - 225);
	{
	win = window.open(docsrc, 'Map', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=yes,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function popStaff(docsrc) {
	window.open(docsrc, 'Popup', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=400,height=550,left=362,top=100');
}

function sugPop(docsrc) {

var docwidth = 400, docheight = 350, docleft = ((screen.width/2) - 150), doctop = ((screen.width/2) - 250);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Popup', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}

 // RightClickMenu

function showmenuie5(){
		var rightedge=document.body.clientWidth-event.clientX
		var bottomedge=document.body.clientHeight-event.clientY
		if (rightedge<ie5menu.offsetWidth)
			ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
		else
			ie5menu.style.left=document.body.scrollLeft+event.clientX
		if (bottomedge<ie5menu.offsetHeight)
			ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight
		else
			ie5menu.style.top=document.body.scrollTop+event.clientY
		ie5menu.style.visibility="visible"
		return false
}
function hidemenuie5(){
		ie5menu.style.visibility="hidden"
}
function highlightie5(){
		if (event.srcElement.className=="menuitems"){
			event.srcElement.style.backgroundColor="highlight"
			event.srcElement.style.color="white"
		}
}
function lowlightie5(){
		if (event.srcElement.className=="menuitems"){
			event.srcElement.style.backgroundColor=""
			event.srcElement.style.color="black"
		}
} 
function jumptoie5(){
		if (event.srcElement.className=="menuitems"){
			if (event.srcElement.url != ''){
				if (event.srcElement.getAttribute("target")!=null)
					window.open(event.srcElement.url,event.srcElement.getAttribute("target"))
				else
					window.location=event.srcElement.url
			}
		}
}
function PopUpload(docsrc) {

var docwidth = 400, docheight = 350, docleft = ((screen.width/2) - 150), doctop = ((screen.width/2) - 250);
	if (window.win && window.win.open && !window.win.closed){
		win.focus();
	}
	else
	{
	win = window.open(docsrc, 'Popup', 'toolbars=no,scrollbars=yes,location=no,statusbars=no,menubars=no,resizable=no,width=' + docwidth + ',height=' + docheight + ',left=' + docleft + ',top=' + doctop);
	}
}
function WA_ClientSideReplace(theval,findvar,repvar)     {
  var retval = "";
  while (theval.indexOf(findvar) >= 0)    {
    retval += theval.substring(0,theval.indexOf(findvar));
    retval += repvar;
    theval = theval.substring(theval.indexOf(findvar) + String(findvar).length);
  }
  if (retval == "" && theval.indexOf(findvar) < 0)    {
    retval = theval;
  }
  return retval;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function WA_UnloadList(thelist,leavevals,bottomnum)    {
  while (thelist.options.length > leavevals+bottomnum)     {
    if (thelist.options[leavevals])     {
      thelist.options[leavevals] = null;
    }
  }
  return leavevals;
}

function WA_FilterAndPopulateSubList(thearray,sourceselect,targetselect,leaveval,bottomleave,usesource,delimiter)     {
  if (bottomleave > 0)     {
    leaveArray = new Array(bottomleave);
    if (targetselect.options.length >= bottomleave)     {
      for (var m=0; m<bottomleave; m++)     {
        leavetext = targetselect.options[(targetselect.options.length - bottomleave + m)].text;
        leavevalue  = targetselect.options[(targetselect.options.length - bottomleave + m)].value;
        leaveArray[m] = new Array(leavevalue,leavetext);
      }
    }
    else     {
      for (var m=0; m<bottomleave; m++)     {
        leavetext = "";
        leavevalue  = "";
        leaveArray[m] = new Array(leavevalue,leavetext);
      }
    }
  }  
  startid = WA_UnloadList(targetselect,leaveval,0);
  mainids = new Array();
  if (usesource)    maintext = new Array();
  for (var j=0; j<sourceselect.options.length; j++)     {
    if (sourceselect.options[j].selected)     {
      mainids[mainids.length] = sourceselect.options[j].value;
      if (usesource)     maintext[maintext.length] = sourceselect.options[j].text + delimiter;
    }
  }
  for (var i=0; i<thearray.length; i++)     {
    goodid = false;
    for (var h=0; h<mainids.length; h++)     {
      if (thearray[i][0] == mainids[h])     {
        goodid = true;
        break;
      }
    }
    if (goodid)     {
      theBox = targetselect;
      theLength = parseInt(theBox.options.length);
      theServices = thearray[i].length + startid;
      var l=1;
      for (var k=startid; k<theServices; k++)     {
        if (l == thearray[i].length)     break;
        theBox.options[k] = new Option();
        theBox.options[k].value = thearray[i][l][0];
        if (usesource)     theBox.options[k].text = maintext[h] + WA_ClientSideReplace(thearray[i][l][1],"|WA|","'");
        else               theBox.options[k].text = WA_ClientSideReplace(thearray[i][l][1],"|WA|","'");
        l++;
      }
      startid = k;
    }
  }
  if (bottomleave > 0)     {
    for (var n=0; n<leaveArray.length; n++)     {
      targetselect.options[startid+n] = new Option();
      targetselect.options[startid+n].value = leaveArray[n][0];
      targetselect.options[startid+n].text  = leaveArray[n][1];
    }
  }
  for (var l=0; l < targetselect.options.length; l++)    {
    targetselect.options[l].selected = false;
  }
  if (targetselect.options.length > 0)     {
    targetselect.options[0].selected = true;
  }
}
function validate1() {
if (document.side_menu.area.value == 0)
	window.alert("Please select an area.");
else
	document.side_menu.submit();
}
function validate2() {
if (document.side_menu.suburb.value == 0)
	window.alert("Please select a suburb.");
else
	document.side_menu.submit();
}
