﻿$(document).ready(function() {
    if (!$.browser.msie) $.preloadCssImages();

    

      
    $(".click_enlarge").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	200, 
		'speedOut'		:	200,
		'titlePosition'	: 'over' });

	$(".click_enlarge_masterplan").hover(function() {
	
	    $.fancybox({
	        'transitionIn'	:	'elastic',
		    'transitionOut'	:	'elastic',
		    'speedIn'		:	200, 
		    'speedOut'		:	200,
		    'titlePosition'	: 'over',
		    'href':this.href
		    
		    });
		    return false;
		
		});

/*
 $(".click_enlarge_masterplan").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	200, 
		'speedOut'		:	200,
		'titlePosition'	: 'over' });
*/
	
    $(".click_iframe").fancybox({ 
    height: "75%", 
	width: 710, 
    type: "iframe" });
    
    $(".click_image").fancybox({ 
    maxWidth: "80%", 
    maxHeight: "80%" });
    


    $("#thumb-gallery-group").cycle({
        fx: 'fade',
        sync: 1,
        speed: 'fast'
    });

    //    $('#pricetag').hide();
    //    $('#pricetag').fadeIn('slow');
    $(".click_flash").fancybox({ 'padding': 0,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        width: 768,
        height: 480});

    if ($("#FloorPlan .floorPlanDownload a").length) {
        $("#FloorPlan .floorPlanThumb").wrap($("#FloorPlan .floorPlanDownload a"));
    }

    $(".click_print").click(function() {
        window.print();
        });
        
        
    var caption = $('img.first').attr('title');
	if ($('#gallery-caption').length > 0)
	{
		$('#gallery-caption').html(caption.replace('#','<sup>#</sup>'));
	}
	$('#gallery-thumbs img').mouseenter(function(){
		var pic = $(this).attr('src');
		var caption = $(this).attr('title');
		var part = pic.split('/');
		$('#big-picture').attr('src',part[0]+'/gallery/'+part[2]).stop(true,true);
		$('#gallery-caption').html(caption.replace('#','<sup>#</sup>'));
		
		
		});

});
