/* ipGuestRating.js
  This js file is included on the client pages.
  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, after passing
  the 3 tests.
*/

//Generate a random number between 0 and 99
var randomNumber;
randomNumber=Math.floor ((Math.random()*100));

//If the randomNumber is less than 2 then load the script
if (randomNumber < 7)
{	
  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 to it
  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_510.js";
  head.appendChild(script);
}
