﻿var $j = jQuery.noConflict();

function mainmenu() {
  $j("#menu ul").css({display: "none"}); // Opera Fix
  $j("#menu li").hover(function() {
    $j(this).find('ul:first').css({visibility: "visible", display: "none"}).fadeIn(300);
	},function() {
	  $j(this).find('ul:first').css({visibility: "hidden"}).fadeOut(300);
	});
}

$j(document).ready(function() {  
  mainmenu();
  $j(document).pngFix();
  $j("#menu li ul").children("li:nth-child(1)").css({"border-top" : "none"});
  $j("#menu").children("li:nth-child(6)").css({"float" : "right"});
  $j("#menu").children("li:nth-child(6)").css({"border-right" : "none"});
});

$j(function() {
    $j("#ctl00_other_slideshow, #ctl00_home_slideshow").cycle({
        
    timeout:       6500,  // milliseconds between slide transitions (0 to disable auto advance) 
    speed:        1200,  // speed of the transition (any valid fx speed value)
    pause:          0 
    });
});

$j(function() {
    $j('#ctl00_ContentPlaceHolder1_ModPropertyDisplay1_img_main a, a#ctl00_ContentPlaceHolder1_ModPropertyDisplay1_hypMorePhotos').lightBox(); // Select all links in object with gallery ID
});

$j(function () {
    $j('a#ctl00_ContentPlaceHolder1_ModPropertyDisplay1_hypFloorPlan').lightBox(); // Select all links in object with gallery ID
});

/* Email Hider uses class='email' for the script to work*/

$j(document).ready(function () {
    $j('a.email').each(function (i) {
        var text = $j(this).text();
        var address = text.replace(" at ", "@");
        $j(this).attr('href', 'mailto:' + address);
        $j(this).text(address);
    });
});

$j(document).ready(function () {
    $j('#tabs div').hide();
    $j('#tabs div:first').show();
    $j('#tabs ul li:first').addClass('active');

    $j('#tabs ul li a').click(function () {
        $j('#tabs ul li').removeClass('active');
        $j(this).parent().addClass('active');
        var currentTab = $j(this).attr('href');
        $j('#tabs div').hide();
        $j(currentTab).show();
        return false;
    });
});

