/*popup*/
jQuery.fn.popupwindow=function(p){var profiles=p||{};return this.each(function(index){var settings,parameters,mysettings,b,a;mysettings=(jQuery(this).attr("rel")||"").split(",");settings={height:600,width:600,toolbar:0,scrollbars:0,status:0,resizable:1,left:0,top:0,center:0,createnew:1,location:0,menubar:0};if(mysettings.length==1&&mysettings[0].split(":").length==1){a=mysettings[0];if(typeof profiles[a]!="undefined"){settings=jQuery.extend(settings,profiles[a])}}else{for(var i=0;i<mysettings.length;i++){b=mysettings[i].split(":");if(typeof settings[b[0]]!="undefined"&&b.length==2){settings[b[0]]=b[1]}}}if(settings.center==1){settings.top=(screen.height-(settings.height+110))/2;settings.left=(screen.width-settings.width)/2}parameters="location="+settings.location+",menubar="+settings.menubar+",height="+settings.height+",width="+settings.width+",toolbar="+settings.toolbar+",scrollbars="+settings.scrollbars+",status="+settings.status+",resizable="+settings.resizable+",left="+settings.left+",screenX="+settings.left+",top="+settings.top+",screenY="+settings.top;jQuery(this).bind("click",function(){var name=settings.createnew?"PopUpWindow"+index:"PopUpWindow";window.open(this.href,name,parameters).focus();return false})})};

var profiles = { courseweather: { height: 840, width: 960, center: 1, createnew: 0, status: 1, scrollbars: 1 }, video: { height: 418, width: 624, center: 1, createnew: 0, status: 1 },windowtoolbar: { height: 560, width: 740, center: 1, createnew: 0, status: 1 },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 }, windowemailcol: { height: 510, width: 400, center: 1, createnew: 0 }, windowprint: { height: 400, width: 600, center: 1, createnew: 0, scrollbars: 1}, newsletter: { height: 670, width: 405, center: 1, createnew: 0 }, windowprint: { height: 400, width: 600, center: 1, createnew: 0, scrollbars: 1} };

$().ready(function() {
    $('a[rel="external"]').click(function() {
        window.open($(this).attr('href'));
        return false
    })
});






$(function($) {
$.preloadCssImages();
$(".popupwindow").popupwindow(profiles);	

$(".tbl-contact tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});

$("ul.newsletter li:odd").addClass("alt");
$("ul.newsletter li:odd").mouseover(function() {$(this).removeClass("alt");}).mouseout(function() {$(this).addClass("alt");});
$("ul.newsletter li").mouseover(function() {$(this).addClass("newsletter-hvr");}).mouseout(function() {$(this).removeClass("newsletter-hvr");});

$('div.topnav ul li ul li:last-child').addClass('finalnav');		   
$("#searchbtnwrap").hover( function() { 
$("#searchbtn",this).css("margin-top","-31px"); },
 function() { $("#searchbtn",this).css("margin-top","0"); });
var seek = "Search";
$(".search-field").val(seek); 
$(".search-field").addClass("srch-off");
$(".search-field").focus(function(){
if($(this).val() == seek){
$(this).val("");
}
$(".search-field").addClass("srch-on");
$(this).removeClass("srch-off");
});
$(".search-field").blur(function(){
if($(this).val() == ("")){
$(this).val(seek);
}
$(".search-field").addClass("srch-off");
$(this).removeClass("srch-on");
});






$('div#main-feature').cycle({ 
	
    fx:     'fade', 
    speed:  'fast', 
    timeout: 6000, 
	pause: true,
    pager:  '#main-feature-nav span.mf-nav' 
});




$(function() {
    function preloadImg(image) {
        var img = new Image();
        img.src = image;
    }

    preloadImg('/images/main_about.jpg');
    preloadImg('/images/main_golf.jpg');
    preloadImg('/images/main_dining.jpg');
    preloadImg('/images/main_join.jpg');
    preloadImg('/images/main_tennis.jpg');
    preloadImg('/images/main_junior.jpg');
    preloadImg('/images/main_pool.jpg');
    preloadImg('/images/main_juniortennis.jpg');
    preloadImg('/images/main_juniorgolf.jpg');
});


});

$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox();
				$("a[rel='example2']").colorbox({transition:"fade"});
				$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
				$("a[rel='example4']").colorbox({slideshow:true});
				$(".single").colorbox({}, function(){
					alert('Howdy, this is an example callback.');
				});
				$(".colorbox").colorbox();
				$(".youtube").colorbox({ iframe: true, width: 650, height: 550 });
				$(".golfrules").colorbox({ iframe: true, width: 650, height: 425 });
				$(".golfholidays").colorbox({ iframe: true, width: 650, height: 355 });
				$(".golffees").colorbox({ iframe: true, width: 300, height: 290 });
				$(".iframe").colorbox({width:"90%", height:"90%", iframe:true, overlayClose:false}); 
				$(".video-cbox").colorbox({width:"664", height:"488", iframe:true}); 
				$(".photogallery").colorbox({width:900, height:760, iframe:true});   
				$(".inline").colorbox({width:"50%", inline:true, href:"#inline_example1"});
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			


$().bind('cbox_open', function(){
    $('body').css({overflow:'hidden'});
}).bind('cbox_closed', function(){

    $('body').css({overflow:'auto'});

});

$(".iframe").colorbox({width:"80%", height:"80%", iframe:true}); 

});
