// global.js for discoverquincy.com
// site-wide functionality
// code by Chris Nott (cnott@NOSPAM.blastradius.com)

/**********************************************************************
   Popups and New Windows
 *********************************************************************/

// openExternalLink(url) - use to open all off-site links
// ie: <a href="http://url.here" onclick="openExternalLink(this.href); return false;">
// requires window.js
function openExternalLink(url) {
   return openSizedFullChromeWindow(url, 'external', getInnerWidth(window)-100, getInnerHeight(window)-100);
}


/**********************************************************************
   Center content
 *********************************************************************/

function positionContentContainer() {
   var winWidth = getInnerWidth(window);
   var left = parseInt((winWidth > 742) ? (winWidth - 742) / 2 : 0);
   
   doc = '<style>#contentContainer { ';
   doc += 'left: ' + left + 'px; ';
   doc += '}';
   document.write(doc + '</style>');
}

function repositionContentContainer() {
   if (document.getElementById) {
      var container = document.getElementById('contentContainer');
      var winWidth = getInnerWidth(window);
      
      container.style.left = ((winWidth > 742) ? (winWidth - 742) / 2 : 0) + 'px';
   }
}

onresize = repositionContentContainer;


