// JavaScript Document

var $j = jQuery.noConflict();

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;
}

$j(function() {
    $j.superbox();
});

$j.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
    };

$j(document).ready(function() {
	
// validate the comment form when it is submitted
//$j("#commentform").validate();

    $j("#features .featurepanel, #plans tr.hover, .contactinfo div div").hover(function() {

//Change the color of the table rows as the mouse hovers

        $j(this).stop().animate({ 
            backgroundColor: "#e5e5e5"
        }, "fast");
    }, function() {

        $j(this).stop().animate({
            backgroundColor: "#F0F0F0"
        }, "slow");
    });

//Make the heights of the feature panel and the individual testimonies equal

    $j("#testimonials div div").equalHeights();

    $j("#backgrounds img").hide(); //Hide backgrounds before being loaded

    $j("#spanel").click(function() { //This whole block of the javascript is explained in the help file.
        return false;
    });

    $j(".sl1").click(function() {

        $j("#spanelbg").animate({
            left: "4px"
        }, 150, 'easeInCirc');
        $j(".slider").animate({
            right: "0px",
        }, 450, 'easeInCubic');
        $j("#slider li").fadeOut("fast");
        $j("#slider li.sp1").fadeIn("slow");
        $j("#backgrounds img").fadeOut(950);
        return false;
    });

    $j(".sl2").click(function() {

        $j("#spanelbg").animate({
            left: "86px"
        }, 250, 'easeInCirc');
        $j(".slider").animate({
            right: "269px" // 220
        }, 450, 'easeInCubic');
        $j("#slider li").fadeOut("fast");
        $j("#slider li.sp2").fadeIn("slow");
        $j("#backgrounds img").fadeOut("fast");
        $j("#backgrounds #bg1").fadeIn(950);
        return false;
    });

    $j(".sl3").click(function() {

        $j("#spanelbg").animate({
            left: "170px"
        }, 250, 'easeInCirc');
        $j(".slider").animate({
            right: "540px" // 440
        }, 450, 'easeInCubic');
        $j("#slider li").fadeOut("fast");
        $j("#slider li.sp3").fadeIn("slow");
        $j("#backgrounds img").fadeOut("fast");
        $j("#backgrounds #bg2").fadeIn(950);
        return false;
    });

    $j(".sl4").click(function() {

        $j("#spanelbg").animate({
            left: "259px"
        }, 250, 'easeInCirc');
        $j(".slider").animate({
            right: "808px" // 660
        }, 450, 'easeInCubic');
        $j("#slider li").fadeOut("fast");
        $j("#slider li.sp4").fadeIn("slow");
        $j("#backgrounds img").fadeOut("fast");
        $j("#backgrounds #bg3").fadeIn(950);
        return false;
    });

    $j("#testimonials").cycle({ //Cycles the testimonials. Feel free to check the help file for more info. 
        timeout: 8000
    });

});
