function loaderStart() {
	//~ alert('di: '+ document.images.length);
	for(i=0; i<document.images.length; i++) {
		//~ new function cacheImage(i);
		cacheImage =  function(i) {
		i_name = 'img_'+i;
		i_name = new Image();
		i_name.src = document.images[i].src;
		mBox = document.getElementById('mload');
		mBox.innerHTML = 'Loading Seabrook image '+ i +'...';
		}
	
	}
}

function cacheImage(num) {
	i_name = 'img_'+num;
	i_name = new Image();
	i_name.src = document.images[num].src;
	mBox = document.getElementById('mload');
	mBox.innerHTML = 'Loading Seabrook image '+ num +'...';
}

function onloadStart() {
	init();
}

checked_img = new Image();
checked_img.src = '../shared/images/mbull_ch.gif';

function CheckOp() {   

                      if (navigator.userAgent.indexOf('Opera') != -1) {

                      return true;        

          }

}

	function check(e)
	{
		//~ if (!e) var e = window.event;
		if(e.keyCode == 13) {
		//document.forms[0].onsubmit = fs;
		event.returnValue=false; 
	    event.cancel = true;
		}

	}
	
	function fs() {	
		return false;
	}

	function ts() {	
		return true;
	}


	function Change(e)
	{
		//~ if (!e) var e = window.event;
//		alert('dfdf');
		//document.forms[0].onsubmit = ts;
		

	}
	


ieHover = function() {

tuls = document.getElementsByTagName('ul');
navs = new Array();
for(i=0; i<tuls.length; i++) {
	if(tuls[i].id == 'nav') {
		navs.push(tuls[i]);
	}
}

for(g = 0; g<navs.length; g++) {
//~ var ieULs = document.getElementById('nav').getElementsByTagName('ul');
var ieULs = navs[g].getElementsByTagName('ul');

	for (j=0; j<ieULs.length; j++) {
		ieULs[j].innerHTML = ('<iframe src="about:blank" scrolling="no" frameborder="0"></iframe>' + ieULs[j].innerHTML);
		var ieMat = ieULs[j].firstChild;
		ieMat.style.width=ieULs[j].offsetWidth+"px";		
		ieMat.style.height=ieULs[j].offsetHeight+"px";	
		ieULs[j].style.zIndex="99";
	}


	//~ var ieLIs = document.getElementById('nav').getElementsByTagName('li');
	var ieLIs = navs[g].getElementsByTagName('li');
	
	for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
		ieLIs[i].onmouseover=function() {this.className+=" iehover";}
		ieLIs[i].onmouseout=function() {this.className=this.className.replace(' iehover', '');}
	}
	
}	
}

function mstart() {	
	if (document.all && !CheckOp()) {
	ieHover();
	}
}

function chBullet(ob,a,i) {

	arreas = new Array();
	arreas = ['golfcourse','ocean','riverocean','march','lakes','tennisclub'];
//	lb = document.getElementById('ucWrap_ctSelectorWrap_lbHiden');
//	imgCh = document.getElementById('ic'+i);
	inpCh = document.getElementById('ucWrap_ctSelectorWrap_' + a);
	ashow = document.getElementById(arreas[i]);	
	if(inpCh.checked == true) {
		//imgCh.src = '../shared/images/mbull_ch.gif';
		//lb.value = a;		
		ashow.style.visibility = 'visible';
	} else {
		//imgCh.src = '../shared/images/mbull.gif';
		//inpCh.value = 0;
		ashow.style.visibility = 'hidden';
	}
}

function chBulletWrap(ob,num,a) {
	imgCh = document.getElementById('ic'+num);
	inpCh = document.getElementById('ucWrap_rpBoxesWrap_ctl0' + a + '_'+num);
	if(imgCh.src.indexOf('mbull.gif') > 1) 
	{
		imgCh.src = '../shared/images/mbull_ch.gif';
		inpCh.checked = true;
	} else {
		imgCh.src = '../shared/images/mbull.gif';
		inpCh.checked = false;
	}
}

function setBullets(a,num) {

/*		inpCh = document.getElementById('ucWrap_rpBoxes_ctl0' + a + '_'+num);		
		imgCh = document.getElementById('ic'+num);
		if(inpCh.checked == true) {		
			imgCh.src = '../shared/images/mbull_ch.gif';
		}
*/
}
function HideTables(id1, id2)
{
	document.getElementById(id1).style.display = 'none';
	document.getElementById(id2).style.display = 'block';
}

function HideTable(id1)
{
	document.getElementById(id1).style.display = 'none';
}

function changeImage(src) {
	imgCh = document.getElementById('imPlan');
	imgCh.src = src;
	
}

function threeColumn() {
	if(document.getElementById('threecol')) {
		var elm = document.getElementById('threecol');	
		elm.style.height = 'auto';
		var x = elm.offsetHeight;
		elm.style.height = x + "px";		
	}
	if(document.getElementById('textcol')) {
		var t_elm = document.getElementById('textcol');
		t_elm.style.height = x - 156 + "px";
	}
	if(document.getElementById('ucWrap_textcol')) {
		var t_elm = document.getElementById('ucWrap_textcol');
		if(document.getElementById('ucWrap_imMainDetails2')) {
			blank_image = document.getElementById('ucWrap_imMainDetails2');			
			if(document.all) {
				t_elm.style.height = x - blank_image.height + "px";		
			}
			else {
				t_elm.style.height = x - 20 - blank_image.height + "px";
			}
		} else if(document.all) {
					t_elm.style.height = x + "px";		
				} else {
					t_elm.style.height = x - 20 + "px";
				}
	}
	
}

function mover(obj) {		
	if(obj.className == 'encl') {
	el = obj.parentNode.parentNode.parentNode.firstChild;
	el.style.backgroundColor = '#93A445';
	el.className = 'bhead';
	}
}

function mout(obj) {		
	if(obj.className == 'encl') {
	el = obj.parentNode.parentNode.parentNode.firstChild;
	if(!el.id) {
	el.style.backgroundColor = '#B0B67A';	
	el.onmouseover = function() { this.style.backgroundColor = '#93A445'; }
	el.onmouseout = function() { this.style.backgroundColor = '#B0B67A'; }
	}
	}
}

function showAnsw(el) {
	el = el.parentNode;	
	while(el.className !== 'answer') {
		el = el.nextSibling;
	}
	if(el.style.display == 'block') {
		el.style.display = '';		
	}
		else {
			el.style.display = 'block';			
		}
		threeColumn();
}


// open window

function getScreen() {
    this.height = screen.height;
    this.width = screen.width;
    this.center = screen.availWidth/2;
    this.middle = screen.availHeight/2;
}

function zoom_win(theURL, w, h) {
sc = new getScreen();
if (document.layers) {
  window.open(theURL,'');
	   } else {

	features ='width='+w+',height='+h+',left='+(sc.center-(w/2))+',top='+(sc.middle-(h/2));
  msgWindow=window.open("","",features);
  msgWindow.document.write('<html style="height:auto"><HEAD><TITLE>Seabrook</TITLE>');
  msgWindow.document.write('</HEAD><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border:none">');
  msgWindow.document.write('<img style="margin:11px 0 0 11px" src="'+theURL+'" />'); 
  msgWindow.document.write('</body></html>');
  }

  if(window.focus) {
     msgWindow.window.focus();
  }
}


function showEv1(evId) {
	el = document.getElementById(evId);
	if(el.style.display == 'block') {
		el.style.display = 'none';
	} else {
	el.style.display = 'block';
	}
}

function showEv(evId) {	
	
	eltabs = evId.parentNode.parentNode.parentNode.getElementsByTagName('div');
	el = evId.parentNode.parentNode.nextSibling;
	var thisEvStyle;
	var thisEv;
	
	while(el.tagName !== 'TR') {
		el = el.nextSibling;
	}
	
	for(j=0; j<el.childNodes.length; j++) {
		if(el.childNodes[j].tagName == 'TD') {
			el = el.childNodes[j];	
			thisEv = el.getElementsByTagName('div')[0];	
			thisEvStyle = thisEv.style.display;
		}			
	}
					
	for(i=0; i<eltabs.length; i++) {
		eltabs[i].style.display = 'none';
	}

	if(thisEvStyle == 'none' || thisEvStyle == '') {
		thisEv.style.display = 'block';		
	}	else {
		thisEv.style.display = 'none';		
	}

}
function contact_win(theURL, w, h) {
	
	sc = new getScreen();

	features ='width='+w+',height='+h+',left='+(sc.center-(w/2))+',top='+(sc.middle-(h/2));
	ctWindow=window.open(theURL,"ctw",features);
	
	if(window.focus) {
		ctWindow.window.focus();
	}
	
}

function privacy_win(theURL, w, h) {
	
	sc = new getScreen();

	features ='width='+w+',height='+h+',left='+(sc.center-(w/2))+',top='+(sc.middle-(h/2))+',scrollbars=yes';
	ctWindow=window.open(theURL,"ctw",features);
	
	if(window.focus) {
		ctWindow.window.focus();
	}
	
}

function print_win(theURL, w, h) {
	
	sc = new getScreen();

	features ='scrollbars=yes,width='+w+',height='+h+',left='+(sc.center-(w/2))+',top='+(sc.middle-(h/2));
	ctWindow=window.open(theURL,"ctw",features);
	
	if(window.focus) {
		ctWindow.window.focus();
	}
	
}

