jQuery(document).ready(function(jQuery) {
  jQuery('a[rel*=facebox]').facebox({
	loading_image : 'facebox/loading.gif',
	close_image   : 'facebox/closelabel.gif'
  });	
  		
		$('#map_canvas').hide();		
		$('#li_map_address').addClass('active');
			
	    });
var infowindow = null;
var map = null;
$(document).ready(function () { initialize();  });
var sites = [
	['mike', 39.930200,-75.216000, 1, '
'],['Judy', 45.649300,-111.034000, 1, 'I think that would be a tough one to come up with ...
Read moreEveryone was very polite, professional and Dr. Yer...
Read moreEveryone was great. Crystal was very good at obtai...
Read moreMy hygienist Justin is terrific. At my previous ap...
Read moreEveryone from check in, to treatment, to check out...
Read moreThe speed with which I obtained an appointment as ...
Read moreMatt was incredibly helpful and accommodating. I w...
Read more
Read Reviews | Reviews Maps ']];
var LatLngList=[];
var gmarkers = []; 
function initialize() {
    var centerMap = new google.maps.LatLng(39.828175, -98.5795);
    var myOptions = {
		zoom: 1,
        center: centerMap,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
		disableDefaultUI: true
	}
	if($("#map_canvas").length >  0){
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	if($('#map_address').length>0){
		var map_address = new google.maps.Map(document.getElementById("map_address"), myOptions);
	}
    setMarkers(map, sites);
	if($('#map_address').length>0){
		setMarkers(map_address, sites_address);
	}
	
	infowindow = new google.maps.InfoWindow({
        content: "loading..."
    });
	var bikeLayer = new google.maps.BicyclingLayer();
	bikeLayer.setMap(map);
	}
}
function setMarkers(map, markers) {
	LatLngList=[];
	gmarkers=[];
    for (var i = 0; i < markers.length; i++) {
        var sites = markers[i];
        var siteLatLng = new google.maps.LatLng(sites[1], sites[2]);
		LatLngList.push(new google.maps.LatLng(sites[1], sites[2]));
        var marker = new google.maps.Marker({
            position: siteLatLng,
            map: map,
            title: sites[0],
            zIndex: sites[3],
            html: sites[4],
			icon: "https://www.markishmanlegal.com/ctr_asset/map/active_greentick.png"
        });
		var contentString = "Some content";
		google.maps.event.addListener(marker, "click", function () {			
			infowindow.setContent(this.html);
			infowindow.open(map, this);
		});
		// save the info we need to use later for the side_bar
		gmarkers.push(marker);
	}
	
	//  Create a new viewpoint bound
	var bounds = new google.maps.LatLngBounds ();
	//  Go through each...
	for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) {
	  //  And increase the bounds to take this point
	  bounds.extend (LatLngList[i]);
	}
	//  Fit these bounds to the map
	map.fitBounds (bounds);
	zoomChangeBoundsListener = 
    google.maps.event.addListenerOnce(map, 'bounds_changed', function(event) {
		var zoom = map.getZoom();
		map.setZoom(zoom >11 ? 11 : zoom);
	});
	setTimeout(function(){google.maps.event.removeListener(zoomChangeBoundsListener)}, 2000);
	
}
function myclick(num) {
    google.maps.event.trigger(gmarkers[num], "click");
}
function showTestimonial(tpath){
	$.facebox(''); 
}
function viewVideoTestimonial(vpath){
	$.facebox('');
}
function setIframeHeight( iframeId ) /** IMPORTANT: All framed documents *must* have a DOCTYPE applied **/
{
 var ifDoc, ifRef = document.getElementById( iframeId );
 try
 {   
  ifDoc = ifRef.contentWindow.document.documentElement;  
 }
 catch( e )
 { 
  try
  { 
   ifDoc = ifRef.contentDocument.documentElement;  
  }
  catch(ee)
  {   
  }  
 }
 
 if( ifDoc )
 {
  ifRef.height = 1;  
  ifRef.height = ifDoc.scrollHeight;
  
  /* For width resize, enable below.  */
  
  // ifRef.width = 1;
  // ifRef.width = ifDoc.scrollWidth; 
 }
}
function loadmap(){
	if (!map) {initialize();}
}
var twitter_username='';
if(twitter_username){
	jQuery(function($){
        $(".twitter_strip").tweet({
          join_text: "auto",
          username: twitter_username,
          avatar_size: 64,
          count: 1,
          auto_join_text_url: "we were checking out",
         loading_text: ""
        });
	});
}else{
	jQuery(document).ready(function(jQuery) {
		$('.footer').addClass('nobackground');
		$('.twitter_strip').html('');
		$('.footer_strip').css('height','auto');
		$('.footer_strip').css('padding-top','20px');
	});
}
stLight.options({publisher: "5cdc8c12-a21a-4869-a0c3-05023e05c4ac"});
function our_menu_link(){
	$('#wrapper').hide();
	$('.wrap_iframe').show();
	$('#iframe1').show();
	$('body').css('background','transparent');
	$('#iframe1').css('padding-top','75px');
}
function resizeIframe() {
    var height = document.documentElement.clientHeight;
    height -= document.getElementById('iframe1').offsetTop;
    
    // not sure how to get this dynamically
    height -= 20; /* whatever you set your body bottom margin/padding to be */
    
    document.getElementById('iframe1').style.height = height +"px";
    
};
if($('#iframe1').length>0){
	document.getElementById('iframe1').onload = resizeIframe;
	window.onresize = resizeIframe;
}
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
//Disable right mouse click Script
/* var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false"); */