// JavaScript Document

function closeWindow()
{
 window.close();
};

function openRedirect(url, width, height, winLoc)
{
 window.open(url,'pt_win','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height);
 window.location = winLoc;
};

function randImage()
{
 var numberOfImages = 9; //Change this value to the number of images that you want to cycle
 var imagePath = new String;
 var randNumber=Math.round(Math.random()*numberOfImages); 
 imgRand = new Image;
 imgRand.src = "images/randImages" + randNumber + ".jpg";
 imagePath = imgRand.src;
 document.getElementById('random').innerHTML = '<img width=150 height=244 src=' + imagePath + '>';
};

function boldSubLink()
{
 var domain = 'http://www.bza.com/clients/180/production/web2/';
 var domainLength = domain.length;
 var url =  window.location;
 url = String(url);
 var z = url.indexOf('.htm');
 var name = url.substring(domainLength, z);
 if(document.getElementById(name))
 {
  document.getElementById(name).className = 'subLinksBold';
 } 
};

function openNew(url, width, height, newLoc)
{
 window.open(url,'pt_win','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=' + width + ', height=' + height);
 window.location = newLoc;
};

function updateButton(program, unplussed)
{
 var replaceH = new String();
 replaceH = '<a href=\"javascript:openNew(\'https://www.paypal.com/xclick/business=wcmcspev%40aol.com&item_name=';
 replaceH += program
 replaceH += '&page_style=180&no_note=1&tax=0&currency_code=USD\', 800, 650,\'donation-after.php?program=180 General Operations\')\">';
 replaceH += '<img border=\'0\' src=\'images/doantenow.gif\'></a>';
 document.getElementById('donateButton').innerHTML = replaceH;
};
