function openWindow(url) {
	var window_width = 760;
	var window_height = 600;
	var the_window = window.open(url,"the_window","height=600,width=760,scrollbars=no,resizable=no,status=yes");
	var screen_height = window.screen.availHeight;
	var screen_width = window.screen.availWidth;
	var left_point = parseInt(screen_width/2) - parseInt(window_width/2);
	var top_point = parseInt(screen_height/2) - parseInt(window_height/2);
	the_window.moveTo(left_point,top_point);
	//remote.opener
}

/**************************************************************************************************
' Function:
' Name:        DropDownChange
' Description: Used to link to dropdown onchange events so that it can perform a specific action
'              depending on which option was selected in the drop down.  Note that this function
'              performs different operations depending on what context it is in.
' Parameters:  DropDown - the drop down object
'              Context  - a string to determine what context it is in
' Output:      none
' History:     Date      Developer                 Comments
'--------------------------------------------------------------------------------------------------
'              04/15/03  Patrick Lok (Habaneros)   Created
'              07/11/07  Pat Homan   Added code for Photo Galleries
**************************************************************************************************/
function DropDownChange(DropDown, Context)
{
   /*Get Index and Values*/
   var SelIndex = DropDown.selectedIndex
   var SelValue = DropDown.options[SelIndex].value
   
   /*Depending on what Context, perform an action*/
   switch(Context)
   {
      /*User selected which year to filter News Releases by...*/
      case 'NewsReleaseYear':
         top.location.href = 'default.htm?year=' + SelValue;
         break;
      /*User selected which gas region to go to...*/
      case 'GasRegion':
         if (SelValue == '1'){top.location.href = '/Gas/default.htm'}
         if (SelValue == '2'){top.location.href = 'http://gas1.terasen.com'}
         break;
   }
    return true;
}

function fnFeedback() {
  var strTo = "customercare.tgvi@terasen.com";
  var strSubj = "Web Inquiry";
  var strSource = document.title;
  if (strSource != "") {
    var arySource = strSource.split(">");
    if (arySource.length > 1) {
      strSubj += ":" + arySource[1];
    }
  }
  if (fnFeedback.arguments[0]) {
    strSubj += " (" + fnFeedback.arguments[0] + ")";
  }
  var strResult = "mailto:" + strTo + "?subject=" + escape(strSubj);  
  window.location = strResult;
}

function fnPopUpSized(strURL, w, h) {
  popupWinSized = window.open(strURL, "sizable", "scrollbars,resizable,width=" + w + ",height=" + h)
}

function showHelp(url) {
  popupWin = window.open(url, 'Help','width=300,height=220,left=150,top=150,scrollbars');
}

function fnPopUpQD(areaID) {
  popupWinQD = window.open("/gas1/system/qd_list.asp?area=" + areaID, "qd", "scrollbars,resizable,width=720,height=540")
}

function fn_navon() {
	var aryLinksBrc = new Array();
	var k = 0;
	var m = 0;
	for (i=0; i<document.links.length; i++) {
		if (document.links[i].className == "brcrmbLink") {
				aryLinksBrc[m] = document.links[i];
				k = i + 1;
				m++;
		}
	}
	if (aryLinksBrc.length > 1) {
		var c = 0;
		if (!document.all) {
			c = 1;
		}
		for (i=2; i<aryLinksBrc.length; i++) {
			for (j=k; j<document.links.length; j++) {
				if (document.links[j].href == aryLinksBrc[i].href) {
					document.links[j].className += " navon";
					document.links[j].parentNode.parentNode.childNodes[c].firstChild.src = document.links[j].parentNode.parentNode.childNodes[c].firstChild.src.replace("_off","_on");
					break;
				}
				k++;
			}			
		}
		for (j=k; j<document.links.length; j++) {
			if (document.links[j].href == document.URL.split("#")[0]) {
				if (document.links[j].className != "") {
					document.links[j].className += " navon";
					document.links[j].parentNode.parentNode.childNodes[c].firstChild.src = document.links[j].parentNode.parentNode.childNodes[c].firstChild.src.replace("_off","_on");
					break;
				}
			}
		}
	}			
}



function newwindow() 
{ 
window.open('http://www.terasengas.com/Gas/assets/Mercurialsample/first/Web_Res_SampleBill_arrows.htm','jav','width=800,height=800,resizable=yes,scrollbars=yes'); 
} 



/*Terasen Measurement video September 2008*/

function openmeasurementvideo() {
  var url = "http://www.terasen.com/MeasurementNew/assets/clipstream/measurementvideo/TerasenMeasurementvideo.html";
  var windowName = "measurementvideo";
  var windowOptions = "width=850";
  windowOptions += ",height=700";
  windowOptions += ",resizable=no";
  windowOptions += ",scrollbars=no";
  windowOptions += ",location=1";
  windowOptions += ",toolbar=non";
  
  window.open(url, windowName, windowOptions);
}



function openMeasurementPhotoGallery() {
  var url = "/MeasurementNew/assets/flash/MeasurementPhotoGallery/slideshow.html";
  var windowName = "SlideShow";
  var windowOptions = "width=750";
  windowOptions += ",height=600";
  windowOptions += ",resizable=no";
  windowOptions += ",scrollbars=no";
  windowOptions += ",location=1";
  windowOptions += ",toolbar=non";
  
  window.open(url, windowName, windowOptions);
}

