var centerX = 0;
var centerY = 0;
var activeSection = "";
function centerContent(){
 centerX = document.body.clientWidth/2 - 385;
 centerY = document.body.clientHeight/2 - 334;
 if(centerY<0){
    centerY = 0;
 }
 if(centerX <0){
    centerX = 0;
 }
 document.getElementById("pagecontent").style.left = centerX;
 document.getElementById("pagecontent").style.top = centerY;
  if(activeSection == ""){
     document.getElementById('homefootercontent').style.left = centerX;
     document.getElementById('homefootercontent').style.top = centerY + 609;
  }
 centerY = centerY + 55;
 //document.getElementById("homePage").setVariable("resizeHeight", document.body.clientHeight); 
 
//BEGIN - set the position of objects in flash
if(activeSection == ""){
  function findObj(obj){
    if(document.all)return(document.all[obj]);
    if(document.getElementById)return(document.getElementById(obj));
    return(false);
  }
  function FlashSetVariable(_var,_value){
    flashObj = findObj('homePage'); //with 'z' at the end
    if(flashObj)flashObj.SetVariable(_var,_value);
  }
  FlashSetVariable('resizeHeight',document.body.clientHeight); 
}
//END - set the position of objects in flash
 
 positionLayers(centerX,centerY);
}
function sub_rollOver(rootColName){
	document.getElementById(rootColName + "Left").className = "topNavSubColOn";
	document.getElementById(rootColName + "Center").className = "topNavSubColOn";
	document.getElementById(rootColName + "Right").className = "topNavSubColOn";
}
function sub_rollOut(rootColName){
	document.getElementById(rootColName + "Left").className = "topNavSubCol";
	document.getElementById(rootColName + "Center").className = "topNavSubCol";
	document.getElementById(rootColName + "Right").className = "topNavSubCol";
}
function side_rollOver(rootColName){
	document.getElementById(rootColName + "Left").className = "sideNavOn";
	document.getElementById(rootColName + "Center").className = "sideNavOn";
	document.getElementById(rootColName + "Right").className = "sideNavOn";
	if(rootColName.match("Sub") == "Sub"){
	  document.getElementById(rootColName + "Content1").className = "sideNavOn";
	  document.getElementById(rootColName + "Content2").className = "sideNavOn";
	}
}

function side_rollOut(rootColName, theClassName){
	document.getElementById(rootColName + "Left").className = theClassName;
	document.getElementById(rootColName + "Center").className = theClassName;
	document.getElementById(rootColName + "Right").className = theClassName;
	if(rootColName.match("Sub") == "Sub"){
	  document.getElementById(rootColName + "Content1").className = theClassName;
	  document.getElementById(rootColName + "Content2").className = theClassName;
	}
}


//if explorer (4.x)
if (document.all) {
		layerRef='document.all'
		styleRef='.style.'
}
//else if netscape (4.x)
else if (document.layers) {
	//alert(navigator.appName)
		layerRef='window.document.layers'
		styleRef='.'
	}
else{
	// location.href="not4x.html"
}

function show(elem,active){
  if(elem == 'contactUs_sub'){
	document.getElementById("topNavLastCol").className = "topNavHeaderCol";
  }
  document.getElementById(elem).style.visibility="visible";
  if(active){
  	document.getElementById(elem + "_items").style.display = 'block';
  }
}
function hide(elem,active){
  if(elem == 'contactUs_sub'){
	document.getElementById("topNavLastCol").className = "topNavHeaderColOff";
  }
  document.getElementById(elem).style.visibility="hidden";
  if(active){
    	document.getElementById(elem + "_items").style.display = 'none';
  }
}

var topNavPosTop;
var contactUsNavOffset;
function positionLayer(layerName, startX, startY){  
  if(layerName == 'CraigRehr' || layerName == 'BobPawlicki' || layerName == 'JBCapuano' || layerName == 'DanKotas' || layerName == 'GordonGizowski'){
     var markerTop = document.getElementById("capabilities_marker").offsetTop;
     var markerLeft = document.getElementById("capabilities_marker").offsetLeft;
     var theTop = markerTop + 111;
     var theLeft = markerLeft + 155;
     document.getElementById(layerName).style.left=theLeft + 'px';
     document.getElementById(layerName).style.top=theTop + 'px';
     //alert(document.getElementById("bios_marker").offsetLeft);
  } else {
	  if(layerName == 'hider'){
		//document.getElementById(layerName).style.top=theTop + 'px';
		document.getElementById(layerName).style.left=startX + 'px';
		document.getElementById(layerName).style.top=startY + 'px';
	  } else {
	    markerName = layerName + '_marker';
		//var markerTop = document.getElementById(markerName).offsetTop;
		var markerLeft = document.getElementById(markerName).offsetLeft;
		//var theTop = markerTop;
		var theLeft = markerLeft + startX - 32;
		//document.getElementById(layerName + '_sub').style.top=theTop + 'px';
		document.getElementById(layerName + '_sub').style.left=theLeft + 'px';
		document.getElementById(layerName + '_sub').style.top=startY + 'px';
		// alert(document.getElementById(markerName).offsetLeft);
	  }
	  if(layerName == 'contactUs'){
		contactUsNavOffset = (772 - (theLeft - startX)) - document.getElementById('contactUs_sub').offsetWidth;
		if(contactUsNavOffset != 1){
		  document.getElementById('contactUsSpacer').style.width = contactUsNavOffset;
		}
	  }  
	  if(layerName == 'capabilities'){
		/*
		if(document.getElementById('homecontent') != null){
		theLeft = theLeft + 624;
		  document.getElementById('homecontent').style.left=theLeft + 'px';
		  document.getElementById('homecontent').style.visibility="visible";
		}*/
	  if(activeSection != ""){
	    document.getElementById(activeSection).style.visibility = "visible";
	  } else {
	    document.getElementById('homefootercontent').style.visibility="visible";
	  }
	  document.getElementById('pagecontent').style.visibility="visible";
	  }
  }
}
function positionLayers(startX, startY){
 positionLayer('capabilities', startX, startY);
 positionLayer('aboutUs', startX, startY);
 positionLayer('portfolio', startX, startY);
 positionLayer('customerCenter', startX, startY);
 positionLayer('contactUs', startX, startY);
 positionLayer('hider', startX, startY);
}

function forceFullScreen(){
  window.resizeTo(screen.availWidth,screen.availHeight);
  window.moveTo(0,0);
}
//forceFullScreen();



// -- BEGIN - the Mail to --
function theMailTo(theLink){
//alert(theLink);
 if(theLink == 'dreamBig'){
  document.getElementById(theLink).href= 'mailto:dreambig@alloutprint.com';
 }
 if(theLink == 'bob'){
  document.getElementById(theLink).href= 'mailto:bob@alloutprint.com';
 }
 if(theLink == 'bigBoldFearless'){
  document.getElementById(theLink).href= 'mailto:bigboldfearlessideas@alloutprint.com';
 }
 if(theLink == 'pressMasters'){
  document.getElementById(theLink).href= 'mailto:theprepressmasters@alloutprint.com';
 }
}
// -- END - the Mail to --