var mainWidth = 425;
var mainHeight = 425;
var portWidth = 630;
var portHeight = 450;

var mainWidth = 425;
var mainHeight = 425;

/*var portWidth = ((window.innerWidth)-(window.innerWidth*.25));*/
var portWidth = 700;
var portHeight = ((window.innerHeight)-(window.innerHeight*.25));

var AW = (window.innerWidth/2 )-(mainWidth/2);
var AH = (window.innerHeight/2)-(mainHeight/2);
var PW = (window.innerWidth/2 )-(portWidth/2);
var PH = (window.innerHeight/2)-(portHeight/2);
var blogTop =(window.innerHeight/2)+(mainHeight/2);
var blogWidth = (window.innerWidth)-20;


var Bvis = false;
var Cvis = false;
var Pvis = false;

function reCenter(){
	var AW = (window.innerWidth/2 )-(mainWidth/2);
var AH = (window.innerHeight/2)-(mainHeight/2);
document.getElementById("main").style.left=(AW+"px");
document.getElementById("main").style.top=(AH+"px");
document.getElementById("main").style.visibility="visible";
}

function main(){
document.getElementById("main").style.margin=("hidden");
}

<!--
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];}}
}

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];}
}

window.onresize = reCenter();





function SetOpacity(elem, opacityAsInt)
{
	var opacityAsDecimal = opacityAsInt;
	
	if (opacityAsInt > 100)
		opacityAsInt = opacityAsDecimal = 100; 
	else if (opacityAsInt < 0)
		opacityAsInt = opacityAsDecimal = 0; 
	
	opacityAsDecimal /= 100;
	if (opacityAsInt < 1)
		opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
	
	elem.style.opacity = opacityAsDecimal;
	elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
}

function FadeOpacity(elemId, fromOpacity, toOpacity, time, fps)
{
	var steps = Math.ceil(fps * (time / 1000));
	var delta = (toOpacity - fromOpacity) / steps;
	
	FadeOpacityStep(elemId, 0, steps, fromOpacity, delta, (time / steps));
}

function FadeOpacityStep(elemId, stepNum, steps, fromOpacity, delta, timePerStep)
{
    SetOpacity(document.getElementById(elemId), Math.round(parseInt(fromOpacity) + (delta * stepNum)));

    if (stepNum < steps)
	        setTimeout("FadeOpacityStep('" + elemId + "', " + (stepNum+1) + ", " + steps + ", " + fromOpacity + ", " + delta + ", " + timePerStep + ");", timePerStep);
}

function viewBlog(){
if (!Bvis){
document.getElementById("blogFrame").style.width=blogWidth+"px";
document.getElementById("blogFrame").style.visibility="visible";
document.getElementById("blogFrame").style.top=(blogTop+20)+"px";
document.getElementById("blogFrame").style.height=145+"%";
document.getElementById("blogFrame").style.overflow="hidden";
FadeOpacity('blogFrame',0,100,2000,30);
Bvis = true;
}else if (Bvis){
	document.getElementById("blogFrame").style.visibility="hidden";
	document.getElementById("blogFrame").style.width=0+"px";
	document.getElementById("blogFrame").style.height=0+"px";
	Bvis= false;
}
}

function viewContact(){
	if (!Cvis){
	document.getElementById("contactFrame").style.width=360+"px";
	document.getElementById("contactFrame").style.height=300+"px";
document.getElementById("contactFrame").style.visibility="visible";
document.getElementById("contactFrame").style.top=(AH/2)+"px";
document.getElementById("contactFrame").style.left=(AW/2)+"px";
FadeOpacity('contactFrame',0,80,2000,30);
Cvis = true;
}else if (Cvis){
	document.getElementById("contactFrame").style.visibility="hidden";
	document.getElementById("contactFrame").style.width=0+"px";
	document.getElementById("contactFrame").style.height=0+"px";
	Cvis= false;
}
}


function viewPortfolio(){
		if (!Pvis){
document.getElementById("PortGal").style.visibility="visible";
document.getElementById("PortGal").style.top=(PH)+"px";
document.getElementById("PortGal").style.left=(PW)+"px";
document.getElementById("PortGal").style.width=portWidth+"px";
document.getElementById("PortGal").style.height=portHeight+"px";
FadeOpacity('PortGal',0,100,2000,30);
Pvis = true;
}else if (Pvis){
	document.getElementById("PortGal").style.visibility="hidden";
	document.getElementById("PortGal").style.width=0+"px";
	document.getElementById("PortGal").style.height=0+"px";
	Pvis= false;
}
}

