// JQuery Scripts
$(document).ready(function() {
   
	/**
	 * Preload Navigation
	 */

	jQuery.preloadImages = function()
	{
	  for(var i = 0; i<arguments.length; i++)
	  {
		jQuery("<img>").attr("src", arguments[i]);
	  }
	}
	
	$.preloadImages("images/nav-home-ro.gif", "images/nav-services-ro.gif", "images/nav-solutions-ro.gif", "images/nav-pricing-ro.gif", "images/nav-clients-ro.gif", "images/nav-our-team-ro.gif", "images/nav-contact-us-ro.gif");
	
	/**
	 * Image Rollover Functionality
	 */
	
	// Rollovers using the class .rollover
	$(".rollover").mouseover(function(){
		imgsrc = $(this).attr("src");
		matches = imgsrc.match(/-ro/);
		// don't do the rollover if state is already ON
		if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"-ro.gif"); // strip off extension
			$(this).attr("src", imgsrcON);
		}
	});
	
	$(".rollover").mouseout(function() {
		$(this).attr("src", imgsrc);
	});
    
	/**
	 * Collapse Functionality on Solutions.php
	 */
    $(".trigger-tool").click(function(event) {
        var $getTrigger = $(this).attr("alt");
        if ($("."+$getTrigger).is('.trigger-active')) {
            $("."+$getTrigger).slideUp("fast", 
                function() {
                    $("td").css('height','0');
                }
            );
            $("."+$getTrigger).removeClass('trigger-active');
        } else {
            $("."+$getTrigger).slideDown("fast", 
                function() {
                    $("td").css('height','100%');
                }
            );
            $("."+$getTrigger).addClass('trigger-active');
        }
   	});
    
    /**
	 * Expand and Collapse Functionaltiy on clients.php?sub=clientlist page
	 */
	$('.client-heading').click(function(event) {
		if($(this).is('.active')) {
			$('.active img.edsuite-2').attr('src','images/edsuite-2-color-icon.png');
			$('.active td:last').text('+');
			$('.client-heading').removeClass('active');	
			$('div.expanded-content').slideUp('fast');	
		} else {
			$('.active img.edsuite-2').attr('src','images/edsuite-2-color-icon.png');
			$('.active td:last').text('+');
			$('.client-heading').removeClass('active');	
			$('div.expanded-content').slideUp('fast');	
			
			$(this).addClass('active');
			$('.active img.edsuite-2').attr('src','images/edsuite-2-white-icon.png');
			$('.active td:last').text('-');
			$('.active ~ div.expanded-content').slideDown('fast');	
		}
	});
    
    /**
	 * Expand and Collapse Functionaltiy on solutions.php?sub=all-tool-pages
	 */
	$('.read-more').click(function(event) {
        if ($('.expanded').is('.expanded')) {
            $('.expanded').slideUp();
            $('.expanded').addClass('collapsed');
            $('.expanded').removeClass('expanded');
        } else {
            $('.collapsed').slideDown();
            $('.collapsed').addClass('expanded');
            $('.collapsed').removeClass('collapsed');
        }
    });
	
});


function addBookmark(title,url) { 
 if (window.sidebar) { 
 	window.sidebar.addPanel(title, url,""); 
 } else if( document.all ) { 
 	window.external.AddFavorite(url, title); 
 } else if( window.opera && window.print ) { 
 	return true; 
	}
}

function ValidateForm(theForm) {
if(theForm.clientcode.value == '') {
	alert('Please fill in the "Clide Code" field.');
	theForm.clientcode.focus();
	return false;
	}
return true;
}

<!--
function Validator(theForm)
{

  if ((theForm.salutation[0].checked == false) && (theForm.salutation[1].checked == false) && (theForm.salutation[2].checked == false) && (theForm.salutation[3].checked == false))
  {
    alert("Please select a title (Mr./Mrs./Miss/Ms.)");
    theForm.salutation[0].focus();
    return (false);
  }
  
  if (theForm.fname.value == 0)
  {
    alert("Please enter something in the \"First Name\" field.");
    theForm.fname.focus();
    return (false);
  }
  if (theForm.lname.value == 0)
  {
    alert("Please enter something in the \"Last Name\" field.");
    theForm.lname.focus();
    return (false);
  }
  if (theForm.org.value == 0)
  {
    alert("Please enter something in the \"Organization\" field.");
    theForm.org.focus();
    return (false);
  }
  if (theForm.city.value == 0)
  {
    alert("Please enter something in the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.zip.value == 0)
  {
    alert("Please enter something in the \"Zip\" field.");
    theForm.zip.focus();
    return (false);
  }
  if (theForm.state.value == 0)
  {
    alert("Please enter something in the \"State\" field.");
    theForm.state.focus();
    return (false);
  }
  if (theForm.phone.value == 0)
  {
    alert("Please enter something in the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  if (theForm.email.value == 0)
  {
    alert("Please enter something in the \"Email\" field.");
    theForm.email.focus();

    return (false);
  }
  if (theForm.code.value == 0)
  {
    alert("Please enter something in the \"Game Code\" field.");
    theForm.code.focus();
    return (false);
  }
}
//-->

