/* Zbox stylez */
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 changeheight(){
	if (window.innerHeight && window.scrollMaxY) {
		var yWithScroll = window.innerHeight + window.scrollMaxY;
		var lightBoxOverlayHeight = yWithScroll;
	} else {
		var yWithScroll = document.body.scrollHeight;
		//var yHeight = document.body.clientHeight;
		var lightBoxOverlayHeight = yWithScroll;
	}
	e = MM_findObj("lightBoxOverlay");
	e.style.height = lightBoxOverlayHeight + 'px';
}
function showLB(containerId) {
    //hideAll();
   // return;
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	changeheight();
}
function showContainer(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}
function showLBMain(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';

	var whatsTheWidth = (obj.offsetWidth)/2;
	obj.style.marginLeft = '-' + whatsTheWidth + 'px';
	
	/*var whatsTheHeight = (obj.offsetHeight)/2;
	obj.style.marginTop = '-' + whatsTheHeight + 'px';*/
	
	showLB('lightBoxOverlay');
}
function hideLB(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
function hideAll(){;
	hideLB('lightBox');
	hideLB('lightBoxOverlay');
	hideLB('pollResults');
	hideLB('previousPolls');
	hideLB('submitStory');
	hideLB('storyThanks');
	hideLB('newsletterPopup');
	hideLB('newsletterThanks');
	hideLB("tellFriend");
	hideLB("tellFriendSuccess");
}
function fileInputCopy(realFile){
	obj = MM_findObj(realFile);
	obj2 = MM_findObj("fakeFile");
	obj2.value = obj.value;
}
var amID = "blank";
function showMe(containerId){
	if(amID != "blank"){
		hideLB(amID);
	}
	amID = containerId;
	showContainer(containerId);
}
