    var mywin;
    var mypics;
    var warning_page = "frmWarning.asp";		
    var script_to_run;
    var message = "Please scroll below for more information regarding e-Census";
    var startChar = 0;
    var maxLength;

    function window_onload()
    {
      var availWidth = 0;
      var spaces = "";
      if (navigator.appName == "Netscape")
      {
        availWidth = window.innerWidth / 10;
      }
      else
      {
        availWidth = document.body.scrollWidth / 10;
      }
      while (availWidth > 0)
      {
        spaces = spaces + " ";
        availWidth--;
      }
      message = spaces + message;
      maxLength = message.length - 1;
      setInterval("scrollMessage()", 65);
      return checkTopFrame();
    }

    function scrollMessage()
    {
      window.status = message.substring(startChar);
      startChar++;
      if (startChar == maxLength)
      {
        startChar = 0;
      }
    }

    function open_window(url) 
    {
      if (typeof(mywin) != "undefined" && mywin.closed == false)
      {
        mywin.close();
      }
      mywin = window.open(url,"sitetools","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=600,height=325,top=50,left=50");
    }

    function open_window2(url)
    {
       close_window();
       mywin = window.open(url,"sitetools",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=350,height=325,top=50,left=50');
    }

    function open_window3(url) 
    {
      if (typeof(mypics) != "undefined" && mypics.closed == false)
      {
        mypics.close();
      }
      mypics = window.open(url,"sitetools2","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=620,height=470,top=50,left=50");
    }

    function open_windowPayPlus(url)
    {
      close_window();
      mywin = window.open(url,"sitetools",'toolbar=0,location=0,directories=0,status=10,menubar=0,scrollbars=yes,resizable=0,width=800,height=450,top=50,left=20');
    }        

    function close_window()
    {
      if (typeof(mypics) != "undefined" && mypics.closed == false)
      {
        mypics.close();
      }
      if (typeof(mywin) != "undefined" && mywin.closed == false)
      {
        mywin.close();
      }
      return true;
    }
    
    function run_script(script)
    {
      var boolValue = window.parent.parent.CodesFrame.checkBrowser();
      if (boolValue)
      {
        script_to_run = script;
        open_window(warning_page);
      }
    }		

    function submit_RegCust_Form()
    {
      document.frm_RegCust.submit();
    }

    function goToChosenURL(elementSelect)  
    {
      var sURL = elementSelect.options[elementSelect.selectedIndex].value;
      if (elementSelect.options.selectedIndex != 0)
        window.top.location.href = sURL;
    }
      
		function checkTopFrame() {
		  var strAddr = window.top.location.href;
		  strAddr = strAddr.toLowerCase();
		  if (strAddr.indexOf("frmindex.asp") == -1)
		  {
				alert("This page is incorrectly accessed.\n\nConnecting you back to the main page.");
		    window.top.location.replace("frmIndex.asp");
		    return false;
		  }
		  return true;
		}

	function close_window() 
	{
	  if (typeof(mywin) != "undefined" && mywin.closed == false)
	  {
	    mywin.close();
	  }
	}

	function showNotAllowedMsg()
	{
	  alert("You are not allowed to mix for-payment and probono requests.");
	  return false;
	}
