
// All JavaScript and HTML code is (c)1999-2010 NetworkActiv Software
// Do not use without prior permission by NetworkActiv Software
// Contact: support@networkactiv.com

if(!document.images){
	window.location = "error.html";
}
	
var ASlashString = "";
//ASlashString = "/";
var HomeSlash = ".";// Fixes problem in Mozilla Firefox

var PageIDText = "";
if(NAPageID == "CS0" || NAPageID == "CS1" || NAPageID == "51" || NAPageID == "52" || NAPageID == "53" || NAPageID == "54" || NAPageID == "55" || NAPageID == "56" || NAPageID == "57" || NAPageID == "58" || NAPageID == "Forum" || NAPageID == "59" || NAPageID == "60" || NAPageID == "61" || NAPageID == "62"){
	ASlashString = "../";
	HomeSlash = "";
}
if(NAPageID == "CS0" || NAPageID == "CS1"){
	PageIDText = "?PID=" + NAPageID;
}

var ProductsExposed = 0;
var SupportExposed = 0;

function CLT(InText,InID){
	if(document.layers){
		document.layers[InID].open();
		document.layers[InID].document.write(InText);
		document.layers[InID].close();
	}
	else if(document.getElementById){
		document.getElementById(InID).innerHTML = InText;
	}
	else if(document.all){
		if(InID)
			InID.innerHTML = InText;
	}
}

function CLTWithFontInfo(InText,InID,InSize,InColour){
	InText = "<FONT SIZE=" + InSize + " COLOR=\"" + InColour + "\">" + InText + "</FONT>";
	CLT(InText,InID);
}

function DoDownloadCount(ProgramName){
	LoadedPicD = new Image();
	LoadedPicD.src = '/WhitePixel.gif?Download=' + ProgramName;
}

function DoClickCount(ClickName){
	LoadedPicC = new Image();
	LoadedPicC.src = '/WhitePixel.gif?Click=' + ClickName;
}

var NavBarText = "<DIV CLASS=\"NavButtonShell\">&nbsp;</DIV>\
<A HREF=\"" + ASlashString + HomeSlash + PageIDText + "\"><H1>Home</H1></A>\
<A HREF=\"javascript:DoProductsThing()\"><H1>Products</H1></A><SPAN ID=\"ProductsSpan\"></SPAN>\
<A HREF=\"javascript:DoSupportThing()\"><H1>Support</H1></A><SPAN ID=\"SupportSpan\"></SPAN>\
<A HREF=\"" + ASlashString + "Forum/" + PageIDText + "\"><H1>Forum</H1></A>\
<A HREF=\"" + ASlashString + "News.html" + PageIDText + "\"><H1>News</H1></A>\
<A HREF=\"" + ASlashString + "About.html" + PageIDText + "\"><H1>About</H1></A>\
<A HREF=\"" + ASlashString + "Contact.html" + PageIDText + "\"><H1>Contact</H1></A>\
<DIV CLASS=\"NavButtonShell\">&nbsp;</DIV>";

var ProductsText = "<A HREF=\"" + ASlashString + "Products.html" + PageIDText + "\"><H1>Overview</H1></A>\
<A HREF=\"" + ASlashString + "AUTAPF.html" + PageIDText + "\"><H1>AUTAPF</H1></A>\
<A HREF=\"" + ASlashString + "Pages/PortImport.html" + PageIDText + "\"><H1>PortImport</H1></A>\
<A HREF=\"" + ASlashString + "PIAFCTM.html" + PageIDText + "\"><H1>PIAFCTM</H1></A>\
<A HREF=\"" + ASlashString + "Scanner.html" + PageIDText + "\"><H1>Scanner</H1></A>\
<A HREF=\"" + ASlashString + "WebServer.html" + PageIDText + "\"><H1>Web Server</H1></A>\
<A HREF=\"" + ASlashString + "Pages/CustomSolutions.html" + PageIDText + "\"><H1>Custom</H1></A>";

var SupportText = "<A HREF=\"" + ASlashString + "Support.html" + PageIDText + "\"><H1>Overview</H1></A>\
<A HREF=\"" + ASlashString + "AUTAPF_Support.html" + PageIDText + "\"><H1>AUTAPF</H1></A>\
<A HREF=\"" + ASlashString + "Pages/PortImport_Support.html" + PageIDText + "\"><H1>PortImport</H1></A>\
<A HREF=\"" + ASlashString + "PIAFCTM_Support.html" + PageIDText + "\"><H1>PIAFCTM</H1></A>\
<A HREF=\"" + ASlashString + "Scanner_Support.html" + PageIDText + "\"><H1>Scanner</H1></A>\
<A HREF=\"" + ASlashString + "WebServer_Support.html" + PageIDText + "\"><H1>Web Server</H1></A>";

function LoadNavBar(){
	CLT(NavBarText,"NavBarSpan");
}

function DoProductsThing(){
	ProductsExposed = !ProductsExposed;
	CLT(ProductsExposed ? ProductsText:"","ProductsSpan");
}

function DoSupportThing(){
	SupportExposed = !SupportExposed;
	CLT(SupportExposed ? SupportText:"","SupportSpan");
}

var ThePageNames = new Array();
ThePageNames['00'] = "Index (Nav)";
ThePageNames['01'] = "PIAFCTM";
ThePageNames['02'] = "WebServer";
ThePageNames['03'] = "";
ThePageNames['04'] = "Scanner";
ThePageNames['05'] = "AUTAPF";
ThePageNames['06'] = "SoundyMouse";
ThePageNames['07'] = "CustomProducts";
ThePageNames['08'] = "Products";
ThePageNames['09'] = "Support";
ThePageNames[10] = "TheForum";
ThePageNames[11] = "News";
ThePageNames[12] = "About";
ThePageNames[13] = "Contact";
ThePageNames[14] = "PIAFCTM-Support";
ThePageNames[15] = "Scanner-Support";
ThePageNames[16] = "WebServer-Support";
ThePageNames[17] = "AUTAPF-Support";
ThePageNames[18] = "SoundyMouse-Support";
ThePageNames[19] = "AUTAPFFAQ";
ThePageNames[20] = "Links";
ThePageNames[21] = "PIAFCTM-1.x";
ThePageNames[22] = "PIA-Purch-Loc";
ThePageNames[23] = "PIA-Purch-Loc-NoVAT";
ThePageNames[24] = "PIA-Purch-Loc-VAT";
ThePageNames[25] = "PIA-TipsAndTricks";
ThePageNames[26] = "PIA-Compatibility";
ThePageNames[27] = "PIAFCTMFAQ";
ThePageNames[28] = "PIA-Screen-2.2";
ThePageNames[29] = "PIA-Screen-1.x";
ThePageNames[30] = "Powered-By-NAWS";
ThePageNames[31] = "RunningMultipleDomains";
ThePageNames[32] = "ScannerFAQ";
ThePageNames[33] = "Scanner-Screen";
ThePageNames[34] = "SoundyMouseFAQ";
ThePageNames[35] = "SoundyMouse-Screen";
ThePageNames[36] = "WebServer-MakeADonation";
ThePageNames[37] = "WebServerFAQ";
ThePageNames[38] = "WebServerHelp";
ThePageNames[39] = "WebServer-Screen";
ThePageNames[40] = "Web-Hosting-Tutorial";
ThePageNames[41] = "AUTAPF-Example";
ThePageNames[42] = "AUTAPF-Screen";
ThePageNames[43] = "CGISecrets";
ThePageNames[44] = "HowToPostFiles";
ThePageNames[45] = "PIA-MakingIG";
ThePageNames[46] = "PIA-Purch-Rem";
ThePageNames[47] = "PIA-Purch-Rem-NoVAT";
ThePageNames[48] = "PIA-Purch-Rem-VAT";
ThePageNames[49] = "";
ThePageNames[50] = "Index (page)";
ThePageNames[51] = "PortImport";
ThePageNames[52] = "PortImportFAQ";
ThePageNames[53] = "PortImportConsolePurchase";
ThePageNames[54] = "PortImportConsolePurchaseNoVAT";
ThePageNames[55] = "PortImportConsolePurchaseVAT";
ThePageNames[56] = "PortImportConsolePurchaseEU";
ThePageNames[57] = "PortImportSupport";
ThePageNames[58] = "AUTAPF_CommonUses";
ThePageNames[59] = "PortImport_Video_GettingStarted";
ThePageNames[60] = "Show_My_IP_Address";
ThePageNames[61] = "AUTAPF_Purchase_Custom";
ThePageNames[62] = "Purchase_Payment_Completed";

var ThePIDLoc = window.location.href.lastIndexOf('PID=');
var ThePID = window.location.href.substring(ThePIDLoc + 4,ThePIDLoc + 8);
if(ThePIDLoc <= 0)
	ThePID = '';
//LoadedPic = new Image();
//LoadedPic.src = 'http://www2.networkactiv.com/WhitePixel.gif? ' + ThePageNames[ThePID] + ' - ' + ThePageNames[NAPageID];

function windowOpener(theA,theB,theC){
	var newWindowVar = window.open(theA,theB,theC);
}

var CrazyTable_UpperRight = "<TABLE ID=\"UpperRightRounder\">";
var X;
var TotalRows = 30;
var PiPerRow = Math.PI / TotalRows / 2;
for(X = TotalRows;X >= 0;X--){
	var Signed = Math.sin(PiPerRow * X);
	var CoSigned = Math.cos(PiPerRow * X);
	var RoundX = Math.sin((Math.PI/2) * CoSigned) * TotalRows;
	CrazyTable_UpperRight += "<TR><TD><TABLE WIDTH=\"";
	CrazyTable_UpperRight += Math.round(RoundX);
	CrazyTable_UpperRight += "\"><TR><TD></TD></TR></TABLE></TD></TR>";
}
CrazyTable_UpperRight += "</TABLE>";

var CrazyTable_LowerRight = "<TABLE ID=\"LowerRightRounder\">";
for(X = 0;X <= TotalRows;X++){
	var Signed = Math.sin(PiPerRow * X);
	var CoSigned = Math.cos(PiPerRow * X);
	var RoundX = Math.sin((Math.PI/2) * CoSigned) * TotalRows;
	CrazyTable_LowerRight += "<TR><TD><TABLE WIDTH=\"";
	CrazyTable_LowerRight += Math.round(RoundX);
	CrazyTable_LowerRight += "\"><TR><TD></TD></TR></TABLE></TD></TR>";
}
CrazyTable_LowerRight += "</TABLE>";

var StructureText_Top = "<TABLE CLASS=\"MainTable\" CELLPADDING=0 CELLSPACING=0><COLGROUP><COL><COL WIDTH=616><COL WIDTH=20><COL WIDTH=112><COL></COLGROUP><TR><TD CLASS=\"MainBackground\" COLSPAN=5 HEIGHT=30></TD></TR><TR><TD CLASS=\"MainBackground\"></TD><TD CLASS=\"MainHeadTD\" COLSPAN=3><SPAN ID=\"NAChar\">N</SPAN>etwork<SPAN ID=\"NAChar\">A</SPAN>ctiv" + CrazyTable_UpperRight + "</TD><TD CLASS=\"MainBackground\"></TD></TR><TR><TD CLASS=\"MainBackground\"></TD><TD CLASS=\"MainBodyTD\">";

var StructureText_Bottom = "</TD><TD CLASS=\"MainBackground\" WIDTH=20></TD><TD CLASS=\"NavBar\">" + NavBarText + "</TD><TD CLASS=\"MainBackground\"></TD></TR><TR><TD CLASS=\"MainBackground\"></TD><TD CLASS=\"MainFootTD\" COLSPAN=3>" + CrazyTable_LowerRight + "<H1>(c)1999-2010 NetworkActiv - All rights reserved</H1></TD><TD CLASS=\"MainBackground\"></TD></TR><TR><TD CLASS=\"MainBackground\" COLSPAN=5 HEIGHT=30></TD></TR></TABLE>";

function EncapsulateMainPageBlock(){
	var InnerBodyText = StructureText_Top + document.getElementById("MainPageBlock").innerHTML + StructureText_Bottom;
	document.getElementById("MainPageBlock").innerHTML = InnerBodyText;
}

var StructureText_NoNav_Top = "<TABLE CLASS=\"MainTable\" CELLPADDING=0 CELLSPACING=0><COLGROUP><COL><COL WIDTH=746><COL></COLGROUP><TR><TD CLASS=\"MainBackground\" COLSPAN=3 HEIGHT=30></TD></TR><TR><TD CLASS=\"MainBackground\"></TD><TD CLASS=\"MainHeadTDNoNav\"><SPAN ID=\"NAChar\">N</SPAN>etwork<SPAN ID=\"NAChar\">A</SPAN>ctiv" + CrazyTable_UpperRight + "</TD><TD CLASS=\"MainBackground\"></TD></TR><TR><TD CLASS=\"MainBackground\"></TD><TD CLASS=\"MainBodyTD\">";

var StructureText_NoNav_Bottom = "</TD><TD CLASS=\"MainBackground\"></TD></TR><TR><TD CLASS=\"MainBackground\"></TD><TD CLASS=\"MainFootTDNoNav\">(c)1999-2010 NetworkActiv - All rights reserved" + CrazyTable_LowerRight + "</TD><TD CLASS=\"MainBackground\"></TD></TR><TR><TD CLASS=\"MainBackground\" COLSPAN=3 HEIGHT=30></TD></TR></TABLE>";

function EncapsulateMainPageBlock_NoNav(){
	var InnerBodyText = StructureText_NoNav_Top + document.getElementById("MainPageBlock").innerHTML + StructureText_NoNav_Bottom;
	document.getElementById("MainPageBlock").innerHTML = InnerBodyText;
}

var ExpDIV_Text = new Array();

function ExpDIV_Init(InDIVID){
	ExpDIV_Text[InDIVID] = document.getElementById(InDIVID).innerHTML;
	document.getElementById(InDIVID).innerHTML = "";
}

function ExpDIV_Toggle(InDIVID){
	var IsVisible = (document.getElementById(InDIVID).innerHTML != "");
	document.getElementById(InDIVID).innerHTML = IsVisible ? "":ExpDIV_Text[InDIVID];
}
