﻿$(document).ready(function() {  
     //sliders       
    $(".slide_slider").each(function(){
       $(this).attr("rel",$(this).children(".inner_con").height()+100);
       $(this).animate({ height: "160px" }, 50);
    });  

    $(".slide_slider").mouseenter(function() {
        $(this).animate({ height: $(this).attr("rel") + "px" }, 250);
    }
   );

    $(".slide_slider").mouseleave(function() {
        $(this).animate({ height: "160px" }, 250);
    }
   );
   
   //conditions blog (retreive feed)
   $.get("blogFeed.asp",function(d){ 
       $("#conditions_blog_top").children(0).before(d);
   });
    
   //testimonials
   $("#quote_box_top").children(0).before("<ul><li><a id=\"prev\" href=\"JavaScript:void(0);\">Prev</a></li><li><a id=\"next\" href=\"JavaScript:void(0);\">Next</a></li></ul>");
   $("#prev").live("click",function(){
        $("#hotscot_quote").fadeOut(500,function(){
             $.get("randomTestimonial.asp?dir=prev&cache=" + Math.random(),function(d){ 
             $("#hotscot_quote").html(d);
             $("#hotscot_quote").fadeIn(500);                     
        });
       });
   });
   $("#next").live("click",function(){
        $("#hotscot_quote").fadeOut(500,function(){
             $.get("randomTestimonial.asp?dir=next&cache=" + Math.random(),function(d){ 
             $("#hotscot_quote").html(d);
             $("#hotscot_quote").fadeIn(500);                     
        });
       });
   });
   $("#hotscot_quote_wraper").mouseenter(function(){
        $(this).children("#hotscot_quote").children("p").attr("rel",$(this).children("#hotscot_quote").html());
        $(this).children("#hotscot_quote").children("p").html($(this).children("#hotscot_quote").children("p").attr("title"));
        $(this).animate({height:$(this).children("#hotscot_quote").children("p").height()  + "px"},250);
    });
    
    $("#hotscot_quote_wraper").mouseleave(function(){
        $(this).children("#hotscot_quote").html($(this).children("#hotscot_quote").children("p").attr("rel"));
        $(this).animate({height:"150px"},250);
    });
   
});