// HxPI - common page header block.

var zj114Ld = 1
var dbg = 0;
var LogoTxtRGB =  "#D8B170";
var MenuTxtRGB = "#F8EAAB";
var PgHdrTxtRGB = "#F8EAAB";
//var PgHdg = "First Steps"; // softfail
//if(window.zj114PgHdg){PgHdg=zj114PgHdg}
var info1="com";

// VIEWING WIDTH on this load, and set flag Narrow/Medium/Wide.
var WinWth = 0;
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {WinWth = window.innerWidth;}
 if (navigator.appName.indexOf("Microsoft")!=-1) {WinWth = document.body.offsetWidth;}
 if (navigator.appName.indexOf("Opera")!=-1) {WinWth = document.body.clientWidth;}
}
var zj114ViewX='n';
if (window.WinWth) {
 if (WinWth>850){zj114ViewX='m';}
 if(WinWth>1200){zj114ViewX='w';}
}


//  Override CSS outer margins if view is narrow/wide.
var BigMarg = '10%';
if(zj114ViewX=='m'){BigMarg='5%'}
if(zj114ViewX=='n'){BigMarg='0.5%'}
document.write("<style>body{margin-left:"+BigMarg+";margin-right:"+BigMarg+";}</style>");
//

// Block height and image selection
var BlkH = 130;
if(window.zj114H){BlkH=zj114H;}
if (BlkH<=100){var ImgSrc = 'ZZimg01/cosmos_422_50_medium.jpg';
} else {var ImgSrc = 'ZZimg01/cosmos_422_100_medium.jpg';}
//
// Block width
if(window.zj114W){
	document.write("<style>#idPgHdrBlock1 {width:"+zj114W+"px;background-color:#202020;"); // and default auto margins
} else {
	//  No width specified, apply some logic to override CSS outer auto-margins if view is narrow/wide.
	var BigMarg = '10%';
	if(zj114ViewX=='m'){BigMarg='5%'}
	if(zj114ViewX=='n'){BigMarg='0.5%'}
	document.write("<style>body{margin-left:"+BigMarg+";margin-right:"+BigMarg+";}</style>");

	document.write("<style>#idPgHdrBlock1 {background-color:#202020; padding-left:1%; padding-right:1%;");
}
if(dbg){document.write("border:1px solid white;")}; document.write("}</style>");
document.write("<style>#idPgHdrMnu {text-align:right;line-height:100%;"); if(dbg){document.write("background:brown;")}; document.write("}</style>");
BuildString = "#idPgHdrMnu a:active, #idPgHdrMnu a:visited, #idPgHdrMnu a:link ";
BuildString += "{color:"+MenuTxtRGB +";text-decoration:none;padding-left:0.1em;padding-right:0.1em;padding-top:0px;padding-bottom:0px;margin-left:0.5em;}";
document.write("<style>"+BuildString+"</style>");
document.write("<style>#idPgHdrMnu a:hover {background: "+MenuTxtRGB+";color:black;padding-left:0.1em;padding-right:0.1em;}</style>");

document.write("<style>#idPgHdrBlock2 {position:relative; height:"+BlkH+"px; background-image:url('"+ImgSrc+"');background-repeat:repeat-x;"); 
if(dbg){document.write("border:1px solid red;")}; document.write("}</style>");

BuildString = "#idTechLink a:active, #idTechLink a:visited, #idTechLink a:link, #idTechLink a:hover ";
BuildString += "{color:#202020;text-decoration:none;margin-left:0;padding:0;line-height:0;}";
document.write("<style>"+BuildString+"</style>");
document.write("<style>#idLogoTxt {font-size:5em; font-weight:bold; font-style:italic; color:"+LogoTxtRGB+"; line-height:1em; position:absolute; bottom:0;left:5px;");
if(dbg){document.write("background:chocolate;")}; document.write("}</style>");
document.write("<style>#idSubLogoTxt {color:"+LogoTxtRGB+";font-size:100%;font-weight:bold;position:absolute;bottom:12px;left:185px;}</style>");
document.write("<style>#idPgHdrHdgTxt{font-size:2em;text-align:right;line-height:1.2em;color:"+PgHdrTxtRGB+"; position:absolute; bottom:0px;right:0;");
if(dbg){document.write("background:goldenrod;")}; document.write("}</style>");
var info2="hxpi";
function TellFriend(){
	var TellFriendStr = "mailto:?Subject=I think you will find this web site interesting.";
	TellFriendStr += "&body=http://www.hxpi.com/radio";
	location.href = TellFriendStr;
}
function TellUs(ToString){
	var BuildString = "mailto:" + ToString + "?subject=Website Feedback&body=" +  location.href;
	location.href = BuildString;
}
var info3="jun08";
// HEADER BLOCK - top menu, image, logo, page heading
var info4="@";
document.write("<div id='idPgHdrBlock1'>"); 
var info5 =".";
document.write("<div id='idPgHdrMnu'>");
// TOP MENU can be overridden with string set externally
var EmString = info3+info4+info2+info5+info1;
if (window.zj114TopMnu){
	document.write(zj114TopMnu);
} else {
	// no override, use the defaults
	var BuildString = "<a href='javascript:TellUs(EmString);'>Talk To Us</a>";	
	BuildString = "<a href='javascript:TellFriend();'>Tell Your Friends</a>" + BuildString;	
	if (window.location.toString().indexOf("index.php")==-1){
		BuildString = "<a href='index.php'>Home</a>"+BuildString;
	}
	document.write(BuildString);
}
document.write("</div>"); // Menu
document.write("<div id='idPgHdrBlock2'>"); // for the HxPI Logo text, background image and page heading 
document.write("<div id='idTechLink'><a href='tsa.shtml'>XXX</a></div>");
document.write("<div id='idPgHdrHdgLine'>");
document.write("<div id='idLogoTxt' style='margin-bottom:3px;'>HxPI</div>");
if(window.zj114SubLogoTxt){document.write("<div id='idSubLogoTxt'>"+zj114SubLogoTxt+"</div>");}
//var ExternalJS01_VarPageHeading ="page heading string"; <<<<<<< declaration in calling HTML
document.write("<div id='idPgHdrHdgTxt'>");
if(window.zj114PgHdg){document.write(zj114PgHdg);}
document.write( "</div>");
document.write("</div>"); // idPgHdrHdgLine

document.write("</div>"); // idPgHdrBlock2

document.write("</div>"); // idPgHdrBlock1

// ends
