// centered pop up window
function centeredPopUpWindow(mypage, myname, w, h, scroll){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// get position of child node
function getPosition(main,spec) {
	var items = main.getElementsByTagName(spec.tagName);
	var found = 0;
	for (p = 0; p < items.length; p++) {
		if (items[p] == spec) {
			found = 1;
			break;
		}
	}
	if (found) {
		return p;
	}
	else {
		return -1;
	}
}

// set date elements
var yy = new Date().getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var dd = new Date().getDate();
var mm = new Array("january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december");
var monthNumber = new Date().getMonth();
var monthLabel = mm[monthNumber];

// check dimensions of browser window
var windowWidth = $(window).width();
var windowHeight = $(window).height();
var halfWindowWidth = windowWidth / 2;
var halfWindowHeight = windowHeight / 2;

// get class name of element
$.fn.getClassNames = function(){
	if (name = this.attr("className")) {
		return name.split(" ");
	}
	else {
		return [];
	}
};
// get name of element
$.fn.getElementNames = function(){
	if (elementName = this.attr("name")) {
		return elementName.split(" ");
	}
	else {
		return [];
	}
};

$(document).ready(function(){

// home page
	$("div#columnTwo ul li:last").css({background: "none"});

// content
	$("div.staffBio:last").addClass("noBG"); // turn off dotted border on last bio / testimonial
	$("div.testimonial:last").addClass("noBG");
	$("div#additionalVideos ul li:last").addClass("noBG");
	$("div.testimonial").append("<span class=\"lquote\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>"); // add left quotes to each testimonial
	$("div#pricingList ul li:odd").addClass("altListBG");

	
// focus areas
	$(".focusArea").hover(
		function(){
			$(this).find("span.graphic").animate({opacity: .75}, {duration: 250, queue: false});
		},
		function(){
			$(this).find("span.graphic").animate({opacity: 1}, {duration: 250, queue: false});
		}
	);


// links with rel="external" will open in a new window
	$("a[rel=external]").click(function(){
		 window.open(this.href);
		 return false;
	});


// display year in footer
	$("span.currentYear").text(year);


});
