/* 	window.js 
	window management functions
	by: 		Neil Johnson
	created:	26 Jan 98
	project:	ROI CD-ROM
*/
document.write('<sc' + 'ript' +   ' src="/exset/fnFrameSet.js"  language' + '="Java' +  'Script"'+  ' ></s' + 'cript>');

function
centerNewWindow (windowWidth, windowHeight, srcName, winName ) {


	var screenMargin = 1.2 // if the screen is at least 20% larger than the window size
	viewPortHorizontal	= screen.width;
	viewPortVertical	= screen.height;

	// determine coords to center the window
	if ( viewPortHorizontal > windowWidth * screenMargin) 
		{
		winLeft = ( viewPortHorizontal / 2 ) -
					( windowWidth / 2 );
		}
	else 
		{
		winLeft = 0;
		}

	if ( viewPortVertical > windowHeight * screenMargin )
		{
		winTop = ( viewPortVertical / 2 ) -
					( windowHeight / 2 );
		}
	else 
		{
		winTop = 0;
		}


	// all window features not specified are FALSE
	windowFeaturesList	= "innerWidth=" + windowWidth +
							",innerHeight=" + windowHeight +
							",screenX=" + winLeft +
							",screenY=" + winTop;
	
	newWindow = window.open(srcName,
		winName,
		windowFeaturesList);

	newWindow.focus();
}


function
viewProgram () {
	centerNewWindow (800, 600, "main.htm", "mainWindow");

}


function
openBig () {
	centerNewWindow (630, 420, "mainwin.htm", "mainWindow");

}

function
openWinstaller () {
	centerNewWindow (500, 430, "winst1.htm", "installWindow");

}

function
openUnixSup () {
	centerNewWindow (500, 430, "../help/unixcalc.htm", "installWindow");

}

function ExitIPIMS(){
	self.close()
}

function textwin(URL,windowname) {
    openwin = window.open(URL,windowname,"menubar=yes,scrollbars=yes,width=600,height=400,toolbar=no,resizable=1");   
}

function figurewin(URL,windowname) {
    openfigure = window.open(URL,windowname,"width=400,height=400");
}

function figurewin2(URL,windowname) {
    openfigure = window.open(URL,windowname,"width=640,height=480");
}

function videowin(URL) {
    openvideo = window.open(URL,"video","width=360,height=360");
}

function ChangeStatus(message) {
    self.status = message;
}

function open_window(url) {
email = window.open(url,"eMailHelp",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=500');
}

function open_window2(url) {
email = window.open(url,"Help",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=750,height=400');
}

function helpWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=yes,toolbar=no,resizable=1,width=750,height=400");
}

function detailWinMul(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=yes,toolbar=no,resizable=1,width=500,height=300");
}

function devWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=no,toolbar=no,resizable=0,width=430,height=340");
}

function SponWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=yes,toolbar=no,resizable=0,width=475,height=575");
}

function ContactWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=yes,toolbar=no,resizable=0,width=475,height=585");
}


function CaptureWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=yes,toolbar=no,resizable=0,width=600,height=600");
}

function popup() {
var page = "blurb.htm";
windowprops = "height=300,width=450,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=no";

window.open(page, "Popup", windowprops);
}

function popup2() {
var page = "intro.htm";
windowprops = "height=500,width=450,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=no";

window.open(page, "Popup2", windowprops);
}

function ReportWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=no,toolbar=no,resizable=0,width=700,height=500");
}

function WebTrendsWin(url,windowName) 
{
  openwin = window.open(url,windowName,"menubar=no,scrollbars=yes,toolbar=no,resizable=1,width=700,height=500");
}

function explainwin(URL,windowname,WindowWidth,WindowHeight) 
{
	windowFeaturesList = "menubar=no,scrollbars=auto," +
     						       "width=" + WindowWidth +
						           ",height=" + WindowHeight + 
						           ",toolbar=no,resizable=1"

	openwin = window.open(URL,windowname,windowFeaturesList);   
}

function genericwin(URL,windowname,WindowWidth,WindowHeight,Scroll) 
{
	windowFeaturesList = "menubar=0,directories=0," +
     						       "width=" + WindowWidth +
						           ",height=" + WindowHeight + 
						           ",scrollbars=" + Scroll + 
						           ",toolbar=0,resizable=1"

	openwin = window.open(URL,windowname,windowFeaturesList);   
}

function genericwin2(URL,windowname,WindowWidth,WindowHeight,Scroll,Menubar) 
{
	windowFeaturesList = "directories=0," + 
				"menubar=" + Menubar + 
     				",width=" + WindowWidth +
				",height=" + WindowHeight + 
				",scrollbars=" + Scroll + 
				",toolbar=0,resizable=1"

	openwin = window.open(URL,windowname,windowFeaturesList);  
	openwin.focus();
 
}

function submitform() {
    if (document.form.Email.value.indexOf("@") + "" != "-1" &&
        document.form.Email.value.indexOf(".") + "" != "-1" &&
        document.form.Email.value != "") 
    document.form.submit();
    else alert("Please enter a valid email address.");
		document.form.Email.focus();
}

function MM_preloadImages() {
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

loc = document.location.href

/*alert(loc.indexOf('progs/mgmt/'))
alert(loc.indexOf('progs/pbody.htm'))
alert(parent.document.location=document.location)  
*/
if ((loc.indexOf('progs/')!=-1 ) && (parent.document.location==document.location) ) {
	var menuID = 1
  //var fset = '/progs/pset.htm' //Management Programs
	document.location = '/InstructionalPrograms/';
	var isOkay = false;
	if (loc.indexOf('progs/mgmt/')!=-1 ||  loc.indexOf('progs/pbody.htm')!=-1)  {
		isOkay = true   //Management Programs ProgramDetails1
	} else if (loc.indexOf('progs/workshps/')!=-1 ) {
		//isOkay = true;
		isOkay = false;
		//menuID = 2;
		document.location = '/InstructionalPrograms/BusinessWorkshops/';
	} else if (loc.indexOf('video')!=-1 ) {
		//isOkay = true
		isOkay = false;
		//menuID = 3;
		document.location = '/InstructionalPrograms/VideoProducts/';
	}
// missing a frameset
	if (isOkay==true) {
		//document.location = '/index.htm?body=' + fset + '&MenuID=' + menuID  + '&right=' + loc
		document.location = '/InstructionalPrograms/ProgramSchedule/'
	}
}