
var ow1=null;
var ow2=null;

// Game system functions

// Mechanoids
function openMechanoidsGame()
{
  ow1=window.open("./html/mechanoids.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes"); 
}

// Rifts
function openRiftsGame()
{
  ow1=window.open("./html/rifts.html", "gamewin" ,"top=10,left=10,height=250,width=640,toolbar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// Deadlands
function openDeadlandsGame()
{
  ow1=window.open("./html/deadlands.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// Rifts Mechanoids
function openRiftsMechGame()
{
  ow1=window.open("./html/riftmech.html", "gamewin" ,"top=10,left=10,height=250,width=640,toolbar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// Xeno - Palladium Systems based 
function openXenoGame()
{
  ow1=window.open("./html/xeno.html", "gamewin" ,"top=10,left=10,height=250,width=640,toolbar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// 3rd Edition D&D
function openDandDGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Twilight 2000
function openTwilight2000Game()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Traveller 
function openTravellerGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Supers
function openGurpsSupersGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Stone Age
function openGurpsStoneAgeGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Circ 1990
function openGurpsCirc1990Game()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps TimeMsaters 2478
function openGurpsTimeMasters2478Game()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Cyborg
function openGurpsCyborgGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Run Out The Guns
function openRunOutTheGunsGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Arabian Knights
function openArabianKnightsGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Amber
function openAmberGame()
{
  ow1=window.open("./html/amber.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Star Ship Troopers 
function openStarShipTroopersGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Star Wars
function openStarWarsGame()
{
  ow1=window.open("./html/starwars.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Snow Valley
function openSnowValleyGame()
{
  ow1=window.open("./html/snowvly.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// RuneQuest
function openRuneQuestGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Generic No Description
function openNoDescGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Mark's Cthulhu
function openCthulhuGame()
{
  ow1=window.open("./html/nodescgame.html", "gamewin" ,"top=10,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Campaign page functions

// Kevin's Rifts Campaign
function openRiftsCamp1()
{
  ow2=window.open("http://www.azer.co.uk/rfthp.html", "campwin" ,"top=165,left=10,height=450,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Kevin's Rifts Mechanoids Campaign
function openRiftsMechCamp()
{
  ow2=window.open("http://www.azer.co.uk/rmech.html", "campwin" ,"top=165,left=10,height=450,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Kevin's Xeno Campaign
function openXenoCamp()
{
  ow2=window.open("http://www.azer.co.uk/html1/xenocpg/Xeno.html", "campwin" ,"top=165,left=10,height=450,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Kevin's Star Wars Rebellion Campaign
function openStarWarsRebel()
{
  ow2=window.open("http://www.azer.co.uk/html1/swcpg/sw.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Andy Leishman's Mechanoids Campaign
function openMechanoidsCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Eddy Blacks D&D Campaign
function openDandDAerth()
{
  ow2=window.open("./html/aerthsyn.html", "campwin" ,"top=165,left=10,height=450,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Andy Collyer's D&D Campaign
function openDandDHaven()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Peter Sjogren's D&D Campaign
function openDandDKalamar()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

//  D&D Campaign
function openDandDNoDescCamp()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Ed's Twilight 2000 Campaign
function openTwilight2000Camp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Star Ship Troopers
function openStarShipTroopersCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Traveller
function openTravellerCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps 
function openGurpsNoDescCamp()
{
  ow2=window.open("./nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Supers
function openGurpsSupersCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Stone Age
function openGurpsStoneAgeCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Circ1990
function openGurpsCirc1990Camp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps TimeMasters 2478
function openGurpsTimeMasters2478Camp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Gurps Cyborg
function openGurpsCyborgCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Run Out The Guns
function openRunOutTheGunsCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Arabian Knights
function openArabianKnightsCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Amber
function openAmberCamp1()
{
  ow2=window.open("http://www.azer.co.uk/html1/amber/amber.html", "campwin" ,"top=165,left=10,height=450,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}
// Amber - Kevins Campaign
function openAmberCamp1()
{
  ow2=window.open("http://www.azer.co.uk/html1/amber/13_intro.html", "campwin" ,"top=165,left=10,height=450,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Deadlands
function openDeadlandsCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Seventh Seas
function openSevenSeasCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// StarWars
function openStarWarsCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// StarWars
function openSWNoDescCamp()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Brian's 3rd Edition Viking D&D Campaign
function openDandDVikingCamp()
{
  ow2=window.open("http://www.queens.ox.ac.uk/brian/index.php", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// RuneQuest
function openRuneQuestCamp1()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Snow Valley
function openSnowValleyCamp()
{
  ow2=window.open("./html/nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Mark's Cthulhu 
function openCthulhuCamp()
{
  ow2=window.open("./nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// Generic No Description 
function openNoDescCamp()
{
  ow2=window.open("./nodesccamp.html", "campwin" ,"top=165,left=10,height=150,width=640,toolbar=no,scrollbars=yes,resizable=yes");
}

// The functions that use close and open in combination
// I have numbered the campaigns so that a generic approach 
// can be used toward multiple campaigns of the same game system.

// Actual button links

// Kevin's Rifts game
function combRiftsCamp1()
{
  closeOW1();
  closeOW2();
  openRiftsGame();
  openRiftsCamp1();
}

// Kevin's Rifts Mechanoids game
function combRiftsMechCamp()
{
  closeOW1();
  closeOW2();
  openRiftsMechGame();
  openRiftsMechCamp();
}

// Kevin's Xeno game
function combXenoCamp()
{
  closeOW1();
  closeOW2();
  openXenoGame();
  openXenoCamp();
}

// Kevin's Windsor Star Wars
function combStarWarsRebel()
{
  closeOW1();
  closeOW2();
  openStarWarsGame();
  openStarWarsRebel();
}

// Andy Leishman's Mechanoids Campaign
function combMechanoidsCamp1()
{
  closeOW1();
  closeOW2();
  openMechanoidsGame();
  openMechanoidsCamp1();
}

// Eddy Black's 3rd edition D&D Campaign
function combDandDAerth()
{
  closeOW1();
  closeOW2();
  openDandDGame();
  openDandDAerth();
}

// Andy Collyer's 3rd edition D&D Haven Campaign
function combDandDHaven()
{
  closeOW1();
  closeOW2();
  openDandDGame();
  openDandDHaven();
}

// Peter Sjogren's 3rd Edition D&D Kalamar Campaign
function combDandDKalamar()
{
  closeOW1();
  closeOW2();
  openDandDGame();
  openDandDKalamar();
}

// Ed's Twilight 2000 Campaign
function combTwilight2000Camp1()
{
  closeOW1();
  closeOW2();
  openTwilight2000Game();
  openTwilight2000Camp1();
}

// Deadlands
function combDeadlandsCamp1()
{
  closeOW1();
  closeOW2();
  openDeadlandsGame();
  openDeadlandsCamp1();
}

// Arabian Knights

function combArabianKnightsCamp1()
{
  closeOW1();
  closeOW2();
  openArabianKnightsGame();
  openArabianKnightsCamp1();
}

// Amber
function combAmberCamp1()
{
  closeOW1();
  closeOW2();
  openAmberGame();
  openAmberCamp1();
}

// Run Out The Guns
function combRunOutTheGunsCamp1()
{
  closeOW1();
  closeOW2();
  openRunOutTheGunsGame();
  openRunOutTheGunsCamp1();
}

// Traveller
function combTravellerCamp1()
{
  closeOW1();
  closeOW2();
  openTravellerGame();
  openTravellerCamp1();
}

// Gurps Stone Age
function combGurpsStoneAgeCamp1()
{
  closeOW1();
  closeOW2();
  openGurpsStoneAgeGame();
  openGurpsStoneAgeCamp1();
}

// Gurps Supers
function combGurpsSupersCamp1()
{
  closeOW1();
  closeOW2();
  openGurpsSupersGame();
  openGurpsSupersCamp1();
}

// Gurps circ 1990
function combGurpsCirc1990Camp1()
{
  closeOW1();
  closeOW2();
  openGurpsCirc1990Game();
  openGurpsCirc1990Camp1();
}

// Gurps TimeMasters 2478
function combGurpsTimeMasters2478Camp1()
{
  closeOW1();
  closeOW2();
  openGurpsTimeMasters2478Game();
  openGurpsTimeMasters2478Camp1();
}

// Gurps Cyborg
function combGurpsCyborgCamp1()
{
  closeOW1();
  closeOW2();
  openGurpsCyborgGame();
  openGurpsCyborgCamp1();
}

// Gurps No Desc
function combGurpsNoDescCamp()
{
  closeOW1();
  closeOW2();
  openNoDescGame();
  openNoDescCamp();
}

// Star Ship Troopers
function combStarShipTroopersCamp1()
{
  closeOW1();
  closeOW2();
  openStarShipTroopersGame();
  openStarShipTroopersCamp1();
}

//  Toms Snow Valley Campaign
function combSnowValleyCamp()
{
  closeOW1();
  closeOW2();
  openSnowValleyGame();
  openSnowValleyCamp();
}

// Star Wars
function combStarWarsCamp1()
{
  closeOW1();
  closeOW2();
  openStarWarsGame();
  openStarWarsCamp1();
}

// Star Wars
function combSWNoDescCamp()
{
  closeOW1();
  closeOW2();
  openStarWarsGame();
  openSWNoDescCamp();
}

// Brians 3rd Edition Viking D&D Campaign
function combDandDVikingCamp()
{
  closeOW1();
  closeOW2();
  openDandDGame();
  openDandDVikingCamp();
}

// 3rd Edition D&D Campaign
function combDandDNoDescCamp()
{
  closeOW1();
  closeOW2();
  openDandDGame();
  openDandDNoDescCamp();
}

// RuneQuest Campaign
function combRuneQuest1()
{
  closeOW1();
  closeOW2();
  openRuneQuestGame();
  openRuneQuestCamp1();
}
// Generic No Desc
function combNoDescCamp()
{
  closeOW1();
  closeOW2();
  openNoDescGame();
  openNoDescCamp();
}

// Mark's Call of Cthulhu Campaign
function combCthulhuCamp()
{
  closeOW1();
  closeOW2();
  openCthulhuGame();
  openCthulhuCamp();
}

//The window close functions
function closeOW1()
{
  if (ow1 != null)
      if (!ow1.closed) ow1.close();
  ow1=null;
}

function closeOW2()
{
  if (ow2 != null)
      if (!ow2.closed) ow2.close();
  ow2=null;
}

function closeBoth()
{
  closeOW1();
  closeOW2();
}