	var pWin = null
	function portWinwAttr(url, x, y) {
		pWin = window.open (url, 'newWin', 'width=' + x + ',height=' + y + ',menubar,location,toolbar,scrollbars')

		if (window.pWin) pWin.focus()
	}

// var pWin = null
	var pWin = null
	function portWin(url, x, y) {
		pWin = window.open (url, 'newWin', 'width=' + x + ',height=' + y + ',menubar=0,scrollbars=1')

		if (window.pWin) pWin.focus()
	}

function portClose()
{
    pWin = window.close();
}//*************************************


function display(pimage,ptitle) {
 html = "<HTML><HEAD><TITLE>'" + ptitle + "'</TITLE>" +
  "</HEAD><BODY LEFTMARGIN=0 " +
  "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" +
  "<IMG SRC='" + myimage + "' BORDER=0 NAME=image " +
  "onload='window.resizeTo(document.image.width,document.image.height)'></CENTER>" +
  "</BODY></HTML>";
 popup=window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
 popup.document.open();
 popup.document.write(html);
 popup.document.focus();
 popup.document.close();
}

function DisplayFoto(img)
{
  foto1= new Image();
  foto1.src=(img);
  Control(img);
}
function Control(img)
{
  if((foto1.width!=0)&&(foto1.height!=0))
  {
    viewFoto(img);
  }
  else
  {
    loopback="Control('"+img+"')";
    interval=setTimeout(funzione,20);
  }
}
function viewFoto(img)
{
  pwidth=foto1.width+20;
  pheight=foto1.height+20;
  pstring="width="+pwidth+",height="+pheight+",scrollbars=no,resizable=no,menubar=no,toolbar=no";
  showit=window.open(img,"foto",pstring);
}

/********* password input display **************************************************/
var openwindow = null;
var winattr = null;
function gateKeeper() 
{
    winattr="width=200,height=100,scrollbars=0,resizable=0,menubar=0,toolbar=0,title=0,location=0";
    openwindow = window.open("gatekeep.asp", "",winattr); 
}

function winClose()
{
    openwindow = window.close();
}

/* clock variables and functions ***************************************************/
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}

function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " pm" : " am"
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}

function startclock() {
stopclock();
showtime();
}
/***********************************************************************************/

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}
document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

/* Button functions *****************************************************************/

function PrintButton(textsize,bgcolor,textcolor){
    if (textsize) {
    }    else {
            textsize="textsize1"}
    if (bgcolor) {
    }    else {
            bgcolor="bggray"}
    if (textcolor) {
    }    else {
            textcolor="text_white"}
    document.write('<form>'
    + '<input class="' + textsize + ' ' + bgcolor + ' ' + textcolor + ' smcaps borderblack" type=button name=print value="Print" '
    + 'onClick="javascript:window.print()"></form>');
}

function CloseButton(textsize,bgcolor,textcolor){
    if (textsize) {
    }    else {
            textsize="textsize1"}
    if (bgcolor) {
    }    else {
            bgcolor="bggray"}
    if (textcolor) {
    }    else {
            textcolor="text_white"}
    document.write('<form>'
    + '<input class="' + textsize + ' ' + bgcolor + ' ' + textcolor + ' smcaps borderblack" type="button" value="Close" '
    + 'onclick="javascript:window.close()"></form>');
}


function PitzerTM(name,domain,textcolor){
    if (textcolor) {
    }    else {
            textcolor="text_darkblue"}
    document.write('<center class="textsize2 '+ textcolor + '">Web design & development by '
    + '<a class="' + textcolor + '" href="mailto:' + name + '@' + domain + '\">'
    + '<i> Bob Pitzer&#169;</i><img class="borderclgalight" src="images/pitzware.gif" height="15" width="15"></a></center>');
}


function TopButton(x,y,textsize,bgcolor,textcolor){
    if (textsize) {
    }    else {
            textsize="textsize1"}
    if (bgcolor) {
    }    else {
            bgcolor="bggray"}
    if (textcolor) {
    }    else {
            textcolor="text_white"}
    document.write('<form>'
    + '<input class="' + textsize + ' ' + bgcolor + ' ' + textcolor + ' smcaps borderblack" type="button" value="Top" '
    + 'onclick="javascript:window.scroll(\'x\',\'y\')"></form>');
}

function EmailButton(name,domain,caption,textsize,bgcolor,textcolor){
var address = "'mailto:" + name + "@" + domain + "'"
    if (textsize) {
    }    else {
            textsize="textsize1"}
    if (bgcolor) {
    }    else {
            bgcolor="bggray"}
    if (textcolor) {
    }    else {
            textcolor="text_white"}
document.write('<form>'
    + '<input class="' + textsize + ' ' + bgcolor + ' ' + textcolor + ' smcaps borderblack" type="button" value="'
    + caption + '" ' + 'onclick="javascript:parent.location=' + address + '"></form>');
}

function BackButton(textsize,bgcolor,textcolor){
    if (textsize) {
    }    else {
            textsize="textsize1"}
    if (bgcolor) {
    }    else {
            bgcolor="bggray"}
    if (textcolor) {
    }    else {
            textcolor="text_white"}
    document.write('<form>'
    + '<input class="' + textsize + ' ' + bgcolor + ' ' + textcolor + ' smcaps borderblack" type=button value="Return"'
    + 'onClick="javascript:history.go(-1)"></form>');
}
/******************************************************************************************/

/* This block provides the code for the SINGLE LINE SCROLLER ******************************/

var l1 = 0; // left of ticker in pixel, or 0 to position relative
var t1 = 0; // top of ticker in pixel, or 0 to position relative
/* var w1 = 800; // width of ticker in pixel */
var ie = document.all ? true : false;
var first = true;
var l2 = l1;
var l3 = l1 - l2;
var l = l2;
function tickinit(w1) {
        if (ie) {
        if (l1 == 0 && t1 == 0) {
        pos = document.all['tickpos'];
        l1 = getLeft(pos);
        t1 = getTop(pos);
        }
        ticktext.style.posTop = t1;
        }
    else {
        if (l1 == 0 && t1 == 0) {
        pos = document.anchors['tickpos'];
        l1 = pos.x;
        t1 = pos.y;
        }
        document.ticktext.pageY = t1;
        }
        l2 = l1 + w1;
        l3 = l1 - l2;
        l = l2;
        setInterval('tick()', 10);
}

function getLeft(ll) {
        if (ll.offsetParent)
        return (ll.offsetLeft + getLeft(ll.offsetParent));
    else 
        return (ll.offsetLeft);
}

function getTop(ll) {
        if (ll.offsetParent)
        return (ll.offsetTop + getTop(ll.offsetParent));
    else
        return (ll.offsetTop);
}

function tick() {
    l = l - 0.5;
    if (l < l3) l = l2;
    cl = l1 - l;
    cr = l2 - l;
    if (ie) {
        ticktext.style.posLeft = l;
        ticktext.style.posTop = t1;
        ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
    if (first) ticktext.style.visibility = "visible";
        }
    else {
        document.ticktext.pageX = l;
        document.ticktext.clip.left = cl;
        document.ticktext.clip.right = cr;
    if (first) document.ticktext.visibility = "show";
        }
    first = false;
}
/***********************************************************************************/

// Regent Park menu buttons
function RPSCMenuButtons()
{
    document.writeln("<div class=\"bordernone bgblack lmargin2 botpad5 toppad5\">");
    document.writeln("  <div class=\"botpad3\"><a class=\"text_yellow lmargin5 smcaps\" href=\"RP_directions.htm\"><img src=\"images/bp_arrow_rt.jpg\" border=0 width=20 height=20>&nbsp;&nbsp;&nbsp;Driving Directions<\/a><\/div>");
/*    document.writeln("    <a class=\"toppad2\" href=\"uc.htm\"><img src=\"images/news_btn_.jpg\"><\/a><br>");*/
/*    document.writeln("    <a class=\"toppad2\" href=\"patrol.asp\"><img src=\"images/crime_btn_.jpg\"><\/a><br>");*/
/*    document.writeln("    <a class=\"toppad2\" href=\"uc.htm\"><img src=\"images/faq_btn_.jpg\"><\/a><br>");*/
/*    document.writeln("    <a class=\"toppad2\" href=\"RP_committees.html\"><img src=\"images/committ_btn_.jpg\"><\/a><br>");*/
/*    document.writeln("    <div class=\"botpad3\"><a class=\"text_yellow lmargin5 smcaps\"  href=\"http://www.yorkcountygov.com\"><img src=\"images/bp_arrow_rt.jpg\" border=0 width=20 height=20>&nbsp;&nbsp;&nbsp;York County<\/a><\/div>");*/
/*    document.writeln("    <a class=\"toppad2\" href=\"RP_minutes.html\"><img src=\"images/board_btn_.jpg\"><\/a><br>");*/
    document.writeln("    <div class=\"botpad3\"><a class=\"text_yellow lmargin5 smcaps\" href=\"http://www.regentparkgolfclub.com\"><img src=\"images/bp_arrow_rt.jpg\" border=0 width=20 height=20>&nbsp;&nbsp;&nbsp;Regent Park Golf<\/a><\/div>");
    document.writeln("    <div class=\"botpad3\"><a class=\"text_yellow lmargin5 smcaps\" href=\"http://www.weather.com/weather/local/29715\"><img src=\"images/bp_arrow_rt.jpg\" border=0 width=20 height=20>&nbsp;&nbsp;&nbsp;Local Weather<\/a><\/div>");
    document.writeln("    <div class=\"botpad3\"><a class=\"text_yellow lmargin5 smcaps\"  href=\"RP_contact_info.html\"><img src=\"images/bp_arrow_rt.jpg\" border=0 width=20 height=20>&nbsp;&nbsp;&nbsp;Contact Info<\/a><\/div>");
/*     document.writeln("    <div class=\"botpad5\"><a  class=\"text_yellow lmargin5 smcaps\" href=\"http://www.yorkelectric.net\"><img src=\"images/bp_arrow_rt.jpg\" border=0 width=20 height=20>&nbsp;&nbsp;&nbsp;York Electric<\/a><\/div>"); */
    document.writeln("<\/div>");
}

var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
function fitWindowSize(pix_image) {
    dcppix=window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
    dcppix.document.write('<html><head><title>Crime Statistics (' + pix_image + ')</title></head>'
        + '<body><script>self.moveTo(0,0)</script>'
        + '<script>self.resizeTo(self.document.images(0).width,self.document.images(0).height)</script>'
        + '</body></html>');
    dcppix.document.close();
    
    if (isIE4) {
        resizeTo(500, 500);
        width = 500 - (document.body.clientWidth - document.images[0].width);
        height = 500 - (document.body.clientHeight - document.images[0].height);
        }
    else {
        innerWidth = document.layers[0].document.images[0].width;
        innerHeight = document.layers[0].document.images[0].height;}
        dcppix.resizeTo(dcppix.document.images(0).width,dcppix.document.images(0).height)
}

