var fontReplace = null;
	/*if(FlashDetect.installed && window.navigator.userAgent.indexOf("Windows") != -1) {
	    fontReplace = 1;
	    sIFR.useStyleCheck = true;
			var rockwell = { src: '/includes/flash/rockwell.swf' };
			sIFR.activate(rockwell);
			sIFR.replace(rockwell, {
			  selector: 'h1,h4,.h1,.h4', wmode: 'transparent', ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18],
			  css: {
				'.sIFR-root' : { 'color': '#900508' , 'font-weight': 'bold' }
		  	}
			 });

             sIFR.replace(rockwell, {
			  selector: 'h2, .h2', wmode: 'transparent', ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18],
			  css: {
				'.sIFR-root' : { 'color': '#646464' , 'font-weight': 'bold' }
		  	}
			 });

             sIFR.replace(rockwell, {
			  selector: 'h5,.h5', 
              wmode: 'transparent', 
              preventWrap : true, 
              ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18], 
			  css: {
				'a,a:hover,a:visited' : { 'color': '#A9A9A9' , 'font-weight': 'bold', 'text-decoration': 'none', 'kerning' : true }
		  	    }
			 });

             sIFR.replace(rockwell, {
			  selector: 'h6,.h6', wmode: 'transparent', tuneHeight: -5, ratios: [6, 1.45, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18],
			  css: {
				'.sIFR-root' : { 'color': '#C1C1C1' , 'font-weight': 'bold' }
		  	}
			 });

             sIFR.replace(rockwell, {
             tuneHeight: -7,
			  selector: '#maincontentwrap1 h3:not(.prevent-replace), #maincontentwrap1 h3 span, .h3', preventWrap : true,  wmode: 'transparent', ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18],
			  css: {
				'.sIFR-root' : { 'color': '#646464' , 'font-weight': 'bold' }, 'a' : { 'color': '#646464' , 'font-weight': 'bold', 'text-decoration': 'none' }, 'a:hover, .selected' : { 'color' : '#8F0508', 'text-decoration': 'underline' }
		  	}
			 });

             sIFR.replace(rockwell, {
			  selector: '#maincontentwrap1 h3.replace', wmode: 'transparent', ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18],
			  css: {
				'.sIFR-root' : { 'color': '#646464' , 'font-weight': 'bold' }, 'a' : { 'color': '#646464' , 'font-weight': 'bold', 'text-decoration': 'none' }, 'a:hover, .selected' : { 'color' : '#8F0508', 'text-decoration': 'underline' }
		  	}
			 });
	}
	else {*/
		fontReplace = 2;
		Cufon.replace('h1,h2,#maincontentwrap1 h3,h4,h5,h6,.h1,.h2,.h3,.h4');
	//}
	
$(document).ready(function() {
    $('.rightmodulecontentfeatured').each(function(i,e) {
	    $('div', this).hide();
	    var $elements = $('div:not(.featuredcontentdivider)', this);
	    var rand = Math.floor(Math.random()*$elements.length + 1);
	    $($elements[rand - 1]).css('display', 'block');
	});

    if($picker != undefined) {
        $picker.change(function() {
            if(this.value != 0) {
                //try {
                    _gaq.push(['_trackEvent', 'ResturantPicker', 'Pick', $('option:selected', $picker).text()]);
                //}
                //catch(err) {}

                $.ajax({
                  type: "POST",
                  url: "/RandomResturant.aspx/GetResturant",
                  data: "{'CategoryID': "+this.value+"}",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function(msg) {
                    $('.restaurantpickerresults').html(msg.d);
                  }
                });
            }
        });
    }

    $.watermark.options.useNative = false;

    $('.mapjumpinput').watermark('enter location in Manhattan');


    $('#locator button').click(function(e) {
        e.preventDefault();
        document.location = '/map/?q='+$(this).siblings('input.mapjumpinput:first').val()+'&db='+$(this).siblings('input[name*="typeid"]:first').val();
    });

    $('.mapjumpinput').keyup(function(e) {
	    if(e.keyCode == 13) {
		    document.location = '/map/?q='+$(this).val()+'&db='+$(this).siblings('input[name*="typeid"]:first').val();
	    }
    });
});


jQuery.fn.outerHTML = function(s) {
		return (s)
			? this.before(s).remove()
			: jQuery("<p>").append(this.eq(0).clone()).html();
	}

  function printThis(obj) {
  var parent = $(obj).parents(".coupon1:first");
	  var d = $("#printer")[0].contentWindow.document; // contentWindow works in IE7 and FF
	  d.open(); d.close(); // must open and close document object to start using it!

	  // now start doing normal jQuery:
	  $("body", d).html("<div id='content'>" + parent.outerHTML() + "</div>");
	  $("head", d).html("<link href=\"/includes/css/manhattan247.css\" rel=\"stylesheet\" type=\"text/css\" /><style type='text/css'>#content { padding-left: 0px; } #content .coupon1 {background-image: none;border:dashed; border-width:3px; border-color:#666;} #content .coupon2 {background-image: none;} #content .coupon3 {background-image: none;}#content .coupon3 table tr td p {font-size:12px;}#content .coupon3 table tr td p.coupon-title, #content .coupon3 table tr td p.coupon-amount {font-size: 16px;}");
	  
	  window.frames['printer'].focus();
	  window.frames['printer'].print();
  }
