function openWindow(url, name) {
  var l = openWindow.arguments.length;
  var w = "";
  var h = "";
  var features = "";

  for (i=2; i<l; i++) {
    var param = openWindow.arguments[i];
    if ( (parseInt(param) == 0) ||
      (isNaN(parseInt(param))) ) {
      features += param + ',';
    } else {
      (w == "") ? w = "width=" + param + "," :
       h = "height=" + param;
    }
  }

  features += w + h;
  var code = "popupWin = window.open(url, name";
  if (l > 2) code += ", '" + features;
  code += "')";
  eval(code);
  }
  
 // drop down menu
function gotosite(site) {            
        if (site != "") {                    
                self.location=site; 
        }
}     



function close_window(){parent.window.close();}
if ((window.navigator.appName.indexOf("Microsoft")==0) &
(window.navigator.appVersion.substring(0,1)=="4")) {
                                window.focus();
                        }
                        else
                            if ((window.navigator.appName.indexOf("Netscape")
==0) & (window.navigator.appVersion.substring(0,1)=="4")) {
                                window.focus();
                        }
 
  // BEGIN: photo popups (pops photo from camera link)
var name = "";

  function photo(filename) {
  openWindow(name="features/see_it_now/"+filename+".html",'photo', 635, 400, 'scrollbars', 'status');
}
 // END: photo popups (pops photo from camera link)
 
 
 
 
// BEGIN: photo popup image browser link
 function browser() {opener.location.href='../../../tools/browser.html'} 
  
// END: photo popup image browser link



// BEGIN: oxford link (this is used on the segment pages)
 function oxford() {openWindow('http://www.oup-usa.org/childrens/historyofus','oxford', 750, 400, 'status', 'scrollbars', 'resizable', 'toolbar', 'location')}
 // END: oxford link
 
// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.html

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};
// end central randomizer. -->


function getWebisode () {

	var a = new Array();
	a[1] = "1	What drove Britain's thirteen North American colonies to revolution?";
	a[2] = "2	After the Treaty of Paris, America drafts a constitution and creates a nation.";
	a[3] = "3	Westward expansion becomes a symbol for the American quest for freedom.";
	a[4] = "4	Industrial development creates a new economy in the North and splits the nation in two.";
	a[5] = "5	The contradiction of slavery in a land of liberty becomes impossible for America to ignore.";
	a[6] = "6	America's bloodiest war lasts four years, testing the strength of the Union.";
	a[7] = "7	Reconstruction seeks to give equality to African Americans, unsuccessfully.";
	a[8] = "8	After the Civil War, Americans continue to push West.";
	a[9] = "9	African Americans, women, laborers, and immigrants fight for their rights.";
	a[10] = "10	America struggles with the inequities that come with economic growth.";
	a[11] = "11	The 20th Century begins with a flurry: the first flight, WWI, the Jazz Age.";
	a[12] = "12	Franklin D. Roosevelt must guide America through depression and world war.";
	a[13] = "13	Fear of communism spreads as the nation enters the Cold War era.";
	a[14] = "14	Rosa Parks, Martin Luther King, and a nation rally behind civil rights.";
	a[15] = "15	The ideals of the sixties quickly dissolve with a slew of political assassinations.";
	a[16] = "16	As America enters the new millennium, she faces a new kind of enemy.";
	
	var getWebisodeNumber = rand(16);
	var thisLineText = a[getWebisodeNumber];
	var b = new Array();
	b = a[getWebisodeNumber].split("\t");
	var webNumber;
	
	if (b[0].length == "1") {
		webNumber = "0" + b[0];
	} else {
		webNumber = b[0];
	}
	
	document.write("<a href=\"web" + webNumber + "/index.html\">Webisode " + b[0] + "</a><BR>" + b[1]);

}

function getGame() {
	
	var c = new Array();
	c[1] = "What Did They Say?	Who said that? Lincoln, Roosevelt, Sam Adams...";
	c[2] = "Place The Landmarks!	Put these landmark events in their proper place.";
 
 	var getGameNumber = rand(2);
	var thisLineText = c[getGameNumber];
	var d = new Array;
	d = c[getGameNumber].split("\t");
	
	document.write("<B>" + d[0] + "</b><BR>" + d[1]);
}
