/*

    Facility:
        wattOBjects(tm) 
        Copyright 2001 Celeritas Technologies, LLC

    Title:
        wattPageTitleLayer.js

    Abstract:
        This module creates the layers presented by the main page of the Wattage Marketing 
		website.

        Requires: ctBrowserSensing.js, ctLayerCommon.js
        
    Author:
        Celeritas Technologies
        
    Creation Date:
        08-Mar-2002
        
    Modification History:
        dd-mmm-yyyy (iii)
            Description of change.

*/

var sCurrentLayer;
var sContentPrefix;
var sContentPostfix;
var sLayerContent;

	//
	// Set default (Internet Explorer) offsets for key layers.
	//
var nLeftMargin          = 10;
var nTopMargin           = 10;

var nPageWidth           = 756;

var nTitleBarHeight      = 80;
	
var nSideBarWidth        = 170; 
var nSideBarHeight       = 4350;

var nMenuBarBorderY      = nTitleBarHeight + 1;
var nMenuBarBorderX      = nSideBarWidth + 8;
var nMenuBarBorderWidth  = nPageWidth - (nMenuBarBorderX + 1 ) + nLeftMargin;
var nMenuBarBorderHeight = 48;

var nMenuBarY            = nMenuBarBorderY + (nMenuBarBorderHeight/4);
var nMenuBarX            = nSideBarWidth + 8;
var nMenuBarWidth        = nMenuBarBorderWidth - 4;
var nMenuBarHeight       = 24;

var nMenuBarDropY        =  nMenuBarY + nMenuBarHeight + 1;
var nMenuBarDropX        =  nMenuBarX;

var nTopLeftCornerX      = nLeftMargin;
var nTopLeftCornerY      = nTopMargin;
var nTopLeftCornerW      = 25;
var nTopLeftCornerH      = 25;

var nTopRightCornerX     = 740;
var nTopRightCornerY     = nTopMargin;
var nTopRightCornerW     = 25;
var nTopRightCornerH     = 25;

var nBodyLeftMargin      = nSideBarWidth + nLeftMargin + 7;
var nBodyTopMargin       = nMenuBarBorderHeight + nMenuBarBorderY + 20;
var nBodyWidth           = nMenuBarWidth;

	//
	// Adjust layer offsets if the user's browser is Netscape (since IE and NS have different default
	// offsets).
	//
if ( isNS ) {
	nMenuBarDropY = 115;
	nMenuBarDropX -= 2;

	nTopLeftCornerX = 8;
	nTopLeftCornerY = 8;

	nTopRightCornerX = 744;
	nTopRightCornerY = 5;
}

function buildMenu(psItems,psHrefs) {
	var asItems = psItems.split("|");
	var asHrefs = psHrefs.split("|");

	if ( asItems.length != asHrefs.length ) {
		alert("The items length does not match the href length");
	}

	var sHtml = "";
	for ( var i = 0 ; i < asItems.length ; i++ ) {
		sHtml += "<a href='" + asHrefs[i] + "'><div class='dropMenuItem' onmouseover='highlightMenuItem(this);' onmouseout='dimMenuItem(this);'>" + asItems[i] + "</div></a>";
	}
	return sHtml;
}
/*

	//
	// Create the Title Bar
	//3dtext_11244
sContentPrefix  = '<table width="755" cellspacing="0" cellpadding="0" border=0><tr><td class="pageBar" width="100%"><table width="100%" cellspacing="0" cellpadding="0" border="0"><tr>'; 
sContentPostfix = '</tr></table></td></tr></table>';
//sLayerContent   = '<td colspan="2" valign="top" ><img src="images/WattageWorksPlugLogo.gif" ></td>';
//sLayerContent  += '<td valign="bottom" align="right"><img id="img2TitleText" src="images/sample.gif"  width="500" >&nbsp;&nbsp;</td>';
//sLayerContent  += '<td valign="bottom" align="right"><img id="imgTitleText" src="images/ToolSet.jpg"  width="500" >&nbsp;&nbsp;</td>';
//sLayerContent  +='<td><table width=95% cellspacing="0" cellpadding="0" border="0"><tr><td align="center"><IMG  src="images/Test3.gif"></td></tr><tr><td valign="bottom" align="center">&nbsp;&nbsp;<IMG id=imgTitleText src="images/Scheduling.jpg"  width=200 >&nbsp;&nbsp;</td>         </tr></table></td>';
//sLayerContent  +='<td><table width=95% cellspacing="0" cellpadding="0" border="0"><tr><td valign="bottom" align="right"><IMG id=imgTitleText src="images/Scheduling.jpg"  width=200 >&nbsp;&nbsp;</td>         </tr></table></td>';
//createLayer( 'lyrPageTitle', nLeftMargin, nTopMargin, nPageWidth, nTitleBarHeight, true, true, sContentPrefix + sLayerContent + sContentPostfix,0 );

	//
	// Define the image layers that make up the memu options of the main page.
	//
//if ( isNew ) {
//	sContentPrefix  = ''; 
//	sContentPostfix = '';
//	sLayerContent   = "<img src='images/corner_left_top.gif' height='" + nTopLeftCornerH + "' width='" + nTopLeftCornerW + "' border='0'>";
//	createLayer( 'lyrTopLeftCorner', nTopLeftCornerX, nTopLeftCornerY, nTopLeftCornerW, nTopLeftCornerH, true, true, sContentPrefix + sLayerContent + sContentPostfix );
//
//	if ( isIE ) {
//		sContentPrefix  = ''; 
//		sContentPostfix = '';
//		sLayerContent   = "<img src='images/corner_right_top.gif' height='" + nTopRightCornerH + "' width='" + nTopRightCornerW + "' border='0'>";
//		createLayer( 'lyrTopRightCorner', nTopRightCornerX, nTopRightCornerY, nTopRightCornerW, nTopRightCornerH, true, true, sContentPrefix + sLayerContent + sContentPostfix );
//	}
//}
//
//	//
//	// Create the Side Bar
//	//
//sContentPrefix  = '<table cellpadding="0" height="100%" width="100%" class="sideMenuBar" onmouseover="hideAll();">'; 
//sContentPostfix = '</table>';
//sLayerContent   = '<tr><td>&nbsp;</td></tr>';
//1:03 PM 10/9/2003createLayer( 'lyrSideMenuBarBg', nLeftMargin, 81, nSideBarWidth, nSideBarHeight, true, true, sContentPrefix + sLayerContent + sContentPostfix,0);


	
//sContentPrefix  = '<table cellpadding="0" width="100%">'; 
//sContentPostfix = '</table>';
//sLayerContent   = '<tr><td>&nbsp;</td></tr>';
//sLayerContent  += '<tr><td>&nbsp;</td></tr>';
//sLayerContent  += '<tr><td><a href="wattGenerationManagement.htm">            <div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">Generation       </div></a></td></tr>';
//sLayerContent  += '<tr><td><a href="wattTransmissionManagement.htm">          <div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">Transmission     </div></a></td></tr>';
//sLayerContent  += '<tr><td><a href="wattInterchangeTransactionScheduler.htm"> <div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">Scheduling       </div></a></td></tr>';
//sLayerContent  += '<tr><td><a href="wattEnergyAccounting.htm">                <div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">Energy Accounting</div></a></td></tr>';
//sLayerContent  += '<tr><td><a href="wattTrading.htm">                         <div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">Marketing/Trading</div></a></td></tr>';
//sLayerContent  += '<tr><td><a href="wattGISToolSet.htm"><div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">GIS Tool Set</div></a></td></tr>';
//sLayerContent  += '<tr><td><br><a href="http://www.celeritas.com"><img src="images/SmallCeleritasLogo1.gif" border="2" bordercolor=black></a><br/></td></tr>';
//sLayerContent  += '<tr><td><a href="http://www.celeritas.com"><div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">Company Info</div></a></td></tr>';
//sLayerContent  += '<tr><td><br><a href="wattDemoLinks.htm"><div class="menuItem" onmouseover="highlight(this);" onmouseout="dim(this);">WattageWorks&trade;<br>Demos</div></a></td></tr>';
//createLayer( 'lyrSideMenuBar', nLeftMargin+2, 100, nSideBarWidth-4, 500, true, true, sContentPrefix + sLayerContent + sContentPostfix );



	//
	// Create the Menu Border
	//
//sContentPrefix  = '<table cellpadding="0" cellspacing="0" width="100%" height="100%"><tr>'; 
//sContentPostfix = '</tr></table>';
//sLayerContent   = '<td class="menuBorderBottom" width="100%">&nbsp;</td>';
//createLayer( 'lyrMenuBarBorder', nMenuBarBorderX, nMenuBarBorderY, nMenuBarBorderWidth, nMenuBarBorderHeight, true, true, sContentPrefix + sLayerContent + sContentPostfix );

	//
	// Create the menu layer
	//	
//sContentPrefix  = '<table cellpadding="0" cellspacing="0" width="97%"><tr>'; 
//sContentPostfix = '</tr></table>';
//sLayerContent   = '<td><a href="wattArchitecture.htm"><div class="menuBarItem" onmouseover="highlight(this);overArchitecture();" onmouseout="dim(this);">Architecture</div></a></td>';
//sLayerContent  += '<td><a href="wattServices.htm">    <div class="menuBarItem" onmouseover="highlight(this);overServices();"     onmouseout="dim(this);">Services    </div></a></td>';
//sLayerContent  += '<td><a href="wattPartners.htm">    <div class="menuBarItem" onmouseover="highlight(this);overPartners();"     onmouseout="dim(this);">Partners    </div></a></td>';
//sLayerContent = '<td><a href="wattTechnicalInformation.htm">    <div class="menuBarItem" onmouseover="highlight(this);overTechnology();"     onmouseout="dim(this);">Technical Information</div></a></td>';
//sLayerContent  += '<td><a href="wattContactUs.htm">   <div class="menuBarItem" onmouseover="highlight(this);overContactUs();"    onmouseout="dim(this);">Contact Us     </div></a></td>';
//sLayerContent  += '<td><a href="wattMain1.htm">       <div class="menuBarItem" onmouseover="highlight(this);hideAll();"          onmouseout="dim(this);">Home           </div></a></td>';


//createLayer( 'lyrMenuBar', nMenuBarX, nMenuBarY, nMenuBarWidth, nMenuBarHeight, true, true, sContentPrefix + sLayerContent + sContentPostfix );
	
	//
	// Build Drop Down layers
	//
sContentPrefix  = '<div class="menu">'; 
sContentPostfix = '</div>';
sLayerContent   = buildMenu("Interchange Scheduling|Generation Managment|Transmission Management|Interfaces|Architecture","wattInterchangeTransactionScheduler.htm|wattGenerationManagement.htm|wattTransmissionManagement.htm|wattInterfaces.htm|wattOO.htm");
createLayer( 'lyrFeatureItems', nMenuBarDropX, nMenuBarDropY, 215, 220, false, true, sContentPrefix + sLayerContent + sContentPostfix );

nMenuBarDropX += 04;
sContentPrefix  = '<div class="menu">'; 
sContentPostfix = '</div>';
sLayerContent   = buildMenu("J2EE Architecture|Object Oriented|XML APIs|Pure Java","wattArchitecture.htm|wattArchitecture.htm|wattArchitecture.htm|wattArchitecture.htm");
createLayer( 'lyrArchitectureItems', nMenuBarDropX, nMenuBarDropY, 120, 220, false, true, sContentPrefix + sLayerContent + sContentPostfix );
	
nMenuBarDropX += 145;
sContentPrefix  = '<div class="menu">'; 
sContentPostfix = '</div>';
sLayerContent   = buildMenu("Design Components|Code/Class Libraries|Security Models","wattServices.htm|wattServices.htm|wattServices.htm");
createLayer( 'lyrServiceItems', nMenuBarDropX, nMenuBarDropY, 185, 220, false, true, sContentPrefix + sLayerContent + sContentPostfix );

nMenuBarDropX += 65;
sContentPrefix  = '<div class="menu">'; 
sContentPostfix = '</div>';
sLayerContent   = buildMenu("Oracle|Sun|Bea|Compaq|F5|Microsoft|ESRI","wattPartners.htm|wattPartners.htm|wattPartners.htm|wattPartners.htm|wattPartners.htm|wattPartners.htm|wattPartners.htm");
createLayer( 'lyrPartnerItems', nMenuBarDropX, nMenuBarDropY, 150, 220, false, true, sContentPrefix + sLayerContent + sContentPostfix );

nMenuBarDropX += 91;
sContentPrefix = '<div class="menu">';
sContentPostfix = '</div>';
sLayerContent = buildMenu("Kansas City|Wichita|Tulsa|Oklahoma City", "wattContactUs.htm|wattContactUs.htm|wattContactUs.htm|wattContactUs.htm");
createLayer( 'lyrLocations', nMenuBarDropX, nMenuBarDropY, 168, 220, false, true, sContentPrefix + sLayerContent + sContentPostfix );

nMenuBarDropX = 180;
nMenuBarDropY = 150;
sContentPrefix  = '<div class="menu">'; 
sContentPostfix = '</div>';
sLayerContent   ='';
createLayer( 'lyrGenerationItems', nMenuBarDropX, nMenuBarDropY, 120, 220, false, true, sContentPrefix + sLayerContent + sContentPostfix );
	
	//
	// Layer manipulation routines:
	//
function hideAll() {
	hideLayer('lyrArchitectureItems');
	hideLayer('lyrFeatureItems');
	hideLayer('lyrServiceItems');
	hideLayer('lyrPartnerItems');
	hideLayer('lyrLocations');
	hideLayer('lyrGenerationItems');
}

function outArchitecture() {
	hideLayer('lyrArchitectureItems');
}

function overArchitecture() {
	hideAll();
	showLayer('lyrArchitectureItems');
}

function outGeneration() {
	hideLayer('lyrGenerationItems');
}

function overGeneration() {
	hideAll();
	showLayer('lyrGenerationItems');
}

function outProducts() {
	hideLayer('lyrFeatureItems');	
}

function overProducts() {
	hideAll();
	showLayer('lyrFeatureItems');
}

function outServices() {
	hideLayer('lyrServiceItems');
}

function overServices() {
	hideAll();
	showLayer('lyrServiceItems');
}

function outPartners() {
	hideLayer('lyrPartnerItems');
}

function overPartners() {
	hideAll();
	showLayer('lyrPartnerItems');
}

function outContactUs() {
	hideLayer('lyrLocations');
}

function overContactUs() {
	hideAll();
	//showLayer('lyrLocations');
}

function overTechnology() {

}

function initPage() {
}

function highlightMenuItem(prObj) {
	prObj.className='dropMenuItemHover';
}
	
function dimMenuItem(prObj) {
	prObj.className='dropMenuItem';
}

var nTitle = 0;
function changeTitle(){
  //return;
	if ( isNew ) {
		var nTimeout = 2000;
		switch ( nTitle ) {
			case 0:
				document.images["imgTitleText"].src='images/Scheduling.jpg';
				break;
			case 1:
				document.images["imgTitleText"].src='images/Generation.jpg';
				//document.images["imgTitleText"].width=200;
				break;
			case 2:
				document.images["imgTitleText"].src='images/Transmission.jpg';
				break;
			case 3:
				document.images["imgTitleText"].src='images/Trading.jpg';
				break;
			case 4:
				document.images["imgTitleText"].src='images/ToolSet.jpg';
				nTitle=-1;
				nTimeout=3000;
				break;
			default:
				nTitle=-1;
		}
		nTitle++;
		setTimeout("changeTitle()",nTimeout);
	}
}

function highlight(prObj) {
	prObj.className=prObj.className + 'Hover';
}

function dim(prObj) {
	prObj.className=prObj.className.substr(0,prObj.className.length-5);	
	hideAll();
}

function dimProducts(prObj) {
	prObj.className=prObj.className.substr(0,prObj.className.length-5);	
}

		
setTimeout("changeTitle()", 2000);

*/