// get browser screen width
function getBrowserWidth() {
	var w;
	if(document.innerWidth){ w=document.innerWidth;
	} else if(document.documentElement.clientWidth){ w=document.documentElement.clientWidth;
	} else if(document.body){ w=document.body.clientWidth; }
	return w;
}

// get browser screen height
function getBrowserHeight() {
	var h;
	if(document.innerHeight){ h=document.innerHeight;
	} else if(document.documentElement.clientHeight){ h=document.documentElement.clientHeight;
	} else if(document.body){ h=document.body.clientHeight; }
	return h;
}

var browserWidth, browserHeight, topBottomPadding=0;

function repositionDivs() {
	browserWidth = getBrowserWidth();
	browserHeight = getBrowserHeight();
	
	// reposition mainbg1
	if(browserHeight>601) {
		topBottomPadding = Math.floor((browserHeight-601)/2);
		document.getElementById('mainbg').style.paddingTop = topBottomPadding+'px';
		document.getElementById('mainbg').style.paddingBottom = topBottomPadding+'px';
	}
	
	// reposition playerdiv
	document.getElementById('playerdiv').style.top = (topBottomPadding+2)+'px';
	document.getElementById('playerdiv').style.left = (Math.floor((browserWidth-901)/2)+4)+'px';

	// reposition mailing list textbox
	document.getElementById('mailing-list-textbox-div').style.top = (topBottomPadding+601-30)+'px';
	document.getElementById('mailing-list-textbox-div').style.left = (Math.floor((browserWidth+901)/2)-222)+'px';
}

function mailingListEmailTextboxOnFocus() {
	if(document.getElementById('mailing-list-textbox').value=='Enter your email here') {
		document.getElementById('mailing-list-textbox').value = '';
	}
}

function mailingListEmailTextboxOnBlur() {
	if(document.getElementById('mailing-list-textbox').value=='') {
		document.getElementById('mailing-list-textbox').value = 'Enter your email here';
	}
}

onload = function() {
	repositionDivs();
};