
// jquery stuff here

    if (document.styleSheets[1].rules)
    {
        document.styleSheets[1].addRule(".calc_inputarea", "display:none");
        document.styleSheets[1].addRule(".calcNONJS", "display:none");
    }
    if (document.styleSheets[1].cssRules)
    {  
        var x = document.styleSheets[1];
        x.insertRule('.calc_inputarea {display:none}',x.cssRules.length);
        x.insertRule('.calcNONJS {display:none}',x.cssRules.length);
        
    }
	 
    function AddHiddenTextOnlyVersionField(isTextOnly)
    {        
        var hidden = document.getElementById("hiddenTextOnlyVersion");
        if(hidden == null)
        {
            $("form").append("<input type=\"hidden\" id=\"hiddenTextOnlyVersion\" value=\"" + isTextOnly +"\" name=\"hiddenTextOnlyVersion\" />");
        }
        else
        {
            hidden.value = isTextOnly;
        }
        
    }
    
    function ShowCalculatorSliders()
    {
       $(".calc_inputarea").fadeIn("slow"); 
    }

	$(document).ready
	(
		function()
		{
		
			 $('.emailButton').click
			(
				function()
				{
                    // Value set for show and hide as without it the event doesnt seem to fire in firefox
                    $(this).hide(100);
                    $("#emailButtonSendingText").show(100); 
				}				
			);
			
			$('#faqListBody h3').css({display:"block"}).click
			(
				function()
				{
                 //this will show one and hide others.
                    $('.faqTextContent').hide();
                    $(".faqHeadingOpen").removeClass("faqHeadingOpen").addClass("faqHeadingClosed");               	
                    $(this).removeClass("faqHeadingClosed").addClass("faqHeadingOpen").next().show();
				}
			);

            var tov_link = $(".textOnlyVersion").css({cursor: "pointer"}).get(0);
            var tov_select = $(".calc_time select:eq(0)").get(0);
            $(".calc_time select:eq(0)").change
            (
                function()
                {
                 slider2.setValue(   this.value*12 );
               
                }
            )
            $(".textOnlyVersion").toggle
            (
                function()
                {
                   slider1.showSibling();
                   slider2.showSibling();
                   tov_link.innerHTML = "slider version";
                   
                   var m2y =(( slider2.value -  (slider2.value % 12))/12) - 5;
                   tov_select.options[m2y].selected=true;
                   AddHiddenTextOnlyVersionField(true);
                   
                }, 
                function()
                {
                
                   slider1.hideSibling();
                   slider2.hideSibling();
                   tov_link.innerHTML  = "text version";
                   AddHiddenTextOnlyVersionField(false);
	
                }
            )
            if (calc1obj) smcalc();
            ShowCalculatorSliders();
        }
	);

