/* 
	TMP Worldwide - Global Functions
	Author:  Michael "Spell" Spellacy, Senior UI Developer <michael.spellacy@tmp.com> and Bobby KC, Senior Web Developer <bobby.kc@tmp.com>, TMP Worldwide LLC
*/

$("html").attr("class", "js");

/* ====== Supress BOM Script Errors ====== */

function errorsuppressor(){

	return true;

}

if(location.href.indexOf("localhost") == -1){

	window.onerror = errorsuppressor;

}

/* ====== Multiple Onload Utility ====== */

function addLoadEvent(func) {

	var oldonload = window.onload;

	if (typeof window.onload != 'function') {

		window.onload = func;

	} else {

		window.onload = function() {
		oldonload();
		func();

		}

	}

}

/* ====== Insert-after Function ====== */

function insertAfter(newElement, targetElement) {

	var parent = targetElement.parentNode;

	if (parent.lastChild == targetElement) {

		parent.appendChild(newElement);

	} else {

		parent.insertBefore(newElement, targetElement.nextSibling);

	}

}

// Open links in new window

$("a.external").click(function(){

	this.target = "_blank";

});

if ( $("#core-capabilities-selects").length)

$("#core-capabilities-selects").tabs({

	event: "mouseover"

});

$(".tcc-navigation").mouseleave(function(){

	$(".core-capabilities-info").addClass("ui-tabs-hide"); // Hide all messages
	$("#core").removeClass("ui-tabs-hide"); // Only show the default message

});

$(".tcc-navigation a").click(function(){

	location.href = $(this).attr("title");
});

if ( $("#accordion").length)

	$("#accordion").accordion({ autoHeight: false});	


	

	$(function() {
 

	$("#pn-select-industry a").hover(
  function () {

    $(this).addClass("ind-hover");
  },
  function () {

    $(this).removeClass("ind-hover");
  }
);

});
