/* 
   wv326redirectXYZ.js
   This js file is included in the client homepage.It generates a random number. 
   If the number is within the range specified, It loads the second js file which 
   then loads the invitation page.
*/

// Generate a random number between 0 and 99
var randomNumber;
randomNumber=Math.floor ((Math.random()*100));

// If the randomNumber is less than 10 then load the script
if (randomNumber < 10) {	
   loadIPScript();
}

// This function loads the script on the client's homepage
// and it in turn generates the invitation page.
function loadIPScript() {
  // Get the head tag and append the script
  var head = document.getElementsByTagName("head")[0];
  script = document.createElement('script');
  script.type = "text/javascript";
  script.src = "http://ipinvite.iperceptions.com/Invitations/Javascripts/ip_Layer_Invitation_645_ChoiceHotels_betaSite.js";
  head.appendChild(script);
}
