/* jQuery - document ready functions */
jQuery(document).ready(function() {
	/*
	FUNCTION: anonymous function for DT tag	
											
	PARAMETERS: none						
	*/
	jQuery('dt').click(function () {
		if (jQuery(this).attr('class') != 'selected') {
			// hides whichever definition data is visiable
			jQuery('dd:visible').slideUp('normal');
			
			// displays the selected definition data
			jQuery(this).next('dd').slideDown('normal');
		}
		
		// removes the 'selected' class
		jQuery('.selected').removeClass('selected');
		
		// adds the 'selected' class
		jQuery(this).addClass('selected');
	});
	/*
	FUNCTION: anonymous function for side navigation
													
	PARAMETERS: none								
	*/
	jQuery('.sectionNavi .odd, .sectionNavi .even').click(function() {
		
		// send use to the location of the hidden a href
		changeWindowLocation(jQuery(this).children('a').attr('href'));
		
		// following events are applied to the trigger
		}).hover(function() {
			jQuery(this).addClass('highlight').addClass('pointer');
		}, function() {
			jQuery(this).removeClass('highlight');
	});
});
/* / jQuery - document ready functions */

/*
FUNCTION: downloadFileAlert	
							
PARAMETERS: none			
*/
function downloadFileAlert() {
	var msg	= 'The File you are trying to download requires you to be logged in.';
	msg		+= '\n\nTo log into your account or register for an account click the "OK" button below, otherwise click "Cancel".';
	
	if (confirm(msg)) {
		changeWindowLocation('/login');
	}
}
/*
FUNCTION: openElqTrackingWindow						
													
PARAMETER:											
	fileName										
		- string: the name of the file to download	
*/
function openElqTrackingWindow(fileName) {
	// makes a new window that tracks the click through in eloqua
	newWindow('/elqNow/elqRedir.htm?ref=http://' + serverName + '/_assets/downloads/' + fileName + '.htm', 'elqTracking', 100, 100, '');
	
	// sets up a timer event to close the window in 5 secs
	closeElqTrackingWin = setTimeout('closeElqTrackingWindow()', 5000);
}
/*
FUNCTION: closeElqTrackingWindow
								
PARAMETERS: none				
*/
function closeElqTrackingWindow() {
	// close the new browser window
	win.close();
	
	// clear out the interval timer
	clearTimeout(closeElqTrackingWin);
}