function winOpen(content, winname) {
	myWindow= window.open(content, winname, 'top=0, left=0, width=700, height=500, scrollbars=yes, toolbar=yes, status=yes, menubar=yes, location=yes, resizable=yes');
}

function winOpenMap(content, winname) {
	myWindow= window.open(content, winname, 'top=0, left=0, width=510, height=550, scrollbars=yes, toolbar=no, status=no, menubar=no, location=no, resizable=yes');
}

function winOpenNews(content, winname) {
	myWindow= window.open(content, winname, 'top=100, left=100, width=600, height=500, scrollbars=yes, toolbar=no, status=no, menubar=no, location=no, resizable=yes');
}

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 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_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];}}
}

/*************************************************************************
  This code is from Dynamic Web Coding at dyn-web.com
  Copyright 2003-5 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// adjust horizontal and vertical offsets here
// (distance from mouseover event which activates tooltip)
Tooltip.offX = -50;  
Tooltip.offY = -85;
Tooltip.followMouse = false;  // must be turned off for hover-tip

// tooltip content variables
var julesepstein = '<span style="color:#160e67;font-weight:bold;">Jules Epstein</span><br>President and CEO<br><a href="people-jules-epstein.php" style="color:#7e7e7e;">more</a>';

var jendemore = '<span style="color:#160e67;font-weight:bold;">Jen Demore</span><br>Web Manager<br><a href="people-jen-demore.php" style="color:#7e7e7e;">more</a>';
var sharynrogers = '<span style="color:#160e67;font-weight:bold;">Sharyn Rogers</span><br>Executive Vice President<br><a href="people-sharyn-rogers.php" style="color:#7e7e7e;">more</a>';
var allisondavis = '<span style="color:#160e67;font-weight:bold;">Allison Davis</span><br>VP, Creative Services<br><a href="people-allison-davis.php" style="color:#7e7e7e;">more</a>';
var christinehardiman = '<span style="color:#160e67;font-weight:bold;">Christine Hardiman</span><br>Projects Director<br><a href="people-christine-hardiman.php" style="color:#7e7e7e;">more</a>';

var elijahgould = '<span style="color:#160e67;font-weight:bold;">Elijah Gould</span><br>Advertising Design Assistant';
var chrissamari = '<span style="color:#160e67;font-weight:bold;">Chris Simari</span><br>Interactive Designer/Developer';
var cathymarchese = '<span style="color:#160e67;font-weight:bold;">Cathy Marchese</span><br>Interactive Design Assistant';
var mikeamaru = '<span style="color:#160e67;font-weight:bold;">Mike Amaru</span><br>Graphic Designer';
var stephaniebyers = '<span style="color:#160e67;font-weight:bold;">Stephanie Byers</span><br>Graphic Designer';
var michellecampbell = '<span style="color:#160e67;font-weight:bold;">Michelle Campbell</span><br>Office Manager';
var ginadishman = '<span style="color:#160e67;font-weight:bold;">Gina Dishman</span><br>Media Planner/Buyer';
var lizfedorzyn = '<span style="color:#160e67;font-weight:bold;">Liz Fedorzyn</span><br>Sr. Art Director';
var camillemaren = '<span style="color:#160e67;font-weight:bold;">Camille Maren</span><br>Production Assistant';
var victoriafiorini = '<span style="color:#160e67;font-weight:bold;">Victoria Fiorini</span><br>Web Designer';
var lynnerempelakis = '<span style="color:#160e67;font-weight:bold;">Lynne Rempelakis</span><br>Production Designer';
var johnschroeder = '<span style="color:#160e67;font-weight:bold;">John Schroeder</span><br>Advertising Manager<br><a href="people-john-schroeder.php" style="color:#7e7e7e;">more</a>';
var davidvadala = '<span style="color:#160e67;font-weight:bold;">David Vadala</span><br>Sr. Graphic Designer';
var nataliehill = '<span style="color:#160e67;font-weight:bold;">Natalie Hill</span><br>Advertising/Media Assistant';

function doTooltip(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.clearTimer();
  var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
  if ( tip && tip.onmouseout == null ) {
      tip.onmouseout = Tooltip.tipOutCheck;
      tip.onmouseover = Tooltip.clearTimer;
  }
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.timerId = setTimeout("Tooltip.hide()", 300);
}

Tooltip.tipOutCheck = function(e) {
  e = dw_event.DOMit(e);
  // is element moused into contained by tooltip?
  var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
  if ( this != toEl && !contained(toEl, this) ) Tooltip.hide();
}

// returns true of oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}

Tooltip.timerId = 0;
Tooltip.clearTimer = function() {
  if (Tooltip.timerId) { clearTimeout(Tooltip.timerId); Tooltip.timerId = 0; }
}

Tooltip.unHookHover = function () {
    var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
    if (tip) {
        tip.onmouseover = null; 
        tip.onmouseout = null;
        tip = null;
    }
}

dw_event.add(window, "unload", Tooltip.unHookHover, true);

function openCenteredWindow(awidth,aheight,aleft,atop,thewidth,theheight) {
 var myWindow;
    var left = parseInt((awidth/2) + 140 + aleft - (thewidth/2));
    var top = parseInt((aheight/2) + 20 + atop - (theheight/2));
    var windowFeatures = "width=" + thewidth + ",height=" + theheight + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open("bluehills_sky.html", "adWindow", windowFeatures);
}

function StartPopin()
{
	setTimeout('TogglePopin(thead)', 0);
}

function TogglePopin(thead,thewidth,theheight)
{
	var Toggle = !(document.getElementById('popIn').style.visibility == 'visible');
	document.getElementById('popIn').style.visibility = (Toggle ? 'visible' : 'hidden');
	
    document.getElementById("popIn").innerHTML='<div id="flashmovie"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+thewidth+'" height="'+theheight+'" id="currentad" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="images/portfolio-ads/'+thead+'.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="images/portfolio-ads/'+thead+'.swf" quality="high" bgcolor="#ffffff" width="'+thewidth+'" height="'+theheight+'" name="currentad" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div><div id="flashclose"><a href="javascript:TogglePopin(&quot;'+thead+'&quot;,'+thewidth+','+theheight+')"><img src="images/flashclose.gif" alt="Close Ad" name="closeWindow" width="63" height="20" border="0" id="closeWindow" /></a></div>'

}

