//for front page
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

//detects window inner resolution

function findLiveHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
	return myHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
	return myHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
	return myHeight;
  }
  return (null);
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function LayerUp(topL){
	var counter=lowest;
	while (counter<highest) {
	var layerNum = eval(counter+1);
	document.getElementById('project_'+layerNum).style.zIndex=layerNum;
	counter++;
	}
	eval("document.getElementById(topL)").style.zIndex = 50;
}

function ProfileUp(topL){
	var counter=lowest;
	while (counter<highest) {
	var layerNum = eval(counter+1);
	document.getElementById('profile_'+layerNum).style.zIndex=layerNum;
	counter++;
	}
	eval("document.getElementById(topL)").style.zIndex = 50;
}


function displayhide(layerID){
  if(document.getElementById)
    layerObj = document.getElementById(layerID);
  else if(document.all)
    layerObj = document.all[layerID];
  else
    layerObj = null;
  if(layerObj)
  {
    display = layerObj.style.display;
    layerObj.style.display = (!display || display == 'block') ?
'none' : 'block';
  }
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//for cutenews popups
function showPic(picname,popwid,pophei)
{
if (!popwid || !pophei) {
popwid = 560;
pophei = 500;
}
window.open('http://www.dimasearchitects.com.au/news2/popup_images.php?show=' + picname,'picture','width=' + popwid + ',height=' + pophei + ',resizable=yes,scrollbars=yes');
}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


