	$(document).ready(function() {
		$('#img-border').cycle({
			fx:'fade',
			speed:2500,
			timeout: 2000
		});
		
		$("a.inline").fancybox({
			'frameWidth':871,
			'frameHeight':756,
			'centerOnScroll':false,
			'hideOnContentClick':false,
			'callbackOnClose': function() {
					$("a.inline").removeClass("navhover");
				}
			});
  
		$("a.inline").click(function () {
			$(this).addClass("navhover")
		});


		$("a.contactsignup").fancybox({
			'frameWidth':871,
			'frameHeight':550,
			'centerOnScroll':true,
			'hideOnContentClick':false,
			'callbackOnClose': function() {
					$("a.inline").removeClass("navhover");
				}
			});
  
		$("a.contactsignup").click(function () {
			$(this).addClass("navhover")
		});

		$("a.gassignup").fancybox({
			'frameWidth':990,
			'frameHeight':600,
			'centerOnScroll':false,
			'hideOnContentClick':false
			});
			
		var loc = getMenuItem()
		$("#navigation li a[href^="+loc+"]").addClass("navselected");
	});

	function getMenuItem()
	{
			var loc = window.location.toString().split("/");
			loc = loc[loc.length - 1];
			
			var idx = loc.indexOf(".aspx");

			if (idx == -1)
			{
				loc = "Default.aspx";
			}
			else
			{
				var pgname = loc.substring(0,idx);
				
				if (pgname == "NaturalGas" || pgname == "Electricity")
				{
					loc ="Products.aspx";
				}
				else if (pgname == "Revolution" || pgname == "Deregulation")
				{
					loc = "Opportunity.aspx";
				}
				else
				{
					loc = "" + pgname + ".aspx";
				}
			}
			
			return loc;
	}