// JavaScript Document

var Thispage;
var ShowUpTo =0;
var mnu;

function CallMenu(vLocation){
//Get the page name from URL

var a = document.URL.split("//"); // split at protocol
a = (a[1] ? a[1] : a[0]).split("/"); 
// use last element of a; split at /
// host is a[0]; path is a[1..(n-1)]; a[n] is page
//alert(a.join("\n"));
Thispage = (a[a.length-1]);

//document.write ("<h1>" + Thispage + "</h1>");

/* 'Declare all the images into array mnu
'mnu(X,A) = "imageNormal"
'mnu(X,B) = "imageColored"
'mnu(X,C) = "myURL"
'mnu(X,D) = "target"
'mnu(X,E) = "myImageName"
*/


//mnu = new Array(9,5);
mnu = new Array(20); 

for (i = 0; i < mnu.length; ++ i)
	mnu [i] = new Array(5);

// Set a variable called vLocation before calling function WriteMenu.
if (vLocation == "CUSERV"){
	ShowUpTo = 8;

	mnu[0][0] = "../submenus/onlinepaymentup.gif";
	mnu[0][1] = "../submenus/onlinepaymentDown.gif";
	mnu[0][2] = "https://ebill.brownsville-pub.com/webinquiry/";
	mnu[0][3] = "_top";
	mnu[0][4] = "Image480";
	
	mnu[1][0] = "../submenus/sm2_r1_c1.gif";
	mnu[1][1] = "../submenus/sm2a_r1_c1.gif";
	mnu[1][2] = "payopt2.html";
	mnu[1][3] = "_top";
	mnu[1][4] = "Image481";	

	mnu[2][0] = "../submenus/sm2_r10_c1.gif";
	mnu[2][1] = "../submenus/sm2a_r10_c1.gif";
	mnu[2][2] = "paysta.html";
	mnu[2][3] = "_top";
	mnu[2][4] = "Image482";

	mnu[3][0] = "../submenus/sm2_r3_c1.gif";
	mnu[3][1] = "../submenus/sm2a_r3_c1.gif";
	mnu[3][2] = "faq.html";
	mnu[3][3] = "_top";
	mnu[3][4] = "Image483";

	mnu[4][0] = "../submenus/sm2_r5_c1.gif";
	mnu[4][1] = "../submenus/sm2a_r5_c1.gif";
	mnu[4][2] = "meter.html";
	mnu[4][3] = "top";
	mnu[4][4] = "Image51";

	mnu[5][0] = "../submenus/sm2_r7_c1.gif";
	mnu[5][1] = "../submenus/sm2a_r7_c1.gif";
	mnu[5][2] = "bill.html";
	mnu[5][3] = "_top";
	mnu[5][4] = "Image484";

	mnu[6][0] = "../images/metertampering_w.gif";
	mnu[6][1] = "../images/metertampering_y.gif";
	mnu[6][2] = "metertampering.html";
	mnu[6][3] = "_top";
	mnu[6][4] = "Image485";

	mnu[7][0] = "../submenus/sm2_r9_c1.gif";
	mnu[7][1] = "../submenus/sm2a_r9_c1.gif";
	mnu[7][2] = "https://ebill.brownsville-pub.com/webinquiry/JSP/cu.iss?command=issueRetrieve&issueTp=AFS&nextPage=issueAFSP";
	mnu[7][3] = "_top";
	mnu[7][4] = "Image486";
	
	mnu[8][0] = "../submenus/gogreen_cuserv_w.gif";
	mnu[8][1] = "../submenus/gogreen_cuserv_y.gif";
	mnu[8][2] = "../gogreen_HES.html";
	mnu[8][3] = "top";
	mnu[8][4] = "GoGreen";	
	
//	'-------------	

}


WriteMenu();

}


function WriteMenu()
{
        document.write ("<div id=\"Layer1\" style=\"position:absolute; left:2; top:137px; width:144px; height:105px; z-index:1\">") ;
        document.write (" <table width=\"129\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");


    var cX;
	//var tOut;
    var response_write="";
	    response_write = response_write + ("	  <tr>  ")
	    response_write = response_write + ("		<td><a href=\"~myURL\"  onXClick=\"myOpenRoot();\" onMouseOut=\"MM_swapImgRestore()\"  ")
	    response_write = response_write + ("		onMouseOver=\"MM_swapImage(")
	    response_write = response_write + ("'~myImageName','','../water/~myImgSrcDown',1)" )
	    response_write = response_write + ("\"       tsarget=\"~myTarget\">  ")
	    response_write = response_write + (" <img name=\"~myImageName\" border=\"0\" src=\"~myImgSrcUP\" xwidth=\"121\" xheight=\"16\"></a></td>  ")
	    
	    response_write = response_write + ("	  </tr>  ")
	    response_write = response_write + ("	   <tr>  ")
	    response_write = response_write + ("		<td height=\"2\"><img src=\"../submenus/gap.gif\" width=\"129\" height=\"2\"></td>  ")
	    response_write = response_write + ("	  </tr>  ")	    
	        

	for (cX=0;cX<=ShowUpTo;cX++)
	{
	    if (Thispage == mnu[cX][2]) {
       //vb if instr(thisPage,mnu(cX,2))>0 then
            //if the page we are looking is the same as the URL then Highlightit.
            mnu[cX][0] = mnu[cX][1];
		}//end if
    
	    var toOut  = response_write.replace("~myImgSrcUP",mnu[cX][0]);
	    toOut  = toOut.replace("~myImgSrcDown",mnu[cX][1]);
	    toOut  = toOut.replace("~myURL",mnu[cX][2]);
	    toOut  = toOut.replace("~myTarget",mnu[cX][3]);
	    toOut  = toOut.replace("~myImageName",mnu[cX][4]);
		toOut  = toOut.replace("~myImageName",mnu[cX][4]);  //replace 2nd instance.
	    document.write(toOut);
		toOut = "";
     }//end forNextLoop
    
    document.write("</table>  </div>  ");
	
	if (Thispage == 'paystamap.html') {
		//do nothing
	}else if (Thispage == 'paystalist.html') {
	//do nothing	
	}else{
		WriteMessage();
		//alert(Thispage);
	}
    
}//end function

function WriteBreaks()
{
	for (x=1;x<=9;x++)
  { document.write ("<BR>");  }
  
}



function WriteMessage()
{
document.write ("<link rel=stylesheet type=\"text/css\"  href=\"sty_cuserv.css\">");

//document.write ("<div id=\"Layer2\" style=\"position:absolute; left:689; top:137px; width:129px; height:132px; z-index:2;  background:#FFFFCC; border:medium; border-style:solid;border-color:#000066;\">");
document.write("<div id=\"Layer_cumessage\">");
document.write("<p align=\"center\" class=\"gogreenDesc\"><span class=\"gogreenlist\">Online Service Requests</span><br />")
document.write("Need help <a href=\"https://ebill.brownsville-pub.com/webinquiry/JSP/cu.iss?command=issueRetrieve&issueTp=AFS&nextPage=issueAFSP\">opening/transferring an account</a> or <a href=\"https://ebill.brownsville-pub.com/webinquiry/JSP/cu.iss?command=issueRetrieve&amp;issueTp=SD&amp;nextPage=issueSDP\">closing an account</a> and don&rsquo;t want to wait in line . . . then do it online!</font> </p>")
document.write("</div>	");
	
	
}




