// JavaScript Document

function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}

jQuery(function() {
    jQuery.superbox();
});

jQuery.superbox.settings = {
    boxId: "superbox",
    // Id attribute of the "superbox" element
    boxClasses: "",
    // Class of the "superbox" element
    overlayOpacity: .8,
    // Background opaqueness
    boxWidth: "696",
    // Default width of the box
    boxHeight: "478"
    // Default height of the box
    };

jQuery(document).ready(function() {
	
// validate the comment form when it is submitted
//jQuery("#commentform").validate();

    jQuery("#features .featurepanel, #plans tr.hover, .contactinfo div div").hover(function() {

//Change the color of the table rows as the mouse hovers

        jQuery(this).stop().animate({ 
            backgroundColor: "#e5e5e5"
        }, "fast");
    }, function() {

        jQuery(this).stop().animate({
            backgroundColor: "#F0F0F0"
        }, "slow");
    });

//Make the heights of the feature panel and the individual testimonies equal

    jQuery("#testimonials div div").equalHeights();

    jQuery("#backgrounds img").hide(); //Hide backgrounds before being loaded

    jQuery("#spanel").click(function() { //This whole block of the javascript is explained in the help file.
        return false;
    });

    jQuery(".sl1").click(function() {

        jQuery("#spanelbg").animate({
            left: "22px"
        }, 150, 'easeInCirc');
        jQuery(".slider").animate({
            right: "0px"
        }, 450, 'easeInCubic');
        jQuery("#slider li").fadeOut("fast");
        jQuery("#slider li.sp1").fadeIn("slow");
        jQuery("#backgrounds img").fadeOut(950);
        return false;
    });

    jQuery(".sl2").click(function() {

        jQuery("#spanelbg").animate({
            left: "104px"
        }, 250, 'easeInCirc');
        jQuery(".slider").animate({
            right: "222px"
        }, 450, 'easeInCubic');
        jQuery("#slider li").fadeOut("fast");
        jQuery("#slider li.sp2").fadeIn("slow");
        jQuery("#backgrounds img").fadeOut("fast");
        jQuery("#backgrounds #bg1").fadeIn(950);
        return false;
    });

    jQuery(".sl3").click(function() {

        jQuery("#spanelbg").animate({
            left: "179px"
        }, 250, 'easeInCirc');
        jQuery(".slider").animate({
            right: "443px"
        }, 450, 'easeInCubic');
        jQuery("#slider li").fadeOut("fast");
        jQuery("#slider li.sp3").fadeIn("slow");
        jQuery("#backgrounds img").fadeOut("fast");
        jQuery("#backgrounds #bg2").fadeIn(950);
        return false;
    });

    jQuery(".sl4").click(function() {

        jQuery("#spanelbg").animate({
            left: "254px"
        }, 250, 'easeInCirc');
        jQuery(".slider").animate({
            right: "665px"
        }, 450, 'easeInCubic');
        jQuery("#slider li").fadeOut("fast");
        jQuery("#slider li.sp4").fadeIn("slow");
        jQuery("#backgrounds img").fadeOut("fast");
        jQuery("#backgrounds #bg3").fadeIn(950);
        return false;
    });

    jQuery("#testimonials").cycle({ //Cycles the testimonials. Feel free to check the help file for more info. 
        timeout: 8000
    });

});
