 // 
 //"file:///C|/Documents and Settings/Peter/Desktop/Documents/newnp/HTML/" 
//common.js
//Shared script 
//initialize
tipleft_default=190;tiptop_default=2;
 last_updated = getModDate();//initialize to HTML file date
 noteflag=0;
 innittextflag=0;
 ietech=""; 
 clicks=0;

 
function write_email(linktext) {
emailstring = '<a href="mailto:peter' +'@net' +'publish' +'.net" subject="Contact from netpublish.net" onmouseover="contactOver()" onmouseout="contactOut()">' +linktext +'</a>';
d.write(emailstring); 
}


function contactOver() {
showInfo("Send an e-mail");
status="Send an e-mail";
//pageset=SetMenu; SetMenu="";
//SetMenuSave = SetMenu;
//LowItem(P);
//SetMenu="";
}

function contactOut() {
showInfo(default_info);
status="";
//SetMenu=pageset;
//window.location.reload();
}

function setBannerImg(kw) 
{
if (kw == "pb")
	{
	var bobj="";
	bobj = gE("bannerblock");
	bobj.style.backgroundImage = "url('http://www.netpublish.net/images/newpb2.png')";
	}
}

//footer text for all pages
function makeFooter(current)
{
home_link = 'Home&nbsp;| ';
pub_link = 'Publishing&nbsp;| ';
fiction_link = 'Fiction&nbsp;| ';
amusements_link = 'Amusements&nbsp;| ';
//moebius_link = 'Moebius&nbsp;| ';
//reddots_link = 'Red Dot Society';
//
if (current!="home") home_link = '<a href=\"' +BaseHref +'">Home</a>&nbsp;| ';
if (current!="publishing") pub_link = '<a href="' +BaseHref +'publishing.htm">Publishing</a>&nbsp;| ';
if (current!="amusements") amusements_link = '<a href="' +BaseHref +'amusements_intro.htm">Amusements</a>&nbsp;| ';
if (current!="puzzles") puzzles_link = '<a href="' +BaseHref +'puzzles/kickself.htm">Puzzles</a>&nbsp;| ';
//if (current!="moebius") moebius_link = '<a href="' +BaseHref +'moebius/index.htm">Moebius</a>&nbsp;| ';
if (current!="moebius") moebius_link = '<a href="' +BaseHref +'moebius/t-index.htm" title="Our magazine--UNDER DEVELOPMENT">Moebius</a>&nbsp;| ';
if (current!="reddots") reddots_link = '<a href="' +BaseHref +'about_rd.htm">Red Dot Society</a>';
//
document.write('<p class="footer" style="margin-bottom:5px">' + home_link + pub_link +  amusements_link + puzzles_link + moebius_link + reddots_link) + '</p>';
writeModDate()
}//End makeFooter function

function writeModDate()
{
//Write last mod date
mdate = getModDate();
document.write('<p class="footer">Page last modified: ' + mdate + '<br>&copy; Peter Bloxsom 2003&ndash;2006</p>')
}


function xref()
{ 
if (clicks >= 1) {alert("Sorry, you can't go anywhere by clicking there, just 'mouse over' the acronym or term to see a definition.")} else {clicks ++}
}


function frameBust() 
{
	if (self.parent.frames.length != 0)
	self.parent.location=document.location;
}


function nowt()
{
//dummy function
}
//
 	
// Picture-swapping 

function rollIn(imgName, divid)
{
if (document.layers && divid != null)
	{	
var divObject=document[divid];
divObject.document[imgName].src = eval(imgName +"_on.src")
	}
else
      document[imgName].src=eval(imgName + "_on.src");
}

function rollOut(imgName,divid)
{
if (document.layers && divid != null)
	{	
divObject=document[divid];
divObject.document[imgName].src = eval(imgName +"_off.src")
	}
else
      document[imgName].src=eval(imgName + "_off.src");
 }

//

function showDiv(divID)
{
 if (isIE4up)
	{
		var divStyle = document.all.item(divID).style;
		divStyle.visibility = "visible"
 	}
		else if (isNS6up)
		{
		var divObject = document.getElementById(divID);
		divObject.style.visibility = "visible"
		}
		else if (isNS4up)
		{
		var divObject = document.layers[divID];
		divObject.visibility = "show"
		}
}

function hideDiv(divID)
{
 if (isIE4up)
	{
		var divStyle = document.all.item(divID).style;
		divStyle.visibility = "hidden"
 	}
		else if (isNS6up)
		{
		var divObject = document.getElementById(divID);
		divObject.style.visibility = "hidden";
		}
		else if (isNS4up)
		{
		var divObject = document.layers[divID];
		divObject.visibility = "hide"
		}
}


 


//
function assembleText(content)	
{
output="<html><head><title>Popup Text</title>";
output += "<style>body {font-family: Verdana, Geneva, Arial, Helvetica, Sans-serif; font-size: 11px; color: #000099} P {margin-top: 2px; margin-right:2px; margin-bottom:8px; margin-left:2px} H3 {font-size: 12px; margin-top: 2px; margin-right:2px; margin-bottom:7px; margin-left:2px; text-align:center}";
output += "A:link {background-color:transparent;color:#0000FF; text-decoration : underline}"
output+= "A:hover {background-color : transparent; color : #CCCC00; text-decoration : underline}</style></head>";
output +="<body bgcolor='#FFFFEE' >";
output +=  content + "<p align=right><a href='javascript:window.close()'>Close window</a></p></body></html>";
}
//onBlur='javascript:window.close()'

function popupBig(output)
{
 bigWindow=window.open("","popupbig","width=800,height=650,top=10,left=10,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
// 
if (bigWindow != null) //window opened successfully
	{
	bigWindow.document.open();
	bigWindow.document.write(output);
	bigWindow.document.close();
	}
else alert("Unable to open popup window. You may need to close other applications or windows to free up some memory, then try again."); 	
}

function popupText(output)
{
 textWindow=window.open("","popuptxt","width=148,height=180,top=1,left=630,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
//
if (textWindow != null) //window opened successfully
	{
	textWindow.document.open();
	textWindow.document.write(output);
	textWindow.document.close();
	}
else alert("Unable to open popup window. You may need to close other applications or windows to free up some memory, then try again."); 	
}

// Popup text 
function popupFile(fileURL,top,height,left,width) 
{
 windowOptions = "directories=1,menubar=1,personalbar=0,status=1,scrollbars=1,resizable=1,";
 windowOptions += "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
 window.open(fileURL,"popwindow",windowOptions)
}

function popupEbook(fileURL,top,height,left,width) 
{
 windowOptions = "directories=0,menubar=0,personalbar=0,status=0,scrollbars=0,resizable=0,";
 windowOptions += "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
 window.open(fileURL,"popwindow",windowOptions)
}


function popupFull(url)
//Full window
{
 fullWindow=window.open(url,"popupfull","left=0,top=0,width=780,resizable,height=565,scrollbars,toolbar, status");
// 
}

function popupURL(fileURL) 
//Use for Glossary
{
glossWindow=window.open(fileURL,"popwindow3","left=460,top=0,width=330,height=560, resizable,scrollbars")
//if (Opr4) glossWindow.reload;
}


// Function showModDate: display the last mod date for the current file
function getModDate(dateText)
{
mm = new Array("January", "February", "March",
"April", "May", "June", "July", "August", "September", "October",
"November", "December");
update = new Date(document.lastModified);
//Use last mod date if processed, otherwise param or literal  
if ((update.getYear()) == "70")
	{if (dateText=="") revdate = "6 March 2002";
	else revdate = dateText;
	}
else 
	{
	dayOfMonth = update.getDate();
	revdate = dayOfMonth + " ";	
	revdate +=  mm[update.getMonth()]+" ";
	theyear = (update.getYear());
if (theyear<1900) theyear+=1900;
	revdate += theyear;
	}
return revdate
}
	
// Display today's date
function todayDate()
{
dw = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ); 
m = new Array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");  
today = new Date(); day = today.getDate();
//
//thedate = (d[today.getDay()]+" ");
thedate = day + " ";
thedate += m[today.getMonth()]+" ";
theyear = today.getYear();
if (theyear < 1900) theyear += 1900;
thedate += theyear;
return thedate;
}


//cont=gE("maincontent"); cont.style.marginLeft="0px";
var picno=1;
fractal = new Array(18);
fractal[1] = '<img src="images/starflight.jpg" width="480" height="360" alt="Starflight" border="0">'; 
fractal[2] = '<img src="images/kaleidoweb.jpg" width="480" height="360" alt="Kaleidoweb" border="0">';
fractal[3] = '<img src="images/planetscape.jpg" width="480" height="361" alt="Planetscape" border="0">'; 
fractal[4] = '<img src="images/reefdance.jpg" width="480" height="360" alt="Reefdance" border="0">'; 
fractal[5] = '<img src="images/moonglow.jpg" width="480" height="316" alt="Moonglow" border="0">'; 

fractal[6] = '<img src="images/spirality.jpg" width="480" height="436" alt="Spirality" border="0">'; 
fractal[7] = '<img src="images/waterworld.jpg" width="480" height="360" alt="Waterworld" border="0">';
fractal[8] = '<img src="images/sunspin.jpg" width="480" height="360" alt="Sunspin" border="0">'; 
fractal[9] = '<img src="images/gnomeland.jpg" width="480" height="384" alt="Gnomeland" border="0">'; 
fractal[10] = '<img src="images/floral_coral.jpg" width="480" height="356" alt="Floral Coral" border="0">'; 

fractal[11] = '<img src="images/noel.jpg" width="480" height="384" alt="Noel" border="0">'; 
fractal[12] = '<img src="images/mandel.jpg" width="480" height="339" alt="Planet Mandel" border="0">'; 
fractal[13] = '<img src="images/tuskforce.jpg" width="480" height="330" alt="Tusk Force" border="0">'; 
fractal[14] = '<img src="images/fuji.jpg" width="480" height="360" alt="Fuji" border="0">'; 
fractal[15] = '<img src="images/greenfuse.jpg" width="480" height="360" alt="Green Fuse" border="0">'; 

fractal[16] = '<img src="images/galaxy.jpg" width="480" height="360" alt="Tusk Force" border="0">'; 
fractal[17] = '<img src="images/petalroad.jpg" width="480" height="360" alt="Fuji" border="0">'; 
fractal[18] = '<img src="images/fireworks.jpg" width="480" height="360" alt="Green Fuse" border="0">'; 

ftitle = new Array(15);
ftitle[1] = 'Starflight'; 
ftitle[2] = 'Kaleidoweb';
ftitle[3] = 'Planetscape'; 
ftitle[4] = 'Reefdance'; 
ftitle[5] = 'Moonglow'; 

ftitle[6] = 'Spirality'; 
ftitle[7] = 'Waterworld';
ftitle[8] = 'Sunspin'; 
ftitle[9] = 'Gnomeland'; 
ftitle[10] = 'Floral Coral'; 

ftitle[11] = 'Noel'; 
ftitle[12] = 'Planet Mandel'; 
ftitle[13] = 'Tusk Force'; 
ftitle[14] = 'Fuji'; 
ftitle[15] = 'Green Fuse'; 

ftitle[16] = 'Galaxy of Galaxies'; 
ftitle[17] = 'Petal Road'; 
ftitle[18] = 'Fireworks'; 


function nextFractal()
{
picno ++;
if (picno==ftitle.length) picno = 1;
fractalobj = gE("picture");
wH(fractalobj,fractal[picno]);
fractalTitle(picno);

}

function prevFractal()
{
picno --;
if (picno==0) picno = ftitle.length-1;
fractalobj = gE("picture");
wH(fractalobj,fractal[picno]);
fractalTitle(picno)
}


function fractalTitle(imgno)
{
titleobj = gE("ftitlediv");
wH(titleobj,ftitle[imgno])
}




