function openjlWindow(url, name) {
  popupWin = window.open(url, name, 'width=280,height=200,left=20,top=20')
}

function openjocelynnWindow(url, name) {
  popupWin = window.open(url, name, 'width=777,height=600,left=20,top=20,scrollbars=yes')
}


function opencorporationWindow(url, name) {
  popupWin = window.open(url, name, 'width=430,height=210,left=20,top=20')
}

function opencalloutboxWindow(url, name) {
  popupWin = window.open(url, name, 'width=460,height=400,left=20,top=20,scrollbars=yes')
}

function opensurveyWindow(url, name) {
  popupWin = window.open(url, name, 'width=770,height=620,left=20,top=20,scrollbars=yes,resizable=yes')
}

function opendefinitionWindow(url, name) {
	popupWin = window.open(url, name, 'width=400,height=200,left=20,top=20,scrollbars=no,resizable=no')
}

function openKeyAreasWindow(url, name) {
	popupWin = window.open(url, name, 'width=500,height=300,left=20,top=20,scrollbars=no,resizable=no')
}

// used by the call out boxes, network operators landing is and example.
function changeStyleById(id,togglevis,theheight,toggledisplay){
if (document.getElementById)
   {
   var nodeObj = document.getElementById(id)
   nodeObj.style.height = theheight;
   nodeObj.style.overflow = togglevis;
  nodeObj.style.visibility = toggledisplay;

   }
}

function checkEmail()
{
  if (!document.email_signup.elements['email'].value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.biz)|(\.info)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
  {
    alert("Error Please enter a valid Email Address");
    return;
  } else if (document.email_signup.elements['email'].value == "email@domain.com") {
    alert("Error Please enter a valid Email Address");
    return;
  } else {
    document.email_signup.submit();
  }
}

function emailpopup() {
  myWindow = window.open("/about_paymentone/email_page_pop.asp?referer=" + window.location, "email_friend", 'width=350,height=280');
}
	

// homepage random image starts

function random_item()
{};
var random_item = new random_item();

var number = 0;

random_item[number++] = '<img src="/pics/home/main_banner.gif" width="429" height="143" alt="Digital Payment Services That Lift Revenue" border="0" /><br /><a href="digital_merchants/"><img src="/pics/home/main_feature_1.gif" width="429" height="128" alt="Over 75% of consumers will buy more with easier and safer payment options..." border="0" /></a>'
random_item[number++] = '<img src="/pics/home/main_banner.gif" width="429" height="143" alt="Digital Payment Services That Lift Revenue" border="0" /><br /><a href="network_operators/"><img src="/pics/home/main_feature_2.gif" width="429" height="128" alt="220 million consumers. 1000 operators. More convenient and secure ways to buy and sell." border="0" /></a>'
random_item[number++] = '<img src="/pics/home/main_banner.gif" width="429" height="143" alt="Digital Payment Services That Lift Revenue" border="0" /><br /><a href="network_operators/"><img src="/pics/home/main_feature_3.gif" width="429" height="128" alt="Market Content Through Operators. 220 million consumers. 1000 operators. Expand Distribution and Reach." border="0" /></a>'
var random_number = Math.floor(Math.random() * number);

// homepage random image ends

function random_item_logo()
{};
var random_item_logo = new random_item_logo();

var number = 0;

random_item_logo[number++] = '<a href="http://www.gaiaonline.com" target="_blank"><img src="../pics/home/gaiaonline_logo.gif" alt="" border="0"></a>'
random_item_logo[number++] = '<a href="http://www.habbo.com" target="_blank"><img src="../pics/home/habbo.gif" alt="" border="0"></a>'
random_item_logo[number++] = '<a href="http://www.worldofwarcraft.com" target="_blank"><img src="../pics/home/warcraft.jpg" alt="" border="0"></a>'
random_item_logo[number++] = '<a href="/news_events/press_releases/imvu.asp"><img src="../pics/home/imvu.gif" alt="IMVU" border="0"></a>'

var random_number_logo = Math.floor(Math.random() * number);

// homepage random logo ends


function random_item_spotlight()
{};
var random_item_spotlight = new random_item_spotlight();

var number = 0;

random_item_spotlight[number++] = '<img src="../pics/home/mercator_home_logo.gif" width="109" height="32" alt="" border="0"><br>"PaymentOne has established itself as the leader in driving higher profitability and revenue growth..."<br><br><img src="../pics/home/AOL_logo.gif" width="182" height="35" alt="" border="0"><br>"PaymentOne\'s PhoneBill service alone has helped us reach additional subscribers...this translates into higher revenue for AOL."'
random_item_spotlight[number++] = '<img src="../pics/home/AOL_logo.gif" width="182" height="35" alt="" border="0"><br>"PaymentOne has been a reliable strategic business partner that continues to deliver innovative thinking to optimize marketing and revenue efforts."<br><br><img src="../pics/home/mercator_logo.gif" width="72" height="36" alt="" border="0" style="padding-bottom: 5px;"><br>"The strength of PaymentOne\'s model is the safety and convenience, and streamlined user experience..."'
random_item_spotlight[number++] = '<img src="../pics/home/jupiter_home_logo.gif" width="122" height="25" alt="" border="0"><br>"PaymentOne\'s payment platform enables payment option management for merchants, with a focus on increasing revenues..."<br><br><img src="../pics/home/AOL_logo.gif" width="182" height="35" alt="" border="0"><br>"PaymentOne has established itself as the leader in driving higher profitability and revenue growth..."'
random_item_spotlight[number++] = '<img src="../pics/home/aberdeengroup.gif" width="156" height="27" alt="" border="0"><br>"PaymentOne\'s clients see subscriber rates rise when they offer PhoneBill &trade; because it is a low-friction option that addresses consumer concerns."<br><br><img src="../pics/home/jupiter_home_logo.gif" width="122" height="25" alt="" border="0"><br>"PaymentOne certainly has a lot of appeal for recurring charges..."'
random_item_spotlight[number++] = '<img src="../pics/home/tower-group.gif" width="130" height="36" alt="" border="0"><br>"PaymentOne has developed a unique suite of authentication and fraud control solutions..."<br><br><img src="../pics/home/nicor_logo.gif" alt="" width="77" height="33" border="0"><br>"we .. selected PaymentOne because of its proven track record, commitment to service quality and deep payments domain experience."'

var random_number_spotlight = Math.floor(Math.random() * number);

// homepage text fading scroller starts

/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 3000; //set delay between message change (in miliseconds)
var maxsteps=15; // number of steps to take to change from start color to endcolor
var stepdelay=0; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(240,241,245); // start color (red, green, blue)
var endcolor=new Array(7,1,1); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div><strong>'; //set opening tag, such as font declarations
fcontent[0]="Access to Over 220 Million Billable Consumers";
fcontent[1]="Connected to 1000 Network & Broadband Operators ";
fcontent[2]="Generated Over $3.1 Billion in New Client Revenue and Transactions";
fcontent[3]="Increases of 25% in New Revenue for Clients";
fcontent[4]="Coverage of 90% of US Households";
fcontent[5]="Over 50 Million Registered PhoneBill Consumers";
fcontent[6]="Increases of 25% in Consumer Acquisition Rates for Clients";
fcontent[7]="PaymentOne clients have generated over $3.1 Billion in New Revenue Transactions";
fcontent[8]="PaymentOne clients typically increase new revenue and acquisition rates by 25%";
fcontent[9]="PaymentOne Has Registered Over 50 Million No Credit Card Required/PhoneBill Consumers";
closetag='</strong></div>';

var fwidth='150px'; //set scroller width
var fheight='150px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}




// homepage text fading scroller ends

//-----------------------------------------------------------------------------
// toggleImage
//  This function cycles through a series of images and sets all the visibility 
//  of all but one to hidden. The other is made visible.
//  It takes two arguments:
//   1 - The image name, minus it's sequence number: 'image' in the case of
//       'image0', 'image1', 'image2', etc...
//   2 - The image number to make visible.
//  By convention, 0 is the default image. Initial states of the images must
//   be defined elsewhere.
function toggleImage(img,which) {
  var i = 1;
  var x = document.getElementById(img+i);

  // Cycle through all rollover images (starting at 1, ending at the first sequentially non-existant element)
  while (x) {
    // Set all images hidden, except 'which'
    if (which != i) { x.style.visibility="hidden"; }
    x = document.getElementById(img+(++i));
  }

  // Make the selected image visible
  document.getElementById(img+which).style.visibility="visible";
}
