
jQuery(document).ready(function() {
	jQuery('#slider').nivoSlider({pauseTime:9000});
	
	jQuery('.backup-web-login-link').click(function() {
		window.open(this.href,"mywindow","menubar=1,resizable=1,width=1010,height=750,location=0");
		return false;
	});
	
	/* Online Games */
	jQuery(".game").hover(function() {
		jQuery(this).addClass("hover");
	}, function() { jQuery(this).removeClass("hover"); });
	
	/* Upgrade Packages */
	//jQuery("#packages .package").click(function() {
	//	window.location = jQuery(this).find("a").attr("href");
	//});

	jQuery(".packages-available-table tr").click(function() {
		window.location = jQuery(this).find("a").attr("href");
	});
	
	/* Default Search term for Events */
	if (jQuery("#search").val() == "") {
		jQuery("#search").addClass("default-text");
		jQuery("#search").val("Search for music, theatre or events...");
	}
	
	jQuery("#search").blur(function() {
		if (jQuery("#search").val() == "") {
			jQuery("#search").addClass("default-text");
			jQuery("#search").val("Search for music, theatre or events...");
		}
	});
	
	jQuery("#search").focus(function() {
		if (jQuery("#search").val() == "Search for music, theatre or events..." ) {
			jQuery("#search").removeClass("default-text");
			jQuery("#search").val(""); 
		}
	});
	
	/* Events City Nav */
	jQuery(".scroll-list #next").click(function() {
		var height = jQuery(this).parent().find("ul").height();
		jQuery(this).parent().find("ul").scrollTo( '+=' + height + 'px', 800 );
		return(false);
	});
	
	jQuery(".scroll-list #previous").click(function() {
		var height = jQuery(this).parent().find("ul").height();
		jQuery(this).parent().find("ul").scrollTo( '-='+height+'px', 800 );
		return(false);
	});
	
	/* Twitter Feed */
	getTwitters('tweet', { id: 'ask4Broadband', 
	  count: 5, 
	  enableLinks: true, 
	  ignoreReplies: true, 
	  clearContents: true
	});
	
	
	/* Paypoint */
	jQuery("#ppnext").click(function() {
		jQuery("#ppnav").scrollTo( '+=300px', 800 );
		return(false);
	});
	
	jQuery("#ppprevious").click(function() {
		jQuery("#ppnav").scrollTo( '-=300px', 800 );
		return(false);
	});
	
	jQuery("#previous").click(function() {
		jQuery("#citynav").scrollTo( '-=300px', 800 );
		return(false);
	});


	jQuery("#ppnav ul li a").hover(function() {
		parts = this.id.split("_");
		addressdiv='#ppinfo_'+parts[1];
		jQuery(addressdiv).addClass('pphover');
	}, function() { 
		jQuery(addressdiv).removeClass('pphover');
	});
	

	
});

