/*
// browser detection
var winIEpass = ((navigator.appVersion.indexOf("MSIE") != -1)&&
    (navigator.appVersion.indexOf("Windows") != -1)) ? true : false;

var NNpass = ((((navigator.appName == "Netscape") && 
    (navigator.userAgent.indexOf("Mozilla") != -1)) ||
     navigator.userAgent.indexOf("Gecko") != -1)) ? true : false;
	 
*/

//var flash = navigator.mimeTypes["application/x-shockwave-flash"] ? true :false;
var flash = navigator.plugins ["Shockwave Flash"] ? true :false;

if (flash != null) {
     flashFound = 1;
} else {
     flashFound = null;
}




// Window openers
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function windowOpener_pos(theURL){
if (theURL == "/ncwiseowl/enrollment/") {
features = 'width=800,height=490,top=0,left=0,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes';
} else {
var features = 'width=780,height=490,top=0,left=0,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes';
}

  if ((linkWindow == null) || (linkWindow.closed)){
       linkWindow = window.open (theURL, 'childWindow', features);
	   linkWindow.focus();
	   }
    else {
	   linkWindow.close();
       linkWindow = window.open (theURL, 'childWindow', features);
    }   
}

// Flash Flowchart Navigation
function flownav (dest) {
	switch (dest) {
	// English
		case 'eng_topics':
	MM_openBrWindow('/support/flowchart/global/media/html/topics/Eng.html','topics','width=640,height=550,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'eng_lp':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=3&Lesson=1','lessonPlan','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'eng_res':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=3&Lesson=2','webResources','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'eng_inq':
			MM_openBrWindow('/ProductEntrance/demoWebInquiry.jsp?Subject=3','webInquiry','width=780,height=550,scrollbars=yes');
			break;
		
		case 'eng_interact1':
			MM_openBrWindow('/products/americanlit/demo/amlit_demo.shtml','IADemo','width=480,height=320');
			break;
		
		
		// Social Studies
		case 'ss_topics':
			MM_openBrWindow('/support/flowchart/global/media/html/topics/SS.html','topics','width=640,height=400,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'ss_lp':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=4&Lesson=1','lessonPlan','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'ss_res':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=4&Lesson=2','webResources','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'ss_inq':
			MM_openBrWindow('/ProductEntrance/demoWebInquiry.jsp?Subject=4','webInquiry','width=780,height=550,scrollbars=yes');
			break;
		
		case 'ss_interact':
			MM_openBrWindow('/products/us_history/demo/ssdemo.shtml','IADemo','width=480,height=320');
			break;
		
		
		// Science
		case 'sci_topics':
			MM_openBrWindow('/support/flowchart/global/media/html/topics/Sci.html','topics','width=640,height=400,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'sci_lp':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=1&Lesson=1','lessonPlan','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'sci_res':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=1&Lesson=2','webResources','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'sci_inq':
			MM_openBrWindow('/ProductEntrance/demoWebInquiry.jsp?Subject=1','webInquiry','width=780,height=550,scrollbars=yes');
			break;
		
		case 'sci_interact':
			MM_openBrWindow('/products/biology/demo/bio_demo.shtml','IADemo','width=480,height=320');
			break;
		
		
		// Mathematics
		case 'math_topics':
			MM_openBrWindow('/support/flowchart/global/media/html/topics/Math.html','topics','width=640,height=400,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'math_lp':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=2&Lesson=1','lessonPlan','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'math_res':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=2&Lesson=2','webResources','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'math_inq':
			MM_openBrWindow('/ProductEntrance/demoWebInquiry.jsp?Subject=2','webInquiry','width=780,height=550,scrollbars=yes');
			break;
		
		case 'math_interact':
			MM_openBrWindow('/products/intro_algebra/demo/algebra_demo.shtml','IADemo','width=480,height=320');
			break;
		
		
		// Spanish
		case 'spanish_topics':
			MM_openBrWindow('/support/flowchart/global/media/html/topics/Sp.html','topics','width=640,height=400,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'spanish_lp':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=5&Lesson=1','lessonPlan','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'spanish_res':
			MM_openBrWindow('/ProductEntrance/demoPathwaysLessonPlans.jsp?Subject=5&Lesson=2','webResources','width=540,height=450,scrollbars=yes,resizable=yes,menubar=yes');
			break;
		
		case 'spanish_inq':
			MM_openBrWindow('/ProductEntrance/demoWebInquiry.jsp?Subject=5','webInquiry','width=780,height=550,scrollbars=yes');
			break;
			
		case 'spanish_interact':
			MM_openBrWindow('/products/spanish_grammar/demo/spanish_demo.shtml','IADemo','width=480,height=320');
			break;
	}

}





var sections = new Array();
sections['section1'] = "1";
sections['section2'] = "1";
sections['section3'] = "1";
sections['section4'] = "1";
sections['section5'] = "1";
sections['section6'] = "1";

function displayCheck() {
	for (i=1; i<=6; i++) {
	var idName = 'section'+i;
	document.getElementById(idName).className = 'hide';
	}
}
/*
This function used to show or hide elements of a page
An array needs to be set up on the content page and look something like
	var sections = new Array();
	sections['XXX1'] = "1";
	sections['XXX2'] = "1";
	sections['XXX3'] = "1";
	sections['XXX4'] = "1";
Each XXXX is the ID of the element to show or hide

switch_XXXX is the ID that should be placed on the link that contains the words "expand".
This will switch between "expand" and "collapse".
*/
function toggle(what) {
	if (sections[what] == 1) {
		document.getElementById(what).className = 'show';
		document.getElementById('cell'+what).height = '1px';
		document.getElementById('img'+what).src= '/global/graphics/bullet_openArrow.gif';
		document.getElementById('img'+what).alt= 'collapse';
		sections[what] = 2;
	} else {
		document.getElementById(what).className = 'hide';
		document.getElementById('cell'+what).height = '10px';
		document.getElementById('img'+what).src= '/global/graphics/bullet_closedArrow.gif';
		document.getElementById('img'+what).alt= 'expand';
		sections[what] = 1;
	}
}


















// image swap for products only
var lastImg;
function productImgSwap (imgNum, ia) {
	if (lastImg) {
		document.getElementById('img'+lastImg).src= '/products/'+ia+'/graphics/'+lastImg+'_th_off.jpg';
	}
	document.getElementById('img'+imgNum).src= '/products/'+ia+'/graphics/'+imgNum+'_th_ro.jpg';
	document.getElementById('ia_img').src= '/products/'+ia+'/graphics/'+imgNum+'_big.jpg';
	lastImg = imgNum;
}