if ((navigator.appVersion.indexOf('Mac')!= -1)){ // Mac adjust
	document.write('<link href="mac.css" rel="stylesheet" type="text/css">');
}

function changeImages() {

     if (document.images && (preloadFlag == true)) {

          for (var i=0; i<changeImages.arguments.length; i+=2) {

               document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
          }
     }
}

function newImage(ovrSrc) {

     if (document.images) {
          img = new Image();
          img.src = ovrSrc;
          return img;
     }
}

var preloadFlag = false;

function preloadImages() {

     if (document.images) {
	 	
		prenatalH_o = "images/prenatalH_o.gif";
		motheringH_o = "images/motheringH_o.gif";
		doulaH_o = "images/doulaH_o.gif";
		aboutusH_o = "images/aboutusH_o.gif";
		resourcesH_o = "images/resourcesH_o.gif";
		contactH_o = "images/contactH_o.gif";
		
		prenatal_o = "images/prenatal_o.gif";
		mothering_o = "images/mothering_o.gif";
		doula_o = "images/doula_o.gif";
		aboutus_o = "images/aboutus_o.gif";
		resources_o = "images/resources_o.gif";
		contact_o = "images/contact_o.gif";
	 
		homeB_o = "images/homeB_o.gif";
		prenatalB_o = "images/prenatalB_o.gif";
		motheringB_o = "images/motheringB_o.gif";
		doulaB_o = "images/doulaB_o.gif";
		aboutusB_o = "images/aboutusB_o.gif";
		resourcesB_o = "images/resourcesB_o.gif";
		contactB_o = "images/contactB_o.gif";
								
		preloadFlag = true;
	}
}

var newWindow = null;

function closeWin() {
	if (newWindow != null) {
		if(!newWindow.closed)
			newWindow.close();
	}
}

function newWin(url, type, strWidth, strHeight) {
	
	closeWin();
	
	if (type == "fullScreen") {
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "menu") tools = "resizable=yes,toolbar=no,location=no,menubar=yes,scrollbars=yes,width="+strWidth+",height="+strHeight+",left=0,top=0";
	if (type == "console") tools = "resizable=no,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;


function printArticle() {
	if (window.print) {
		setTimeout('window.print();',200);
	}
	else if (agt.indexOf("mac") != -1) {
		alert("Press 'Cmd+p' on your keyboard to print article.");
	}
	else {
		alert("Press 'Ctrl+p' on your keyboard to print article.")
	}
}



