jQuery.noConflict();
jQuery(document).ready(function() {
    /* preload images */
    //$.preloadCssImages();
	

    jQuery('a').filter(function() {
        // if this link/href is not the same as this site
        if (this.hostname && this.hostname !== location.hostname){            
            // open in a new window
            jQuery(this).click(function() {
                window.open(this.href); 
                return false; 
            });
        }
    })

  
  
  // Function that return a number between 0 and "nums - 1"
  function getRandom()
  {
  var ranNum= Math.floor(Math.random()*3+1);
  return ranNum;
  }
  
  var slide = getRandom();
  jQuery('#slides #'+slide).show();

  //homepage services slideshow 
   jQuery('#slideshow #slides').cycle(
       {
           fx:'fade',
           speed:400,
           timeout:5000,
          //after: setCurrent,
          cleartypeNoBg: true
       }
   );
   
   /*$('#slideshow').toggle(
     function(){
       $('#slideshow #slides').cycle('pause');
     },
     function(){ 
       $('#slideshow #slides').cycle('resume');
     }
   );*/
   
    jQuery("#mailing_list #inline").click(function(){
      jQuery('#contact_info').hide();
      jQuery('#mailing_list_form').show();
    });
    
    jQuery("#hide_form a").click(function(){
      jQuery('#mailing_list_form').hide();
      jQuery('#contact_info').show();
      return false;
    });
});
