  //------------------------------------------------------//
 /* TechTarget ROI Summit Functionality by Team Creative */
//------------------------------------------------------//


//NAVIGATION
//----------------------------------------------------------------------------------------

//CHANGING STYLES with SCROLL
//----------------------------------------------------------------------------------------

/*--------------------------------------------------------------------------------------------------|
| This section takes care of the "Changing Styles with Scroll" automatically. No need to edit.		|
|																									|
| Requires: 																						|
| DOM Div class "cwrapper" required. Div.cwrapper resides inside div#content[n] and it has only 	|
| two css properties: height: auto, overflow: hidden.												|
| DOM class "contentOn" required in the CSS file. This class replaces the gray with the Teal color	|
| when the content is in designated position.														|
--------------------------------------------------------------------------------------------------*/




//CHANGING NAVIGATION BAR POSITION with SCROLL
//----------------------------------------------------------------------------------------

//navPosition variable to set the normal, non-scrolling position
var navPosition = 115;

// Main absolute/fixed position setting function
function limitNavPosition() {

	var $nav_wrapper = $('#nav-wrapper'); 
	var scrollTop = $(window).scrollTop();
	var $nav_link = $('#nav-wrapper a');
	var $nav1 = $('#main_nav1 li.apply a');
	var $nav2 = $('#main_nav2 li a');

	if (scrollTop >= navPosition) {
  		$nav_wrapper.css({
			'position': 'fixed',
			'top': '0px',
			'background' : 'url(assets/TTG_SD_nav_bg_gray.png) top center repeat-x'
 		 });

		$nav_link.addClass('nav_scroll');




	}
	else {
  		$nav_wrapper.css({
			'position': 'absolute',
			'top': navPosition,
			'background' : 'url(assets/TTG_SD_nav_bg.png) top center repeat-x'
		});


		$nav_link.removeClass('nav_scroll');
	}    
}
$(window).scroll(function () {limitNavPosition(); });

//NAVIGATING TO THE CONTENT CLICKED FROM NAVIGATION MENU with SCROLL
//----------------------------------------------------------------------------------------
function goToByScroll(id){
	if(id == "header") {
				$('html,body').animate({scrollTop: $("#header").offset().top},1000, "easeOutCirc");
	}

	else {
		$('html,body').animate({scrollTop: $("#content"+id).offset().top-60},1000, "easeOutCirc");
	}
}
	

 
$(document).ready(function() {
						   
$("*[style]").attr("style", "");

$.fancybox.init();



if (location.href.indexOf("#") != -1) {
	var hloc = location.hash.substr(1);
	var inloc = $("td.loc:contains("+hloc+")");
	var pinloc = $("td.loc:contains("+hloc+")").prev();
	var ninloc = $("td.loc:contains("+hloc+")").next();
	if(inloc) {
		 $('tr#sorter').append(pinloc, inloc, ninloc);
		 $('tr#sorter span.venue_info_off').removeClass().addClass('venue_info_on');
	};	
	if(hloc == "registration") {
		$.fancybox({
						  'type' : 'iframe',
						  'width' : 440,
						  'height' : 330,
						  'href'                          : 'registration.html',
						  'centerOnScroll' : true});
	};

}
						   
//PopUp FUNCTION
//----------------------


$("a.popup").fancybox({
					  'type' : 'iframe',
					  'height' : 380,
					  'width' : 400,
					  'centerOnScroll' : true});

$("a.register").fancybox({
					  'type' : 'iframe',
					  'height' : 400,
					  'width' : 800,
					  'centerOnScroll' : true});

//TABLE HOVER FUNCTION
//----------------------

$('table.agenda tr').hover(
  function () {
    $(this).find('td.highlight').removeClass().addClass("tealHighlight");
  }, 
  function () {
    $(this).find('td.tealHighlight').removeClass().addClass("highlight");
  }
);




	



});

