//used to open pop-ups into larger photos
//<!--
function showPhoto(pFileName, pTitle, pCaption,w,h) {
// specify window parameters

  var ww = Number(w) +50;
  var hh = Number(h) +100;
  ww = String(ww);
  hh = String(hh);
  var photoName = String(pFileName);
  var photoWin = window.open( '', '_blank', 'width='+ww+',height='+hh+',status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40');
// write content to new window
  photoWin.document.write('<html><head><title>' + pTitle + '</title></head>');	
  photoWin.document.write('<BODY BGCOLOR=#333333 TEXT=#FFFFCC  LINK=#33CCFF VLINK=#FF6666>');
  photoWin.document.write('<center>');
  photoWin.document.write('<font size=1 face="verdana"><b>' + pCaption + '</b></font><br>');
  photoWin.document.write('<img src="' + pFileName + '"><p>');
  photoWin.document.write('<font face="verdana" size=0>');
  photoWin.document.write( '"' + pTitle + '" photo &copy; Incremental Systems<br>');
  photoWin.document.write('<p></font></body></html>');
  photoWin.document.close();

};
function launchSWF( htmlName,w,h) {
/* 
Loads an already created html into the new window.

*/
  var ww = Number(w) +50;
  var hh = Number(h) +100;
  ww = String(ww);
  hh = String(hh);
  htmlName = String(htmlName);
  var swfWin = window.open( 'swf/'+htmlName+'.html','_blank', 'width='+ww+',height='+hh+',status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40');
}

var SimHosts = new Array();
SimHosts["BURBANK"]		= "burbank.powerdata.com";
SimHosts["BURBANK_demo"]	= "burbank.powerdata.com";
SimHosts["BURBANK-test-DE"]	= "de.powerdata.com";
SimHosts["BURBANK-test"]	= "de.powerdata.com"
SimHosts["SOS_Development"]	= "miso.powerdata.com";
SimHosts["ISO-NE"]		= "isone.powerdata.com";
SimHosts["ISO-NE-MSQ"]		= "isone_msq.powerdata.com";
SimHosts["AESO-private"]	= "aeso.powerdata.com";
SimHosts["AESO-shared"]		= "aeso.powerdata.com";
SimHosts["AESO-test-DE"]	= "aeso.powerdata.com";
SimHosts["AESO-test-1"]	 	= "aeso.powerdata.com";
SimHosts["AESO-work"]	 	= "de.powerdata.com";
SimHosts["AESO-work-PAL"] 	= "de.powerdata.com";
SimHosts["AESO-work-DE"] 	= "de.powerdata.com";
SimHosts["PGAE-1"]		= "pgae.powerdata.com";
SimHosts["PGAE-2"]		= "pgae.powerdata.com";
SimHosts["railbelt"]		= "railbelt.powerdata.com";
SimHosts["railbelt-p"]		= "railbelt.powerdata.com";
SimHosts["railbelt-work"]	= "66.114.139.245";
SimHosts["chugach"]		= "railbelt.powerdata.com";
SimHosts["amlp"]		= "railbelt.powerdata.com";
SimHosts["gvea"]		= "railbelt.powerdata.com";
SimHosts["railbelt_sosdev"]	= "railbelt.powerdata.com";
SimHosts["CW_demo"] 		= "66.114.139.245";
SimHosts["railbelt_demo"]	= "66.114.139.245";
SimHosts["demo_PAL"]		= "66.114.139.245";
SimHosts["demo_PAL07"]		= "66.114.139.245";
SimHosts["saeopstest-default-PAL2007"] = "vmiso.powerdata.com";
SimHosts["SERC-A"]		= "serc.powerdata.com";
SimHosts["SERC-B"]		= "serc.powerdata.com";
SimHosts["SERC-C"]		= "serc.powerdata.com";
SimHosts["SERC-D"]		= "serc.powerdata.com";
SimHosts["SERC-E"]		= "serc.powerdata.com";
SimHosts["SERC-F"]		= "serc.powerdata.com";
SimHosts["SERC-G"]		= "serc.powerdata.com";
SimHosts["SERC-H"]		= "serc.powerdata.com";
SimHosts["SERC-I"]		= "serc.powerdata.com";
SimHosts["SERC-J"]		= "serc.powerdata.com";
SimHosts["SIPC"]		= "sipc.powerdata.com";
SimHosts["SIPC-A"]		= "sipc.powerdata.com";
SimHosts["SIPC-B"]		= "sipc.powerdata.com";
SimHosts["SIPC-C"]		= "sipc.powerdata.com";
SimHosts["SIPC-D"]		= "sipc.powerdata.com";
SimHosts["SIPC-test"]		= "sipc.powerdata.com";
SimHosts["SIPC-test-A"]		= "sipc.powerdata.com";
SimHosts["SIPC-DE-test"]	= "de.powerdata.com";
SimHosts["TID-1"]		= "tid.powerdata.com";
SimHosts["TID-2"] 		= "tid.powerdata.com";
SimHosts["TID-exercises"] 	= "tid.powerdata.com";
SimHosts["TID-work"] 		= "tid.powerdata.com";
SimHosts["MID"] 		= "de.powerdata.com";
SimHosts["MID-test"] 		= "de.powerdata.com";
SimHosts["AESO-model"] 		= "de.powerdata.com";
SimHosts["AESO-model-DE"] 	= "de.powerdata.com";
SimHosts["BURBANK-model"] 	= "de.powerdata.com";
SimHosts["BURBANK-model-DE"] 	= "de.powerdata.com";
SimHosts["CENTWA-model"] 	= "de.powerdata.com";
SimHosts["CENTWA-model-DE"] 	= "de.powerdata.com";
SimHosts["GCPUD-work"] 		= "de.powerdata.com";
SimHosts["GCPUD-work-DE"] 	= "de.powerdata.com";
SimHosts["DCPUD-work"] 		= "de.powerdata.com";
SimHosts["DCPUD-work-DE"] 	= "de.powerdata.com";
SimHosts["ISONE-model"] 	= "debeta.powerdata.com";
SimHosts["ISONE-model-DE"] 	= "debeta.powerdata.com";
SimHosts["ISO-NE-DE"] 		= "isone.powerdata.com";
SimHosts["ISO-NE-test"] 	= "isone.powerdata.com";
SimHosts["MID-model"] 		= "de.powerdata.com";
SimHosts["MID-model-DE"] 	= "de.powerdata.com";
SimHosts["PGAE-model"] 		= "de.powerdata.com";
SimHosts["PGAE-model-DE"] 	= "de.powerdata.com";
SimHosts["RAILBELT-model"] 	= "de.powerdata.com";
SimHosts["RAILBELT-model-DE"] 	= "de.powerdata.com";
SimHosts["SIPC-model"] 		= "de.powerdata.com";
SimHosts["SIPC-model-DE"] 	= "de.powerdata.com";
SimHosts["TID-model"] 		= "de.powerdata.com";
SimHosts["TID-model-DE"] 	= "de.powerdata.com";
SimHosts["PAL2007-model"] 	= "de.powerdata.com";
SimHosts["EMPTY-CIM"] 		= "de.powerdata.com";
SimHosts["NEW-CIM"] 		= "de.powerdata.com";
SimHosts["PALCO2007-robin-work"] = "de.powerdata.com";
SimHosts["PALCO2007-robin-DE-work"] = "de.powerdata.com";
SimHosts["TID-robin-work"] 	= "asp1.powerdata.com";
SimHosts["PALCO2007-shared-new"]= "burbank.powerdata.com";
SimHosts["PALCO2007-individual-new"] 	= "burbank.powerdata.com";
SimHosts["PALCO2007-individual-old"] 	= "asp1.powerdata.com";
SimHosts["PALCO2007-shared-old"] 	= "asp1.powerdata.com";
SimHosts["DE-test-manual"] 	= "de.powerdata.com";
SimHosts["DE-test-manual-runtime"] 	= "de.powerdata.com";
SimHosts["FRCC"] 		= "incsysdemo.powerdata.com";
SimHosts["SCAL-DEMO"] 		= "incsysdemo.powerdata.com";
SimHosts["LES-TEST"] 		= "de.powerdata.com";
SimHosts["LES-model"] 		= "de.powerdata.com";
SimHosts["LES-model-DE"] 	= "de.powerdata.com";
SimHosts["NIPSCO-robin-work"] 	= "de.powerdata.com";


var eopshost="asp2.powerdata.com";
var teopshost="sos.powerdata.com";
//var cbshost = "asp1.powerdata.com";
var deftarget="getemail.jsp";
var logintarget="common/usermgmt/simplelogin.jsp";
var directtarget="simulator";
var wwidth = 950;
var wheight = 300;

function opensim()
{
 opensim2(teopshost, "default-PAL", "default", "PAL", false, "getemail.jsp", false, true);
}
function opengsim(ses)
{
 opensim2(teopshost, ses, "default", "PAL", true, "getemail.jsp", false, true);
}

function opensim1(sesname, grp, model, isshared, target, issecure, useajax)
{
    var host = SimHosts[sesname];
    if ( typeof(host) == "undefined" )
    {
        alert("Host not defined for group \""+sesname+"\"");
    }
    else
    {
        opensim2(host, sesname, grp, model, isshared, target, issecure, useajax);
    }		
}

function opensim2(host, sesname, grp, model, isshared, target, issecure, useajax)
{
 var uax = (useajax == null) ? false : useajax;
 var suax = "&useAjax="+uax;
 var scheme = "http";
 if (issecure)
 {
 scheme += "s";
 }
 var url = scheme + "://"+host+"/eops/"+target+"?isshared="+isshared+"&group="+grp+"&session="+sesname+"&model="+model+"&config=OTS"+suax;
 var wopt = "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no," + "width="+wwidth+",height="+wheight;
 window.open(url, "simeops", wopt);
}

function opengsim2(u,g,m)
{
window.open("http://" + teopshost + "/eops/simulator?uname="+u+"&passwd=demo&company="+g+"&modid="+m+"&shared=true","simeops",'toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=1000,height=600')
}

function opende1(sesname, grp, model, isshared, target, issecure, useajax)
{
    var host = SimHosts[sesname];
    if ( typeof(host) == "undefined" )
    {
        alert("Host not defined for group \""+sesname+"\"");
    }
    else
    {
        opende(host, sesname, grp, model, isshared, target, issecure, useajax);
    }		
}

function opende(host, sesname, grp, model, isshared, target, issecure)
{
 var scheme = "http";
 if (issecure)
 {
 scheme += "s";
 }
 var url = scheme + "://"+host+"/de/"+target+"?isshared="+isshared+"&group="+grp+"&session="+sesname+"&model="+model+"&config=DE&target=/de/demain.jsp";
 var wopt = "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no," + "width="+wwidth+",height="+wheight;
 window.location.href=url;
}

function opende2(host, sesname, grp, model, isshared, target, issecure, useajax)
{
 var uax = (useajax == null) ? false : useajax;
 var suax = "&useAjax="+uax;
 var scheme = "http";
 if (issecure)
 {
 scheme += "s";
 }
 var url = scheme + "://"+host+"/de/"+target+"?isshared="+isshared+"&group="+grp+"&session="+sesname+"&model="+model+"&config=DE&target=/de/demain.jsp"+suax;
 var wopt = "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no," + "width="+wwidth+",height="+wheight;
 window.location.href=url;
}
//used for ISONE Exercises
function opensim_alt(host, sesname, grp, model, isshared, target, issecure)
{
        var scheme = "http";
        if (issecure)
        {
                scheme += "s";
        }
        var url = scheme + "://"+host+"/eops/"+target+"?useAjax=true&isshared="+isshared+"&group="+grp+"&session="+sesname+"&model="+model+"&config=OTS";
        var wopt = "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no," + "width="+wwidth+",height="+wheight;
        window.open(url, "simeops", wopt);
}
/*var secure = false;
function logInOut(siteStyle) {
	var ss = String(siteStyle);
	var tb = document.getElementById("titlebar");
	if (ss !== "")
	{
		if (ss == "secure")
		{
			tb.style.backgroundImage="url(images/stitlebackground.jpg)";
			makeRequest("psmsecurenav.html","navigation");
			makeRequest("psmblank.html","currentevents");
			secure = true;
		}
		else 
		{
			tb.style.backgroundImage="url(images/titlebackground.jpg)";
			makeRequest("psmnavigation.html","navigation");
			makeRequest("psmcurrentevents.html","currentevents");
			secure = false;
		}
	}
	
	else 
	{
		
		if (secure == false)
		{
			tb.style.backgroundImage="url(images/stitlebackground.jpg)";
			makeRequest("psmsecurenav.html","navigation");
			makeRequest("psmblank.html","currentevents");
			secure = true;
		}
		else 
		{
			tb.style.backgroundImage="url(images/titlebackground.jpg)";
			makeRequest("psmnavigation.html","navigation");
			makeRequest("psmcurrentevents.html","currentevents");
			secure = false;
		}
	}


}
*/

/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

					
// -->
