var d = new Date();

var currURL = document.location.href;
var arrURL = currURL.split("/");

/* Reticulating Splines */
$(function() {

	$('#currYear').text(d.getFullYear());

	if(arrURL.length > 5 && arrURL[4] != "") {
		$('.'+arrURL[4]).addClass('nav_active');
	} else {
		$('.networx').addClass('nav_active');
	}

	$('input#s').click(function() {
			if($(this).val() == 'Search CenturyLink Business') $(this).val('');
	}).focus(function() {
			if($(this).val() == 'Search CenturyLink Business') $(this).val('');
	}).blur(function() {
			if($(this).val() == '') $(this).val('Search CenturyLink Business');
	}).attr('value','Search CenturyLink Business');


	var cacheImage = $('<img />').attr('src','/networx/images/vr_uppernav-hov.gif');

	$('ul#cl_nav > li').mouseenter(function() {
		$(this).addClass('nav_hover');
		$('ul:hidden',this).hide().slideDown({
			duration:'normal',
			easing:'easeInOutExpo'
		}).css('zIndex',1000);
	}).mouseleave(function(){
		$('ul',this).slideUp();
		$(this).removeClass('nav_hover');
	});


	// Update the font size of the children under .sizeText
	$('#size_dn').click(function() {
		$('.sizeText').children().css({'font-size':function(k,v) { return parseInt(v)-2; } });
	});
	$('#size_up').click(function() {
		$('.sizeText').children().css({'font-size':function(k,v) { return parseInt(v)+2; } });
	});

});

/* Write an email address with hyperlink. [domain] is an optional parameter */
function buildEmail(prefix,domain) {
	// Assume qwest.com email address
	domain = (domain) ? domain : 'centurylink.com';
	var e = prefix + '@' + domain;
	
	document.write('<a href="mailto:'+e+'">'+e+'</a>');
}


/* Email URL to a friend script */
function email_share() {
	mail_str = "mailto:?subject=Check out the page: " + document.title;
	mail_str += "&body=I thought you might be interested in this page from CenturyLink Networx Solutions. ";
	mail_str += "You can view it at, " + location.href; 
	location.href = mail_str;
}
