
//set vars for popinWindows which are used on all pages
//popinWindows only used on specific pages have sizes in actual page
var contactTop='175';
var contactWidth='996';
var contactHeight='350';

var privacyTop='200';
var privacyWidth='400';
var privacyHeight='170';

function popDiv(theDiv, theTop, theWidth, theHeight)
{
	setStyleById(theDiv, 'width', theWidth+'px');
	setStyleById(theDiv, 'height', theHeight+'px');
	setStyleById(theDiv, 'top', theTop+'px');
	var docWidth = Math.max(document.documentElement.clientWidth, document.body.clientWidth);
	setStyleById(theDiv, 'position', 'absolute');
	setStyleById(theDiv, 'left', ((docWidth-theWidth)/2)  + 'px');
	setStyleById(theDiv, 'zIndex', '100');
	//setStyleById(theDiv, 'visibility', 'visible');
	setVisible(theDiv);
}
	
//set visibility and reduce width of close bar by amount of padding
function setVisible(theDiv)
{
	theDiv = document.getElementById(theDiv);
	theClose=document.getElementById('close');//set width of close bar
	closeWidth=theDiv.style.width;//get width of popwindow
	closeWidth=closeWidth.slice(0, closeWidth.length-2);//chop of px
	closeWidth=closeWidth-4;//reduce width by padding amount
	theClose.style.width= closeWidth+'px';//set width of close bar
	theDiv.style.visibility = (theDiv.style.visibility == 'visible') ? 'hidden' : 'visible';	
}

function doHidePop()//only on pages  ONLY priacy and contact ie no help buttons
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer

window.focus();//return focus to window
}

function doTextHidePop()//text_pages_design.html ONLY
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer
	setStyleById("bookSizeLr", "visibility", "hidden");//hide  layer
	setStyleById("bookStyleLr", "visibility", "hidden");//hide  layer
	setStyleById("bookCharCountLr", "visibility", "hidden");//hide  layer
	setStyleById("bookChapterCountLr", "visibility", "hidden");//hide  layer
	setStyleById("bookAdditionalPagesLr", "visibility", "hidden");//hide  layer

window.focus();//return focus to window
}

function doCountHidePop()//copy_counter.html ONLY
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer
	setStyleById("countCopyHelpLr", "visibility", "hidden");//hide  layer

window.focus();//return focus to window
}

function doSpineCalcHidePop()//text_pages_paper.html ONLY
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer
	setStyleById("spineCalcHelpLr", "visibility", "hidden");//hide  layer
	setStyleById("environmentalLr", "visibility", "hidden");//hide  layer
	
window.focus();//return focus to window
}

function doISBNCalcHidePop()//isbn.html ONLY
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer
	setStyleById("ISBNCalcHelpLr", "visibility", "hidden");//hide  layer

window.focus();//return focus to window
}

function doMessageHidePop()//pricing.html and contact.html ONLY
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer
	setStyleById("messageLr", "visibility", "hidden");//hide  layer

window.focus();//return focus to window
}

function doCoverTypeHidePop()//cover_facts.html and contact.html ONLY
{
	setStyleById("contactLr", "visibility", "hidden");//hide  layer
	setStyleById("privacyLr", "visibility", "hidden");//hide  layer
	setStyleById("coverTypeLr", "visibility", "hidden");//hide  layer

window.focus();//return focus to window
}

