// Global JavaScript //

$(function(){

	//always add class 'last-child' to last element in a list
	/*$("li:last-child").addClass("last-child");*/
	
	//make curent link 'current'
	/*var bodyID = $("body").attr("id");
	if( bodyID ) $("a."+bodyID).addClass("current");
	var contentID = $(".content").attr("id");
	if( contentID ) $("a."+contentID).addClass("current");*/
	
	/*$("a").each(function(i){
		if( $("body").attr("id") == $(this).attr("class") || $("body").attr("class") == $(this).attr("class") || $(".content").attr("id") == $(this).attr("class") ) {
			alert( this.text );
			$(this).addClass("current");
		}
	});*/
	
	//share bar
	$(".sharebar").css("display","block");

	//add notification on DEV & STAGING
	if( window.location.hostname == "10.0.7.141" ) {
		$("body").prepend("<div class='server-name'>Development</div>");
	} else if ( window.location.hostname == "10.0.7.127" ) {
		$("body").prepend("<div class='server-name'>Staging</div>");
	}
	
	
	//Tooltips
	/*if ( (jQuery.browser.msie && parseInt(jQuery.browser.version) >= 7) || !jQuery.browser.msie ) {
		$(".footer a.jobs").tooltip({tip: '#jobstip', effect: 'slide', offset: [15, 0]});
	}*/
	
});

//popup window
function popup( url, width, height ) {
	var winLeft = (screen.width - width)/2;  	//Auto position popup in center of screen
	var winTop = (screen.height - height)/2;	//Auto position popup in center of screen
	var newwindow = window.open( url, "popup", ('width='+width+', height='+height+', resizable=yes, scrollbars=yes, menubar=no, status=yes, top='+winTop+', left='+winLeft )); 
	if (window.focus) {newwindow.focus()}
}
