// JavaScript Document

/**** Motionbox Animation ****/
var show_length = 15000;

/**** Set Testimonial Timeout ****/
function setTestTimeout(seconds){
      var time = seconds * 1000;
      show_length = time;
}
$(document).ready(function(){
    $('#slider').innerfade({
    	  speed: 600,
    	  timeout: show_length,
    	  type: 'random',
    	  containerheight: 'auto'
    });

    $('#testimonials').innerfade({
        speed: 600,
        timeout: show_length,
        type: 'random',
        containerheight: '120px'
    } );
});



/**** Adjust Testimonial Font to fit in box ****/
function adjustTestFont(t){
      var maxheight = '60';
      while($('.tst_quote', t).height() > maxheight){
          newFontSize = parseFloat($('.tst_quote', t).css('font-size')) - 1;
          $('.tst_quote', t).css('font-size',newFontSize);
      }
}


/**** load random Same Day Printing image on home page ****/
var sdLocation = '';
function setSDLocation(path){
  sdLocation = path;
}
$(document).ready(function(){

  if(document.getElementById('samedayimage')){
			var imgArr = new Array();
			imgArr[0] = '250GT.jpg';
			imgArr[1] = 'Colorwave.jpg';
			imgArr[2] = 'Docucolor.jpg';
			imgArr[3] = 'HP.jpg';

			document.getElementById('samedayimage').setAttribute("src", sdLocation + imgArr[Math.round(Math.random()*3)]);
  }
});

