
$(document).ready(function() {

///////////////////////////////////  Main Navigation  ///////////////////////////////////
	$("#main_nav .link").prepend("<span></span>"); //Throws an empty span tag right before the a tag

	$("#main_nav .link").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
		$(this).find("span").show().html(linkText); //Add the text in the <span> tag
	}); 

	$("#main_nav .link").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-60" //Find the <span> tag and move it up 40 pixels
		}, 200);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"  //Move the <span> back to its original state (0px)
		}, 200);
	});


/////////////////////////////////// NIVO SLIDER MAIN PAGE ///////////////////////////////////
    //main menu
    $('#slider').nivoSlider({
        effect:'random', //Specify sets like: 'random,fold,fade,sliceDown'
        slices:15,
        animSpeed:300, //Slide transition speed
        pauseTime:5000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:true, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
    //about us
    $('#abt_slider').nivoSlider({
        effect:'fade', //Specify sets like: 'random,fold,fade,sliceDown'
        slices:15,
        animSpeed:500, //Slide transition speed
        pauseTime:5000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:false, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
    //properties
    $('#prop_slider').nivoSlider({
        effect:'fade', //Specify sets like: 'random,fold,fade,sliceDown'
        slices:15,
        animSpeed:500, //Slide transition speed
        pauseTime:5000,
        startSlide:0, //Set starting Slide (0 index)
        controlNav:false, //1,2,3...
        directionNav:false, //Next & Prev
        directionNavHide:false, //Only show on hover
        manualAdvance:false, //Force manual transitions
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
    //Property page
    $('#pp_slideshw').nivoSlider({
        effect:'fade', //Specify sets like: 'random,fold,fade,sliceDown'
        slices:15,
        animSpeed:500, //Slide transition speed
        directionNav:false, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNavThumbs:true,
        controlNavThumbsFromRel:true,
        manualAdvance:true //Force manual transitions
    });



/////////////////////////////////// FEATURED LINKS ///////////////////////////////////
    $("ul#m_fl_menu li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
    
    // set opacity to nill on page load
		$("ul#m_fl_menu span").css("opacity","0");

    $("ul#m_fl_menu li").each(function() { //For each list item...
      var linkText2 = $(this).find("div").html(); //Find the text inside
      $(this).find("span").show().html(linkText2); //Add the text in the <span> tag
    }); 

    $("ul#m_fl_menu li").hover(function() {	//On hover...
      $(this).find("span").stop().animate({
        opacity: 1
			}, 'slow');
    } , function() { //On hover out...
      $(this).find("span").stop().animate({
        opacity: 0
			}, 'slow');
    });

    


/////////////////////////////////// TINY CAROUSEL SCRIPT //////////////////////////////////////
		$('#fp_slider').tinycarousel({ display: 2 });



/////////////////////////////////// ACCORDION //////////////////////////////////////
       $('#accordion dd').hide();
       $('#accordion dt a').click(function(){
               $('#accordion dd').slideUp();
               $(this).parent().next().slideDown();
               return false;
       });
       
       
});

