 //register fonts:
var praxisLight = { src: '/wp-content/themes/diners/fla/praxis.swf' };
//activate fonts (only 1 activate call!):
sIFR.activate(praxisLight);
//replace fonts:
sIFR.replace(praxisLight, {
  selector: 'h1',
  css: '.sIFR-root { color: #0069aa; font-size: 26px}'
});

sIFR.replace(praxisLight, {
  selector: '.sub_head',
  css: '.sIFR-root { color: #0069aa; font-size: 20px}'
});


jQuery(document).ready(function($){

$('#golf_banner').cycle({
	timeout:       6000,  // milliseconds between slide transitions (0 to disable auto advance) 
    speed:         2500 // speed of the transition (any valid fx speed value) 
 });
 
 $('#services_banner').cycle({
	timeout:       7000,  // milliseconds between slide transitions (0 to disable auto advance) 
    speed:         2500 // speed of the transition (any valid fx speed value) 
 });

//page break privileges
//$('.livelisting .priv_group:nth-child(5n)').after('<div class="page_break" style="page-break-after:always"></div>');



// open external links in a new window
$('.priv_group a[href^="http://"]')
  .attr("target", "_blank");

	 $("img.overImg").fadeTo(.5, .5);
	  $("img.overImg").hover(
		function () {
		  $(this).fadeTo("fast", 1);
		},
		function () {
		  $(this).fadeTo("normal", .5);
		}
	  );


// hide and show
	$("p.showhide").addClass("hide");
	$(".showInfo").click(function () {
      $("p.showhide").slideToggle("slow");
    });


$("div.card_fullDetails").addClass("hide");
	$("div.priv_fullDetails").addClass("hide");
    $("p.show_details").click(function() {
	        var img = $(this).find("img"); //get a handle of the image tag inside title link
	        var src = $(img).attr("src"); //get the source of the image	 
	        //toggle the source of the image to show either plus/minus
	        if (src.endsWith("plus.jpg"))
	          {  src = src.replace('plus.jpg', 'minus.jpg');
				//add printability
			/*var parent_div = $(this).parents('div.priv_group'); 
			$(parent_div).attr("id", "divToPrint");*/
			
			  }
	        else{
	            src = src.replace('minus.jpg', 'plus.jpg');
				/*var parent_div = $(this).parents('div.priv_group'); 
			$(parent_div).attr("id", "");*/
			}
	        $(img).attr("src", src);
	 
	        //get the title of the anchor tag which corresponds to the id of the content div
	        var content = $(this).attr("title");
	        //toggle the display of the content div
	        $('#'+content).slideToggle();	
			
	    });
	
	 
$('#nav li')
	.css( { marginTop: "0px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{ marginTop: "-3px"}, 
			{duration:300})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{ marginTop: "0px"}, 
			{duration:300})
		});
	
	
String.prototype.endsWith = function(str) {
return this.lastIndexOf(str) == this.length - str.length;
	}

//Jquery popupWindow
var profiles =
{

	window800:
	{
		height:800,
		width:800,
		status:1
	},

	window200:
	{
		height:200,
		width:200,
		status:1,
		resizable:0
	},

	windowCenter:
	{
		height:300,
		width:400,
		center:1
	},

	windowNotNew:
	{
		height:300,
		width:400,
		center:1,
		createnew:0
	},

	windowCallUnload:
	{
		height:300,
		width:400,
		center:1,
		onUnload:unloadcallback
	}

};

function unloadcallback(){
	alert("unloaded");
};


$(function()
{
  		$(".popupwindow").popupwindow(profiles);
});


//Lightbox
  $(function() {
        $('.order_thumb a').lightBox();
    });
});
