{
	var url = "" + window.location;
	if ( (url.indexOf('billPayment') != -1) && (url.indexOf('https') == -1) ){
		window.location = url.replace('http','https');
	}
}

function validateListAndsubmit(form,list){
       if (list.selectedIndex != 0){
          form.submit();
       }
}

function clearMailForm(form){
 for (var i=0;i<form.length;i++){
   form[i].value = '';
 }//for
}

function mailThisUrl(){
      var u = window.parent.location;
      //var CRLF="%0D%0A";
      u = escape(u);      
      var m = "I thought this might interest you...";
      // the following expression must be all on one line...
      window.location = "mailto:"+""+"?subject="+m+"&body="+document.title+"&body="+u
      ;
}

function pop_window(url) {
  
    window.open(url);
    //return;
}
	
function popUp(URL) {
	eval("page= window.open(URL, '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=175');");
}

function print_page() {
	window.print();  
}

/**
 * This function open a blank popup window and writes the inner html inside
 * the window document.
 */
function printTagContent(id){
  //Generating new Document
  var generator = window.open('','name','width=640,height=400,toolbar=0,scrollbars=1,resizable=1,top=80px,left=80px');
  //Writing starting tags
  generator.document.write('<html><head><title>Print Preview</title>');
  //Header Includes
  
  generator.document.write('<meta http-equiv="Content-Type" content="text/jsp; charset=utf-8" />');
  generator.document.write('<link rel="stylesheet" type="text/css" HREF="/framework/skins/default/css/styles_en.css">');
  //writes content
  generator.document.write(document.getElementById(id).innerHTML);
  generator.document.write('<br clear="all"/>');
  //view the close link in the window
  generator.document.write('<br/><center><hr width="80%" noshaded /></center>');
  generator.document.write('<table align="center"><tr><td><input type="button" value=" Print " onClick="javascript:window.print();"/>&nbsp;<input type="button" value=" Close " onClick="javascript:self.close();"/></td></tr></table>');
  generator.document.write('</html>');
  generator.document.close();
}

function set_CSS(el_id, CSS_attr, CSS_val) {
	var el = document.getElementById(el_id);
	if (el) el.style[CSS_attr] = CSS_val;
}

function toggleGoDoInfo(state) {
	if (state == "on")
		set_CSS('goDoInfo', "display", 'block');
	if (state == "off")
		set_CSS('goDoInfo', "display", 'none');
}

function redirect(location) {
	if (location != "") 
		top.location.href=location;
}

function swapImage(imgName,newImg) { 
	eval('document.' + imgName + '.src = "' + newImg + '"'); 
}

var naviPics = new Array();
var rightNaviPics = new Array();
var otherPics = new Array();

function preLoadImages() {		
}

if(document.images) preLoadImages()

/* SERVICES ROAMING MAP FUNCTIONALITY */

function populateCountries(selCountry) {
	if(selCountry != 0) {
        for(var i = 0; i < cat[selCountry].length; i++) {
            //document.regionCountries.country2.options[i] = new Option(cat[selCountry][i],catValue[selCountry][i])
            document.regionCountries[getNetuiTagName("country2",this)].options[i] = new Option(cat[selCountry][i],catValue[selCountry][i])
	    }
	//document.regionCountries.country2.options[0].selected = true;
    document.regionCountries[getNetuiTagName("country2",this)].options[0].selected = true;
    } else {
        resetCountries();
		return false;
    }
}

function resetCountries() {
/*
	document.regionCountries.country2.length = 0;
    document.regionCountries.country2.options[0] = new Option();
    document.regionCountries.country2.options[0].value="";
    document.regionCountries.country2.options[0].text="Choose Region First";
    document.regionCountries.country2.options[0].selected = true;
*/
    selectedValue = 0;
    document.regionCountries[getNetuiTagName("country2",this)].length= 0;
    document.regionCountries[getNetuiTagName("country2",this)].options[0] = new Option();
    document.regionCountries[getNetuiTagName("country2",this)].options[0].value = "";
    document.regionCountries[getNetuiTagName("country2",this)].options[0].text="Choose Region First";
    document.regionCountries[getNetuiTagName("country2",this)].options[0].selected = true;

}

function change(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}




/* END: SERVICES ROAMING MAP, DATA */

function dropDownPosition(area) {
	if (document.all) {
		var dropDown1 = document.all.dropDownLayer.style;
		var dropDown2 = document.all.dropDownLayer2.style;
	}else if (document.getElementById){
		var dropDown1 = document.getElementById('dropDownLayer').style;
		var dropDown2 = document.getElementById('dropDownLayer2').style;
	}
	
	if(area != ""){
		dropDown1.visibility = "hidden";
		dropDown2.visibility = "visible";
	}else {
		dropDown1.visibility = "visible";
		dropDown2.visibility = "hidden";
	}
}

