/*
function fwLoadMenus() {
  if (window.fw_menu_0) return;
  window.fw_menu_0 = new Menu("root",100,19,"Arial, Helvetica, sans-serif",12,"#ffffff","#000000","#228307","#00CC66");
  fw_menu_0.addMenuItem("Sour Gas","location='http://www.eub.ca/portal/server.pt?open=512&objID=238&PageID=0&cached=true&mode=2'");
  fw_menu_0.addMenuItem("Public Safety","location='http://www.eub.ca/portal/server.pt?open=512&objID=236&PageID=0&cached=true&mode=2'");
  fw_menu_0.addMenuItem("Utilities","location='http://www.eub.ca/portal/server.pt?open=512&objID=239&PageID=0&cached=true&mode=2'");
  fw_menu_0.addMenuItem("Oil and Gas","location='http://www.eub.ca/portal/server.pt?open=512&objID=235&PageID=0&cached=true&mode=2'");
  fw_menu_0.addMenuItem("EUB Process","location='http://www.eub.ca/portal/server.pt?open=512&objID=230&PageID=0&cached=true&mode=2'");
   fw_menu_0.hideOnMouseOut=true;
  window.fw_menu_1 = new Menu("root",231,19,"Arial, Helvetica, sans-serif",12,"#ffffff","#000000","#F37F03","#FFB164");
  fw_menu_1.addMenuItem("Rules, Regulations, Requirements","location='http://www.eub.ca/portal/server.pt?open=512&objID=233&PageID=0&cached=true&mode=2'");
  fw_menu_1.addMenuItem("Applications","location='http://www.eub.ca/portal/server.pt?open=512&objID=224&PageID=0&cached=true&mode=2'");
  fw_menu_1.addMenuItem("Compliance and Enforcement","location='http://www.eub.ca/portal/server.pt?open=512&objID=226&PageID=0&cached=true&mode=2'");
  fw_menu_1.addMenuItem("Industry Activity and Data","location='http://www.eub.ca/portal/server.pt?open=512&objID=231&PageID=0&cached=true&mode=2'");
  fw_menu_1.addMenuItem("Decisions","location='http://www.eub.ca/portal/server.pt?open=512&objID=228&PageID=0&cached=true&mode=2'");
  fw_menu_1.addMenuItem("Alberta's Energy Resources & Statistics","location='http://www.eub.ca/portal/server.pt?open=512&objID=223&PageID=0&cached=true&mode=2'");
 fw_menu_1.addMenuItem("Upstream Oil and Gas Authorizations Guide","location='http://www.ercb.ca/portal/server.pt/gateway/PTARGS_0_0_322_252_0_43/http%3B/ercbContent/publishedcontent/publish/ercb_home/industry_zone/upstream_oil_and_gas_authorizations_guide/'");  
fw_menu_1.addMenuItem("Digital Data Submission (DDS)","location='https://www3.eub.gov.ab.ca/Eub/Dds/'");

   fw_menu_1.hideOnMouseOut=true;

  fw_menu_1.writeMenus();
} // fwLoadMenus() 2005-01-06
//////////////////////////////////////////////////////////////////////////////
*/

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function formHandler(form){
var URL = document.myform.mysite.options[document.myform.mysite.selectedIndex].value;
window.location.href = URL;

}

function MenuHandler(form){
var URL = document.menuform.sitemenu.options[document.menuform.sitemenu.selectedIndex].value;
window.location.href = URL;

}

function Start(page) {
OpenWin = this.open(page, "CtrlWindow",
"toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}


function show(page) {
NewWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no, width=440, height=640");
}


var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

linkset[0]='<div class="menuitems"><a href="/bbs/applications/iar.htm">&nbsp;IAR Overview</a></div>'
linkset[0]+='<div class="menuitems"><a href="http://www2.eub.gov.ab.ca/dds.iar/dds-iar-default.asp">&nbsp;IAR Query System</a></div>'

linkset[1]='<div class="menuitems"><a href="/bbs/applications/EAS/EAS_Overview.htm">&nbsp;EAS Overview</a></div>'
linkset[1]+='<div class="menuitems"><a href="/bbs/applications/EAS/EAS_Scope.htm">&nbsp;EAS Scope</a></div>'
linkset[1]+='<div class="menuitems"><a href="/bbs/applications/EAS/EAS_FAQ.htm">&nbsp;EAS Frequently Asked Questions</a></div>'
linkset[1]+='<div class="menuitems"><a href="/bbs/applications/EAS/EAS_ProjectStatus.htm">&nbsp;EAS Project Status Updates</a></div>'
linkset[1]+='<div class="menuitems"><a href="/bbs/applications/EAS/EAS_FocusGroup.htm">&nbsp;EAS Focus Group</a></div>'
linkset[1]+='<div class="menuitems"><a href="/bbs/applications/EAS/EAS_GB.htm">&nbsp;EAS General Bulletin</a></div>'

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function showmenu(e,which){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#8898AA width=240 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()
}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
else
menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY : ns6? window.pageYOffset+eventY : eventY
menuobj.thestyle.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element is contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynamichide(e){
if (ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",500)
}

function openWindowAnim(win){
	leftPos=0
	topPos=0
	if(screen)
		{
			leftPos=50;
			topPos=50;
		}

	newWindow = window.open(win,'imagesWin','toolbar=no,scrollbars=no,height=100,width=100,menubar=no,left='+leftPos+',top='+topPos+'')      
	newWindow.focus()
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
else if (document.getElementById)
source_el=e.target
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

if (ie4||ns6)
document.onclick=hidemenu


///////////Google Analytics code///////////////////////////////////////////////////////////////////

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24105593-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

///////////Image rotation 2011-12-16 candace/////////////////////////////////////////////////////////

var theImages = new Array() 
var theLinks = new Array() 

theImages[0] = 'http://www.ercb.ca/imageserver/plumtree/portal/custom/HomeCanvas/EmbraceChange.jpg'
theImages[1] = 'http://www.ercb.ca/imageserver/plumtree/portal/custom/HomeCanvas/PublicInterest.jpg'
theImages[2] = 'http://www.ercb.ca/imageserver/plumtree/portal/custom/HomeCanvas/Unconventional.jpg'
theImages[3] = 'http://www.ercb.ca/imageserver/plumtree/portal/custom/HomeCanvas/UpstreamGuide.jpg'

theLinks[0] = '#'
theLinks[1] = '#'
theLinks[2] = '#'
theLinks[3] = '#'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichI = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichI]+'" border=0>');
//document.write('<a href="'+theLinks[whichI]+'" border=0 ><img src="'+theImages[whichI]+'" border=0></a>');
}

///////////////////////Applications Area - Print This page///////////////



function openWindowAnim(win){
   leftPos=0
   topPos=0
   if(screen)
   {
    leftPos=50;
    topPos=50;
   }
   newWindow = window.open(win,'imagesWin','toolbar=no,scrollbars=no,height=100,width=100,menubar=no,left='+leftPos+',top='+topPos+'')      
   newWindow.focus()
}

function PrintThisPage() 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 

   var sWinHTML = document.getElementById('contentstart').innerHTML; 
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><body>'); 
       winprint.document.write(sWinHTML);          
       winprint.document.write('</body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}


