﻿//BUG: when display : none for the form, it will remove form (IE)
//Set the display none on actual div container("enquiryContainer")
$(function() {

    var container = $("#enqFormContainer");
    //var formHeight = $("form#onlineEnquiry").height();
    var initialHeight = 1;
    var fullHeight = 515;
    //container.after("<span style=\"display:none\" href=\"#\" id=\"hideEnquiryFormLink\">&laquo; Hide</span>")
    //$('#enquiryContainer').css({ "position": "relative", "border": "none" });
    $("#showEnquiryForm").click(function() {
       
        if ($("#showEnquiryForm").hasClass("showEnqForm")) 
        {
            container.css("display", "inline");
            
            container.animate({ height: fullHeight }, 2000,
								  function() {
								    
								      //$(this).hide();
								      //$("#showEnquiryForm").css("display", "inline");
								  });
            
            
            
            
            $("#showEnquiryForm").removeClass("showEnqForm");
            $(this).css("background-image", "url(../../../images/OfferDetails/yesBtnGreyBG.jpg)");
           
        }
       // else 
        //{
        //    container.css("display", "none");
        //    $("#showEnquiryForm").addClass("showEnqForm");

        //}
    });
});

 //$("#showEnquiryForm").css("display", "none");
            //container.animate({ height: initialHeight }, 2000,
			//					  function() {
								      //$(this).hide();
								      //$("#showEnquiryForm").css("display", "inline");
			//					  });
            
            //$("#showEnquiryForm span").html("Enquire");
            
            
            
            //            $("#showEnquiryForm").css("display", "none");
//            container.animate({ height: fullHeight + 'px' }, 2000,
//								   function() {
//								       $("#showEnquiryForm").css("display", "inline");
//								       $(this).show();
//								   });
//            $("#showEnquiryForm").addClass("hideEnqForm");
//            $("#showEnquiryForm span").html("Hide Enquiry Form");