// Random Image Generator for MTS
// James Ruggieri ©2011
// For Use on the Montgomery Travel Services Website Only



//initialize jquery function
$(document).ready(function() {
// Generate first Random Number
var randNum = Math.floor(Math.random()*5);

// Don't allow zero for a value
if (randNum == 0) {
	randNum = 1;
	}

//Set first image
/* $( '#parnterImage1' ).attr({'src' : 'images/corpPartBnr'+randNum+'.png'}); */

var randNum2 = Math.floor(Math.random()*5);

// If the second generated number is equal to the first, try again until they are different
while (randNum2 == randNum) {
	 // alert ("First: "+randNum+" and Second: "+randNum2+"are equal.");
	var randNum2 = Math.floor(Math.random()*5);
	
	}
 
 if (randNum2 == 0) {
 
	randNum2 = 1;
 	}
 
 if (randNum2 == 1 && randNum == 1) {
 
 	randNum2 = 2;
	}
 
 // alert ("This is the first "+randNum+" and this is the second "+randNum2);
 
 //Set second image
$( '#partnerImage2' ).attr({'src' : 'images/corpPartBnr'+randNum2+'.png'});

//Set first image
$( '#parnterImage1' ).attr({'src' : 'images/corpPartBnr'+randNum+'.png'});

});
