﻿var newwindow;
function pop(url)
{
	newwindow=window.open(url,'name','height=294,width=382');
	if (window.focus) {newwindow.focus()}
}

function SearchSite()   
{   
    document.location.href='http://web.miamibeachfl.gov/search.aspx?' +   
  'cx=000383909869072862915:jdvnf5suisi&cof=FORID%3A11&ie=UTF-8&q=' +    
  document.getElementById('q').value + '&sa=Search';   
}  

function URLEncode (clearString) {   
  var output = '';   
  var x = 0;   
  clearString = clearString.toString();   
  var regex = /(^[a-zA-Z0-9_.]*)/;   
  while (x < clearString.length) {   
    var match = regex.exec(clearString.substr(x));   
    if (match != null && match.length > 1 && match[1] != '') {   
        output += match[1];   
      x += match[1].length;   
    } else {   
      if (clearString[x] == ' ')   
        output += '+';   
      else {   
        var charCode = clearString.charCodeAt(x);   
        var hexVal = charCode.toString(16);   
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();   
      }   
      x++;   
    }   
  }   
  return output;   
}   

function submitenter(myfield, e)   
{   
    var keycode;   
    if (window.event)   
        keycode = window.event.keyCode;   
    else if (e)   
        keycode = e.which;   
    else  
        return true;   
    if (keycode == 13)   
    {   
        SearchSite();   
        return false;   
    }   
    else  
        return true;   
}   

function mailpage()
{
  mail_str = "mailto:?subject= Must See Miami Beach Website " + document.title;
  mail_str += "&body= I recommend this Website (web.miamibeachfl.gov) tip -- " + document.title;
  mail_str += ". You should check this out at, " + location.href; 
  location.href = mail_str;
}

var slidespeed=3000
var slideimages=new Array("images/header1000.png","images/header2-1000.png","images/header3-1000.png","images/header4-1000.png","images/header5-1000.png")

var slidelinks=new Array("default.aspx","default.aspx","default.aspx","default.aspx","default.aspx")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

var message="";

function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false") 
