﻿// JScript File

if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "/images/systemize_erp_home/costcutting.jpg";
      image_url[1] = "/images/systemize_erp_home/realtimeinfo.jpg";
      image_url[2] = "/images/systemize_erp_home/saas.jpg";
      image_url[3] = "/images/systemize_erp_home/lowcost.jpg";

       var i = 0;
       for(i=0; i<=3; i++) 
         preload_image_object.src = image_url[i];
    }

      
    function incrementIndex()
    {
        var indx = parseInt($("#indexKeeper").attr("value"));
        if (indx < 3)
        {
            indx++;
        }
        else
        {
            indx = 0;
        }
        $("#indexKeeper").attr("value", indx + '');
    }
    var timeoutId = 0;
    function timedCount()
    {
        timeoutId = setTimeout(function() {
            animateSplash();
            timedCount();
        }, 10000);
        
    }
    function animateSplash()
    {
        var lineOne = new Array();
          lineOne[0] = "Cut Costs With Systemize!";
          lineOne[1] = "Real Time Business Information";
          lineOne[2] = "True SaaS Eliminates Complicated IT Systems";
          lineOne[3] = "$99/month For Each User";
          
          var lineTwo = new Array();
          lineTwo[0] = "Reduce over-head by increasing the efficiency of all your employees.";
          lineTwo[1] = "Get up-to the second information on every aspect of your company from anywhere in the world.";
          lineTwo[2] = "No hardware to buy, no additional software to license. Systemize! simplifies your IT infrastructure.";
          lineTwo[3] = "Unlimited Support. Unlimited Storage. All Features Included. No contracts. No additional costs.";
          
          var imgPaths = new Array();
          imgPaths[0] = "costcutting.jpg";
          imgPaths[1] = "realtimeinfo.jpg";
          imgPaths[2] = "saas.jpg";
          imgPaths[3] = "lowcost.jpg";
          
          var links = new Array();
          links[0] = "/cuttingcosts.aspx";
          links[1] = "/realtime.aspx";
          links[2] = "/itsavings.aspx";
          links[3] = "/modules.aspx";
          
        $("#splashimage")
           .fadeOut(1000, function() 
           {
              setTimeout( function()
              {
                 $("#mainline").text(lineOne[parseInt($("#indexKeeper").attr("value"))]);
                 $("#secondline").text(lineTwo[parseInt($("#indexKeeper").attr("value"))]);
                 $("#splashleft").attr("src", "/images/systemize_erp_home/" + imgPaths[parseInt($("#indexKeeper").attr("value"))]);
                 $("#learnmorelink").attr("href", links[parseInt($("#indexKeeper").attr("value"))]);
                 incrementIndex();
                 $("#splashimage").fadeIn(2000);
              }, 20);
           });
    }
    
    
    $(document).ready( function(){
  $(".rounded").corner();
  
  timedCount();
  
  $("#splashimage").hover(
      function () {
        clearTimeout(timeoutId);
      }, 
      function () {
        timedCount();
      }
    );

  
  $(".hide").click(function(event) {
    event.preventDefault();
      setTimeout( function() {
          animateSplash();
       },0);
       
    });
   

});