$(document).ready(function() {
			$("#loginDiv").css("display","block");
			$("#loginDiv").toggle(); 
			$("a.member_login").toggle(function(){
   				$("#utilities #member_login").css("background","transparent url(../images/utilities-link-open-left.gif) no-repeat left top");
   				$("#utilities #member_login a").css("background","transparent url(../images/utilities-link-open-right.gif) no-repeat right top");   				
			 },function(){
				$("#utilities #member_login").css("background","transparent url(../images/utilities-link-bg-left.gif) no-repeat left top");
   				$("#utilities #member_login a").css("background","transparent url(../images/utilities-link-bg-right.gif) no-repeat right top");   				
		 });
		  	
		$('a[@href^=http]').not('[@href*=midcoastmaine.com]').addClass("popupwindow");
});

$(function(){
   		$(".popupwindow").popupwindow();
   	});
   	
   	
//menu for IE	 
function startlist(){
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("menu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

ieHover = function() {
	var ieLIs = document.getElementById('menu').getElementsByTagName('li');
	for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
		ieLIs[i].onmouseover=function() {
			var ieUL = this.getElementsByTagName('ul')[0];
			if (ieUL) {
				var ieMat = document.createElement('iframe');
				ieMat.style.width=ieUL.offsetWidth+"px";
				ieMat.style.height=ieUL.offsetHeight+"px";	
				ieUL.insertBefore(ieMat,ieUL.firstChild);
				ieUL.style.zIndex="99";
				}
			
			this.className+=" iehover";
			}
		ieLIs[i].onmouseout=function() {
		var ieUL = this.getElementsByTagName('ul')[0];
		if (ieUL) { }  //ieUL.removeChild(ieUL.firstChild); }			
			this.className=this.className.replace(' iehover', '');
			}
		}
	}


 /****************************************************
     Author: Eric King
     Url: <a href="http://redrival.com/eak/index.shtml">http://redrival.com/eak/index.shtml</a>
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (<a href="http://www.dynamicdrive.com">http://www.dynamicdrive.com</a>)
 ****************************************************/
 var win=null;
 function NewWindow(mypage,myname,w,h,scroll,pos){
 if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
 if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
 else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
 settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
 win=window.open(mypage,myname,settings);}

 // swfir parameters - back pages
 function swfirIt() {
	sir = new swfir();
	sir.specify("shadow-blur", "6");
	sir.specify('rotate', '0');
	sir.specify("border-width", "6");
	sir.specify("border-color", "fff");
	sir.specify('shadow-color', '999');
	sir.specify('src', '/swfir/swfir.swf');
	sir.swap("img.swfir_img");
	}

function init() {
if (window.attachEvent) window.attachEvent('onload', ieHover);
swfirIt();
}
window.onload = init;