// JavaScript Document

var imagenumber = 4 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "hp_img/1.jpg"
images[2] = "hp_img/2.jpg"
images[3] = "hp_img/3.jpg"
images[4] = "hp_img/4.jpg"
var image = images[rand1]


//Edit this line to list all of your background images
var backgroundSrcs = new Array("/sites/pwyp.gn.apc.org/themes/pwyp2/hp_img/1.jpg","/sites/pwyp.gn.apc.org/themes/pwyp2/hp_img/2.jpg","/sites/pwyp.gn.apc.org/themes/pwyp2/hp_img/3.jpg","/sites/pwyp.gn.apc.org/themes/pwyp2/hp_img/4.jpg")

window.onload = function() { pickimage();}
function pickimage()
{
//This line picks an image at random from the list you entered above
var bgimage=backgroundSrcs[(Math.round(Math.random()*(backgroundSrcs.length-1)))]

//This line applies the background image to your masthead
document.getElementById("homepage_top").style.background = "url('" + bgimage + "') no-repeat top right";
} 
//  twttr.anywhere(function (T) {
//    T('#follow-twitterapi').followButton("pwyptweets");
//  });
  
  
  
  
  $('.text').focus(function () {
	if ($(this).val() == $(this).attr("title")) {
		$(this).val("");
	}
}).blur(function () {
	if ($(this).val() == "") {
		$(this).val($(this).attr("title"));
	}
});


