/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


$(function () {
    //$('#menu-navigation li').ClassName = index(this);
    $('.copycontent').jScrollPane();
    
    $("#menu-navigation li a:not(.sub-menu li a)").each(function (index, domEle) {
        $(domEle).addClass("m" + index); 
      });
      
    $("#menu-at_adelphi li a").each(function (index, domEle) {
        $(domEle).addClass("m" + index); 
      });
      
    $("#menu-suites li a").each(function (index, domEle) {
        $(domEle).addClass("m" + index); 
      });
      
      
      for (i=0; i < $(".jcarousel-control>a").size(); i++)//
      {
        $(".sldr"+(i+1)).html($(".h4sldr"+i).text())
              
      }
      

    $('.roomgallery a').click(function() {
      //$(".listic_sliderb img[alt='" +  $(this).attr("imagealt") + "']").attr("src","/wp-content/themes/adelphi/images/background/rooms/" + $(this).attr("folder") + "/"+ $(this).attr("folder") + $(this).attr("thumbnumber") + ".jpg");
        //var tempimg = "/wp-content/themes/adelphi/images/background/rooms/" + $(this).attr("folder") + "/"+ $(this).attr("folder") + $(this).attr("thumbnumber") + ".jpg";
        var tempimg = "/wp-content/uploads/2012/01/" + $(this).attr("folder") + $(this).attr("thumbnumber") + ".jpg";
        var tempobj = $(".listic_sliderb img[alt='" +  $(this).attr("imagealt") + "']");
        //alert(tempimg);
        
        tempobj.fadeOut("fast",function (){
            tempobj.attr("src",tempimg);
            tempobj.fadeIn("slow",function (){
                
            })
        });
        
        
    });
    
//    $('.roomgallery a').click(function() {
//      var img = $(".listic_sliderb img[alt='" +  $(this).attr("imagealt") + "']");
//      img.fadeout(500,function(){
//        $(this).attr("src","/wp-content/themes/adelphi/images/background/rooms/" + $(this).attr("folder") + "/premier" + $(this).attr("thumbnumber") + ".jpg");
//        if (this.complete) $(this).fadeIn(500);
//      });

    // Expand Panel
    $("#open").click(function () {
        $("div#panel").slideDown("slow");
        //$("#content-inner").slideDown("slow",function(){$("#content-inner").css("padding-top", "100px");});
    });
    // Collapse Panel
    $("#close").click(function () {
        $("div#panel").slideUp("slow");
    });
    // Switch buttons from "Log In | Register" to "Close Panel" on click
    $("#follow a").click(function () {
        $("#follow a").toggle();
    });
    
    //.jcarousel-control .sldr2 .listic_slider_nav
    //$(".expand").click(function () { $("#" + this.href.split("#").slice(-1)).show('slow') }); //$(this.href.split("#").slice(-1)).removeClass("collapse") });
    //$("#" + window.location.toString().split("#").slice(-1)).removeClass("collapse");
    //$(".sldr3").onclick();
    //$(".sldr3").click();//.trigger('click');
    if (window.location.toString().split("#").slice(-1) == "follow")
    {
        $("div#panel").slideDown("slow");
        $("#follow a").toggle(function(){$("body").scrollTop(0)});
    }

//sldr2 listic_slider_nav
});
/*
    startslider(3);
    function startslider(slideno) {
            var navclass = jQuery(obj).attr("class");
            var slide = navclass.replace("sldr", "");
            carousel.scroll(jQuery.jcarousel.intval(slideno));
            carousel.startAuto(0);
            return false;
    }
 */
/*
$(document).ready(function() {
    var current = -1;
    var elems = new Array();
    var elems_i = 0;
    $('.wp-forecast-fc-oneday').each(function() {
            elems[elems_i++] = $(this);
    });
    var num_elems = elems_i - 1;
    var animate_out = function() {
            elems[current].animate({ top: '-100px' }, 'slow', 'linear', animate_in);
    }
    var animate_out_delay = function() {
            setTimeout(animate_out, 10000); 
    }
    var animate_in = function() {
            current = current < num_elems ? current + 1 : 0;
            elems[current].css('top', '200px').animate({ top: '0px' }, 'fast', 'linear', animate_out_delay);
    }
    animate_in();
});
*/
