// JavaScript Document
var frame = 0;

function getWindowHeight (type) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  if (type == 'height') { 
  	return myHeight;
  } else {
	return myWidth;
	}
}

function initAlphaTable () {
	var bWidth = getWindowHeight('width');
	var bHeight = getWindowHeight('height') - 2;
	var alphaTable = document.getElementById('alphaTable');
	
	alphaTable.style.height = bHeight + 'px';
	
}

function initDropDown (priSelectLayer,subSelectLayer,availSubNav) {
	var bWidth = getWindowHeight('width');
	var bHeight = getWindowHeight('height');
	var priSelobj = document.getElementById(priSelectLayer);
	var subSelobj = document.getElementById(subSelectLayer);
	var ddPlacement = bWidth / 2;
	var ddPlacement = ddPlacement + 110;
	
	priSelobj.style.display = 'block';
	priSelobj.style.left = ddPlacement + 'px';
	priSelobj.style.top = '25px';
	
	subSelobj.style.display = 'block';
	subSelobj.style.left = ddPlacement + 'px';
	subSelobj.style.top = '50px';
	if (availSubNav) { subSelobj.style.backgroundColor = 'yellow'; }
	
	
}

function setIframeHeight (frameID) {
	var frmObj = document.getElementById(frameID);
	var bHeight = getWindowHeight('height') - 167;
	
	frmObj.style.height = bHeight + 'px';
}

function loc (loc,frame) {
	if (frame == 1) {
		window.mainFrame.location = loc;
	} else if (frame == 2) {
		window.open('http://www.mywindermeresouth.com/');
	} else {
		window.location = loc;
	}
}

function initClickWebsite () {
	var thsBwidth = getWindowHeight('width');
	var thsPlacement = thsBwidth - 743;
	thsBwidth = thsPlacement / 2;
	thsBwidth = thsBwidth + 700;
	document.getElementById('thsOfficeWebsite').style.top =  '5px';
	document.getElementById('thsOfficeWebsite').style.left = thsBwidth + 'px';
	document.getElementById('thsOfficeWebsite').style.display = 'block';
}
