// JavaScript Document
var minH = 450;
var f;

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function populateNav(){
	var d = document.getElementById("mainNav");
	d.innerHTML = "<a href=\"default.html\"><img src='http://www.rivermark.biz/images/logo.gif' align='absmiddle' /></a>" + 
	"<a href='default.html'><img src='http://www.rivermark.biz/images/navHomeOut.gif' align='absmiddle' id='Image1' onMouseOver=\"MM_swapImage('Image1','','http://www.rivermark.biz/images/navHomeOver.gif',0)\" onMouseOut=\"MM_swapImgRestore()\" /></a>" + 
	"<a href='about_us.html'><img src='http://www.rivermark.biz/images/navAboutUsOut.gif' alt='About Us' align='absmiddle' id='Image2' onMouseOver=\"MM_swapImage('Image2','','http://www.rivermark.biz/images/navAboutUsOver.gif',0)\" onMouseOut=\"MM_swapImgRestore()\" /></a>" + 
	"<a href='services.html'><img src=\"http://www.rivermark.biz/images/navServicesOut.gif\" alt=\"Services\" align=\"absmiddle\" id=\"Image3\" onMouseOver=\"MM_swapImage('Image3','','http://www.rivermark.biz/images/navServicesOver.gif',0)\" onMouseOut=\"MM_swapImgRestore()\" /></a>" + 
	"<a href=\"applications.html\"><img src=\"http://www.rivermark.biz/images/navApplicationsOut.gif\" alt=\"Applications\" align=\"absmiddle\" id=\"Image4\" onMouseOver=\"MM_swapImage('Image4','','http://www.rivermark.biz/images/navApplicationsOver.gif',0)\" onMouseOut=\"MM_swapImgRestore()\" /></a>" + 
	"<a href=\"contact_us.html\"><img src=\"http://www.rivermark.biz/images/navContactUsOut.gif\" alt=\"Contact Us\" align=\"absmiddle\" id=\"Image5\" onMouseOver=\"MM_swapImage('Image5','','http://www.rivermark.biz/images/navContactUsOver.gif',0)\" onMouseOut=\"MM_swapImgRestore()\" /></a>";
}

function gettSize() {
  var o = new Object();
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
	o.ie=false;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
	o.ie=true;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
	o.ie=true;
  }
  
  o.w = myWidth;
  o.h = myHeight;
  return o;
}

function doResize(){
	var o = gettSize();
	if(o.h>minH) o.h = minH+"px";
	var d = document.getElementById("bgSubPage").style;
	d.height = o.h;
}


window.onload = function(){
	if(document.getElementById("bgSubPage")!=undefined){
		f = document.getElementById("bgSubPage").style;
		f.minHeight = minH;
	
		if(document.all) { // for IE
			document.getElementById("bgSubPage").onresize = doResize;
			doResize();
		}
	}
	populateNav();
}
document.title = "Rivermark";